Users#
This section describes the following API operations that are supported for users.
In this section, “user has access to a database” means that the user has full
create, read, update, and delete access to the given database. In other words,
on a cloud database instance, a user named USER and a database named DATABASE
exist, and within MySQL, a GRANT ALL ON DATABASE.* TO USER
has been issued
on the instance.
Create user#
POST /{version}/{accountId}/instances/{instanceId}/users
Creates a user for the specified database instance.
This operation asynchronously provisions a new user for the specified database instance based on the configuration defined in the request object. Once the request is validated and progress has started on the provisioning process, a 202 Accepted response object is returned.
If the corresponding request cannot be fulfilled due to insufficient or invalid data, an HTTP 400 “Bad Request” error response is returned with information regarding the nature of the failure. Failures in the validation process are non-recoverable and require the caller to correct the cause of the failure and POST the request again.
The following table lists the required and optional attributes for Create User. Refer to the request examples for the required json format:
Applies To |
Name |
Description |
Required |
---|---|---|---|
User |
name |
Name of the user for the database. |
Yes |
password |
User password for database access. |
Yes |
|
(database) name |
Name of the database that the user can access. |
No |
|
host |
Specifies the host from which a user is
allowed to connect to the database. Possible
values are a string containing an IPv4
address or “%” to allow connecting from any
host. Refer to User access restriction by
host
for details. If |
No |
Note
A user is granted all privileges on the specified databases.
The following user name is reserved and cannot be used for creating users: root.
Refer to the following tables for information about characters that are valid/invalid for creating database names, user names, and passwords.
Character |
---|
Letters (upper and lower cases allowed) |
Numbers |
‘@’, ‘?’, ‘#’, and spaces are allowed, but not at the beginning and end of the database name, user name, and password |
‘.’ is allowed, but must be escaped by replacing it with “%2E” before URL encoding occurs if it occurs in GET, DELETE, and PUT calls, where such a name is the last section of the request URL. Please refer to the Warning in User access restriction by host for details and an example. |
“_” is allowed anywhere in the database name, user name, and password |
Restriction |
Value |
---|---|
Database name maximum length |
64 |
User name maximum length |
16 |
Password maximum length |
unlimited (no restrictions) |
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
202 |
Accepted |
The request has been accepted for processing. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
This operation does not accept a request body.
Example Create user: JSON request
The following example shows the Create user request:
POST /v1.0/1234/instances/d4603f69-ec7e-4e9b-803f-600b9205576f/users HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{
"users": [
{
"databases": [
{
"name": "databaseA"
}
],
"name": "dbuser1",
"password": "password"
},
{
"databases": [
{
"name": "databaseB"
},
{
"name": "databaseC"
}
],
"name": "dbuser2",
"password": "password"
},
{
"databases": [
{
"name": "databaseD"
}
],
"name": "dbuser3",
"password": "password"
}
]
}
Response#
Example Create user: JSON response
The following example shows the Create user response:
HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 0
Date: Thu, 13 Feb 2014 21:47:14 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
This operation does not return a response body.
List users in database instance#
GET /{version}/{accountId}/instances/{instanceId}/users
Lists the users in the specified database instance.
This operation lists the users in the specified database instance, along with the associated databases for that user.
Note
This operation does not return the system users (database administrators that administer the health of the database). Also, this operation returns the “root” user only if “root” user has been enabled.
The following notes apply to database users:
User names can be up to 16 characters long.
When you create accounts with INSERT, you must use FLUSH PRIVILEGES to tell the server to reload the grant tables.
For additional information, refer to http://dev.mysql.com/doc/refman/5.1/en/user-account-management.html
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
Success |
Request succeeded. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
This operation does not accept a request body.
Example List users in database instance: JSON request
The following example shows the List users in database instance request:
GET /v1.0/1234/instances/d4603f69-ec7e-4e9b-803f-600b9205576f/users HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Example List users in database instance paged request: JSON
The following example shows the paginated List users in database instance
requests to return a limit of two users at a time ( users?limit=2
).
GET /v1.0/1234/instances/d4603f69-ec7e-4e9b-803f-600b9205576f/users?limit=2 HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Response#
Example List users in database instance response: JSON
The following example shows the List users in database instance response:
HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 322
Date: Thu, 13 Feb 2014 21:47:14 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
{
"users": [
{
"databases": [
{
"name": "databaseA"
}
],
"host": "%",
"name": "dbuser1"
},
{
"databases": [
{
"name": "databaseB"
},
{
"name": "databaseC"
}
],
"host": "%",
"name": "dbuser2"
},
{
"databases": [
{
"name": "databaseD"
}
],
"host": "%",
"name": "dbuser3"
},
{
"databases": [
{
"name": "sampledb"
}
],
"host": "%",
"name": "demouser"
}
]
}
Refer to
User access restriction by host
for a description of the host
field.
Example List users in database instance paged response: JSON
The following example shows the paginated List users in database instance response.
HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 336
Date: Thu, 13 Feb 2014 21:47:14 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
{
"links": [
{
"href": "https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/d4603f69-ec7e-4e9b-803f-600b9205576f/users?marker=dbuser2%2540%2525&limit=2",
"rel": "next"
}
],
"users": [
{
"databases": [
{
"name": "databaseA"
}
],
"host": "%",
"name": "dbuser1"
},
{
"databases": [
{
"name": "databaseB"
},
{
"name": "databaseC"
}
],
"host": "%",
"name": "dbuser2"
}
]
}
Note that the response contains the link ( href
) to the next set of users
in the list ( users?marker=dbuser2%4010.0.0.1 & limit=2
), so using that
link for the request will return the next two users in the list after
dbuser2%4010.0.0.1
.
Change user or users password#
PUT /{version}/{accountId}/instances/{instanceId}/users
Changes the database password of one or more users.
This operation changes the database password of one or more users.
Note
For information about choosing a valid password, please refer to Create user for details.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
202 |
Accepted |
The request has been accepted for processing. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
This operation does not accept a request body.
Example Change user(s) password: JSON request
The following example shows the Change user(s) password request:
PUT /v1.0/1234/instances/692d8418-7a8f-47f1-8060-59846c6e024f/users HTTP/1.1
User-Agent: python-example-client
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{
"users": [
{
"name": "dbuser1",
"password": "newpassword"
},
{
"name": "dbuser2",
"password": "anotherpassword"
}
]
}
Response#
Example Change user(s) password: JSON response
The following example shows the Change user(s) password response:
HTTP/1.1 202 Accepted
Content-Type: application/json
Content-Length: 152
Date: Wed, 21 Mar 2012 17:46:46 GMT
Modify user attributes#
PUT /{version}/{accountId}/instances/{instanceId}/users/{name}
Modifies one or more of the following for the specified user: name, password, and host from which the user is allowed to connect to the database.
This operation modifies one or more of the following for the specified user: user name, password, and host from which the user is allowed to connect to the database. User in this case is user or user@host, whichever is appropriate.
Refer to Create user for information about the characters that are valid for the user name and password.
The following table lists attributes for Modify User Attributes. Note that one or more of the attributes must be specified. Refer to the request examples for the required json format:
Name |
Description |
---|---|
name |
Name of the user for the database. |
password |
User password for database access. |
host |
Specifies the host from which a user is
allowed to connect to the database. Possible
values are a string containing an IPv4 address
or “%” to allow connecting from any host.
Refer to User access restriction by host
for details. If |
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
Success |
Request succeeded. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
{name} |
String |
The name for the specified user. Refer to User access restriction by host for details about restricting the name to a particular host. Examples: testuser, testuser@192.168.1.12 (to restrict the user to connecting from a particular host IP). |
This operation does not accept a request body.
Example Modify user attributes: JSON request
The following example shows the Modify user attributes request:
PUT /v1.0/1234/instances/d4603f69-ec7e-4e9b-803f-600b9205576f/users/dbuser1 HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{
"user": {
"name": "new_username",
"password": "new_password"
}
}
Response#
Example Modify user attributes: JSON response
The following example shows the Modify user attributes response:
HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 0
Date: Thu, 13 Feb 2014 21:47:14 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
List user#
GET /{version}/{accountId}/instances/{instanceId}/users/{name}
Lists the specified user’s name and a list of databases that the user can access.
This operation lists the specified user’s name and a list of databases that the user can access.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
Success |
Request succeeded. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
{name} |
String |
The name for the specified user. Refer to User access restriction by host for details about restricting the name to a particular host. Examples: testuser, testuser@192.168.1.12 (to restrict the user to connecting from a particular host IP). |
This operation does not accept a request body.
Example List user: JSON request
The following example shows the List user request:
GET /v1.0/1234/instances/692d8418-7a8f-47f1-8060-59846c6e024f/users/exampleuser HTTP/1.1
User-Agent: python-example-client
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Example List user access for restricted host request: JSON
The following example shows the List user for restricted host request.
This example shows using the host parameter syntax (user@host) to restrict the user to connecting from a particular host for the call. In this example, user@host has been URL encoded by the client, so the parameter dbuser1@% is URL encoded to dbuser1%40%25, since the ‘@’ is 40 hex and the ‘%’ is 25 hex. In this case, since % is used for the host, the user can connect from any host.
GET /v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users/dbuser1%40%25 HTTP/1.1
User-Agent: python-reddwarfclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Response#
Example List user: JSON response
The following example shows the List user responses:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 0
Date: Wed, 27 Jun 2012 23:11:19 GMT
{
"user": {
"name": "exampleuser",
"host": "%",
"databases": [
{
"name": "databaseA"
},
{
"name": "databaseB"
}
]
}
}
Example List user access for restricted host response: JSON
The following example shows the List user for restricted host response.
This example shows using the host parameter syntax (user@host) to restrict the user to connecting from a particular host for the call. In this example, user@host has been URL encoded by the client, so the parameter dbuser1@% is URL encoded to dbuser1%40%25, since the ‘@’ is 40 hex and the ‘%’ is 25 hex. In this case, since % is used for the host, the user can connect from any host.
HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 59
Date: Wed, 08 May 2013 22:43:35 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
{
"user": {
"databases": [],
"host": "%",
"name": "dbuser1"
}
}
Delete user#
DELETE /{version}/{accountId}/instances/{instanceId}/users/{name}
Deletes the user identified by {name} for the specified database instance.
This operation deletes the specified user for the specified database instance.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
202 |
Accepted |
The request has been accepted for processing. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
{name} |
String |
The name for the specified user. Refer to User access restriction by host for details about restricting the name to a particular host. Examples: testuser, testuser@192.168.1.12 (to restrict the user to connecting from a particular host IP). |
This operation does not accept a request body.
Example Delete user: JSON request
The following example shows the Delete user request:
DELETE /v1.0/1234/instances/d4603f69-ec7e-4e9b-803f-600b9205576f/users/demouser HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Response#
Example Delete user: JSON response
The following example shows the Delete user response:
HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 0
Date: Thu, 13 Feb 2014 21:47:14 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
This operation does not return a response body.
List user access#
GET /{version}/{accountId}/instances/{instanceId}/users/{name}/databases
Shows a list of all databases a user has access to.
This operation shows a list of all databases a user has access to.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
Success |
Request succeeded. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
{name} |
String |
The name for the specified user. Refer to User access restriction by host for details about restricting the name to a particular host. Examples: testuser, testuser@192.168.1.12 (to restrict the user to connecting from a particular host IP). |
This operation does not accept a request body.
Example List user access: JSON request
The following example shows the List user access request:
GET /v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users/dbuser1/databases HTTP/1.1
User-Agent: python-reddwarfclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Example List user access for restricted host request: JSON
The following example shows the List user access for restricted host request.
This example shows using the host parameter syntax (user@host) to restrict the user to connecting from a particular host for the call. In this example, user@host has been URL encoded by the client, so the parameter dbuser2@10.0.0.1 is URL encoded in the request example to dbuser2%4010%252E0%252E0%252E1 to escape the periods in the host component of the name (refer to User access restriction by host for details):
GET /v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users/dbuser2%4010%252e0%252e0%252e1/databases HTTP/1.1
User-Agent: python-reddwarfclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Response#
Example List user access: JSON response
The following example shows the List user access response:
HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 38
Date: Wed, 08 May 2013 22:43:35 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
{
"databases": [
{
"name": "databaseE"
}
]
}
Example List user access for restricted host response: JSON
The following example shows the List user access for restricted host response.
This example shows the results of using the host parameter syntax (user@host) to restrict the user to connecting from a particular host for the call. In this example, user@host has been URL encoded by the client, so the parameter dbuser2@10.0.0.1 is URL encoded in the request example to dbuser2%4010%252E0%252E0%252E1 to escape the periods in the host component of the name (refer to User access restriction by host for details):
HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 61
Date: Wed, 08 May 2013 22:43:35 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
{
"databases": [
{
"name": "databaseB"
},
{
"name": "databaseC"
}
]
}
Grant user access#
PUT /{version}/{accountId}/instances/{instanceId}/users/{name}/databases
Grants access for the specified user to one or more databases for the specified instance.
This operation grants access for the specified user to one or more databases for the specified instance. The user is granted ALL privileges on the database. Refer to the information at the beginning of Users for more details on access.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
202 |
Accepted |
The request has been accepted for processing. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
{name} |
String |
The name for the specified user. Refer to User access restriction by host for details about restricting the name to a particular host. Examples: testuser, testuser@192.168.1.12 (to restrict the user to connecting from a particular host IP). |
This operation does not accept a request body.
Example Grant user access: JSON request
The following example shows the Grant user access request:
PUT /v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users/dbuser1/databases HTTP/1.1
User-Agent: python-reddwarfclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{
"databases": [
{
"name": "databaseE"
}
]
}
Response#
Example Grant user access: JSON response
The following example shows the Grant user access response:
HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 0
Date: Wed, 08 May 2013 22:43:35 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
Revoke user access#
DELETE /{version}/{accountId}/instances/{instanceId}/users/{name}/databases/{databaseName}
Removes access to the specified database for the specified user.
This operation removes access to the specified database for the specified user.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
202 |
Accepted |
The request has been accepted for processing. |
400 |
Bad Request |
The request is missing one or more elements, or the values of some elements are invalid. |
401 |
Unauthorized |
You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token. |
403 |
Forbidden |
You are denied access to the requested resource. |
404 |
Not Found |
The requested item was not found. |
405 |
badMethod |
The specified method is not allowed for the given resource. |
413 |
Over Limit |
The number of items returned is above the allowed limit. |
422 |
unprocessableEntity |
The item cannot be processed. |
500 |
instanceFault |
The instance has experienced a fault. |
501 |
notImplemented |
The server does not support the functionality required to fulfill the request. |
503 |
Service Unavailable |
The service is not available. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{accountId} |
String |
The account ID of the owner of the specified instance. |
{instanceId} |
String |
The instance ID for the specified database instance. |
{name} |
String |
The name for the specified user. Refer to User access restriction by host for details about restricting the name to a particular host. Examples: testuser, testuser@192.168.1.12 (to restrict the user to connecting from a particular host IP). |
{databaseName} |
String |
The name for the specified database. |
This operation does not accept a request body.
Example Revoke user access: JSON request
The following example shows the Revoke user access request:
DELETE /v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users/dbuser1/databases/databaseE HTTP/1.1
User-Agent: python-reddwarfclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
Response#
Example Revoke user access: JSON response
The following example shows the Revoke user access response:
HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 0
Date: Wed, 08 May 2013 22:43:35 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
This operation does not return a response body.