Query Role-Account Relationships
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/identities/role-account-refs?q=roleUuid=686cb963323e491e955a0fd0b49dd743Queryable Fields
Run the CLI command line tool, enter QuerySharedResource and press the Tab key to view all queryable fields and cross-table queryable resource names.
API Response
Response Example
{
"inventories": [
{
"roleUuid": "686cb963323e491e955a0fd0b49dd743",
"accountUuid": "5360250ef145409e862b4e99d2b2efc4",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the query is successful | 4.10.0 |
| inventories | List | For details, see inventories | 4.10.0 |
| error | ErrorCode | Error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.10.0 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| roleUuid | String | Role UUID | 4.10.0 |
| accountUuid | String | Account UUID | 4.10.0 |
| accountPermissionFrom | String | Source of account permissions. If the account obtained the role by joining an account group, this value is the UUID of that account group. If the account is directly bound to the role, this value is null. | 4.10.0 |
| createDate | Timestamp | Creation time | 4.10.0 |
| lastOpDate | Timestamp | Last modification time | 4.10.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001. | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null. | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists. | 0.6 |
SDK Examples
Java SDK
QueryRoleAccountRefAction action = new QueryRoleAccountRefAction();
action.conditions = asList("roleUuid=686cb963323e491e955a0fd0b49dd743");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryRoleAccountRefAction.Result res = action.call();
Python SDK
QueryRoleAccountRefAction action = QueryRoleAccountRefAction()
action.conditions = ["roleUuid=686cb963323e491e955a0fd0b49dd743"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryRoleAccountRefAction.Result res = action.call()