| Verb | URI | Description |
|---|---|---|
| GET | /instances/{instanceId}/users | Lists the users in the specified database instance. |
Normal Response Code(s): 200
Error Response Code(s): badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), unprocessableEntity (422), instanceFault (500), notImplemented (501), serviceUnavailable (503), itemNotFound (404)
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 MySQL 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
| Name | Style | Type | Description |
|---|---|---|---|
accountId | Template | String | The account ID of the owner of the specified instance. |
instanceId | Template | String | The instance ID for the specified database instance. |
The following examples show the List Users in Database Instance requests:
Example 4.65. List Users in Database Instance Request: XML
GET /v1.0/1234/instances/9cccb45e-e15d-4bcc-aedc-61a4bf3e4ad9/users HTTP/1.1 User-Agent: python-reddwarfclient Host: ord.databases.api.rackspacecloud.com X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7 Accept: application/xml Content-Type: application/xml
Example 4.66. List Users in Database Instance Request: JSON
GET /v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users 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
The following examples show the paginated List Users in Database Instance requests:
Example 4.67. List Users in Database Instance Paged Request: XML
GET /v1.0/1234/instances/9cccb45e-e15d-4bcc-aedc-61a4bf3e4ad9/users?limit=2 HTTP/1.1 User-Agent: python-reddwarfclient Host: ord.databases.api.rackspacecloud.com X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7 Accept: application/xml Content-Type: application/xml
Example 4.68. List Users in Database Instance Paged Request: JSON
GET /v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users?limit=2 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
This operation does not require a request body.
The following examples show the List Users in Database Instance responses:
Example 4.69. List Users in Database Instance Response: XML
HTTP/1.1 200 OK
Content-Type: application/xml
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 511
Date: Wed, 08 May 2013 22:43:34 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
<users xmlns="http://docs.openstack.org/database/api/v1.0">
<user host="%" name="dbuser1">
<databases/>
</user>
<user host="10.0.0.1" name="dbuser2">
<databases>
<database name="databaseB"/>
<database name="databaseC"/>
</databases>
</user>
<user host="%" name="dbuser3">
<databases/>
</user>
<user host="%" name="demouser">
<databases>
<database name="sampledb"/>
</databases>
</user>
</users>
Example 4.70. List Users in Database Instance Response: JSON
HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 287
Date: Wed, 08 May 2013 22:43:34 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
{
"users": [
{
"databases": [],
"host": "%",
"name": "dbuser1"
},
{
"databases": [
{
"name": "databaseB"
},
{
"name": "databaseC"
}
],
"host": "10.0.0.1",
"name": "dbuser2"
},
{
"databases": [],
"host": "%",
"name": "dbuser3"
},
{
"databases": [
{
"name": "sampledb"
}
],
"host": "%",
"name": "demouser"
}
]
}
Refer to Section 3.11.1, “User Access Restriction by Host” for a description of the host field.
The following examples show the paginated List Users in Database Instance responses:
Example 4.71. List Users in Database Instance Paged Response: XML
HTTP/1.1 200 OK
Content-Type: application/xml
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 497
Date: Wed, 08 May 2013 22:43:34 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
<users xmlns="http://docs.openstack.org/database/api/v1.0">
<user host="%" name="dbuser1">
<databases/>
</user>
<user host="10.0.0.1" name="dbuser2">
<databases>
<database name="databaseB"/>
<database name="databaseC"/>
</databases>
</user>
<links>
<link href="https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/9cccb45e-e15d-4bcc-aedc-61a4bf3e4ad9/users?marker=dbuser2%4010.0.0.1&limit=2" rel="next"/>
</links>
</users>
Example 4.72. List Users in Database Instance Paged Response: JSON
HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: 323
Date: Wed, 08 May 2013 22:43:34 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)
{
"links": [
{
"href": "https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/dcc5c518-73c7-4471-83e1-15fae67a98eb/users?marker=dbuser2%4010.0.0.1&limit=2",
"rel": "next"
}
],
"users": [
{
"databases": [],
"host": "%",
"name": "dbuser1"
},
{
"databases": [
{
"name": "databaseB"
},
{
"name": "databaseC"
}
],
"host": "10.0.0.1",
"name": "dbuser2"
}
]
}

![[Note]](/cdb-v1.0-cdb-devguide/common/images/admon/note.png)
