AD/LDAP/OAuth Operations
AddLdapServer
API Request
URLs
POST zstack/v1/ldap/serversHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "miao",
"description": "miao desc",
"url": "ldap://localhost:1888",
"base": "dc\u003dexample,dc\u003dcom",
"username": "",
"password": "",
"encryption": "None"
},
"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":"miao","description":"miao desc","url":"ldap://localhost:1888","base":"dc=example,dc=com","username":"","password":"","encryption":"None"}}' \
http://localhost:8080/zstack/v1/ldap/serversRequest Parameters
Note:
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| name | String | body (contained in the params structure) | The resource name. | 0.6 | |
| description | String | body (contained in the params structure) | The detailed description of the resource. | 0.6 | |
| url | String | body (contained in the params structure) | The URL of the LDAP server. | 0.6 | |
| base | String | body (contained in the params structure) | The base DN of the LDAP server. | 0.6 | |
| username | String | body (contained in the params structure) | The username used to access the LDAP server. | 0.6 | |
| password | String | body (contained in the params structure) | The password. | 0.6 | |
| encryption | String | body (contained in the params structure) | The encryption method. |
|
0.6 |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
Note:
- When you add an AD/LDAP server in ZStack Cloud, you can synchronize users by adding the
virtualIDSyncConfiguration option to SystemTags.
- Format of the virtualIDSyncConfiguration option:
virtualIDSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"cn\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"fullname\",\"attribute\":\"cn\",\"type\":\"CUSTOM\",\"optional\":\"true\"}]} - Example:
virtualIDSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"cn\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"fullname\",\"attribute\":\"cn\",\"type\":\"CUSTOM\",\"optional\":\"true\"}]}
- Format of the virtualIDSyncConfiguration option:
- When you add an AD/LDAP server in ZStack Cloud,
you can synchronize organizations by adding the
organizationSyncConfiguration option to SystemTags.
- Format of the organizationSyncConfiguration option:
organizationSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"distinguishedName\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"description\",\"attribute\":description,\"type\":\"SYSTEM\",\"optional\":\"true\"}],\"strategy\":\"Group\"} - Example:
organizationSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"distinguishedName\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"description\",\"attribute\":description,\"type\":\"SYSTEM\",\"optional\":\"true\"}],\"strategy\":\"Group\"}
- Format of the organizationSyncConfiguration option:
Note:
- When you add AD/LDAP, the system will automatically check whether the server, port, base DN, login attribute, user DN, and password are correct. The waiting time does not exceed 5 seconds.
API Response
Sample
Response
{
"inventory": {
"uuid": "ef7291bd94ce478880938851e3ff6ad6",
"name": "miao",
"description": "miao desc",
"url": "ldap://localhost:1888",
"base": "dc\u003dexample,dc\u003dcom",
"username": "",
"password": "",
"encryption": "None"
}
}#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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| url | String | 0.6 | |
| base | String | The base DN of the LDAP server. | 0.6 |
| username | String | The username used to access the LDAP server. | 0.6 |
| password | String | The password. | 0.6 |
| encryption | String | The encryption method. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
AddLdapServerAction action = new AddLdapServerAction();
action.name = "miao";
action.description = "miao desc";
action.url = "ldap://localhost:1888";
action.base = "dc=example,dc=com";
action.username = "";
action.password = "";
action.encryption = "None";
action.sessionId = "c805609607b94f1688e4f5791089ab6f";
AddLdapServerAction.Result res = action.call();Python
SDK
AddLdapServerAction action = AddLdapServerAction()
action.name = "miao"
action.description = "miao desc"
action.url = "ldap://localhost:1888"
action.base = "dc=example,dc=com"
action.username = ""
action.password = ""
action.encryption = "None"
action.sessionId = "611a70f771874450945f77465bca7642"
AddLdapServerAction.Result res = action.call()DeleteLdapServer
API Request
URLs
DELETE/v1/ldap/servers/{uuid}?deleteMode={deleteMode}Headers
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth a90abb1116c0428097769adfdc9ae867" \
-X DELETE http://localhost:8080/zstack/v1/ldap/servers/93d7c467c493464fa3d244163c94f64e?deleteMode=PermissiveRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 0.6 | |
| deleteMode | String | body | Optional. The delete mode. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
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
DeleteLdapServerAction action = new DeleteLdapServerAction();
action.uuid = "0e757aebf26346c19ee1f163ea9f0915";
action.deleteMode = "Permissive";
action.sessionId = "3dae39cdbba749ba91deda6b854695ec";
DeleteLdapServerAction.Result res = action.call();Python
SDK
DeleteLdapServerAction action = DeleteLdapServerAction()
action.uuid = "7755f302acd44c62833f9d4eb3f7327c"
action.deleteMode = "Permissive"
action.sessionId = "61e33f5ab13b44ef873ef7fc719d3804"
DeleteLdapServerAction.Result res = action.call()QueryLdapServer
API Request
URLs
GET zstack/v1/ldap/servers
GET zstack/v1/ldap/servers/{uuid}Headers
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 940b9dba281d40b897497a95e8a0e942" \
-X GET http://localhost:8080/zstack/v1/ldap/servers?q=name=ldap servercurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth e4e74e66dc074b24b7071b43b12240a2" \
-X GET http://localhost:8080/zstack/v1/ldap/servers/c898d74cdcb94ac4b3b28ac6b7a8f7f5Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryLdapServer, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"uuid": "91820f68407a441c9ba031ac15fa322d",
"name": "miao",
"description": "miao desc",
"url": "ldap://localhost:1888",
"base": "dc\u003dexample,dc\u003dcom",
"username": "",
"password": "",
"encryption": "None"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| url | String | 0.6 | |
| base | String | The base DN of the LDAP server. | 0.6 |
| username | String | The username used to access the LDAP server. | 0.6 |
| password | String | The password. | 0.6 |
| encryption | String | The encryption method. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
QueryLdapServerAction action = new QueryLdapServerAction();
action.conditions = asList("name=ldap server");
action.sessionId = "a8d28261d5b940c9bdd4712a511bd537";
QueryLdapServerAction.Result res = action.call();Python
SDK
QueryLdapServerAction action = QueryLdapServerAction()
action.conditions = ["name=ldap server"]
action.sessionId = "aee6bc43a2fb4f1eb6c35e3a064dd464"
QueryLdapServerAction.Result res = action.call()UpdateLdapServer
API Request
URLs
PUT zstack/v1/ldap/servers/{ldapServerUuid}Headers
Authorization: OAuth the-session-uuidBody
{
"updateLdapServer": {
"name": "new name"
},
"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 e0360b3fd1d04df0b98005ab41f233ea" \
-X PUT -d '{"updateLdapServer":{"name":"new name"}}' \
http://localhost:8080/zstack/v1/ldap/servers/6c2af8cab16b3310a3d31aa772b093baRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| ldapServerUuid | String | url | The LDAP server UUID. | 0.6 | |
| name | String | body (contained in the updateLdapServer structure) | Optional. The resource name. | 0.6 | |
| description | String | body (contained in the updateLdapServer structure) | Optional. The detailed description of the resource. | 0.6 | |
| url | String | body (contained in the updateLdapServer structure) | Optional. The URL of the LDAP server. | 0.6 | |
| base | String | body (contained in the updateLdapServer structure) | Optional. The base DN of the LDAP server. | 0.6 | |
| username | String | body (contained in the updateLdapServer structure) | Optional. The username used to access the LDAP server. | 0.6 | |
| password | String | body (contained in the updateLdapServer structure) | Optional. The password. | 0.6 | |
| encryption | String | body (contained in the updateLdapServer structure) | Optional. The encryption method. |
|
0.6 |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventory": {
"uuid": "8e1ee5b25564449fbd6054621567b5c1",
"name": "new name",
"description": "miao desc",
"url": "ldap://localhost:1888",
"base": "dc\u003dexample,dc\u003dcom",
"username": "",
"password": "",
"encryption": "None"
}
}#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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| url | String | 0.6 | |
| base | String | The base DN of the LDAP server. | 0.6 |
| username | String | The username used to access the LDAP server. | 0.6 |
| password | String | The password. | 0.6 |
| encryption | String | The encryption method. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
UpdateLdapServerAction action = new UpdateLdapServerAction();
action.ldapServerUuid = "37fbaf59c5d74dd7b61c2af4e74c28cf";
action.name = "new name";
action.sessionId = "f968929105af41ef8a6a2c602f315c91";
UpdateLdapServerAction.Result res = action.call();Python
SDK
UpdateLdapServerAction action = UpdateLdapServerAction()
action.ldapServerUuid = "57e7fe86092046228999e8599c6c8bd1"
action.name = "new name"
action.sessionId = "f6ca4878b0164e9eab1d6219777c5af2"
UpdateLdapServerAction.Result res = action.call()CreateLdapBinding
API Request
URLs
POST zstack/v1/ldap/bindingsHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"ldapUid": "ou\u003dEmployee,uid\u003dtest",
"accountUuid": "29777229ee1e32d29c6f255b126e29a1"
},
"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":{"ldapUid":"ou=Employee,uid=test","accountUuid":"29777229ee1e32d29c6f255b126e29a1"}}' http://localhost:8080/zstack/v1/ldap/bindingsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| ldapUid | String | body (contained in the params structure) | The LDAP UID. | 4.7.0 | |
| accountUuid | String | body (contained in the params structure) | The account UUID. | 4.7.0 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventory": {
"uuid": "a552eb007adf4070ade72a4b678ecc30",
"ldapUid": "ou\u003dEmployee,uid\u003dtest",
"ldapServerUuid": "cd37f226e18c4ef09bb613200e3e90ba",
"accountUuid": "5ff96c17eb8f476a988991e9410b153f"
}
}| 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. | 0.6 |
| inventory | LdapAccountRefInventory | See inventory. | 0.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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| ldapUid | String | The LDAP UID. | 0.6 |
| ldapServerUuid | String | The LDAP server UUID. | 0.6 |
| accountUuid | String | The account UUID. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
CreateLdapBindingAction action = new CreateLdapBindingAction();
action.ldapUid = "ou=Employee,uid=test";
action.accountUuid = "7bff0855d3da4ab89659d29821d6daee";
action.sessionId = "5fd897a8db504aee91a64a3b02c05ce9";
CreateLdapBindingAction.Result res = action.call();Python
SDK
CreateLdapBindingAction action = CreateLdapBindingAction()
action.ldapUid = "ou=Employee,uid=test"
action.accountUuid = "db2842e0b16d4aa2af39abee7e80d2f1"
action.sessionId = "9ece25398fe74a91a90cec68b50cd203"
CreateLdapBindingAction.Result res = action.call()DeleteLdapBinding
API Request
URLs
DELETE/v1/ldap/bindings/{uuid}Headers
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 50d8d41e03b54adf9d8d88342a9d6efe" \
-X DELETE http://localhost:8080/zstack/v1/ldap/bindings/9a04287ade54400686e99485c86d9545?Request Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
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
DeleteLdapBindingAction action = new DeleteLdapBindingAction();
action.uuid = "5f9ff578f8ff4231b2ad18f5aa185076";
action.sessionId = "6690dcc7a9c64c26a17ae9bf29955e0a";
DeleteLdapBindingAction.Result res = action.call();Python
SDK
DeleteLdapBindingAction action = DeleteLdapBindingAction()
action.uuid = "3e5a338390d046008e2723c475c90a66"
action.sessionId = "2f93ee0fc083464fbe73053354ba470c"
DeleteLdapBindingAction.Result res = action.call()QueryLdapBinding
AP Request
URLs
GET zstack/v1/ldap/bindings
GET zstack/v1/ldap/bindings/{uuid}Headers
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth f114b38ccae244c38cda7ec7dbdd062c" \
-X GET http://localhost:8080/zstack/v1/ldap/bindings?q=accountUuid=f1672bbe810b4b3b89f030f5f51fdb79curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 43f9144da747462eaa08da071d317c45" \
-X GET http://localhost:8080/zstack/v1/ldap/bindings/9e959125b2f64a86a2a380b335b2543eQueryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QueryLdapBinding, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"uuid": "7e7c5818d2bc4d45b61fdbed5c1a64b0",
"ldapUid": "ou\u003dEmployee,uid\u003dtest",
"ldapServerUuid": "540e7691df7349c58cff8ffcaf305b9b",
"accountUuid": "0829b88f337b4500b2ba28936fe5ae3d"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| ldapUid | String | The LDAP UID. | 0.6 |
| ldapServerUuid | String | The LDAP server UUID. | 0.6 |
| accountUuid | String | The account UUID. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
QueryLdapBindingAction action = new QueryLdapBindingAction();
action.conditions = asList("accountUuid=d5915883c1c04b62af8423f04bb1b3f3");
action.sessionId = "2b7a31a70f7d4e90b0159cd0b9396f26";
QueryLdapBindingAction.Result res = action.call();Python
SDK
QueryLdapBindingAction action = QueryLdapBindingAction()
action.conditions = ["accountUuid=15cdbd6f45bf434492ef22eb2d77b6f4"]
action.sessionId = "4956fb9e5d874e88851634154bda4d4a"
QueryLdapBindingAction.Result res = action.call()CleanInvalidLdapBinding
API Request
URLs
PUT zstack/v1/ldap/bindings/actionsHeaders
Authorization: OAuth the-session-uuidBody
{
"cleanInvalidLdapBinding": {},
"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 f8ba3bdbb1fe407db3da890e5a47d322" \
-X PUT -d '{"cleanInvalidLdapBinding":{}}' \
http://localhost:8080/zstack/v1/ldap/bindings/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventories": [
{
"uuid": "f9e03ca4fe8a3680831df56460533615",
"name": "admin",
"type": "Normal",
"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. | 0.6 |
| inventories | List | See inventories. | 0.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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| type | String | The account type, including administrator and user. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
CleanInvalidLdapBindingAction action = new CleanInvalidLdapBindingAction();
action.sessionId = "ba374e312f0044669323e3ba55aa44a2";
CleanInvalidLdapBindingAction.Result res = action.call();Python
SDK
CleanInvalidLdapBindingAction action = CleanInvalidLdapBindingAction()
action.sessionId = "61a940c24a5e4667a03c87dbd968dfd8"
CleanInvalidLdapBindingAction.Result res = action.call()LogInByLdap
API Request
URLs
PUT zstack/v1/ldap/loginBody
{
"logInByLdap": {
"uid": "ou\u003dEmployee,uid\u003dtest",
"password": "password",
"verifyCode": "test",
"captchaUuid": "3bb4e611b10e32cfaaa7fb4b1e3515ac"
},
"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 '{"logInByLdap":{"uid":"ou=Employee,uid=test","password":"password","verifyCode":"test","captchaUuid":"3bb4e611b10e32cfaaa7fb4b1e3515ac"}}'
http://localhost:8080/zstack/v1/ldap/loginRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uid | String | body (contained in the logInByLdap structure) | The LDAP UID. | 0.6 | |
| password | String | body (contained in the logInByLdap structure) | The password. | 0.6 | |
| captchaUuid | String | body (contained in the logInByLdap structure) | Optional. The verification code UUID. | 2.6.0 | |
| verifyCode | String | body (contained in the logInByLdap structure) | Optional. The verification code. | 2.6.0 | |
| clientInfo | Map | body (contained in the logInByLdap structure) | Optional. The client information. | 3.5.0 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventory": {
"uuid": "2ce3cd4b2e5c441699edc09e612e916c",
"accountUuid": "27df0ac39afd42eab643dfb1d448252b",
"expiredDate": "Jun 7, 2017 9:20:34 PM"
"noSessionEvaluation": false
},
"accountInventory": {
"uuid": "243382994e2643c18f5f5ec69305d866",
"name": "test",
"type": "Normal"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the API succeeds. | 0.6 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventory | SessionInventory | See inventory. | 0.6 |
| accountInventory | AccountInventory | See accountInventory. | 0.6 |
| error | ErrorCode | See error. | 0.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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| accountUuid | String | The account UUID. | 0.6 |
| userUuid | String | The user UUID. | 0.6 |
| expiredDate | Timestamp | The expiration date of the session. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
#accountInventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| type | String | The account type, including administrator and user. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.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. | 0.6 |
SDK Sample
Java
SDK
LogInByLdapAction action = new LogInByLdapAction();
action.uid = "ou=Employee,uid=test";
action.password = "password";
action.verifyCode = "test";
action.captchaUuid = "3bb4e611b10e32cfaaa7fb4b1e3515ac";
LogInByLdapAction.Result res = action.call();Python
SDK
LogInByLdapAction action = LogInByLdapAction()
action.uid = "ou=Employee,uid=test"
action.password = "password"
action.verifyCode = "test"
action.captchaUuid = "3bb4e611b10e32cfaaa7fb4b1e3515ac"
LogInByLdapAction.Result res = action.call()GetLdapEntry
API Request
URLs
GET zstack/v1/ldap/entryHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ldap/entry?ldapFilter=(cn=user_xxx)&limit=2500.0Request Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| ldapFilter | String | query | The query condition. | 2.2 | |
| systemTags | List | query | Optional. The system tags. | 2.2 | |
| userTags | List | query | Optional. The user tags. | 2.2 | |
| limit | Integer | query | Optional. The maximum number of returned records. This parameter is similar to the limit field of MySQL. | 2.2 |
API Response
Sample
Response
{
"inventories": [
{
"attributes": [
{
"id": "userPrincipalName",
"orderMatters": false,
"values": [
"weiqi@adtest.zs"
],
"valuesAsNames": {}
},
{
"id": "displayName",
"orderMatters": false,
"values": [
"zstest"
],
"valuesAsNames": {}
},
{
"id": "name",
"orderMatters": false,
"values": [
"weiqi"
],
"valuesAsNames": {}
},
{
"id": "distinguishedName",
"orderMatters": false,
"values": [
"CN=weiqi,OU=ui,OU=zstest,DC=adtest,DC=zs"
],
"valuesAsNames": {}
},
{
"id": "cn",
"orderMatters": false,
"values": [
"weiqi"
],
"valuesAsNames": {}
},
{
"id": "objectClass",
"orderMatters": false,
"values": [
"top",
"person",
"organizationalPerson",
"user"
],
"valuesAsNames": {}
}
],
"dn": "CN=weiqi,OU=ui,OU=zstest,dc=adtest,dc=zs"
}
],
"success": true
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| inventories | List | 2.2 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.2 |
#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.2 |
| description | String | The brief description of the error. | 2.2 |
| details | String | The details about the error. | 2.2 |
| elaboration | String | The reserved field. Default value: null. | 2.2 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 2.2 |
| 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.2 |
SDK Sample
Java
SDK
GetLdapEntryAction action = new GetLdapEntryAction();
action.ldapFilter = "(cn=user_xxx)";
action.limit = 2500.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetLdapEntryAction.Result res = action.call();Python
SDK
GetLdapEntryAction action = GetLdapEntryAction()
action.ldapFilter = "(cn=user_xxx)"
action.limit = 2500.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetLdapEntryAction.Result res = action.call()GetCandidateLdapEntryForBinding
API Request
URLs
GET zstack/v1/ldap/entries/candidatesHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ldap/entries/candidates?ldapFilter=(cn=user_xxx)&limit=2500.0Request Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| ldapFilter | String | query | The query condition. | 2.2 | |
| systemTags | List | query | Optional. The system tags. | 2.2 | |
| userTags | List | query | Optional. The user tags. | 2.2 | |
| limit | Integer | query | Optional. The maximum number of returned records. This parameter is similar to the limit field of MySQL. | 2.2 |
API Response
Sample
Response
{
"inventories": [
{
"attributes": [
{
"id": "userPrincipalName",
"orderMatters": false,
"values": [
"weiqi@adtest.zs"
],
"valuesAsNames": {}
},
{
"id": "displayName",
"orderMatters": false,
"values": [
"zstest"
],
"valuesAsNames": {}
},
{
"id": "name",
"orderMatters": false,
"values": [
"weiqi"
],
"valuesAsNames": {}
},
{
"id": "distinguishedName",
"orderMatters": false,
"values": [
"CN=weiqi,OU=ui,OU=zstest,DC=adtest,DC=zs"
],
"valuesAsNames": {}
},
{
"id": "cn",
"orderMatters": false,
"values": [
"weiqi"
],
"valuesAsNames": {}
},
{
"id": "objectClass",
"orderMatters": false,
"values": [
"top",
"person",
"organizationalPerson",
"user"
],
"valuesAsNames": {}
}
],
"dn": "CN=weiqi,OU=ui,OU=zstest,dc=adtest,dc=zs"
}
],
"success": true
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| inventories | List | 2.2 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.2 |
#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.2 |
| description | String | The brief description of the error. | 2.2 |
| details | String | The details about the error. | 2.2 |
| elaboration | String | The reserved field. Default value: null. | 2.2 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 2.2 |
| 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.2 |
SDK Sample
Java
SDK
GetCandidateLdapEntryForBindingAction action = new GetCandidateLdapEntryForBindingAction();
action.ldapFilter = "(cn=user_xxx)";
action.limit = 2500.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateLdapEntryForBindingAction.Result res = action.call();Python
SDK
GetCandidateLdapEntryForBindingAction action = GetCandidateLdapEntryForBindingAction()
action.ldapFilter = "(cn=user_xxx)"
action.limit = 2500.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateLdapEntryForBindingAction.Result res = action.call()CreateOAuthClient
API Request
URLs
POST zstack/v1/create/oauth2/clientHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "test",
"description": "test",
"clientId": "756770202fcd36bfbaa00ea7dea7f5ff",
"clientSecret": "8255b36a4e0e38ffa20dda1a079aa687",
"authorizationUrl": "http://zstack.com/code",
"tokenUrl": "http://zstack.com/token",
"userinfoUrl": "http://zstack.com/userinfoUrl",
"redirectUrl": "http://zstack.com/redirectUrl",
"logoutUrl": "http://zstack.com/logoutUrl",
"loginType": "iam1",
"urlTemplate": "http://172.24.194.28:5000/oauth1/verify/?username\u003d${username}\u0026sessionId\u003d${sessionId}\u0026userUuid\u003d${userUuid}\u0026accountUuid\u003d${accountUuid}\u0026loginType\u003d${loginType}\u0026userType\u003d${userType}\u0027"
},
"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":"test","description":"test","clientId":"756770202fcd36bfbaa00ea7dea7f5ff","clientSecret":"8255b36a4e0e38ffa20dda1a079aa687",
"authorizationUrl":"http://zstack.com/code",
"tokenUrl":"http://zstack.com/token",
"userinfoUrl":"http://zstack.com/userinfoUrl",
"redirectUrl":"http://zstack.com/redirectUrl",
"logoutUrl":"http://zstack.com/logoutUrl",
"loginType":"iam1","urlTemplate":"http://172.24.194.28:5000/oauth1/verify/?username=${username}&sessionId=${sessionId}&userUuid=${userUuid}&accountUuid=${accountUuid}&loginType=${loginType}&userType=${userType}'"}}'
http://localhost:8080/zstack/v1/create/oauth2/clientRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| name | String | body (contained in the paramsstructure) | The resource name. | 4.5.0 | |
| description | String | body (contained in the paramsstructure) | Optional. The detailed description of the resource. | 4.5.0 | |
| clientId | String | body (contained in the paramsstructure) | The client ID. | 4.5.0 | |
| clientSecret | String | body (contained in the paramsstructure) | Optional. The client key. | 4.5.0 | |
| authorizationUrl | String | body (contained in the paramsstructure) | Optional. The authentication url. | 4.5.0 | |
| tokenUrl | String | body (contained in the paramsstructure) | The authentication token url. | 4.5.0 | |
| loginType | String | body (contained in the paramsstructure) | The login type. |
|
4.5.0 |
| clientType | String | body (contained in the paramsstructure) | The client type. | 4.5.0 | |
| grantType | String | body (contained in the paramsstructure) | The authentication mode. | 4.5.0 | |
| urlTemplate (可选) | String | body (contained in the paramsstructure) | The address skipped to after the authentication. | 4.5.0 | |
| resourceUuid | String | body (contained in the paramsstructure) | Optional. The resource UUID. | 4.5.0 | |
| tagUuids | List | body (contained in the paramsstructure) | Optional. The tag UUID. | 4.5.0 | |
| systemTags | List | body | Optional. The system tag. | 4.5.0 | |
| userTags | List | body | Optional. The user tag. | 4.5.0 | |
| userinfoUrl | String | body (contained in the paramsstructure) | Optional. User information url. | 4.7.21 | |
| redirectUrl | String | body (contained in the paramsstructure) | Optional. User redirect url. | 4.7.21 | |
| logoutUrl | String | body (contained in the paramsstructure) | Optional. Logout url. | 4.7.21 |
API Response
Sample
Response
{
"inventory": {
"clientId": "b7e1d25d8ae833f8b6f13c448efbfb4a",
"clientSecret": "64a93cc0b9263993a25ef033994afc10",
"authorizationUrl": "http://zstack.com/code",
"tokenUrl": "http://zstack.com/token",
"userinfoUrl": "http://zstack.com/userinfoUrl",
"uuid": "628dbf582da836ba9693c8813f98371f",
"loginMNUrl": "http://127.0.0.1:8080/zstack/sso/oauth2/",
"redirectUrl": "http://zstack.com/redirectUrl"
}
}#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| clientId | String | The client ID. | 4.5.0 |
| clientSecret | String | The client key. | 4.5.0 |
| authorizationUrl | String | The authentication url. | 4.5.0 |
| tokenUrl | String | The authentication token url. | 4.5.0 |
| grantType | String | The authentication mode. | 4.5.0 |
| uuid | String | The resource UUID. | 4.5.0 |
| name | String | The resource name. | 4.5.0 |
| description | String | The detailed information of the resource. | 4.5.0 |
| clientType | String | The client type. | 4.5.0 |
| loginType | String | The login type:
|
4.5.0 |
| loginMNUrl | String | The password-free login url. | 4.5.0 |
| createDate | Timestamp | The creation date. | 4.5.0 |
| lastOpDate | Timestamp | The last operation date. | 4.5.0 |
| accountUuid | String | The account UUID. | 4.5.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.5.0 |
| description | String | The brief description of the error. | 4.5.0 |
| details | String | The details about the error. | 4.5.0 |
| elaboration | String | The reserved field. Default value: null. | 4.5.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.5.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.5.0 |
SDK Sample
Java
SDK
CreateOAuthClientAction action = new CreateOAuthClientAction();
action.name = "test";
action.description = "test";
action.clientId = "756770202fcd36bfbaa00ea7dea7f5ff";
action.clientSecret = "8255b36a4e0e38ffa20dda1a079aa687";
action.authorizationUrl = "http://zstack.com/code";
action.tokenUrl = "http://zstack.com/token";
action.userinfoUrl = "http://zstack.com/userinfoUrl";
action.redirectUrl = "http://zstack.com/redirectUrl";
action.logoutUrl = "http://zstack.com/logoutUrl";
action.loginType = "iam1";
action.urlTemplate = "http://172.24.194.28:5000/oauth1/verify/?username=${username}&sessionId=${sessionId}&userUuid=${userUuid}&accountUuid=${accountUuid}&loginType=${loginType}&userType=${userType}'";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateOAuthClientAction.Result res = action.call();Python
SDK
CreateOAuthClientAction action = CreateOAuthClientAction()
action.name = "test"
action.description = "test"
action.clientId = "756770202fcd36bfbaa00ea7dea7f5ff"
action.clientSecret = "8255b36a4e0e38ffa20dda1a079aa687"
action.authorizationUrl = "http://zstack.com/code"
action.tokenUrl = "http://zstack.com/token"
action.userinfoUrl = "http://zstack.com/userinfoUrl"
action.redirectUrl = "http://zstack.com/redirectUrl"
action.logoutUrl = "http://zstack.com/logoutUrl"
action.loginType = "iam1"
action.urlTemplate = "http://172.24.194.28:5000/oauth1/verify/?username=${username}&sessionId=${sessionId}&userUuid=${userUuid}&accountUuid=${accountUuid}&loginType=${loginType}&userType=${userType}'"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateOAuthClientAction.Result res = action.call()DeleteSSOClient
API Request
URLs
POST zstack/v1/delete/sso/clientHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"uuid": "3e54cb2e27ff31dda2c49851bf2662d2",
"deleteMode": "Permissive"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"uuid":"3e54cb2e27ff31dda2c49851bf2662d2","deleteMode":"Permissive"}}' \
http://localhost:8080/zstack/v1/delete/sso/client参数列表
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | body (contained in the paramsstructure) | The resource UUID. | 4.5.0 | |
| deleteMode | String | body (contained in the paramsstructure) | Optional. The deletion mode:
|
4.5.0 | |
| systemTags | List | body | Optional. The system tag. | 4.5.0 | |
| userTags | List | body | Optional. The user tag. | 4.5.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
DeleteSSOClientAction action = new DeleteSSOClientAction();
action.uuid = "3e54cb2e27ff31dda2c49851bf2662d2";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteSSOClientAction.Result res = action.call();Python
SDK
DeleteSSOClientAction action = DeleteSSOClientAction()
action.uuid = "3e54cb2e27ff31dda2c49851bf2662d2"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteSSOClientAction.Result res = action.call()UpdateOAuthClient
API Request
URLs
POST zstack/v1/update/oauth2/clientHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "test",
"description": "test",
"clientId": "9f44e569b86c3883b0295fcab980e945",
"clientSecret": "8b151acd0f7533538ed9e9315fadcaca",
"authorizationUrl": "http://zstack.com/code",
"tokenUrl": "http://zstack.com/token",
"redirectUrl": "http://zstack.com/redirectUrl",
"userinfoUrl": "http://zstack.com/userinfoUrl",
"loginType": "iam1",
"logoutUrl": "http://zstack.com/logouturl"
},
"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":"test","description":"test","clientId":"9f44e569b86c3883b0295fcab980e945","clientSecret":"8b151acd0f7533538ed9e9315fadcaca",
"authorizationUrl":"http://zstack.com/code",
"tokenUrl":"http://zstack.com/token",
"redirectUrl":"http://zstack.com/redirectUrl",
"userinfoUrl":"http://zstack.com/userinfoUrl","loginType":"iam1",
"logoutUrl":"http://zstack.com/logouturl"}}'
http://localhost:8080/zstack/v1/update/oauth2/clientRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | body (contained in the paramsstructure) | The resource UUID. | 4.5.0 | |
| name | String | body (contained in the paramsstructure) | Optional. The resource name. | 4.5.0 | |
| description | String | body (contained in the paramsstructure) | Optional. The detailed description of the resource. | 4.5.0 | |
| clientId | String | body (contained in the paramsstructure) | Optional. The client ID. | 4.5.0 | |
| clientSecret | String | body (contained in the paramsstructure) | Optional. The client key. | 4.5.0 | |
| authorizationUrl | String | body (contained in the paramsstructure) | Optional. The authentication url. | 4.5.0 | |
| tokenUrl | String | body (contained in the paramsstructure) | The authentication token url. | 4.5.0 | |
| loginType | String | body (contained in the paramsstructure) | The login type:
|
4.5.0 | |
| systemTags | List | body | Optional. The system tag. | 4.5.0 | |
| userTags | List | body | Optional. The user tag. | 4.5.0 | |
| redirectUrl | String | body (contained in the paramsstructure) | Optional. User information url. | 4.7.21 | |
| userinfoUrl | String | body (contained in the paramsstructure) | Optional. User redirect url. | 4.7.21 | |
| logoutUrl | String | body (contained in the paramsstructure) | Optional. Logout url. | 4.7.21 |
API Response
Sample
Response
{
"inventory": {
"clientId": "90de13d7ad483cb582bd14c792bd1ba7",
"clientSecret": "e9107bd9f6213e29926da80c016a9639",
"authorizationUrl": "http://zstack.com/code",
"tokenUrl": "http://zstack.com/token",
"userinfoUrl": "http://zstack.com/userinfoUrl",
"uuid": "76467fb551ca362d98d6ba0782f3bb4c",
"loginMNUrl": "http://127.0.0.1:8080/zstack/sso/oauth2/",
"redirectUrl": "http://zstack.com/redirectUrl"
}
}#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| clientId | String | The client ID. | 4.5.0 |
| clientSecret | String | The client key. | 4.5.0 |
| authorizationUrl | String | The authentication url. | 4.5.0 |
| tokenUrl | String | The authentication token url. | 4.5.0 |
| grantType | String | The authentication mode. | 4.5.0 |
| uuid | String | The resource UUID. | 4.5.0 |
| name | String | The resource name. | 4.5.0 |
| description | String | The detailed description of the resource. | 4.5.0 |
| clientType | String | The client type. | 4.5.0 |
| loginType | String | The login type:
|
4.5.0 |
| loginMNUrl | String | The password-free login url. | 4.5.0 |
| createDate | Timestamp | The creation date. | 4.5.0 |
| lastOpDate | Timestamp | The last operation date. | 4.5.0 |
| accountUuid | String | The account UUID. | 4.5.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.5.0 |
| description | String | The brief description of the error. | 4.5.0 |
| details | String | The details about the error. | 4.5.0 |
| elaboration | String | The reserved field. Default value: null. | 4.5.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.5.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.5.0 |
SDK Sample
Java
SDK
UpdateOAuthClientAction action = new UpdateOAuthClientAction();
action.name = "test";
action.description = "test";
action.clientId = "9f44e569b86c3883b0295fcab980e945";
action.clientSecret = "8b151acd0f7533538ed9e9315fadcaca";
action.authorizationUrl = "http://zstack.com/code";
action.tokenUrl = "http://zstack.com/token";
action.redirectUrl = "http://zstack.com/redirectUrl";
action.userinfoUrl = "http://zstack.com/userinfoUrl";
action.loginType = "iam1";
action.logoutUrl = "http://zstack.com/logouturl";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateOAuthClientAction.Result res = action.call();Python
SDK
UpdateOAuthClientAction action = UpdateOAuthClientAction()
action.name = "test"
action.description = "test"
action.clientId = "9f44e569b86c3883b0295fcab980e945"
action.clientSecret = "8b151acd0f7533538ed9e9315fadcaca"
action.authorizationUrl = "http://zstack.com/code"
action.tokenUrl = "http://zstack.com/token"
action.redirectUrl = "http://zstack.com/redirectUrl"
action.userinfoUrl = "http://zstack.com/userinfoUrl"
action.loginType = "iam1"
action.logoutUrl = "http://zstack.com/logouturl"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateOAuthClientAction.Result res = action.call()