MethodPathDescription
GET/v1/redis_aclsGet all Redis ACLs
GET/v1/redis_acls/{uid}Get a single Redis ACL
PUT/v1/redis_acls/{uid}Update a Redis ACL
POST/v1/redis_aclsCreate a new Redis ACL
DELETE/v1/redis_acls/{uid}Delete a Redis ACL

Get all Redis ACLs

GET /v1/redis_acls

Get all Redis ACL objects.

Permissions

Permission nameRoles
view_all_redis_acls_infoadmin
cluster_member
cluster_viewer
db_member
db_viewer

Request

Example HTTP request

GET /redis_acls

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Response

Returns a JSON array of Redis ACL objects.

Example JSON body

[
    {
     "uid": 1,
     "name": "Full Access",
     "acl": "+@all ~*"
    },
    {
     "uid": 2,
     "name": "Read Only",
     "acl": "+@read ~*"
    },
    {
     "uid": 3,
     "name": "Not Dangerous",
     "acl": "+@all -@dangerous ~*"
    },
    {
     "uid": 17,
     "name": "Geo",
     "acl": "~* +@geo"
    }
]

Status codes

CodeDescription
200 OKNo error
501 Not ImplementedCluster doesn’t support redis_acl yet.

Get Redis ACL

GET /v1/redis_acls/{int: uid}

Get a single Redis ACL object.

Permissions

Permission nameRoles
view_redis_acl_infoadmin
cluster_member
cluster_viewer
db_member
db_viewer

Request

Example HTTP request

GET /redis_acls/1

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerThe object’s unique ID.

Response

Returns a Redis ACL object.

Example JSON body

{
     "uid": 17,
     "name": "Geo",
     "acl": "~* +@geo"
}

Status codes

CodeDescription
200 OKSuccess.
403 ForbiddenOperation is forbidden.
404 Not Foundredis_acl does not exist.
501 Not ImplementedCluster doesn’t support redis_acl yet.

Update Redis ACL

PUT /v1/redis_acls/{int: uid}

Update an existing Redis ACL object.

Permissions

Permission nameRoles
update_redis_acladmin

Request

Example HTTP request

PUT /redis_acls/17

Example JSON body

{
     "acl": "~* +@geo -@dangerous"
}

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Request body

Include a Redis ACL object with updated fields in the request body.

Response

Returns the updated Redis ACL object.

Example JSON body

{
     "uid": 17,
     "name": "Geo",
     "acl": "~* +@geo -@dangerous"
}

Error codes

CodeDescription
unsupported_resourceThe cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
name_already_existsAn object of the same type and name exists
invalid_paramA parameter has an illegal value

Status codes

CodeDescription
200 OKSuccess, redis_acl was updated.
400 Bad RequestBad or missing configuration parameters.
404 Not FoundAttempting to change a non-existent redis_acl.
409 ConflictCannot change a read-only object
501 Not ImplementedCluster doesn’t support redis_acl yet.

Create Redis ACL

POST /v1/redis_acls

Create a new Redis ACL object.

Permissions

Permission nameRoles
create_redis_acladmin

Request

Example HTTP request

POST /redis_acls

Example JSON body

{
     "name": "Geo",
     "acl": "~* +@geo"
}

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Request body

Include a Redis ACL object in the request body.

Response

Returns the newly created Redis ACL object.

Example JSON body

{
     "uid": 17,
     "name": "Geo",
     "acl": "~* +@geo"
}

Error codes

Possible error_code values:

CodeDescription
unsupported_resourceThe cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
name_already_existsAn object of the same type and name exists
missing_fieldA needed field is missing
invalid_paramA parameter has an illegal value

Status codes

CodeDescription
200 OKSuccess, redis_acl is created.
400 Bad RequestBad or missing configuration parameters.
501 Not ImplementedCluster doesn’t support redis_acl yet.

Examples

cURL

curl -k -u "[username]:[password]" -X POST \
     -H 'Content-Type: application/json' \
     -d '{ "name": "Geo", "acl": "~* +@geo" }' \
     https://[host][:port]/v1/redis_acls

Python

import requests
import json

url = "https://[host][:port]/v1/redis_acls"

headers = {
  'Content-Type': 'application/json'
}

payload = json.dumps({
    "name": "Geo",
    "acl": "~* +@geo"
})
auth=("[username]", "[password]")

response = requests.request("POST", url,
           auth=auth, headers=headers, payload=payload, verify=False)

print(response.text)

Delete Redis ACL

DELETE /v1/redis_acls/{int: uid}

Delete a Redis ACL object.

Permissions

Permission nameRoles
delete_redis_acladmin

Request

Example HTTP request

DELETE /redis_acls/1

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerThe redis_acl unique ID.

Response

Returns a status code that indicates the Redis ACL deletion success or failure.

Status codes

CodeDescription
200 OKSuccess, the redis_acl is deleted.
406 Not AcceptableThe request is not acceptable.
409 ConflictCannot delete a read-only object
501 Not ImplementedCluster doesn’t support redis_acl yet.