ZStack Cloud Platform
Single Server, Free Trial for One Year
GET zstack/v1/account-import/bindingsAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X GET http://localhost:8080/zstack/v1/account-import/bindings?q=accountUuid=bcfc6b1c7aaf3a43a39ab4edf8b9107dQueryable Fields
Run the CLI command line tool, enter QueryThirdPartyAccountSourceBinding and press the Tab key to view all queryable fields and cross-table queryable resource names.
{ "inventories": [ { "id": 1, "credentials": "ou\u003dEmployee,uid\u003dtest", "accountSourceUuid": "617cef7cda233b559d134245cf8211d5", "accountUuid": "f29adf4e230831f3b34f4d4bf7cfa1dc" } ] }| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the API call is successful | 4.3.0 |
| error | ErrorCode | Error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.3.0 |
| inventories | List | For details, see inventories | 4.3.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001. | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null. | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | Uniquely identifies the relationship | 4.3.0 |
| credentials | String | Unique identifier of the user from the import source. For example, for users imported from an LDAP source, this is the UID used for login. | 4.3.0 |
| accountSourceUuid | String | Import source server UUID | 4.3.0 |
| accountUuid | String | Account UUID | 4.3.0 |
| createDate | Timestamp | Creation time | 4.3.0 |
| lastOpDate | Timestamp | Last modification time | 4.3.0 |
QueryThirdPartyAccountSourceBindingAction action = new QueryThirdPartyAccountSourceBindingAction(); action.conditions = asList("accountUuid=5ec5476a24423683ad3f51da0891682e"); action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; QueryThirdPartyAccountSourceBindingAction.Result res = action.call(); QueryThirdPartyAccountSourceBindingAction action = QueryThirdPartyAccountSourceBindingAction() action.conditions = ["accountUuid=c02ff535be723284947cad9f679cc1b9"] action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" QueryThirdPartyAccountSourceBindingAction.Result res = action.call() POST zstack/v1/ldap/serversAuthorization: OAuth the-session-uuid{ "params": { "name": "miao", "description": "miao desc", "url": "ldap://localhost:1888", "base": "dc\u003dexample,dc\u003dcom", "username": "", "password": "", "encryption": "None", "serverType": "WindowsAD", "usernameProperty": "cn", "filter": "(cn\u003dMicha Kops)", "syncCreatedAccountStrategy": "CreateAccount", "syncDeletedAccountStrategy": "StaleAccount" }, "systemTags": [], "userTags": [] }
Note: In the preceding example, the systemTags and userTags fields are optional. They are listed here to show that the body can contain these two fields.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","serverType":"WindowsAD","usernameProperty":"cn","filter":"(cn=Micha Kops)","syncCreatedAccountStrategy":"CreateAccount","syncDeletedAccountStrategy":"StaleAccount"}}' \ http://localhost:8080/zstack/v1/ldap/servers| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (enclosed in the params structure) | Resource name | 4.3.0 | |
| description (Optional) | String | body (enclosed in the params structure) | Detailed description of the resource | 4.3.0 | |
| url | String | body (enclosed in the params structure) | LDAP server access URL | 4.3.0 | |
| base | String | body (enclosed in the params structure) | LDAP server query BaseDN | 4.3.0 | |
| username | String | body (enclosed in the params structure) | Username for accessing the LDAP server | 4.3.0 | |
| password | String | body (enclosed in the params structure) | Password | 4.3.0 | |
| encryption | String | body (enclosed in the params structure) | Encryption method |
| 4.3.0 |
| systemTags (Optional) | List | body | System tags | 4.3.0 | |
| userTags (Optional) | List | body | User tags | 4.3.0 | |
| serverType (Optional) | String | body (enclosed in the params structure) | LDAP server type |
| 4.3.0 |
| usernameProperty (Optional) | String | body (enclosed in the params structure) | The field used as the username when a user logs in to the virtualization platform | 4.3.0 | |
| filter (Optional) | String | body (enclosed in the params structure) | The filter used when syncing from the LDAP server, which determines which users need to be synced | 4.3.0 | |
| syncCreatedAccountStrategy (Optional) | String | body (enclosed in the params structure) | The strategy for handling newly created users on the LDAP server during synchronization: create a corresponding account or take no action |
| 4.3.0 |
| syncDeletedAccountStrategy (Optional) | String | body (enclosed in the params structure) | The strategy for handling deleted users on the LDAP server during synchronization: delete the corresponding account, mark as stale, or take no action |
| 4.3.0 |
{ "inventory": { "uuid": "01b489793e3d31728ccbbc4fdfd99ed0", "name": "miao", "description": "miao desc", "url": "ldap://localhost:1888", "base": "dc\u003dexample,dc\u003dcom", "username": "", "password": "", "encryption": "None" } }| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.3.0 | |
| error | ErrorCode | Error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.3.0 |
| inventory | LdapServerInventory | For details, see inventory | 4.3.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001. | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null. | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID. Uniquely identifies the resource. | 4.3.0 |
| name | String | Resource name | 4.3.0 |
| type | String | User source type, typically ldap | 4.3.0 |
| description | String | Detailed description of the resource | 4.3.0 |
| url | String | 4.3.0 | |
| base | String | LDAP server access URL | 4.3.0 |
| username | String | Username for accessing the LDAP server | 4.3.0 |
| password | String | Password | 4.3.0 |
| encryption | String | Encryption method | 4.3.0 |
| serverType | String | Server type. Possible values are OpenLdap or WindowsAD. Returns Unknown if the type cannot be determined. | 4.3.0 |
| createDate | Timestamp | Creation time | 4.3.0 |
| lastOpDate | Timestamp | Last modification time | 4.3.0 |
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.serverType = "WindowsAD"; action.usernameProperty = "cn"; action.filter = "(cn=Micha Kops)"; action.syncCreatedAccountStrategy = "CreateAccount"; action.syncDeletedAccountStrategy = "StaleAccount"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; AddLdapServerAction.Result res = action.call();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.serverType = "WindowsAD" action.usernameProperty = "cn" action.filter = "(cn=Micha Kops)" action.syncCreatedAccountStrategy = "CreateAccount" action.syncDeletedAccountStrategy = "StaleAccount" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" AddLdapServerAction.Result res = action.call()DELETE zstack/v1/ldap/servers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/ldap/servers/01d547012c9a39cf85964e578842f5a5| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID. Uniquely identifies the resource. | 4.3.0 | |
| deleteMode (Optional) | String | body | Deletion mode | 4.3.0 | |
| systemTags (Optional) | List | body | System tags | 4.3.0 | |
| userTags (Optional) | List | body | User tags | 4.3.0 |
{} on success. On failure, the returned JSON structure contains an error field, for example:{ "error": { "code": "SYS.1001", "description": "A message or a operation timeout", "details": "Create VM on KVM timeout after 300s" } }DeleteLdapServerAction action = new DeleteLdapServerAction(); action.uuid = "01d547012c9a39cf85964e578842f5a5"; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteLdapServerAction.Result res = action.call(); DeleteLdapServerAction action = DeleteLdapServerAction() action.uuid = "01d547012c9a39cf85964e578842f5a5" action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteLdapServerAction.Result res = action.call()