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

Content: nil

Error

Content: object Error response

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

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 the list of keys present in the namespace.

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()
print(result.keys)

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

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}
})