Learn how to update your user ACLs with the OVHcloud API.
Users and roles
As explained on this page: Caching Capabilities, Users & roles, the users' ACLs can not be updated via the OVHcloud Control Panel.
You must therefore use the OVHcloud API.
Requirements
- a Public Cloud project in your OVHcloud account.
- an up-and-running Managed Database (also called Cloud Database) for Caching.
If you have never used the OVHcloud API before, then follow this tutorial: First Steps with the OVHcloud APIs.
For this tutorial, we assume that you are logged in to the OVHcloud API.
Instructions
Get your service, Caching cluster, and user IDs
You first need to identify the service, the Caching cluster, and the user you want to apply the changes to.
Get the desired service ID
Execute the following API call:
From the resulting list, select and copy the service identifier corresponding to the desired service, also known as serviceName.
Get the desired cluster ID
Open the following API call, paste your service ID into the serviceName input field and click Execute
:
GET /cloud/project/{serviceName}/database/redis
From the resulting list, select and copy the cluster ID, also known as clusterId.
Get the desired user ID
Open the following API call and do the following steps:
- paste your service ID into the serviceName input field
- paste the cluster ID into the clusterId input field
- click
Execute
GET /cloud/project/{serviceName}/database/redis/{clusterId}/user
From the resulting list, find and select the desired user.
To get more details on a user, open the following API call and do the following steps:
- paste your service ID into the serviceName input field
- the user ID into the userId input field
- the cluster ID into the clusterId input field
- click
Execute
GET /cloud/project/{serviceName}/database/redis/{clusterId}/user/{userId}
Example:
The result shows four string arrays, which represent the ACLs defined for the given user.
- Keys: Allow and disallow certain keys and key permissions.
- Categories: Add all the commands in such category to be called by the user, with valid categories being like @admin, @set, @sortedset,...
- Commands: Add or remove the command to the list of commands the user can call.
- Channels: Allow and disallow Pub/Sub channels.
You can follow the official Redis® documentation about users and ACL.
Update an ACL with the API
Open the following API call and paste the corresponding inputs (serviceName, clusterId, user).
PUT /cloud/project/{serviceName}/database/redis/{clusterId}/user/{userId}
Now, according to the strategy you choose, set the different values into the string arrays, such as in the example below:
When ready, click Execute
to update the ACL.
The result should be displayed similarly to the example below.
Go further
For more information and tutorials, please see our other Cloud Databases support guides or explore the guides for other OVHcloud products and services.