Settings Operations
Global Settings Operations
QueryGlobalConfig
API Request
GET zstack/v1/global-configurationsAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 036d9a68cd8243e99e8d740eaf8b4baf" \
-X GET http://localhost:8080/zstack/v1/global-configurationsQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryGlobalConfig, and pressing the Tab key.
API Response
{
"inventories": [
{
"name": "reservedCapacity",
"category": "backupStorage",
"description": "Reserved capcacity on every backup storage",
"defaultValue": "1G",
"value": "2G"
}
]
}| 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 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 0.6 |
| category | String | 0.6 | |
| description | String | The detailed description of the resource. | 0.6 |
| defaultValue | String | 0.6 | |
| value | String | 0.6 |
SDK Sample
QueryGlobalConfigAction action = new QueryGlobalConfigAction();
action.conditions = asList();
action.sessionId = "8509eaa6301b4935a4b100a05f1fe2ba";
QueryGlobalConfigAction.Result res = action.call();QueryGlobalConfigAction action = QueryGlobalConfigAction()
action.conditions = []
action.sessionId = "e085fdf6aa354291b71ae8dc5fa880fe"
QueryGlobalConfigAction.Result res = action.call()UpdateGlobalConfig
API Request
PUT zstack/v1/global-configurations/{category}/{name}/actionsAuthorization: OAuth the-session-uuid{
"updateGlobalConfig": {
"value": "90"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateGlobalConfig":{"value":"90"}}' \
http://localhost:8080/zstack/v1/global-configurations/quota/scheduler.num/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| category | String | url | The category. | 0.6 | |
| name | String | url | The resource name. | 0.6 | |
| value | String | body (contained in the updateGlobalConfig structure) | Optional. The value. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
{
"inventory": {
"name": "scheduler.num",
"category": "quota",
"description": "default quota for scheduler.num",
"defaultValue": "80",
"value": "90"
}
}| 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 |
| inventory | GlobalConfigInventory | See inventory. | 0.6 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 0.6 |
| category | String | 0.6 | |
| description | String | The detailed description of the resource. | 0.6 |
| defaultValue | String | 0.6 | |
| value | String | 0.6 |
SDK Sample
UpdateGlobalConfigAction action = new UpdateGlobalConfigAction();
action.category = "quota";
action.name = "scheduler.num";
action.value = "90";
action.sessionId = "84a1a9ed2d54449db13e01f7d6face7e";
UpdateGlobalConfigAction.Result res = action.call();UpdateGlobalConfigAction action = UpdateGlobalConfigAction()
action.category = "quota"
action.name = "scheduler.num"
action.value = "90"
action.sessionId = "b077cfa8599a4ff1ac4fd7ba67b20a82"
UpdateGlobalConfigAction.Result res = action.call()ResetGlobalConfig
API Request
PUT zstack/v1/global-configurations/actionsAuthorization: OAuth the-session-uuid{
"resetGlobalConfig": {},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"resetGlobalConfig":{}}' http://localhost:8080/zstack/v1/global-configurations/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | body | Optional. The system tags. | 3.1.0 | |
| userTags | List | body | Optional. The user tags. | 3.1.0 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
ResetGlobalConfigAction action = new ResetGlobalConfigAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ResetGlobalConfigAction.Result res = action.call();ResetGlobalConfigAction action = ResetGlobalConfigAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ResetGlobalConfigAction.Result res = action.call()Advanced Settings Operations
GetResourceConfig
API Request
GET zstack/v1/resource-configurations/{resourceUuid}/{category}/{name}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/77663dd5ff84460bbf1817aa3c59d125/host/cpu.overProvisioning.ratio| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| category | String | url | The setting category. | 3.4.0 | |
| name | String | url | The setting name. | 3.4.0 | |
| resourceUuid | String | url | The resource UUID. | 3.4.0 | |
| systemTags | List | query | Optional. The system tags. | 3.4.0 | |
| userTags | List | query | Optional. The user tags. | 3.4.0 |
API Response
{
"value": "5",
"effectiveConfigs": [
{
"uuid": "dae9aeb6d74e4f44823f2e0c4f1cc79f",
"resourceUuid": "46597de31eac41539c4e6eda52885769",
"resourceType": "HostVO",
"name": "cpu.overProvisioning.ratio",
"category": "host",
"value": "5",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
},
{
"uuid": "5c3c94a73d7b4a95a1818241f2e427ae",
"resourceUuid": "371519310f344695854de27bb9743121",
"resourceType": "ClusterVO",
"name": "cpu.overProvisioning.ratio",
"category": "host",
"value": "10",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| value | String | The setting value. | 3.4.0 |
| success | boolean | 3.4.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.4.0 |
| effectiveConfigs | List | The setting list that takes effect. Settings are ordered from high to low priorities. For more information, see effectiveConfigs. | 3.4.0 |
| error | ErrorCode | See error. | 3.4.0 |
| 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.4.0 |
| description | String | The brief description of the error. | 3.4.0 |
| details | String | The details about the error. | 3.4.0 |
| elaboration | String | The reserved field. Default value: null. | 3.4.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.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. | 3.4.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.4.0 |
| resourceUuid | String | The resource UUID corresponded by the setting. | 3.4.0 |
| resourceType | String | The resource type corresponded by the setting. | 3.4.0 |
| name | String | The setting name. | 3.4.0 |
| description | String | The detailed description of the setting. | 3.4.0 |
| category | String | The setting category. | 3.4.0 |
| value | String | The setting value. | 3.4.0 |
| createDate | Timestamp | The creation date. | 3.4.0 |
| lastOpDate | Timestamp | The last operation date. | 3.4.0 |
| 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.4.0 |
| description | String | The brief description of the error. | 3.4.0 |
| details | String | The details about the error. | 3.4.0 |
| elaboration | String | The reserved field. Default value: null. | 3.4.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.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. | 3.4.0 |
SDK Sample
GetResourceConfigAction action = new GetResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "70fdcc564f564c29af98e48e78be56e4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceConfigAction.Result res = action.call();GetResourceConfigAction action = GetResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "b1ea1d424bf04a50b15b33bcd0f8a80d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceConfigAction.Result res = action.call()GetResourceBindableConfig
API Request
GET zstack/v1/resource-configurations/bindable
GET zstack/v1/resource-configurations/bindable/{category}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/bindable?category=hostcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/bindable/host?category=host| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| category | String | query | Optional. The setting category. | 3.4.0 | |
| systemTags | List | query | Optional. The system tags. | 3.4.0 | |
| userTags | List | query | Optional. The user tags. | 3.4.0 |
API Response
{
"bindableConfigs": [
{
"name": "cpu.overProvisioning.ratio",
"category": "host",
"bindResourceTypes": [
"HostVO",
"ClusterVO",
"ZoneVO"
]
}
]
}| 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.4.0 |
| bindableConfigs | List | See bindableConfigs. | 3.4.0 |
| 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.4.0 |
| description | String | The brief description of the error. | 3.4.0 |
| details | String | The details about the error. | 3.4.0 |
| elaboration | String | The reserved field. Default value: null. | 3.4.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.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. | 3.4.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The setting name. | 3.4.0 |
| category | String | The setting category. | 3.4.0 |
| description | String | The detailed description of the setting. | 3.4.0 |
| bindResourceTypes | List | The resource types that can be bound by the setting. | 3.4.0 |
SDK Sample
GetResourceBindableConfigAction action = new GetResourceBindableConfigAction();
action.category = "host";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceBindableConfigAction.Result res = action.call();GetResourceBindableConfigAction action = GetResourceBindableConfigAction()
action.category = "host"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceBindableConfigAction.Result res = action.call()DeleteResourceConfig
API Request
DELETE zstack/v1/resource-configurations/{category}/{name}/{resourceUuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/resource-configurations/host/cpu.overProvisioning.ratio/02bcf0b045e247e59bfd51630064443f| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| category | String | url | The setting category. | 3.4.0 | |
| name | String | url | The setting name. | 3.4.0 | |
| resourceUuid | String | url | The resource UUID. | 3.4.0 | |
| deleteMode | String | body | Optional. The delete mode. | 3.4.0 | |
| systemTags | List | body | Optional. The system tags. | 3.4.0 | |
| userTags | List | body | Optional. The user tags. | 3.4.0 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
DeleteResourceConfigAction action = new DeleteResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "763612d48d514b35a7df506cf1a23f57";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteResourceConfigAction.Result res = action.call();DeleteResourceConfigAction action = DeleteResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "4ac85edbee2c489ea58e3f26b53182de"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteResourceConfigAction.Result res = action.call()QueryResourceConfig
API Request
GET zstack/v1/resource-configurationsAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurationsQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryResourceConfig, and pressing the Tab key.
API Response
{
"inventories": [
{
"uuid": "4944c2599c394bd5be5ccc1099dfdb4b",
"resourceUuid": "45a511dfef1b474dbef3c1ff88275465",
"resourceType": "ClusterVO",
"name": "cpu.overProvisioning.ratio",
"category": "host",
"value": "10",
"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.4.0 |
| inventories | List | See inventories. | 3.4.0 |
| 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.4.0 |
| description | String | The brief description of the error. | 3.4.0 |
| details | String | The details about the error. | 3.4.0 |
| elaboration | String | The reserved field. Default value: null. | 3.4.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.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. | 3.4.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.4.0 |
| resourceUuid | String | The resource UUID corresponded by the setting. | 3.4.0 |
| resourceType | String | The resource type corresponded by the setting. | 3.4.0 |
| name | String | The setting name. | 3.4.0 |
| description | String | The detailed description of the setting. | 3.4.0 |
| category | String | The setting category. | 3.4.0 |
| value | String | The setting value. | 3.4.0 |
| createDate | Timestamp | The creation date. | 3.4.0 |
| lastOpDate | Timestamp | The last operation date. | 3.4.0 |
SDK Sample
QueryResourceConfigAction action = new QueryResourceConfigAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryResourceConfigAction.Result res = action.call();QueryResourceConfigAction action = QueryResourceConfigAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryResourceConfigAction.Result res = action.call()UpdateResourceConfig
API Request
PUT zstack/v1/resource-configurations/{category}/{name}/{resourceUuid}/actionsAuthorization: OAuth the-session-uuid{
"updateResourceConfig": {
"value": "10"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateResourceConfig":{"value":"10"}}' http://localhost:8080/zstack/v1/resource-configurations/host/cpu.overProvisioning.ratio/afd5f67a253b4990b9e8160672357eed/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| category | String | url | The setting category. | 3.4.0 | |
| name | String | url | The setting name. | 3.4.0 | |
| resourceUuid | String | url | The resource UUID. | 3.4.0 | |
| value | String | body (contained in the updateResourceConfig structure) | The setting value. | 3.4.0 | |
| systemTags | List | body | Optional. The system tags. | 3.4.0 | |
| userTags | List | body | Optional. The user tags. | 3.4.0 |
API Response
{
"inventory": {
"uuid": "ce61962673574ff689e2e6cb6f8cf558",
"resourceUuid": "435a7c71c82b4b0b971f4674ab346822",
"resourceType": "ClusterVO",
"name": "cpu.overProvisioning.ratio",
"category": "host",
"value": "10",
"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.4.0 |
| inventory | ResourceConfigInventory | See inventory. | 3.4.0 |
| 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.4.0 |
| description | String | The brief description of the error. | 3.4.0 |
| details | String | The details about the error. | 3.4.0 |
| elaboration | String | The reserved field. Default value: null. | 3.4.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.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. | 3.4.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.4.0 |
| resourceUuid | String | The resource UUID corresponded by the setting. | 3.4.0 |
| resourceType | String | The resource type corresponded by the setting. | 3.4.0 |
| name | String | The setting name. | 3.4.0 |
| description | String | The detailed description of the setting. | 3.4.0 |
| category | String | The setting category. | 3.4.0 |
| value | String | The setting value. | 3.4.0 |
| createDate | Timestamp | The creation date. | 3.4.0 |
| lastOpDate | Timestamp | The last operation date. | 3.4.0 |
SDK Sample
UpdateResourceConfigAction action = new UpdateResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "5fa296dff4f04c96b29f38bef93e9e15";
action.value = "10";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateResourceConfigAction.Result res = action.call();UpdateResourceConfigAction action = UpdateResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "1e0f389aca364a1f94929bb4f39597b3"
action.value = "10"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateResourceConfigAction.Result res = action.call()Template Operations
ApplyTemplateConfig
API Request
PUT zstack/v1/template-configurations/{templateUuid}/actionsAuthorization: OAuth the-session-uuid{
"applyTemplateConfig": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"applyTemplateConfig":{}}' http://localhost:8080/zstack/v1/template-configurations/00000000/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| templateUuid | String | url | The template 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
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
ApplyTemplateConfigAction action = new ApplyTemplateConfigAction();
action.templateUuid = "00000000";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ApplyTemplateConfigAction.Result res = action.call();ApplyTemplateConfigAction action = ApplyTemplateConfigAction()
action.templateUuid = "00000000"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ApplyTemplateConfigAction.Result res = action.call()QueryGlobalConfigTemplate
API Request
GET zstack/v1/template-configurations/templates
GET zstack/v1/template-configurations/templates/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/template-configurations/templates?Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryGlobalConfigTemplate, and pressing the Tab key.
API Response
{
"inventories": [
{
"uuid": "reservedCapacity",
"name": "scenes1",
"type": "System",
"description": "For scenes1"
}
]
}| 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 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.6.0 |
| name | String | The template name. | 3.6.0 |
| type | String | The template type. | 3.6.0 |
| description | String | The detailed description of and the recommended scenario of the template. | 3.6.0 |
SDK Sample
QueryGlobalConfigTemplateAction action = new QueryGlobalConfigTemplateAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryGlobalConfigTemplateAction.Result res = action.call();QueryGlobalConfigTemplateAction action = QueryGlobalConfigTemplateAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryGlobalConfigTemplateAction.Result res = action.call()QueryTemplateConfig
API Request
GET zstack/v1/template-configurations/configs
GET zstack/v1/template-configurations/configs/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/template-configurations/configs?Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryTemplateConfig, and pressing the Tab key.
API Response
{
"inventories": [
{
"templateUuid": "0000111122223333",
"category": "backupStorage",
"name": "reservedCapacity",
"defaultValue": "1G",
"value": "2G"
}
]
}| 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 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| templateUuid | String | The template UUID. | 3.6.0 |
| category | String | The setting category. | 3.6.0 |
| name | String | The setting name. | 3.6.0 |
| defaultValue | String | The default template value. | 3.6.0 |
| value | String | The template value. | 3.6.0 |
SDK Sample
QueryTemplateConfigAction action = new QueryTemplateConfigAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryTemplateConfigAction.Result res = action.call();QueryTemplateConfigAction action = QueryTemplateConfigAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryTemplateConfigAction.Result res = action.call()UpdateTemplateConfig
API Request
PUT zstack/v1/template-configurations/{templateUuid}/actionsAuthorization: OAuth the-session-uuid{
"updateTemplateConfig": {
"category": "quota",
"name": "scheduler.num",
"value": "90"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateTemplateConfig":{"category":"quota","name":"scheduler.num","value":"90"}}' http://localhost:8080/zstack/v1/template-configurations/0000/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| templateUuid | String | url | The template UUID. | 3.6.0 | |
| category | String | body (contained in the updateTemplateConfig structure) | The corresponding global setting category. | 3.6.0 | |
| name | String | body (contained in the updateTemplateConfig structure) | The corresponding global setting name. | 3.6.0 | |
| value | String | body (contained in the updateTemplateConfig structure) | The template value. | 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
{
"inventory": {
"templateUuid": "000011112222",
"category": "vm",
"name": "emulateHyperV",
"defaultValue": "true",
"value": "true"
}
}| 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 | TemplateConfigInventory | See inventory. | 3.6.0 |
| 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 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| templateUuid | String | The template UUID. | 3.6.0 |
| category | String | The setting category. | 3.6.0 |
| name | String | The setting name. | 3.6.0 |
| defaultValue | String | The default template value. | 3.6.0 |
| value | String | The template value. | 3.6.0 |
SDK Sample
UpdateTemplateConfigAction action = new UpdateTemplateConfigAction();
action.templateUuid = "0000";
action.category = "quota";
action.name = "scheduler.num";
action.value = "90";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateTemplateConfigAction.Result res = action.call();UpdateTemplateConfigAction action = UpdateTemplateConfigAction()
action.templateUuid = "0000"
action.category = "quota"
action.name = "scheduler.num"
action.value = "90"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateTemplateConfigAction.Result res = action.call()ResetTemplateConfig
API Request
PUT zstack/v1/template-configurations/{templateUuid}/actionsAuthorization: OAuth the-session-uuid{
"resetTemplateConfig": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"resetTemplateConfig":{}}' http://localhost:8080/zstack/v1/template-configurations/00000000/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| templateUuid | String | url | The template 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
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
ResetTemplateConfigAction action = new ResetTemplateConfigAction();
action.templateUuid = "00000000";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ResetTemplateConfigAction.Result res = action.call();ResetTemplateConfigAction action = ResetTemplateConfigAction()
action.templateUuid = "00000000"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ResetTemplateConfigAction.Result res = action.call()RevertTemplateConfig
API Request
PUT zstack/v1/template-configurations/{templateUuid}/actionsAuthorization: OAuth the-session-uuid{
"resetTemplateConfig": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \-X PUT -d '{"revertTemplateConfig":{}}' http://localhost:8080/zstack/v1/template-configurations/fd5ae067a0b037d2af3a6ec060c4be86/actions| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| templateUuid | String | url | The template UUID. | 4.6.21 | |
| systemTags | List | body | Optional. The system tags. | 4.6.21 | |
| userTags | List | body | Optional. The user tags. | 4.6.21 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
RevertTemplateConfigAction action = new RevertTemplateConfigAction();
action.templateUuid = "fd5ae067a0b037d2af3a6ec060c4be86";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RevertTemplateConfigAction.Result res = action.call();RevertTemplateConfigAction action = RevertTemplateConfigAction()
action.templateUuid = "fd5ae067a0b037d2af3a6ec060c4be86"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RevertTemplateConfigAction.Result res = action.call()HA Policy Operations
UpdateHaStrategyCondition
API Request
PUT zstack/v1/ha-strategy-condition/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateHaStrategyCondition": {
"name": "new ha strategycondition name",
"state": "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 -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateHaStrategyCondition":{"name":"new ha strategycondition name","state":"Enable"}}' http://localhost:8080/zstack/v1/ha-strategy-condition/bf798f9ae94f3007a293f090ec555d57/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 4.7.0 | |
| name | String | body (contained in the updateHaStrategyCondition structure) | Optional. The resource name. | 4.7.0 | |
| state | String | body(contained in the updateHaStrategyCondition structure) | Optional. The state | 4.7.0 | |
| systemTags | List | body | Optional. The system tags. | 4.7.0 | |
| userTags | List | body | Optional. The user tags. | 4.7.0 |
API Response
{
"inventory": {
"uuid": "9a01c1cea2793814b8b1bf228a2ff601",
"name": "test",
"fencerName": "hostStorageState"
}
}| 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. | 4.7.0 |
| inventory | ResourceConfigInventory | See inventory. | 4.7.0 |
| 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.7.0 |
| description | String | The brief description of the error. | 4.7.0 |
| details | String | The details about the error. | 4.7.0 |
| elaboration | String | The reserved field. Default value: null. | 4.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.7.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.7.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.7.0 |
| name | String | The resource namne. | 4.7.0 |
| fencerName | String | The fencer name. | 4.7.0 |
| state | String | The state. | 4.7.0 |
| createDate | Timestamp | The creation date. | 4.7.0 |
| lastOpDate | Timestamp | The last operation date. | 4.7.0 |
SDK Sample
UpdateHaStrategyConditionAction action = new UpdateHaStrategyConditionAction();
action.uuid = "bf798f9ae94f3007a293f090ec555d57";
action.name = "new ha strategycondition name";
action.state = "Enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateHaStrategyConditionAction.Result res = action.call();UpdateHaStrategyConditionAction action = UpdateHaStrategyConditionAction()
action.uuid = "bf798f9ae94f3007a293f090ec555d57"
action.name = "new ha strategycondition name"
action.state = "Enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateHaStrategyConditionAction.Result res = action.call()