Modifying Information About a Specified User
Function
This API is used to modify the information about a specified user.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/clusters/{cluster_id}/db-manager/users/{name}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID. To obtain the value, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
cluster_id |
Yes |
String |
Definition Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID. Constraints N/A Range N/A Default Value N/A |
name |
Yes |
String |
Definition Username or role name. Constraints N/A Range N/A Default Value N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
login |
No |
Boolean |
Definition Whether the login is allowed. Range N/A |
createrole |
No |
Boolean |
Definition Permission to create roles. Range N/A |
createdb |
No |
Boolean |
Definition Permission to create databases. Range N/A |
systemadmin |
No |
Boolean |
Definition System administrator. Range N/A |
auditadmin |
No |
Boolean |
Definition Audit administrator. Range N/A |
inherit |
No |
Boolean |
Definition Whether a user can inherit the permissions of the group to which it belongs. Range N/A |
useft |
No |
Boolean |
Definition Permission to access foreign tables. Range N/A |
conn_limit |
No |
Integer |
Definition Maximum number of connections. Range N/A |
replication |
No |
Boolean |
Definition Whether streaming replication is allowed. Range N/A |
valid_begin |
No |
String |
Definition Time when a role takes effect. The format is yyyy-MM-ddTHH:mm:ssZ. Range N/A |
valid_until |
No |
String |
Definition Time when a role expires. The format is yyyy-MM-ddTHH:mm:ssZ. Range N/A |
lock |
No |
Boolean |
Definition Whether the user is locked. Range N/A |
Response Parameters
Status code: 200
Modification succeeded.
None
Example Requests
Modify the information about user user1 in the cluster whose ID is a89aea88-7ea2-40bd-8ac8-8b93e169e5d6. The user can log in to a database, create roles, create databases, and access foreign tables. The system administrator and audit administrator permissions are not granted to the user, and the number of connections is not limited.
POST https://{Endpoint}/v1/0536cdee2200d5912f7cc00b877980f1/clusters/a89aea88-7ea2-40bd-8ac8-8b93e169e5d6/db-manager/users/user1 { "login" : true, "createrole" : true, "createdb" : true, "systemadmin" : false, "auditadmin" : false, "inherit" : false, "useft" : true, "conn_limit" : -1, "replication" : false, "valid_begin" : "2023-04-03T12:23:01", "valid_until" : "2023-04-18T12:23:01", "lock" : false }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
200 |
Modification succeeded. |
400 |
Request error. |
401 |
Authentication failed. |
403 |
You do not have required permissions. |
404 |
No resources found. |
500 |
Internal server error. |
503 |
Service unavailable. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot