Key-Value Storage Service

This service allows you to store data for your solution based on unique key identifiers. Use it to safely store your Murano application configuration variables, logs, and much more.
Moreover, based on the wonderful Redis database, this service provides many of the powerful Redis commands.

Important: The number of keys you can use are limited and depend on your Murano plan.
Use the info operation described in this page 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 - nil

All solution keys successfully removed

Error response - object
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 namespace. This operation frees a quota count for your solution.

Arguments
parameters - object - Object containing service call parameters.
Name Type Description
key string {1..200} Key identifier
Responses
Key successfully deleted - nil

Key successfully deleted

Error response - object
Name Type Description
type string Error type
error string Error message
status integer Response code
Example
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 identifier
Responses
The response object containing the key value. - object
Name Type Description
value array, object, string, number, boolean, null Key content
Error response - object
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 the list of keys present in the namespace.

Responses
Solution namespace information - object
Name Type Description
keys [ string ] Active namespace keys
quota object Usage limitation applying to this service. WARNING! This property is deprecated and will be removed in a future version. Use the info operation instead to get this value.
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. WARNING! This property is deprecated and will be removed in a future version. Use the info operation instead to get this value.
usage.keys integer Current number of keys being used by the solution namespace.
Error response - object
Name Type Description
type string Error type
error string Error message
status integer Response code
Example
local result = Keystore.list()
print(result.keys)

set

Set or update a key value. If the key does not exist, this operation will increase your usage count.

Arguments
parameters - object - Object containing service call parameters.
Name Type Description
key string {1..200} Key identifier
value string, number, boolean, null Key content
Responses
Key successfully set - nil

Key successfully set

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. - 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.

Error response - object
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
Solution namespace information - object
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.
Error response - object
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} Target key
command "get", "set", "del", "setnx", "strlen", "type", "exists", "append", "bitcount", "bitpos", "getbit", "setbit", "getrange", "incr", "incrby", "decr", "decrby", "getset", "incrbyfloat", "lpush", "lpushx", "lindex", "llen", "linsert", "lrange", "lrem", "lset", "ltrim", "lpop", "rpop", "rpush", "rpushx", "sadd", "srem", "scard", "smembers", "sismember", "srandmember", "spop", "setex", "psetex", "expire", "pexpireat", "pexpire", "expireat", "pttl", "ttl", "persist", "zadd", "zcard", "zcount", "zincrby", "zlexcount", "zrange", "zrangebylex", "zrangebyscore", "zrank", "zrem", "zremrangebylex", "zremrangebyscore", "zremrangebyrank", "zrevrange", "zrevrangebylex", "zrevrangebyscore", "zrevrank", "zscore", "hdel", "hexists", "hget", "hgetall", "hincrby", "hincrbyfloat", "hkeys", "hlen", "hmget", "hstrlen", "hvals", "hscan", "hset", "hmset", "hsetnx" 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
The response object containing the key value. - object
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. - nil

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.

Error response - object
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}
})