Redis - Manage Redis ACLs via API

Update Redis users ACLs with the OVHcloud API

Last updated March 8th, 2022

Objective

This page shows you how to update your Redis user ACLs with the OVHcloud API.

Users and roles

As explained on this page: Redis 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 Public Cloud Database for Redis.

If you have never used the OVHcloud API before, then follow this tutorial: First Steps with the OVHcloud APIs.

For this tutorial, we consider that your are logged on the relevant API (Europe: https://api.ovh.com, Canada/Asia: https://ca.api.ovh.com). We will use Europe API for this tutorial.

Instructions

Get your service, Redis cluster and user IDs

You first need to identify the service, the Redis 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.

API path project

Get the desired Redis cluster ID

Open the following API call, paste your service ID into the serviceName input field and click Execute:

From the resulting list, select and copy the Redis cluster ID, also known as clusterId.

API path cluster

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

From the resulting list, find and select the desired user.

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

Example:

API path user detail

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: https://redis.io/topics/acl.

Update an ACL with the API

Open the following API call and paste the corresponding inputs (serviceName, clusterId, user).

Now, according the strategy you choosed, set the different values into the string arrays, such as in the example below:

API update ACL string arrays

When ready, click Execute to update the ACL.

The result should be displayed similarly to the example below.

API ACL change result

We want your feedback!

We would love to help answer questions and appreciate any feedback you may have.

Are you on Discord? Connect to our channel at https://discord.gg/PwPqWUpN8G and interact directly with the team that builds our databases service!


Haben Ihnen die Anleitungen geholfen?

Bevor Sie Ihre Meinung abgeben, nehmen wir gerne Ihre Vorschläge auf, wie wir diese Dokumente verbessern können.

Woran liegt es? An den Bildern, dem Inhalt oder Aufbau der Anleitungen? Schreiben Sie es uns gerne, dann machen wir es zusammen besser.

Ihre Support-Anfragen werden in diesem Formular nicht entgegengenommen. Verwenden Sie hierfür bitte das Formular "Ein Ticket erstellen" .

Vielen Dank. Ihr Feedback wurde gesendet.


Diese Anleitungen könnten Sie auch interessieren...

OVHcloud Community

Besuchen Sie Ihren Community-Bereich und tauschen Sie sich mit anderen Mitgliedern der OVHcloud Community aus. Hier können Sie Fragen stellen, zusätzliche Informationen finden und eigene Inhalte veröffentlichen.

Tauschen Sie sich mit der Community aus

Alle Preise verstehen sich inklusive der gesetzlichen Mehrwertsteuer.

In Übereinstimmung mit der Richtlinie 2006/112/EG in der geänderten Fassung können die Preise ab 01.01.2015 je nach Wohnsitzland des Kunden variieren
(die Preise in den Angeboten verstehen sich inklusive der gesetzlichen Mehrwertsteuer für die Bundesrepublik Deutschland).