Allocator Domain APIs
Manage allocator domains, their resource rules and scenarios, and associated virtual machines.
CreateAllocatorDomain
Create an allocator domain.
API Request
POST zstack/v1/allocator-domains
Authorization: OAuth the-session-uuid
{
"params": {
"name": "domain-1",
"description": "example allocator domain",
"zoneUuid": "ff0c268342c535aabf273d41a2be1d00",
"rules": [
{
"resourceUuid": "ff0192fa70113da886101145c084bd00",
"resourceType": "HostVO",
"effect": "Include"
}
],
"scenes": [
"NewCreate",
"Start",
"Migrate",
"Ha",
"HostMaintenance",
"Drs"
]
},
"systemTags": [],
"userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are shown to indicate 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":"domain-1","description":"example allocator domain","zoneUuid":"ff0c268342c535aabf273d41a2be1d00","rules":[{"resourceUuid":"ff0192fa70113da886101145c084bd00","resourceType":"HostVO","effect":"Include"}],"scenes":["NewCreate","Start","Migrate","Ha","HostMaintenance","Drs"]}}' http://localhost:8080/zstack/v1/allocator-domains
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (included in the params structure) |
Resource name | 5.2.0 | |
| description (Optional) | String | body (included in the params structure) |
Detailed description of the resource | 5.2.0 | |
| zoneUuid | String | body (included in the params structure) |
Zone UUID. Resources referenced by rules in the domain must belong to this zone. | 5.2.0 | |
| rules (Optional) | List | body (included in the params structure) |
Ordered rule list, evaluated from top to bottom; later matching rules override earlier ones. Host/cluster, primary storage, and L3 network rules are evaluated in separate chains. A chain containing Include rules acts as an allowlist; otherwise, it acts as a denylist. Place exceptions after broader rules. The zero-based list index is stored as priority. | 5.2.0 | |
| scenes (Optional) | List | body (included in the params structure) |
Scenarios in which the rules take effect. The presence of a scenario entry enables it. |
|
5.2.0 |
| resourceUuid (Optional) | String | body (included in the params structure) |
Resource UUID | 5.2.0 | |
| tagUuids (Optional) | List | body (included in the params structure) |
List of tag UUIDs | 5.2.0 | |
| systemTags (Optional) | List | body | System tags | 5.2.0 | |
| userTags (Optional) | List | body | User tags | 5.2.0 |
API Response
{
"inventory": {
"uuid": "ff0b7658d3cd30e390a6d8799a78fa00",
"name": "domain-1",
"description": "example allocator domain",
"zoneUuid": "ff0c268342c535aabf273d41a2be1d00",
"state": "Enabled",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"rules": [],
"scenes": []
}
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the request succeeded | 5.2.0 |
| error | ErrorCode | See error | 5.2.0 |
| inventory | AllocatorDomainInventory | See inventory | 5.2.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code that uniquely identifies the error, such as SYS.1000 or HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Error details | 0.6 |
| elaboration | String | Reserved field. The default value is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null. | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no underlying error. | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 5.2.0 |
| name | String | Resource name | 5.2.0 |
| description | String | Detailed description of the resource | 5.2.0 |
| zoneUuid | String | Zone UUID | 5.2.0 |
| state | String | Enabled or Disabled. When Disabled, the domain does not constrain associated virtual machines for the current operation. | 5.2.0 |
| createDate | Timestamp | Creation time | 5.2.0 |
| lastOpDate | Timestamp | Last modification time | 5.2.0 |
| rules | List | See rules | 5.2.0 |
| scenes | List | See scenes | 5.2.0 |
#rules
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | Auto-incrementing primary key | 5.2.0 |
| domainUuid | String | UUID of the allocator domain to which the entry belongs | 5.2.0 |
| priority | Integer | Evaluation order, starting from 0. Assigned from the index in the API rules list during creation or update. | 5.2.0 |
| resourceUuid | String | UUID of the resource referenced by the rule | 5.2.0 |
| resourceType | String | Resource type: HostVO, ClusterVO, PrimaryStorageVO, or L3NetworkVO | 5.2.0 |
| resourceQualifier | String | Qualifier used with resourceType. For PrimaryStorageVO, use Root, Data, or an empty value for all volumes. | 5.2.0 |
| resourcePolicy | String | Reserved field. Currently null. | 5.2.0 |
| effect | String | Include / Exclude / Recommend / NotRecommend | 5.2.0 |
| policyFrom | String | Rule source type. A null value normally indicates the default source. | 5.2.0 |
| policyUuid | String | Rule source UUID. Normally null. | 5.2.0 |
| createDate | Timestamp | Creation time | 5.2.0 |
#scenes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | Auto-incrementing primary key | 5.2.0 |
| domainUuid | String | UUID of the allocator domain to which the entry belongs | 5.2.0 |
| scene | String | NewCreate, Start, Migrate, Ha, HostMaintenance, or Drs. The presence of a scenario entry enables it. | 5.2.0 |
| createDate | Timestamp | Creation time | 5.2.0 |
SDK Examples
CreateAllocatorDomainAction action = new CreateAllocatorDomainAction();
action.name = "domain-1";
action.description = "example allocator domain";
action.zoneUuid = "ff0c268342c535aabf273d41a2be1d00";
action.rules = asList([resourceUuid:ff0192fa70113da886101145c084bd00, resourceType:HostVO, effect:Include]);
action.scenes = asList("NewCreate","Start","Migrate","Ha","HostMaintenance","Drs");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateAllocatorDomainAction.Result res = action.call();
action = CreateAllocatorDomainAction()
action.name = "domain-1"
action.description = "example allocator domain"
action.zoneUuid = "ff0c268342c535aabf273d41a2be1d00"
action.rules = [{"resourceUuid": "ff0192fa70113da886101145c084bd00", "resourceType": "HostVO", "effect": "Include"}]
action.scenes = ["NewCreate", "Start", "Migrate", "Ha", "HostMaintenance", "Drs"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
DeleteAllocatorDomain
Delete an allocator domain. Deletion fails if the configured or current domain value of a virtual machine still references this domain.
API Request
DELETE zstack/v1/allocator-domains/{uuid}
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X DELETE http://localhost:8080/zstack/v1/allocator-domains/ff0b7658d3cd30e390a6d8799a78fa00?deleteMode=Permissive
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, which uniquely identifies the resource | 5.2.0 | |
| deleteMode (Optional) | String | query | Deletion mode: Permissive or Enforcing. The default value is Permissive. | 5.2.0 | |
| systemTags (Optional) | List | query | System tags | 5.2.0 | |
| userTags (Optional) | List | query | User tags | 5.2.0 |
API Response
This API returns an empty JSON object {} on success. On failure, the JSON response contains an error field, as shown below:
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
SDK Examples
DeleteAllocatorDomainAction action = new DeleteAllocatorDomainAction();
action.uuid = "ff0b7658d3cd30e390a6d8799a78fa00";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteAllocatorDomainAction.Result res = action.call();
action = DeleteAllocatorDomainAction()
action.uuid = "ff0b7658d3cd30e390a6d8799a78fa00"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
UpdateAllocatorDomain
Update an allocator domain. Specifying rules or scenes replaces the corresponding rule or scenario list in full. Updating zoneUuid is not supported.
API Request
PUT zstack/v1/allocator-domains/{uuid}/actions
Authorization: OAuth the-session-uuid
{
"updateAllocatorDomain": {
"name": "domain-1",
"state": "Enabled"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are shown to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X PUT -d '{"updateAllocatorDomain":{"name":"domain-1","state":"Enabled"}}' http://localhost:8080/zstack/v1/allocator-domains/ff0b7658d3cd30e390a6d8799a78fa00/actions
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, which uniquely identifies the resource | 5.2.0 | |
| name (Optional) | String | body (included in the updateAllocatorDomain structure) |
Resource name | 5.2.0 | |
| description (Optional) | String | body (included in the updateAllocatorDomain structure) |
Detailed description of the resource | 5.2.0 | |
| state (Optional) | String | body (included in the updateAllocatorDomain structure) |
Enabled applies the rules to associated virtual machines; Disabled removes the constraint for the current operation. |
|
5.2.0 |
| rules (Optional) | List | body (included in the updateAllocatorDomain structure) |
Ordered rule list, evaluated in list order. Setting this field replaces all rules. The zero-based list index is stored as priority. | 5.2.0 | |
| scenes (Optional) | List | body (included in the updateAllocatorDomain structure) |
Scenarios in which the rules take effect. Setting this field replaces all scenario entries. |
|
5.2.0 |
| systemTags (Optional) | List | body | System tags | 5.2.0 | |
| userTags (Optional) | List | body | User tags | 5.2.0 |
API Response
{
"inventory": {
"uuid": "ff0b7658d3cd30e390a6d8799a78fa00",
"name": "domain-1",
"description": "example allocator domain",
"zoneUuid": "ff0c268342c535aabf273d41a2be1d00",
"state": "Enabled",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"rules": [],
"scenes": []
}
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the request succeeded | 5.2.0 |
| error | ErrorCode | See error | 5.2.0 |
| inventory | AllocatorDomainInventory | See inventory | 5.2.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code that uniquely identifies the error, such as SYS.1000 or HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Error details | 0.6 |
| elaboration | String | Reserved field. The default value is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null. | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no underlying error. | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 5.2.0 |
| name | String | Resource name | 5.2.0 |
| description | String | Detailed description of the resource | 5.2.0 |
| zoneUuid | String | Zone UUID | 5.2.0 |
| state | String | Enabled or Disabled. When Disabled, the domain does not constrain associated virtual machines for the current operation. | 5.2.0 |
| createDate | Timestamp | Creation time | 5.2.0 |
| lastOpDate | Timestamp | Last modification time | 5.2.0 |
| rules | List | See rules | 5.2.0 |
| scenes | List | See scenes | 5.2.0 |
#rules
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | Auto-incrementing primary key | 5.2.0 |
| domainUuid | String | UUID of the allocator domain to which the entry belongs | 5.2.0 |
| priority | Integer | Evaluation order, starting from 0. Assigned from the index in the API rules list during creation or update. | 5.2.0 |
| resourceUuid | String | UUID of the resource referenced by the rule | 5.2.0 |
| resourceType | String | Resource type: HostVO, ClusterVO, PrimaryStorageVO, or L3NetworkVO | 5.2.0 |
| resourceQualifier | String | Qualifier used with resourceType. For PrimaryStorageVO, use Root, Data, or an empty value for all volumes. | 5.2.0 |
| resourcePolicy | String | Reserved field. Currently null. | 5.2.0 |
| effect | String | Include / Exclude / Recommend / NotRecommend | 5.2.0 |
| policyFrom | String | Rule source type. A null value normally indicates the default source. | 5.2.0 |
| policyUuid | String | Rule source UUID. Normally null. | 5.2.0 |
| createDate | Timestamp | Creation time | 5.2.0 |
#scenes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | Auto-incrementing primary key | 5.2.0 |
| domainUuid | String | UUID of the allocator domain to which the entry belongs | 5.2.0 |
| scene | String | NewCreate, Start, Migrate, Ha, HostMaintenance, or Drs. The presence of a scenario entry enables it. | 5.2.0 |
| createDate | Timestamp | Creation time | 5.2.0 |
SDK Examples
UpdateAllocatorDomainAction action = new UpdateAllocatorDomainAction();
action.uuid = "ff0b7658d3cd30e390a6d8799a78fa00";
action.name = "domain-1";
action.state = "Enabled";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateAllocatorDomainAction.Result res = action.call();
action = UpdateAllocatorDomainAction()
action.uuid = "ff0b7658d3cd30e390a6d8799a78fa00"
action.name = "domain-1"
action.state = "Enabled"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
GetAllocatorDomainCandidates
Get candidate hosts, clusters, primary storages, and L3 networks that can be added to an allocator domain in the specified zone. Candidates are associated with the zone and available. L3 network candidates include port groups.
API Request
GET zstack/v1/allocator-domains/candidates
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/allocator-domains/candidates?zoneUuid=ff0c268342c535aabf273d41a2be1d00
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| zoneUuid | String | query | Zone UUID | 5.2.0 | |
| systemTags (Optional) | List | query | System tags | 5.2.0 | |
| userTags (Optional) | List | query | User tags | 5.2.0 |
API Response
{
"hosts": [],
"clusters": [],
"primaryStorages": [],
"l3Networks": []
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the request succeeded | 5.2.0 |
| error | ErrorCode | See error | 5.2.0 |
| hosts | List | See hosts | 5.2.0 |
| clusters | List | See clusters | 5.2.0 |
| primaryStorages | List | See primaryStorages | 5.2.0 |
| l3Networks | List | See l3Networks | 5.2.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code that uniquely identifies the error, such as SYS.1000 or HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Error details | 0.6 |
| elaboration | String | Reserved field. The default value is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null. | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no underlying error. | 0.6 |
#hosts
| Name | Type | Description | Starting Version |
|---|---|---|---|
| zoneUuid | String | Zone UUID | 0.6 |
| name | String | Resource name | 0.6 |
| uuid | String | Resource UUID, which uniquely identifies the resource | 0.6 |
| clusterUuid | String | Cluster UUID | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| managementIp | String | 0.6 | |
| hypervisorType | String | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| totalCpuCapacity | Long | 0.6 | |
| availableCpuCapacity | Long | 0.6 | |
| cpuSockets | Integer | Number of physical CPU sockets | 0.6 |
| totalMemoryCapacity | Long | 0.6 | |
| availableMemoryCapacity | Long | 0.6 | |
| cpuNum | Integer | Number of logical CPUs | 0.6 |
| ipmiAddress | String | IPMI address | 0.6 |
| ipmiUsername | String | IPMI username | 0.6 |
| ipmiPort | Integer | IPMI port | 0.6 |
| ipmiPowerStatus | String | IPMI power status | 0.6 |
| architecture | String | 0.6 | |
| nqn | String | NVMe qualified name | 4.10.6 |
| hostname | String | Host name | 4.10.20 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| cpuStatus | HwMonitorStatus | See cpuStatus | 4.10.0 |
| memoryStatus | HwMonitorStatus | See memoryStatus | 4.10.0 |
| diskStatus | HwMonitorStatus | See diskStatus | 4.10.0 |
| nicStatus | HwMonitorStatus | See nicStatus | 4.10.0 |
| gpuStatus | HwMonitorStatus | See gpuStatus | 4.10.0 |
| powerSupplyStatus | HwMonitorStatus | See powerSupplyStatus | 4.10.0 |
| fanStatus | HwMonitorStatus | See fanStatus | 4.10.0 |
| raidStatus | HwMonitorStatus | See raidStatus | 4.10.0 |
| temperatureStatus | HwMonitorStatus | See temperatureStatus | 4.10.0 |
#cpuStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#memoryStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#diskStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#nicStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#gpuStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#powerSupplyStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#fanStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#raidStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#temperatureStatus
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | HwMonitorStatus | Normal | 4.10.0 |
| Error | HwMonitorStatus | Error | 4.10.0 |
| Unknown | HwMonitorStatus | Unknown | 4.10.0 |
#clusters
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name | 0.6 |
| uuid | String | Resource UUID, which uniquely identifies the resource | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| state | String | Cluster state | 0.6 |
| hypervisorType | String | Hypervisor type | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| zoneUuid | String | Zone UUID | 0.6 |
| type | String | Reserved field | 0.6 |
#primaryStorages
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 0.6 |
| zoneUuid | String | Zone UUID | 0.6 |
| name | String | Resource name | 0.6 |
| url | String | 0.6 | |
| description | String | Detailed description of the resource | 0.6 |
| totalCapacity | Long | 0.6 | |
| availableCapacity | Long | 0.6 | |
| totalPhysicalCapacity | Long | 0.6 | |
| availablePhysicalCapacity | Long | 0.6 | |
| systemUsedCapacity | Long | 0.6 | |
| type | String | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| mountPath | String | 0.6 | |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| attachedClusterUuids | List | 0.6 |
#l3Networks
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 0.6 |
| name | String | Resource name | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| type | String | 0.6 | |
| zoneUuid | String | Zone UUID | 0.6 |
| l2NetworkUuid | String | L2 network UUID | 0.6 |
| state | String | 0.6 | |
| dnsDomain | String | 0.6 | |
| system | Boolean | 0.6 | |
| category | String | 0.6 | |
| ipVersion | Integer | IP version | 3.1.0 |
| enableIPAM | Boolean | Whether IP address management is enabled | 4.10.16 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| dns | List | 0.6 | |
| ipRanges | List | See ipRanges | 0.6 |
| networkServices | List | See networkServices | 0.6 |
| hostRoute | List | See hostRoute | 2.3 |
| reservedIpRanges | List | See reservedIpRanges | 4.10.16 |
#ipRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 0.6 |
| l3NetworkUuid | String | L3 network UUID | 0.6 |
| name | String | Resource name | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| startIp | String | Start IP address | 0.6 |
| endIp | String | End IP address | 0.6 |
| netmask | String | Netmask | 0.6 |
| prefixLen | String | Prefix length | 3.1 |
| gateway | String | Gateway | 0.6 |
| networkCidr | String | Network CIDR | 0.6 |
| ipVersion | Integer | IP version | 3.1 |
| addressMode | String | IPv6 address allocation mode | 3.1 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| ipRangeType | IpRangeType | See ipRangeType | 3.9 |
#ipRangeType
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Normal | IpRangeType | Normal IP range | 3.9 |
| AddressPool | IpRangeType | Address pool | 3.9 |
#networkServices
| Name | Type | Description | Starting Version |
|---|---|---|---|
| l3NetworkUuid | String | L3 network UUID | 0.6 |
| networkServiceProviderUuid | String | Network service provider UUID | 0.6 |
| networkServiceType | String | 0.6 |
#hostRoute
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | 2.3 | |
| l3NetworkUuid | String | L3 network UUID | 2.3 |
| prefix | String | 2.3 | |
| nexthop | String | 2.3 | |
| createDate | Timestamp | Creation time | 2.3 |
| lastOpDate | Timestamp | Last modification time | 2.3 |
#reservedIpRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 4.10.16 |
| l3NetworkUuid | String | L3 network UUID | 4.10.16 |
| name | String | Resource name | 4.10.16 |
| description | String | Detailed description of the resource | 4.10.16 |
| startIp | String | Start IP address, included in the reserved IP range | 4.10.16 |
| endIp | String | End IP address, included in the reserved IP range | 4.10.16 |
| ipVersion | Integer | IP version | 4.10.16 |
| createDate | Timestamp | Creation time | 4.10.16 |
| lastOpDate | Timestamp | Last modification time | 4.10.16 |
SDK Examples
GetAllocatorDomainCandidatesAction action = new GetAllocatorDomainCandidatesAction();
action.zoneUuid = "ff0c268342c535aabf273d41a2be1d00";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetAllocatorDomainCandidatesAction.Result res = action.call();
action = GetAllocatorDomainCandidatesAction()
action.zoneUuid = "ff0c268342c535aabf273d41a2be1d00"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
GetAllocatorDomainVms
Get virtual machines currently in the specified allocator domain, virtual machines that will enter the domain at the next start and are not in the current list, and virtual machines that can currently be added to the domain.
API Request
GET zstack/v1/allocator-domains/{uuid}/vms
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/allocator-domains/ff0b7658d3cd30e390a6d8799a78fa00/vms
Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Allocator domain UUID | 5.2.0 | |
| systemTags (Optional) | List | query | System tags | 5.2.0 | |
| userTags (Optional) | List | query | User tags | 5.2.0 |
API Response
{
"currentVms": [
"ff01ec80fd11327cba7519b66119d900"
],
"nextStartVms": [],
"candidateVms": []
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the request succeeded | 5.2.0 |
| currentVms | List | UUIDs of virtual machines currently in the domain. Their current SystemTag value identifies this domain. | 5.2.0 |
| candidateVms | List | UUIDs of running virtual machines that are not currently in the domain and can be added to it. | 5.2.0 |
| nextStartVms | List | UUIDs of virtual machines that will enter the domain at the next start and are not in currentVms. Their ResourceConfig value identifies this domain, but their current value does not. | 5.2.0 |
| error | ErrorCode | See error | 5.2.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code that uniquely identifies the error, such as SYS.1000 or HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Error details | 0.6 |
| elaboration | String | Reserved field. The default value is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null. | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no underlying error. | 0.6 |
SDK Examples
GetAllocatorDomainVmsAction action = new GetAllocatorDomainVmsAction();
action.uuid = "ff0b7658d3cd30e390a6d8799a78fa00";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetAllocatorDomainVmsAction.Result res = action.call();
action = GetAllocatorDomainVmsAction()
action.uuid = "ff0b7658d3cd30e390a6d8799a78fa00"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
