Back to Redis

Passwords

content/operate/rs/references/rest-api/requests/bdbs/passwords.md

latest4.9 KB
Original Source
MethodPathDescription
PUT/v1/bdbs/{uid}/passwordsUpdate database password
POST/v1/bdbs/{uid}/passwordsAdd database password
DELETE/v1/bdbs/{uid}/passwordsDelete database password

Update database password {#put-bdbs-password}

PUT /v1/bdbs/{int: uid}/passwords

Set a single password for the bdb's default user (i.e., for AUTH <password> authentications).

Required permissions

Permission name
[update_bdb]({{< relref "/operate/rs/references/rest-api/permissions#update_bdb" >}})

Request {#put-request}

Example HTTP request

PUT /v1/bdbs/1/passwords 

Example JSON body

json
{
    "password": "new password"
}

The above request resets the password of the bdb to ‘new password’.

Request headers

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

URL parameters

FieldTypeDescription
uidintegerThe unique ID of the database to update the password.

Request body

FieldTypeDescription
passwordstringNew password

Response {#put-response}

Returns a status code that indicates password update success or failure.

Status codes {#put-status-codes}

CodeDescription
200 OKThe password was changed.
404 Not FoundA nonexistent database.
406 Not AcceptableInvalid configuration parameters provided.

Add database password {#post-bdbs-password}

POST /v1/bdbs/{int: uid}/passwords

Add a password to the bdb's default user (i.e., for AUTH <password> authentications).

Required permissions

Permission name
[update_bdb]({{< relref "/operate/rs/references/rest-api/permissions#update_bdb" >}})

Request {#post-request}

Example HTTP request

POST /v1/bdbs/1/passwords 

Example JSON body

json
{
    "password": "password to add"
}

The above request adds a password to the bdb.

Request headers

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

URL parameters

FieldTypeDescription
uidintegerThe unique ID of the database to add password.

Request body

FieldTypeDescription
passwordstringPassword to add

Response {#post-response}

Returns a status code that indicates password creation success or failure.

Status codes {#post-status-codes}

CodeDescription
200 OKThe password was added.
404 Not FoundA nonexistent database.
406 Not AcceptableInvalid configuration parameters provided.

Delete database password {#delete-bdbs-password}

DELETE /v1/bdbs/{int: uid}/passwords

Delete a password from the bdb's default user (i.e., for AUTH <password> authentications).

Required permissions

Permission name
[update_bdb]({{< relref "/operate/rs/references/rest-api/permissions#update_bdb" >}})

Request {#delete-request}

Example HTTP request

DELETE /v1/bdbs/1/passwords 

Example JSON body

json
{
    "password": "password to delete"
}

The above request deletes a password from the bdb.

Request headers

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

URL parameters

FieldTypeDescription
uidintegerThe unique ID of the database to delete password.

Request body

FieldTypeDescription
passwordstringPassword to delete

Response {#delete-response}

Returns a status code that indicates password deletion success or failure.

Status codes {#delete-status-codes}

CodeDescription
200 OKThe password was deleted.
404 Not FoundA nonexistent database.
406 Not AcceptableInvalid configuration parameters provided.