Query ZCE-X
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zce-x-plugin?q=name=zce-xcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zce-x-plugin/7746a57778193dcd9201c12a6dbc20fbQueryable Fields
Run the CLI command tool, enter QueryZceX and press Tab to view all queryable fields and resource names that can be queried across tables.
API Response
Response Example
{
"inventories": [
{
"uuid": "77e1393bf5aa4536a018b4c0c4e29c72",
"name": "zce-x-plugin",
"managementIp": "127.0.0.1",
"apiPort": 8056,
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the query was successful | 4.10.6 |
| inventories | List | For details, see inventories | 4.10.6 |
| error | ErrorCode | Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error | 4.10.6 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 4.10.6 |
| name | String | Resource name | 4.10.6 |
| managementIp | String | IP address for accessing ZCE-X | 4.10.6 |
| apiPort | int | API port for accessing ZCE-X | 4.10.6 |
| createDate | Timestamp | Creation time | 4.10.6 |
| lastOpDate | Timestamp | Last modification time | 4.10.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 | 4.10.0 |
| description | String | Brief summary of the error | 4.10.0 |
| details | String | Detailed error information | 4.10.0 |
| elaboration | String | Reserved field, defaults to null | 4.10.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 4.10.0 |
| cause | ErrorCode | Root cause: the source error that triggered the current error. If there is no original error, this field is null | 4.10.0 |
SDK Examples
Java SDK
QueryZceXAction action = new QueryZceXAction();
action.conditions = asList("name=zce-x");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryZceXAction.Result res = action.call();Python SDK
QueryZceXAction action = QueryZceXAction()
action.conditions = ["name=zce-x"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryZceXAction.Result res = action.call()