Query Role-Account Relationships

GET/zstack/v1/identities/role-account-refs

Headers

Authorization: OAuth the-session-uuid

Curl 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=686cb963323e491e955a0fd0b49dd743

Queryable 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"
    }
  ]
}
NameTypeDescriptionStarting Version
successbooleanWhether the query is successful4.10.0
inventoriesListFor details, see inventories4.10.0
errorErrorCodeError code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error4.10.0

inventories

NameTypeDescriptionStarting Version
roleUuidStringRole UUID4.10.0
accountUuidStringAccount UUID4.10.0
accountPermissionFromStringSource 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
createDateTimestampCreation time4.10.0
lastOpDateTimestampLast modification time4.10.0

error

NameTypeDescriptionStarting Version
codeStringError code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001.0.6
descriptionStringBrief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null.0.6
opaqueLinkedHashMapReserved field. Default is null.0.6
causeErrorCodeRoot 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()