Key-Value Storage Service

Store, retrieve, and manage configuration or associative data in a powerful Key-Value database

Use it to safely store your configuration variables, logs, and much more. Based on the Redis database, this service provides many of the powerful Redis commands.

IMPORTANT: The number of keys you can use are limited and depends on your Murano Business tier. Use the info operation to see your current usage.

Operations

Keys

Settings

Other

Operations

Keys


clear

Remove all keys from this solution namespace. Be careful. There is no going back!

Responses

All solution keys successfully removed

Content: nil

Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

Keystore.clear()

delete

Remove a key-value from the store. This operation free a quota count for your namespace.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
key string {1..200} Key id

Responses

Key successfully deleted

Content: nil

Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local result = Keystore.delete({ key = "myKey" })


get

Returns the value of the given key.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
key string {1..200} Key id

Responses

Key value successfully retrieved

Content: object The response object containing the key value.

Name Type Description
value array, object, string, number, boolean, null Key content
Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local result = Keystore.get({ key = "myKey" }) print(result.value)


list

Returns namespace keys

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
match string A filter to only return keys containing the matching string. This is case-insensitive.

Responses

Namespace active keys

Content: object Solution namespace information

Name Type Description
keys [ string ] Active namespace keys
Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local result = Keystore.list({match = "mykey"}) print(result.keys)


mdelete

Remove multiple keys-value from the store and return the number of removed keys. This operation free quota count for your namespace.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
keys [ string {1..200} ] {..100} List of Keys

Responses

Multi-delete response

Content: object

Name Type Description
removed integer Number of new keys removed to the namespace.
Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local result = Keystore.mdelete({ keys = {"key1", "key0"} }) print(result.removed)


mget

Returns the values of the given keys.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
keys [ string {1..200} ] {..100} List of Keys

Responses

The response object containing the key values.

Content: object

Name Type Description
values [ array, object, string, number, boolean, null ] Keys values data
Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

result = Keystore.mget({ keys = {"key1", "key2"} }) print(result.values[1])


mset

Set or update multiple keys. This operation will increase your usage count.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
keys [ string {1..200} ] {..100} List of Keys
values [ string, number, boolean, null ] Values to set in related keys. This array length MUST match the key length.

Responses

Multi-Set response

Content: object

Name Type Description
added integer Number of new keys added to the namespace.
Namespace, Key count quota reached. Delete some un-used keys or contact Murano team for upgrading your plan. You can view your current namespace usage with the list operation or on your Murano portal account.

Content: nil

Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local result = Keystore.mset({ keys = {"key1", "key2"}, values = {"value1", "value2"} })
print(result.added)


set

Set or update a key value. If the key does not exist, this operation will increase your usage count. The value size cannot exceed 100kb.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
key string {1..200} Key id
value string, number, boolean, null Key content

Responses

Key successfully set

Content: nil

Namespace, Key count quota reached. Delete some unused keys or contact Murano team for upgrading your plan. You can view your current namespace usage with the info operation or on your Murano portal account.

Content: nil

Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

Keystore.set({ key = "myKey", value = "myValue" })

Settings


info

Returns namespace information including usage and quota.

Responses

Namespace information including usage and quota

Content: object Solution namespace information

Name Type Description
quota object Usage limitation applying to this service
quota.keys integer Maximum number of keys allowed for this solution depending on your Murano plan. Contact Murano team for more information.
usage object Namespace usage
usage.keys integer Current number of keys being used by the solution namespace.
usage.size integer Total data size of solution namespace in bytes.
Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local result = Keystore.info()
print("I am using " .. result.usage.keys .. " out of my " .. result.quota.keys .. " keys")

Other


command

This function offers some popular Redis commands to execute on the key. Please refer to http://redis.io/commands documentation page for the command information and parameters. Remember, some commands will increase your namespace usage and may hit your namespace quota. Not all Redis commands are supported. Please refer to the command parameter information below for the available functions.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
key string {1..200} Key id
command "get", "set", "setnx", "getset", "del", "type", "exists", "strlen", "append", "getrange", "setrange", "bitcount", "bitpos", "getbit", "setbit", "incr", "incrby", "decr", "decrby", "incrbyfloat", "setex", "psetex", "expire", "pexpireat", "pexpire", "expireat", "pttl", "ttl", "persist", "lpush", "lpushx", "lindex", "llen", "linsert", "lrange", "lrem", "lset", "ltrim", "lpop", "rpop", "rpush", "rpushx", "sadd", "srem", "scard", "smembers", "sismember", "srandmember", "spop", "sscan", "hset", "hsetnx", "hdel", "hexists", "hget", "hgetall", "hincrby", "hincrbyfloat", "hkeys", "hlen", "hmget", "hmset", "hstrlen", "hvals", "hscan", "zadd", "zcard", "zincrby", "zcount", "zlexcount", "zrange", "zrangebylex", "zrangebyscore", "zrank", "zrem", "zremrangebylex", "zremrangebyscore", "zremrangebyrank", "zrevrange", "zrevrangebylex", "zrevrangebyscore", "zrevrank", "zscore", "zscan", "geoadd", "geohash", "geopos", "geodist", "georadius", "georadiusbymember" This function offers some popular Redis commands to execute on the key. Please refer to http://redis.io/commands documentation page for the command information and parameters.
args [ string, number, boolean ] List of arguments for the specified command. Please refer to http://redis.io/commands documentation page for the command information and parameters.

Responses

Command successfully executed

Content: object The response object containing the key value.

Name Type Description
value array, object, string, number, boolean, null Key content
Namespace, Key count quota reached. Delete some un-used keys or contact Murano team for upgrading your plan. You can view your current namespace usage with the list operation or on your Murano portal account.

Content: nil

Error

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

-- Add a string to a list
result = Keystore.command({
  key = "myList",
  command = "lpush",
  args = {"oneItem"}
})
-- Retrieve the list content
result = Keystore.command({
  key = "myList",
  command = "lrange",
  args = {0, -1}
})