Document navigation

Organization Operations

CreateIAM2Organization

API Request

URLs
POST /v1/iam2/organizations
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "org1",
    "type": "Company",
    "parentUuid": "398f147aef0347099c16548bce0ceca1",
    "attributes": [
      {
        "name": "some-attribute-name",
        "value": "attribute-value"
      }
    ],
    "quota": {
      "vm.num": 100.0
    }
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"org1","type":"Company","parentUuid":"1c26fe0d3e384ac9bf67ce4340d65413","attributes":[{"name":"some-attribute-name","value":"attribute-value"}]}}' http://localhost:8080/zstack/v1/iam2/organizations
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The resource name. 2.4.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 2.4.0
type OrganizationType body (contained in the params structure) The organization type.
  • Company
  • Department
2.4.0
parentUuid String body (contained in the params structure) Optional. 2.4.0
attributes List body (contained in the params structure) Optional. 2.4.0
quota List body (contained in the params structure) Optional. The quota. 4.3.6
resourceUuid String body (contained in the params structure) Optional. 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "d8880014345347e1ab945d8ef750fac7",
    "name": "org1",
    "state": "Enabled",
    "type": "Company",
    "srcType": "ZStack",
    "parentUuid": "1dffd2c40215412d8ab4b811ce6888f0",
    "rootOrganizationUuid": "a531128bc8724f0ba55a85c425f22c32",
    "attributes": [
      {
        "uuid": "053353cf77d6493daef4de70c9ff8d24",
        "name": "attribute-name",
        "value": "attribute-value",
        "type": "Customized"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventory IAM2OrganizationInventory See inventory. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
description String The detailed description of the resource. 2.4.0
createDate Timestamp The creation date. 2.4.0
lastOpDate Timestamp The last operation date. 2.4.0
parentUuid String 2.4.0
state State See state. 2.4.0
type OrganizationType See type. 2.4.0
attributes List See attributes. 2.4.0
#state
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#attributes
Name Type Description Starting Version
organizationUuid String 2.4.0
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
value String 2.4.0
type AttributeType See type. 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0

SDK Sample

Java SDK
CreateIAM2OrganizationAction action = new CreateIAM2OrganizationAction();
action.name = "org1";
action.type = "Company";
action.parentUuid = "1d650e96108c47a297a7529d45afef97";
action.attributes = asList([name:some-attribute-name, value:attribute-value]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateIAM2OrganizationAction.Result res = action.call();
Python SDK
CreateIAM2OrganizationAction action = CreateIAM2OrganizationAction()
action.name = "org1"
action.type = "Company"
action.parentUuid = "a7faaafa84ae4345957fd7e61434481b"
action.attributes = [[name:some-attribute-name, value:attribute-value]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateIAM2OrganizationAction.Result res = action.call()

DeleteIAM2Organization

API Request

URLs
DELETE /v1/iam2/organizations/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/iam2/organizations/b30d1f09a0df3f708bba1208ade2aa90?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
deleteMode String url Optional. The delete mode. 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
DeleteIAM2OrganizationAction action = new DeleteIAM2OrganizationAction();
action.uuid = "b30d1f09a0df3f708bba1208ade2aa90";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteIAM2OrganizationAction.Result res = action.call();
Python SDK
DeleteIAM2OrganizationAction action = DeleteIAM2OrganizationAction()
action.uuid = "b30d1f09a0df3f708bba1208ade2aa90"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteIAM2OrganizationAction.Result res = action.call()

QueryIAM2Organization

API Request

URLs
GET zstack/v1/iam2/organizations
GET zstack/v1/iam2/organizations/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/organizations?q=name=test
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/organizations/e09768162e273e56aaffa649184585e3

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryIAM2Organization, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "22e5c247ec02478286a1fccfdaa9a2d3",
      "name": "org1",
      "state": "Enabled",
      "type": "Company",
      "parentUuid": "3714d14d9b78487e983236a5ae65a190",
      "attributes": [
        {
          "uuid": "ee3bccfce21243cfbfc03cce1118b929",
          "name": "attribute-name",
          "value": "attribute-value",
          "type": "Customized"
        }
      ]
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventories List See inventories. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
description String The detailed description of the resource. 2.4.0
createDate Timestamp The creation date. 2.4.0
lastOpDate Timestamp The last operation date. 2.4.0
parentUuid String 2.4.0
state State See state. 2.4.0
type OrganizationType See type. 2.4.0
attributes List See attributes. 2.4.0
#state
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#attributes
Name Type Description Starting Version
organizationUuid String 2.4.0
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
value String 2.4.0
type AttributeType See type. 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0

SDK Sample

Java SDK
QueryIAM2OrganizationAction action = new QueryIAM2OrganizationAction();
action.conditions = asList("name=test");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIAM2OrganizationAction.Result res = action.call();
Python SDK
QueryIAM2OrganizationAction action = QueryIAM2OrganizationAction()
action.conditions = ["name=test"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIAM2OrganizationAction.Result res = action.call()

UpdateIAM2Organization

API Request

URLs
PUT zstack/v1/iam2/organizations/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateIAM2Organization": {
    "name": "new-name",
    "description": "new-description",
    "parentUuid": "56bf430cab663c908d1ebe7ab28e5e90"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateIAM2Organization":{"name":"new-name","description":"new-description","parentUuid":"56bf430cab663c908d1ebe7ab28e5e90"}}' http://localhost:8080/zstack/v1/iam2/organizations/f68813583328377fa44bb72d75a13ed5/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
name String body (contained in the updateIAM2Organization structure) Optional. The resource name. 2.4.0
description String body (contained in the updateIAM2Organization structure) Optional. The detailed description of the resource. 2.4.0
parentUuid String body (contained in the updateIAM2Organization structure) Optional. 2.4.0
type OrganizationType body (contained in the updateIAM2Organization structure) Optional.
  • Company
  • Department
2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "3f0315c83d524c0fa0da9be22c1cd58e",
    "name": "org1",
    "state": "Enabled",
    "type": "Company",
    "parentUuid": "8b15e39fb62a43089610103be30c17b5",
    "attributes": [
      {
        "uuid": "5dd14ca022554b22938d94c27de872fb",
        "name": "attribute-name",
        "value": "attribute-value",
        "type": "Customized"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventory IAM2OrganizationInventory See inventory. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
description String The detailed description of the resource. 2.4.0
createDate Timestamp The creation date. 2.4.0
lastOpDate Timestamp The last operation date. 2.4.0
parentUuid String 2.4.0
state State See state. 2.4.0
type OrganizationType See type. 2.4.0
attributes List See attributes. 2.4.0
#state
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#attributes
Name Type Description Starting Version
organizationUuid String 2.4.0
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
value String 2.4.0
type AttributeType See type. 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0

SDK Sample

Java SDK
UpdateIAM2OrganizationAction action = new UpdateIAM2OrganizationAction();
action.uuid = "f68813583328377fa44bb72d75a13ed5";
action.name = "new-name";
action.description = "new-description";
action.parentUuid = "56bf430cab663c908d1ebe7ab28e5e90";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateIAM2OrganizationAction.Result res = action.call();
Python SDK
UpdateIAM2OrganizationAction action = UpdateIAM2OrganizationAction()
action.uuid = "f68813583328377fa44bb72d75a13ed5"
action.name = "new-name"
action.description = "new-description"
action.parentUuid = "56bf430cab663c908d1ebe7ab28e5e90"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateIAM2OrganizationAction.Result res = action.call()

ChangeIAM2OrganizationParent

API Request

URLs
PUT zstack/v1/iam2/organizations/{parentUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeIAM2OrganizationParent": {
    "childrenUuids": [
      "b71dcc43656f399c82b09a379d1d6a74",
      "220c9c0ec8a53c37b9c680b0deed7563"
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeIAM2OrganizationParent":{"childrenUuids":["b71dcc43656f399c82b09a379d1d6a74","220c9c0ec8a53c37b9c680b0deed7563"]}}' http://localhost:8080/zstack/v1/iam2/organizations/4fef501c5ba331f496907f642f609ea3/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
parentUuid String url 2.4.0
childrenUuids List body (contained in the changeIAM2OrganizationParent structure) 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
ChangeIAM2OrganizationParentAction action = new ChangeIAM2OrganizationParentAction();
action.parentUuid = "4fef501c5ba331f496907f642f609ea3";
action.childrenUuids = asList("b71dcc43656f399c82b09a379d1d6a74","220c9c0ec8a53c37b9c680b0deed7563");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeIAM2OrganizationParentAction.Result res = action.call();
Python SDK
ChangeIAM2OrganizationParentAction action = ChangeIAM2OrganizationParentAction()
action.parentUuid = "4fef501c5ba331f496907f642f609ea3"
action.childrenUuids = [b71dcc43656f399c82b09a379d1d6a74, 220c9c0ec8a53c37b9c680b0deed7563]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeIAM2OrganizationParentAction.Result res = action.call()

ChangeIAM2OrganizationState

API Request

URLs
PUT zstack/v1/iam2/organizations/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeIAM2OrganizationState": {
    "stateEvent": "enable"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeIAM2OrganizationState":{"stateEvent":"enable"}}' http://localhost:8080/zstack/v1/iam2/organizations/61e292aa7d3f3796a313c338214e0f34/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
stateEvent StateEvent body (contained in the changeIAM2OrganizationState structure)
  • enable
  • disable
2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "c62fea9f96644a9cb5ba1ba383a9335c",
    "name": "org1",
    "state": "Enabled",
    "type": "Company",
    "parentUuid": "80f101e520f94f958b1357f7d7a3dc37",
    "attributes": [
      {
        "uuid": "754a49f70fcb46ad879b347447af7b25",
        "name": "attribute-name",
        "value": "attribute-value",
        "type": "Customized"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventory IAM2OrganizationInventory See inventory. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
description String The detailed description of the resource. 2.4.0
createDate Timestamp The creation date. 2.4.0
lastOpDate Timestamp The last operation date. 2.4.0
parentUuid String 2.4.0
state State See state. 2.4.0
type OrganizationType See type. 2.4.0
attributes List See attributes. 2.4.0
#state
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#attributes
Name Type Description Starting Version
organizationUuid String 2.4.0
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
value String 2.4.0
type AttributeType See type. 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0

SDK Sample

Java SDK
ChangeIAM2OrganizationStateAction action = new ChangeIAM2OrganizationStateAction();
action.uuid = "61e292aa7d3f3796a313c338214e0f34";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeIAM2OrganizationStateAction.Result res = action.call();
Python SDK
ChangeIAM2OrganizationStateAction action = ChangeIAM2OrganizationStateAction()
action.uuid = "61e292aa7d3f3796a313c338214e0f34"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeIAM2OrganizationStateAction.Result res = action.call()

RemoveAttributesFromIAM2Organization

API Request

URLs
DELETE zstack/v1/iam2/organizations/{uuid}/attributes?attributeUuids={attributeUuids}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/iam2/organizations/7783a8869e6a31a29562fb58dfdccc69/attributes?attributeUuids=cdec45ca22a43b47942268b3dc90bc43&attributeUuids=f6febd00a2633bd98d8763ffdff1b693
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
attributeUuids List url 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
RemoveAttributesFromIAM2OrganizationAction action = new RemoveAttributesFromIAM2OrganizationAction();
action.uuid = "7783a8869e6a31a29562fb58dfdccc69";
action.attributeUuids = asList("cdec45ca22a43b47942268b3dc90bc43","f6febd00a2633bd98d8763ffdff1b693");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveAttributesFromIAM2OrganizationAction.Result res = action.call();
Python SDK
RemoveAttributesFromIAM2OrganizationAction action = RemoveAttributesFromIAM2OrganizationAction()
action.uuid = "7783a8869e6a31a29562fb58dfdccc69"
action.attributeUuids = [cdec45ca22a43b47942268b3dc90bc43, f6febd00a2633bd98d8763ffdff1b693]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveAttributesFromIAM2OrganizationAction.Result res = action.call()

RemoveIAM2VirtualIDsFromOrganization

API Request

URLs
DELETE zstack/v1/iam2/organizations/{organizationUuid}/virtual-ids?virtualIDUuids={virtualIDUuids}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/iam2/organizations/a28a5646a6ed32b2b854af830709d05c/virtual-ids?virtualIDUuids=f998d391462734c69998072fc801b96c&virtualIDUuids=df9c6eeb32df35558b8dd214f2527a23
Request Parameters
Name Type Location Description Optional Value Starting Version
virtualIDUuids List url 2.4.0
organizationUuid String url 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
RemoveIAM2VirtualIDsFromOrganizationAction action = new RemoveIAM2VirtualIDsFromOrganizationAction();
action.virtualIDUuids = asList("f998d391462734c69998072fc801b96c","df9c6eeb32df35558b8dd214f2527a23");
action.organizationUuid = "a28a5646a6ed32b2b854af830709d05c";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveIAM2VirtualIDsFromOrganizationAction.Result res = action.call();
Python SDK
RemoveIAM2VirtualIDsFromOrganizationAction action = RemoveIAM2VirtualIDsFromOrganizationAction()
action.virtualIDUuids = [f998d391462734c69998072fc801b96c, df9c6eeb32df35558b8dd214f2527a23]
action.organizationUuid = "a28a5646a6ed32b2b854af830709d05c"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveIAM2VirtualIDsFromOrganizationAction.Result res = action.call()

CreateIAM2VirtualID

API Request

URLs
POST zstack/v1/iam2/virtual-ids
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "id1",
    "password": "password",
    "attributes": [
      {
        "name": "some-attribute-name",
        "value": "attribute-value"
      }
    ],
    "projectUuid": "fbc22f14b3873e30b4439d973ab2f817",
    "organizationUuid": "5fef6c4ca6e63c7fa5e82d1437190ebe",
    "withoutDefaultRole": false
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"id1","password":"password","attributes":[{"name":"some-attribute-name","value":"attribute-value"}],"projectUuid":"fbc22f14b3873e30b4439d973ab2f817","organizationUuid":"5fef6c4ca6e63c7fa5e82d1437190ebe","withoutDefaultRole":false}}' http://localhost:8080/zstack/v1/iam2/virtual-ids
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The resource name. 2.4.0
password String body (contained in the params structure) 2.4.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 2.4.0
attributes List body (contained in the params structure) Optional. 2.4.0
projectUuid String body (contained in the params structure) Optional. 2.4.0
organizationUuid String body (contained in the params structure) Optional. 2.4.0
resourceUuid String body (contained in the params structure) Optional. 2.4.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "894f1c5bf6714a76b08324c69b8cac7c",
    "name": "id1",
    "state": "Enabled",
    "attributes": [
      {
        "uuid": "04f039d7f3f04dc5a1b6bf9fe93e6cdd",
        "name": "attribute-name",
        "value": "attribute-value",
        "type": "Customized"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventory IAM2VirtualIDInventory See inventory. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
description String The detailed description of the resource. 2.4.0
createDate Timestamp The creation date. 2.4.0
lastOpDate Timestamp The last operation date. 2.4.0
state State See state. 2.4.0
attributes List See attributes. 2.4.0
#state
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#attributes
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
value String 2.4.0
type AttributeType See type. 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0

SDK Sample

Java SDK
CreateIAM2VirtualIDAction action = new CreateIAM2VirtualIDAction();
action.name = "id1";
action.password = "password";
action.attributes = asList([name:some-attribute-name, value:attribute-value]);
action.projectUuid = "fbc22f14b3873e30b4439d973ab2f817";
action.organizationUuid = "5fef6c4ca6e63c7fa5e82d1437190ebe";
action.withoutDefaultRole = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateIAM2VirtualIDAction.Result res = action.call();
Python SDK
CreateIAM2VirtualIDAction action = CreateIAM2VirtualIDAction()
action.name = "id1"
action.password = "password"
action.attributes = [[name:some-attribute-name, value:attribute-value]]
action.projectUuid = "fbc22f14b3873e30b4439d973ab2f817"
action.organizationUuid = "5fef6c4ca6e63c7fa5e82d1437190ebe"
action.withoutDefaultRole = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateIAM2VirtualIDAction.Result res = action.call()

DeleteIAM2VirtualID

API Request

URLs
DELETE zstack/v1/iam2/virtual-ids/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/iam2/virtual-ids/b141cd136a1f384d9e8e68319f8e1281?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
deleteMode String url Optional. The delete mode. 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
DeleteIAM2VirtualIDAction action = new DeleteIAM2VirtualIDAction();
action.uuid = "b141cd136a1f384d9e8e68319f8e1281";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteIAM2VirtualIDAction.Result res = action.call();
Python SDK
DeleteIAM2VirtualIDAction action = DeleteIAM2VirtualIDAction()
action.uuid = "b141cd136a1f384d9e8e68319f8e1281"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteIAM2VirtualIDAction.Result res = action.call()

QueryIAM2VirtualID

API Request

URLs
GET zstack/v1/iam2/virtual-ids
GET zstack/v1/iam2/virtual-ids/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/virtual-ids?q=name=test
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/virtual-ids/53c8b09e9ea63679add5c2003c4ce1cd

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryIAM2VirtualID, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "e6e349e2d3e94ad39d2d620366de2b33",
      "name": "id1",
      "state": "Enabled",
      "attributes": [
        {
          "uuid": "fcd5e53a4bc44906a31e93012b46dab1",
          "name": "attribute-name",
          "value": "attribute-value",
          "type": "Customized"
        }
      ]
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventories List See inventories. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
description String The detailed description of the resource. 2.4.0
createDate Timestamp The creation date. 2.4.0
lastOpDate Timestamp The last operation date. 2.4.0
state State See state. 2.4.0
attributes List See attributes. 2.4.0
#state
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#attributes
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
value String 2.4.0
type AttributeType See type. 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0

SDK Sample

Java SDK
QueryIAM2VirtualIDAction action = new QueryIAM2VirtualIDAction();
action.conditions = asList("name=test");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIAM2VirtualIDAction.Result res = action.call();
Python SDK
QueryIAM2VirtualIDAction action = QueryIAM2VirtualIDAction()
action.conditions = ["name=test"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIAM2VirtualIDAction.Result res = action.call()

LoginIAM2VirtualID

API Request

URLs
PUT zstack/v1/iam2/virtual-ids/login
Body
{
  "loginIAM2VirtualID": {
    "name": "id1",
    "password": "password"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"loginIAM2VirtualID":{"name":"id1","password":"password"}}' http://localhost:8080/zstack/v1/iam2/virtual-ids/login
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the loginIAM2VirtualID structure) The resource name. 2.4.0
password String body (contained in the loginIAM2VirtualID structure) 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0
captchaUuid String body (contained in the loginIAM2VirtualID structure) Optional. 2.4.0
verifyCode String body (contained in the loginIAM2VirtualID structure) Optional. 2.4.0
clientInfo Map body (contained in the loginIAM2VirtualID structure) Optional. The client information. 3.5.0
Note:
  • When you log in to ZStack Cloud as a user, you can use the two-factor authentication method by adding the twofatoken option to SystemTags.
    • Format of the twofatoken option: twofatoken::6-digit two-factor authentication code
    • Example: twofatoken::123456

API Response

Sample Response
{
  "inventory": {
    "uuid": "7fcdc9d9e4bf3d8681a4472f38951dc0",
    "noSessionEvaluation": false
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventory SessionInventory See inventory. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
accountUuid String The account UUID. 2.4.0
userUuid String The user UUID. 2.4.0
expiredDate Timestamp 2.4.0
createDate Timestamp The creation date. 2.4.0

SDK Sample

Java SDK
LoginIAM2VirtualIDAction action = new LoginIAM2VirtualIDAction();
action.name = "id1";
action.password = "password";
LoginIAM2VirtualIDAction.Result res = action.call();
Python SDK
LoginIAM2VirtualIDAction action = LoginIAM2VirtualIDAction()
action.name = "id1"
action.password = "password"
LoginIAM2VirtualIDAction.Result res = action.call()

ChangeIAM2VirtualIDState

API Request

URLs
PUT zstack/v1/iam2/virtual-ids/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeIAM2VirtualIDState": {
    "stateEvent": "enable"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeIAM2VirtualIDState":{"stateEvent":"enable"}}' http://localhost:8080/zstack/v1/iam2/virtual-ids/cc723702dcc24fafba542aa64d953d58/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
stateEvent StateEvent body (contained in the changeIAM2VirtualIDState structure)
  • enable
  • disable
2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "0524ea53082646569dfbc1bdecc82b70",
    "name": "id1",
    "state": "Enabled",
    "attributes": [
      {
        "uuid": "9eb16e277f1f412890e0fa8f6b76d432",
        "name": "attribute-name",
        "value": "attribute-value",
        "type": "Customized"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.4.0
inventory IAM2VirtualIDInventory See inventory. 2.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 2.4.0
description String The brief description of the error. 2.4.0
details String The details about the error. 2.4.0
elaboration String The reserved field. Default value: null. 2.4.0
opaque LinkedHashMap The reserved field. Default value: null. 2.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
description String The detailed description of the resource. 2.4.0
createDate Timestamp The creation date. 2.4.0
lastOpDate Timestamp The last operation date. 2.4.0
state State See state. 2.4.0
attributes List See attributes. 2.4.0
#state
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0
#attributes
Name Type Description Starting Version
uuid String The resource UUID. 2.4.0
name String The resource name. 2.4.0
value String 2.4.0
type AttributeType See type. 2.4.0
#type
Name Type Description Starting Version
name String The resource name. 2.4.0
ordinal int 2.4.0

SDK Sample

Java SDK
ChangeIAM2VirtualIDStateAction action = new ChangeIAM2VirtualIDStateAction();
action.uuid = "028961c0f40b4a63b8bf8f8fb6da2e6a";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeIAM2VirtualIDStateAction.Result res = action.call();
Python SDK
ChangeIAM2VirtualIDStateAction action = ChangeIAM2VirtualIDStateAction()
action.uuid = "7a40071d17b74e8085fb41c1e6f2216b"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeIAM2VirtualIDStateAction.Result res = action.call()

AddIAM2VirtualIDsToOrganization

API Request

URLs
POST zstack/v1/iam2/organizations/{organizationUuid}/virtual-ids
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "virtualIDUuids": [
      "e747d2bd298c38aab5ac7ee561377845",
      "8bda3c55564031bc9666cd6607e1aa6f"
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"virtualIDUuids":["e747d2bd298c38aab5ac7ee561377845","8bda3c55564031bc9666cd6607e1aa6f"]}}' http://localhost:8080/zstack/v1/iam2/organizations/e28067165c7a3d098ea64c564ac2f53f/virtual-ids
Request Parameters
Name Type Location Description Optional Value Starting Version
virtualIDUuids List body (contained in the params structure) 2.4.0
organizationUuid String url 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
AddIAM2VirtualIDsToOrganizationAction action = new AddIAM2VirtualIDsToOrganizationAction();
action.virtualIDUuids = asList("e747d2bd298c38aab5ac7ee561377845","8bda3c55564031bc9666cd6607e1aa6f");
action.organizationUuid = "e28067165c7a3d098ea64c564ac2f53f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddIAM2VirtualIDsToOrganizationAction.Result res = action.call();
Python SDK
AddIAM2VirtualIDsToOrganizationAction action = AddIAM2VirtualIDsToOrganizationAction()
action.virtualIDUuids = [e747d2bd298c38aab5ac7ee561377845, 8bda3c55564031bc9666cd6607e1aa6f]
action.organizationUuid = "e28067165c7a3d098ea64c564ac2f53f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddIAM2VirtualIDsToOrganizationAction.Result res = action.call()

AddAttributesToIAM2VirtualID

API Request

URLs
POST zstack/v1/iam2/virtual-ids/{uuid}/attributes
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "attributes": [
      {
        "name": "some-attribute-name",
        "value": "attribute-value"
      }
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
attributes List body (contained in the params structure) The attributes. 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
AddAttributesToIAM2VirtualIDAction action = new AddAttributesToIAM2VirtualIDAction();
action.uuid = "94d943b468573d9d9cdfd5472a6235dc";
action.attributes = asList([name:some-attribute-name, value:attribute-value]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddAttributesToIAM2VirtualIDAction.Result res = action.call();
Python SDK
AddAttributesToIAM2VirtualIDAction action = AddAttributesToIAM2VirtualIDAction()
action.uuid = "94d943b468573d9d9cdfd5472a6235dc"
action.attributes = [[name:some-attribute-name, value:attribute-value]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddAttributesToIAM2VirtualIDAction.Result res = action.call()

RemoveAttributesFromIAM2VirtualID

API Request

URLs
DELETE zstack/v1/iam2/virtual-ids/{uuid}/attributes?attributeUuids={attributeUuids}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/iam2/virtual-ids/041a44d7d5983fe480c577c897b08eb7/attributes?attributeUuids=4d06d2b6742636dfaed60ea4b8807aa2&attributeUuids=c7ba41447321334b852cf2217bfa34f4
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.4.0
attributeUuids List url 2.4.0
systemTags List body Optional. The system tags. 2.4.0
userTags List body Optional. The user tags. 2.4.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
RemoveAttributesFromIAM2VirtualIDAction action = new RemoveAttributesFromIAM2VirtualIDAction();
action.uuid = "041a44d7d5983fe480c577c897b08eb7";
action.attributeUuids = asList("4d06d2b6742636dfaed60ea4b8807aa2","c7ba41447321334b852cf2217bfa34f4");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveAttributesFromIAM2VirtualIDAction.Result res = action.call();
Python SDK
RemoveAttributesFromIAM2VirtualIDAction action = RemoveAttributesFromIAM2VirtualIDAction()
action.uuid = "041a44d7d5983fe480c577c897b08eb7"
action.attributeUuids = [4d06d2b6742636dfaed60ea4b8807aa2, c7ba41447321334b852cf2217bfa34f4]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveAttributesFromIAM2VirtualIDAction.Result res = action.call()

SetOrganizationSupervisor

API Request

URLs
PUT zstack/v1/iam2/organizations/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "setOrganizationSupervisor": {
    "virtualIDUuid": "b3edb976bc0244b38711fad11913fb49"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"setOrganizationSupervisor":{"virtualIDUuid":"4424b77e00cb49bca232faf58e5d1f5e"}}' http://localhost:8080/zstack/v1/iam2/organizations/25a96af2ef0144e5ae4d0fbee57a6af8/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.6.0
virtualIDUuid String body (contained in the setOrganizationSupervisor structure) 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
SetOrganizationSupervisorAction action = new SetOrganizationSupervisorAction();
action.uuid = "ea1a78daf9ff449b89326e95bc56bdcd";
action.virtualIDUuid = "b0d40be841ad41b7aec8a80ee483a88b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetOrganizationSupervisorAction.Result res = action.call();
Python SDK
SetOrganizationSupervisorAction action = SetOrganizationSupervisorAction()
action.uuid = "a4f5561ff9404c6ebb6c07dce8245f17"
action.virtualIDUuid = "d9376e7c92cf43f3a27bf006e46406ca"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetOrganizationSupervisorAction.Result res = action.call()

BatchCreateIAM2VirtualIDFromConfigFile

API Request

URLs
POST zstack/v1/iam2/virtual-ids/from-file
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "virtualIDInfos": "FILE CONTENT ENCODE BY BASE64"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"virtualIDInfos":"FILE CONTENT ENCODE BY BASE64"}}' http://localhost:8080/zstack/v1/iam2/virtual-ids/from-file
Request Parameters
Name Type Location Description Optional Value Starting Version
virtualIDInfos String body (contained in the params structure) The user information encoded in Base64 format. 3.6.0
resourceUuid String body (contained in the params structure) Optional. 3.6.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "numberOfImportedUser": 10.0
}
Name Type Description Starting Version
numberOfImportedUser int The number of users that you have created successfully when you create users in bulk. 3.6.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0

SDK Sample

Java SDK
BatchCreateIAM2VirtualIDFromConfigFileAction action = new BatchCreateIAM2VirtualIDFromConfigFileAction();
action.virtualIDInfos = "FILE CONTENT ENCODE BY BASE64";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
BatchCreateIAM2VirtualIDFromConfigFileAction.Result res = action.call();
Python SDK
BatchCreateIAM2VirtualIDFromConfigFileAction action = BatchCreateIAM2VirtualIDFromConfigFileAction()
action.virtualIDInfos = "FILE CONTENT ENCODE BY BASE64"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
BatchCreateIAM2VirtualIDFromConfigFileAction.Result res = action.call()

CheckIAM2VirtualIDConfigFile

API Request

URLs
PUT zstack/v1/iam2/virtual-ids/from-file
Headers
Authorization: OAuth the-session-uuid
Body
{
  "checkIAM2VirtualIDConfigFile": {
    "virtualIDInfos": "FILE CONTENT ENCODE BY BASE64"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"checkIAM2VirtualIDConfigFile":{"virtualIDInfos":"FILE CONTENT ENCODE BY BASE64"}}' http://localhost:8080/zstack/v1/iam2/virtual-ids/from-file
Request Parameters
Name Type Location Description Optional Value Starting Version
virtualIDInfos String body (contained in the checkIAM2VirtualIDConfigFile structure) The user information encoded in Base64 format. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "results": [
    {
      "line": 123.0,
      "detail": "Duplicate user name"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
results List See results. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#results
Name Type Description Starting Version
line int 3.6.0
detail String 3.6.0

SDK Sample

Java SDK
CheckIAM2VirtualIDConfigFileAction action = new CheckIAM2VirtualIDConfigFileAction();
action.virtualIDInfos = "FILE CONTENT ENCODE BY BASE64";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckIAM2VirtualIDConfigFileAction.Result res = action.call();
Python SDK
CheckIAM2VirtualIDConfigFileAction action = CheckIAM2VirtualIDConfigFileAction()
action.virtualIDInfos = "FILE CONTENT ENCODE BY BASE64"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CheckIAM2VirtualIDConfigFileAction.Result res = action.call()

AttachIAM2ProjectToIAM2Organization

API Request

URLs
POST zstack/v1/iam2/projects/{projectUuid}/iam2/organizations/{organizationUuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/iam2/projects/d5698b56f9f23a61958201cf7bee4e72/iam2/organizations/72363068daea3772bb52aa663554c1e5
Request Parameters
Name Type Location Description Optional Value Starting Version
projectUuid String url The project UUID. 3.6.0
organizationUuid String url The organization UUID. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "262a60f99c5a49e8866ed9f92ef550e2",
    "name": "project",
    "state": "Enabled"
  }
}
Name Type Description Starting Version
success boolean 4.7.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
inventory IAM2ProjectInventory See inventory. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
name String The resource name. 3.6.0
description String The detailed description of the resource. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0
linkedAccountUuid String 3.6.0
state ProjectState See state. 3.6.0
attributes List See attributes. 3.6.0
#state
Name Type Description Starting Version
name String The resource name. 3.6.0
ordinal int 3.6.0
#attributes
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
name String The resource name. 3.6.0
value String 3.6.0
type AttributeType See type. 3.6.0
#type
Name Type Description Starting Version
name String The resource name. 3.6.0
ordinal int 3.6.0

SDK Sample

Java SDK
AttachIAM2ProjectToIAM2OrganizationAction action = new AttachIAM2ProjectToIAM2OrganizationAction();
action.projectUuid = "d5698b56f9f23a61958201cf7bee4e72";
action.organizationUuid = "72363068daea3772bb52aa663554c1e5";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachIAM2ProjectToIAM2OrganizationAction.Result res = action.call();
Python SDK
AttachIAM2ProjectToIAM2OrganizationAction action = AttachIAM2ProjectToIAM2OrganizationAction()
action.projectUuid = "d5698b56f9f23a61958201cf7bee4e72"
action.organizationUuid = "72363068daea3772bb52aa663554c1e5"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachIAM2ProjectToIAM2OrganizationAction.Result res = action.call()

DetachIAM2ProjectFromIAM2Organization

API Request

URLs
DELETE zstack/v1/iam2/projects/{projectUuid}/iam2/organizations
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/iam2/projects/3fbdf0b46d3b3dec908ddb90fd4c6f42/iam2/organizations
Request Parameters
Name Type Location Description Optional Value Starting Version
projectUuid String url The project UUID. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "de0637fdd1ca423489d31ab65e5bf886",
    "name": "project",
    "state": "Enabled"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
inventory IAM2ProjectInventory See inventory. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
name String The resource name. 3.6.0
description String The detailed description of the resource. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0
linkedAccountUuid String 3.6.0
state ProjectState See state. 3.6.0
attributes List See attributes. 3.6.0
#state
Name Type Description Starting Version
name String The resource name. 3.6.0
ordinal int 3.6.0
#attributes
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
name String The resource name. 3.6.0
value String 3.6.0
type AttributeType See type. 3.6.0
#type
Name Type Description Starting Version
name String The resource name. 3.6.0
ordinal int 3.6.0

SDK Sample

Java SDK
DetachIAM2ProjectFromIAM2OrganizationAction action = new DetachIAM2ProjectFromIAM2OrganizationAction();
action.projectUuid = "3fbdf0b46d3b3dec908ddb90fd4c6f42";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachIAM2ProjectFromIAM2OrganizationAction.Result res = action.call();
Python SDK
DetachIAM2ProjectFromIAM2OrganizationAction action = DetachIAM2ProjectFromIAM2OrganizationAction()
action.projectUuid = "3fbdf0b46d3b3dec908ddb90fd4c6f42"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachIAM2ProjectFromIAM2OrganizationAction.Result res = action.call()

QueryIAM2OrganizationProjectRef

API Request

URLs
GET zstack/v1/iam2/projects/organizations/refs
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/projects/organizations/refs?q=projectUuid=6b0fa1d3c0433a378e50f42a53034457

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryIAM2OrganizationProjectRef, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "id": 1.0,
      "projectUuid": "29db1d979502319da9ecacb37168e0c6",
      "organizationUuid": "cd0af78809683f72b02a3fe8da0f1db0",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
inventories List See inventories. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#inventories
Name Type Description Starting Version
projectUuid String The project UUID. 3.6.0
organizationUuid String The organization UUID. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0

SDK Sample

Java SDK
QueryIAM2OrganizationProjectRefAction action = new QueryIAM2OrganizationProjectRefAction();
action.conditions = asList("projectUuid=a36c8328d0543cf09d51730a3ee5441f");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIAM2OrganizationProjectRefAction.Result res = action.call();
Python SDK
QueryIAM2OrganizationProjectRefAction action = QueryIAM2OrganizationProjectRefAction()
action.conditions = ["projectUuid=287be9d5470a3a6b95c985de918c19f8"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIAM2OrganizationProjectRefAction.Result res = action.call()

QueryIAM2ProjectAccountRef

API Request

URLs
GET zstack/v1/iam2/projects/account/refs
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/projects/account/refs?q=projectUuid=d8b70d161b993f479cd737fbf74fe597

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryIAM2ProjectAccountRef, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "projectUuid": "84e2577b7dcd327792d89b5ea0869044",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.6.0
inventories List See inventories. 3.6.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.6.0
#inventories
Name Type Description Starting Version
projectUuid String The project UUID. 3.6.0
accountUuid String The account UUID. 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0

SDK Sample

Java SDK
QueryIAM2ProjectAccountRefAction action = new QueryIAM2ProjectAccountRefAction();
action.conditions = asList("projectUuid=e326155182fe367ab919c9282b261db7");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIAM2ProjectAccountRefAction.Result res = action.call();
Python SDK
QueryIAM2ProjectAccountRefAction action = QueryIAM2ProjectAccountRefAction()
action.conditions = ["projectUuid=efd02b28577c3d6d855ebf27329757e2"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIAM2ProjectAccountRefAction.Result res = action.call()

GetIAM2OrganizationVirtualIDNumber

API Request

URLs
GET zstack/v1/iam2/organizations/{uuid}/virtualIDNumber
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/organizations/0572004dc33b36c4bd38216a024f5e0d/virtualIDNumber
Request Parameters
Name Type Location Description Valid Value Starting Version
uuid String url The UUID of the organization. 4.0.0
systemTags List query Optional. The system tags. 4.0.0
userTags List query Optional. The user tags. 4.0.0

API Response

Sample Response
{
  "virtualTotalNumber": 0.0,
  "virtualDirectNumber": 0.0
}
Name Type Description Starting Version
virtualTotalNumber Integer 4.0.0
virtualDirectNumber Integer 4.0.0
success boolean 4.0.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.0.0
description String The brief description of the error. 4.0.0
details String The details about the error. 4.0.0
elaboration String The reserved field. Default value: null. 4.0.0
opaque LinkedHashMap The reserved field. Default value: null. 4.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.0.0

SDK Sample

Java SDK
GetIAM2OrganizationVirtualIDNumberAction action = new GetIAM2OrganizationVirtualIDNumberAction();
action.uuid = "0572004dc33b36c4bd38216a024f5e0d";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetIAM2OrganizationVirtualIDNumberAction.Result res = action.call();
Python SDK
GetIAM2OrganizationVirtualIDNumberAction action = GetIAM2OrganizationVirtualIDNumberAction()
action.uuid = "0572004dc33b36c4bd38216a024f5e0d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetIAM2OrganizationVirtualIDNumberAction.Result res = action.call()

SetOrganizationOperation

API Request

URLs
GET zstack/v1/iam2/organizations/{uuid}/operation
Headers
Authorization: OAuth the-session-uuid
Body
{
  "setOrganizationOperation": {
    "virtualIDUuid": "7c5f7a277d094ce2bb17a3e7c776c636"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"setOrganizationOperation":{"virtualIDUuid":"f8f5f4f72e5c47aab9a73aa5a1b6a1df"}}' http://localhost:8080/zstack/v1/iam2/organizations/8cf02a09ab864bcf883e19a1c06e6c7b/operation
Request Parameters
Name Type Location Description Valid Value Starting Version
uuid String url The resource UUID. 4.3.6
virtualIDUuid String body(contained in the setOrganizationOperation structure) The usee UUID. 4.3.6
systemTags List body Optional. The system tags. 4.3.6
userTags List body Optional. The user tags. 4.3.6

API Response

Sample Response
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
SetOrganizationOperationAction action = new SetOrganizationOperationAction();
action.uuid = "460a3e9f3d2047679e2bcdf3cb0a8c3a";
action.virtualIDUuid = "12d54783a9ee42d198135ee1929d91ec";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetOrganizationOperationAction.Result res = action.call();
Python SDK
SetOrganizationOperationAction action = SetOrganizationOperationAction()
action.uuid = "673bd0eb6d0c4ef0b4c1dd2ef30ed82e"
action.virtualIDUuid = "543c2373e1da4c0cb76d232156db525f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetOrganizationOperationAction.Result res = action.call()

UpdateOrganizationQuota

API Request

URLs
GET zstack/v1/iam2/Organization/quotas/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateOrganizationQuota": {
    "identityUuid": "3e083dfff99b309bb15e848f7acef41b",
    "name": "quota",
    "value": 100.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateOrganizationQuota":{"identityUuid":"3e083dfff99b309bb15e848f7acef41b","name":"quota","value":100.0}}' http://localhost:8080/zstack/v1/iam2/Organization/quotas/actions
Request Parameters
Name Type Location Description Valid Value Starting Version
identityUuid String body (contained in the updateOrganizationQuota structure) The identity UUID. 4.3.6
name String body (contained in the updateOrganizationQuota structure) The quota name. 4.3.6
value long body (contained in the updateOrganizationQuota structure) The modified value. 4.3.6
systemTags List body Optional. The system tags. 4.3.6
userTags List body Optional. The user tags. 4.3.6

API Response

Sample Response
{
  "inventory": {
    "name": "quota",
    "identityUuid": "09081c19d997357ca8f07b4c44ddc640",
    "value": 20.0
  }
}
Name Type Description Starting Version
success boolean 4.3.6
inventory QuotaInventory Seeinventory. 4.3.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.3.6
#inventory
Name Type Description Starting Version
name String The resource name. 4.3.6
identityUuid String The identity UUID. 4.3.6
identityType String The identity type. 4.3.6
value Long The default quota. 4.3.6
lastOpDate Timestamp The last update time. 4.3.6
createDate Timestamp The creation time. 4.3.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.3.6
description String The brief description of the error. 4.3.6
details String The details about the error. 4.3.6
elaboration String The reserved field. Default value: null. 4.3.6
opaque LinkedHashMap The reserved field. Default value: null. 4.3.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.3.6

SDK Sample

Java SDK
UpdateOrganizationQuotaAction action = new UpdateOrganizationQuotaAction();
action.identityUuid = "3e083dfff99b309bb15e848f7acef41b";
action.name = "quota";
action.value = 100.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateOrganizationQuotaAction.Result res = action.call();
Python SDK
UpdateOrganizationQuotaAction action = UpdateOrganizationQuotaAction()
action.identityUuid = "3e083dfff99b309bb15e848f7acef41b"
action.name = "quota"
action.value = 100.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateOrganizationQuotaAction.Result res = action.call()

GetOrganizationQuotaUsage

API Request

URLs
GET zstack/v1/iam2/organizations/quota/{uuid}/usages
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/iam2/organizations/quota/9636f37046a63657b26cb28ed8cbc38a/usages
Request Parameters
Name Type Location Description Valid Value Starting Version
uuid String url The resource UUID. 4.3.6
systemTags List query Optional. The system tags. 4.3.6
userTags List query Optional. The user tags. 4.3.6

API Response

Sample Response
{
  "usages": [
    {
      "name": "testquota",
      "total": 20.0,
      "used": 10.0
    }
  ]
}
Name Type Description Starting Version
success boolean 4.3.6
usages List See usages. 4.3.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.3.6
#usages
Name Type Description Starting Version
name String The resource name. 4.3.6
total Long The total quota. 4.3.6
used Long The used quota. 4.3.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.3.6
description String The brief description of the error. 4.3.6
details String The details about the error. 4.3.6
elaboration String The reserved field. Default value: null. 4.3.6
opaque LinkedHashMap The reserved field. Default value: null. 4.3.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.3.6

SDK Sample

Java SDK
GetOrganizationQuotaUsageAction action = new GetOrganizationQuotaUsageAction();
action.uuid = "9636f37046a63657b26cb28ed8cbc38a";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetOrganizationQuotaUsageAction.Result res = action.call();
Python SDK
GetOrganizationQuotaUsageAction action = GetOrganizationQuotaUsageAction()
action.uuid = "9636f37046a63657b26cb28ed8cbc38a"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetOrganizationQuotaUsageAction.Result res = action.call()
API Reference | 4.8.38 | ZStack Cloud · ZCF | ZStack Resource Center