VM Related Interfaces

Get Interdependent Images and Distributed Port Groups

GET/zstack/v1/images-l3networks/dependencies

ZSvirt In ZStack, a Distributed Port Group belongs to a Data Center, and the Image Storage where Images are stored can be attached to one or more Data Centers. There are also dependencies between Image Storage and Clusters. For example, Distributed Image Storage can only work with Distributed Storage. Due to these dependencies, when creating a Virtual Machine, the specified Distributed Port Group and Image may not be able to work together. Users can use this API to get the interdependencies between Images or Distributed Port Groups.

When the l3NetworkUuids parameter is specified, the returned list is Images that can work with these Distributed Port Groups.

When the imageUuid parameter is specified, the returned list is Distributed Port Groups that can work with this Image.

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/images-l3networks/dependencies?zoneUuid=97c8f8e07cf23b8789f910cdd7221dda&imageUuid=f3081ae6203d30c49ca7194d6d07f412&raiseException=true

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
zoneUuidStringqueryData Center UUID. Required, to determine the dependency between Distributed Port Groups and Images. 0.6
l3NetworkUuids (Optional)ListqueryDistributed Port Group UUID list 0.6
imageUuid (Optional)StringqueryImage UUID 0.6
raiseException (Optional)booleanqueryWhether to raise an exception 4.6.11
systemTags (Optional)ListquerySystem Tag 0.6
userTags (Optional)ListqueryUser Tag 0.6

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "961b708c480a3f5ba605defbee45eb36",
      "name": "private L3",
      "type": "L3BasicNetwork",
      "zoneUuid": "c0904ef326bf3cc1b69056d1bcf4282d",
      "l2NetworkUuid": "a6ea56d5a589322082a4b7df3e135aeb",
      "state": "Enabled",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "ipRanges": [
        {
          "uuid": "516e170a56283a5bb9fa20f262b17bd0",
          "l3NetworkUuid": "961b708c480a3f5ba605defbee45eb36",
          "name": "ip range",
          "startIp": "192.168.0.10",
          "endIp": "192.168.0.100",
          "netmask": "255.255.255.0",
          "gateway": "192.168.0.1",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ],
      "networkServices": [
        {
          "l3NetworkUuid": "961b708c480a3f5ba605defbee45eb36",
          "networkServiceProviderUuid": "8b31ada3e7703ae38b43a2b6f9617f96",
          "networkServiceType": "DHCP"
        },
        {
          "l3NetworkUuid": "961b708c480a3f5ba605defbee45eb36",
          "networkServiceProviderUuid": "8b31ada3e7703ae38b43a2b6f9617f96",
          "networkServiceType": "DNS"
        },
        {
          "l3NetworkUuid": "961b708c480a3f5ba605defbee45eb36",
          "networkServiceProviderUuid": "8b31ada3e7703ae38b43a2b6f9617f96",
          "networkServiceType": "SNAT"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
inventoriesListIf the input parameter is l3NetworkUuids, this is the Image list; if the input parameter is imageUuid, this is the Distributed Port Group list0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation is successful. For details, see error0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The source error that caused the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

GetInterdependentL3NetworksImagesAction action = new GetInterdependentL3NetworksImagesAction();
action.zoneUuid = "97c8f8e07cf23b8789f910cdd7221dda";
action.imageUuid = "f3081ae6203d30c49ca7194d6d07f412";
action.raiseException = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetInterdependentL3NetworksImagesAction.Result res = action.call();

Python SDK

GetInterdependentL3NetworksImagesAction action = GetInterdependentL3NetworksImagesAction()
action.zoneUuid = "97c8f8e07cf23b8789f910cdd7221dda"
action.imageUuid = "f3081ae6203d30c49ca7194d6d07f412"
action.raiseException = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetInterdependentL3NetworksImagesAction.Result res = action.call()