Abiquo 5.1

Skip to end of metadata
Go to start of metadata

Introduction

This page describes how to obtain a public IP in AWS using the Abiquo API.

You will need the following resources.

  • Virtual datacenter in public cloud with public IPs (AWS or Azure)
  • A VM that is not deployed
    • To use a public IP in AWS, you must first add a private IP on the public subnet
    • You can do this with the UI or with the API
    • If you use the API
      • Select the private network with the internetGatewayRole attribute set to true
      • Also remember to check the valid IP range

         Click here to expand...
            "internetGatewayRole": true,
            "ipRanges": [
                {
                    "firstIp": "192.168.1.5",
                    "lastIp": "192.168.1.253"
                }
            ],

Your user role must include the following privileges.

  • ROLE_VDC_ENUMERATE
  • ROLE_VAPP_CUSTOMISE_SETTINGS
  • ROLE_MANAGE_FLOATINGIPS

Your user must be in the enterprise that owns the virtual datacenter and virtual resources.

The following pages describe public IP configuration and UI functionality.

This tutorial contains some API shortcuts from the standard UI procedure for managing public IPs in public cloud. However, it is also possible to perform the same steps as in the UI with the API.

Summary diagram

The steps in this diagram link to the API reference guide resources and data entities sections.


Requires a VM in public cloudwith a private IP onthe public subnet Get the VM by name withthe vmlabel parameter Get the virtualdatacenter,edit, and nicX links Get the virtualdatacenter Get the location andfloating IPs links Synchronize floating IPs Get the available public IPsin the location Get the VM againusing the edit link Add the public IP's self linkto the VM object as nicX+1 Update the VM toadd the public IP

Detailed steps

  1. Get the VM by its friendly name
    1. Use the vmlabel parameter
    2. cURL

      curl -X GET https://example.com:443/api/cloud/virtualmachines?vmlabel=awsvm \
           -H 'Accept:application/vnd.abiquo.virtualmachines+json;version=4.7' \
           -u admin:xabiquo --verbose
    3. Keep the link of the virtual datacenter

                      {
                          "title": "aws_vdc",
                          "rel": "virtualdatacenter",
                          "type": "application/vnd.abiquo.virtualdatacenter+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
                      },
    4. Keep the edit link of the virtual machine

                      {
                          "title": "ABQ_90b52e0e-7b96-4721-abfc-47bd746443f3",
                          "rel": "edit",
                          "type": "application/vnd.abiquo.virtualmachine+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767"
                      },


      You will need the VM entity later, but you should use the edit link to retrieve it again, just in case there are any changes

    5. There should be one nicX link for each NIC in the VM. Keep the highest number nic link, so that you can add the new NIC with the next number in the series

                      {
                          "title": "192.168.1.5",
                          "rel": "nic0",
                          "type": "application/vnd.abiquo.privateip+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2843/ips/15183"
                      },
  2. Get the virtual datacenter
    1. Use the virtualdatacenter URL from the VM entity as shown above
    2. Or filter by location with the datacenter parameter and/or by a text string with the has parameter. For example:

      curl -X GET https://example.com/api/cloud/virtualdatacenters?datacenter=2&has=aws \ 
      	 -H 'Accept:application/vnd.abiquo.virtualdatacenters+json;version=4.7' \ 
      	 -u user:password --verbose 
    3. Sample response. Success status code: 200

       Click here to expand...
      {
          "totalSize": 1,
          "links": [
              {
                  "rel": "first",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters?datacenter=2&limit=25&by=name&asc=true"
              },
              {
                  "rel": "last",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters?datacenter=2&startwith=0&limit=25&by=name&asc=true"
              },
              {
                  "title": "alarmssearch",
                  "rel": "alarmssearch",
                  "type": "application/vnd.abiquo.alarms+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/alarms"
              }
          ],
          "collection": [
              {
                  "id": 2100,
                  "hypervisorType": "AMAZON",
                  "name": "aws_vdc",
                  "network": {
                      "id": 2842,
                      "name": "default_private_network",
                      "address": "192.168.0.0",
                      "mask": 24,
                      "gateway": "192.168.0.1",
                      "primaryDNS": "10.60.1.4",
                      "secondaryDNS": "8.8.8.8",
                      "sufixDNS": "",
                      "defaultNetwork": false,
                      "type": "INTERNAL",
                      "dhcpOptions": {
                          "links": [],
                          "collection": []
                      },
                      "ipv6": false,
                      "strict": false,
                      "providerId": "subnet-045f28b04543ee4aa",
                      "restricted": false,
                      "internetGatewayRole": false,
                      "ipRanges": [
                          {
                              "firstIp": "192.168.0.5",
                              "lastIp": "192.168.0.253"
                          }
                      ],
                      "excludedFromFirewall": false,
                      "notUsableLoadBalancers": false,
                      "notUsableVirtualMachines": false,
                      "links": [
                          {
                              "title": "aws_vdc",
                              "rel": "virtualdatacenter",
                              "type": "application/vnd.abiquo.virtualdatacenter+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
                          },
                          {
                              "title": "default_private_network",
                              "rel": "edit",
                              "type": "application/vnd.abiquo.vlan+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842"
                          },
                          {
                              "title": "ips",
                              "rel": "ips",
                              "type": "application/vnd.abiquo.privateips+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842/ips"
                          },
                          {
                              "title": "eu-west-1c",
                              "rel": "availabilityzone",
                              "type": "application/vnd.abiquo.availabilityzone+json",
                              "href": "https://example.com:443/api/cloud/locations/2/availabilityzones/33"
                          },
                          {
                              "title": "load balancers",
                              "rel": "loadbalancers",
                              "type": "application/vnd.abiquo.loadbalancers+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842/loadbalancers"
                          },
                          {
                              "title": "configuration",
                              "rel": "configuration",
                              "type": "application/vnd.abiquo.networkconfiguration+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842/configuration"
                          },
                          {
                              "title": "192.168.0.0/24",
                              "rel": "network_configuration",
                              "type": "application/vnd.abiquo.networkconfiguration+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842/configuration/2842"
                          },
                          {
                              "title": "reserve a set of ips",
                              "rel": "reserveips",
                              "type": "application/vnd.abiquo.ipliterals+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842/ips/action/reserve"
                          },
                          {
                              "title": "release a set of ips",
                              "rel": "releaseips",
                              "type": "application/vnd.abiquo.ipliterals+json",
                              "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842/ips/action/release"
                          }
                      ]
                  },
                  "providerId": "vpc-08a48bac0f1160434",
                  "syncState": "NONE",
                  "usersRole": [],
                  "diskSoftLimitInMb": 0,
                  "diskHardLimitInMb": 0,
                  "storageSoftInMb": 0,
                  "storageHardInMb": 0,
                  "vmsSoft": 0,
                  "vmsHard": 0,
                  "vlansSoft": 0,
                  "vlansHard": 0,
                  "publicIpsSoft": 0,
                  "publicIpsHard": 0,
                  "links": [
                      {
                          "title": "aws_vdc",
                          "rel": "edit",
                          "type": "application/vnd.abiquo.virtualdatacenter+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
                      },
                      {
                          "title": "private networks",
                          "rel": "privatenetworks",
                          "type": "application/vnd.abiquo.vlans+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks"
                      },
                      {
                          "title": "public networks",
                          "rel": "network",
                          "type": "application/vnd.abiquo.vlans+json",
                          "href": "https://example.com:443/api/admin/datacenters/2/network"
                      },
                      {
                          "rel": "asynctasks",
                          "type": "application/vnd.abiquo.asynctasks+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/asynctasks"
                      },
                      {
                          "title": "default_private_network",
                          "rel": "defaultvlan",
                          "type": "application/vnd.abiquo.vlan+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2842"
                      },
                      {
                          "title": "Video_enterprise",
                          "rel": "enterprise",
                          "type": "application/vnd.abiquo.enterprise+json",
                          "href": "https://example.com:443/api/admin/enterprises/15"
                      },
                      {
                          "title": "virtual appliances",
                          "rel": "virtualappliances",
                          "type": "application/vnd.abiquo.virtualappliances+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances"
                      },
                      {
                          "title": "private ips",
                          "rel": "privateips",
                          "type": "application/vnd.abiquo.privateips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/action/privateips"
                      },
                      {
                          "title": "external ips",
                          "rel": "externalips",
                          "type": "application/vnd.abiquo.externalips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/action/externalips"
                      },
                      {
                          "title": "unmanaged ips",
                          "rel": "unmanagedips",
                          "type": "application/vnd.abiquo.unmanagedips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/action/unmanagedips"
                      },
                      {
                          "title": "default vlan",
                          "rel": "defaultvlan",
                          "type": "application/vnd.abiquo.vlan+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/action/defaultvlan"
                      },
                      {
                          "title": "disks",
                          "rel": "disks",
                          "type": "application/vnd.abiquo.harddisks+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/disks"
                      },
                      {
                          "title": "ips to purchase",
                          "rel": "topurchase",
                          "type": "application/vnd.abiquo.publicips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/topurchase"
                      },
                      {
                          "title": "ips purchased",
                          "rel": "purchased",
                          "type": "application/vnd.abiquo.publicips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased"
                      },
                      {
                          "title": "volumes",
                          "rel": "volumes",
                          "type": "application/vnd.abiquo.volumes+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/volumes"
                      },
                      {
                          "title": "tiers",
                          "rel": "tiers",
                          "type": "application/vnd.abiquo.tiers+json",
                          "href": "https://example.com:443/api/cloud/locations/2/tiers"
                      },
                      {
                          "title": "available templates",
                          "rel": "templates",
                          "type": "application/vnd.abiquo.virtualmachinetemplates+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/action/templates"
                      },
                      {
                          "title": "all virtual machines",
                          "rel": "virtualmachines",
                          "type": "application/vnd.abiquo.virtualmachines+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/action/virtualmachines"
                      },
                      {
                          "title": "000AmazonDC-IReland",
                          "rel": "region",
                          "type": "application/vnd.abiquo.region+json",
                          "href": "https://example.com:443/api/config/hypervisortypes/AMAZON/regions/eu-west-1"
                      },
                      {
                          "title": "amazon-device",
                          "rel": "device",
                          "type": "application/vnd.abiquo.device+json",
                          "href": "https://example.com:443/api/cloud/locations/2/devices/1"
                      },
                      {
                          "title": "firewalls",
                          "rel": "firewalls",
                          "type": "application/vnd.abiquo.firewallpolicies+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/firewalls"
                      },
                      {
                          "title": "load balancers",
                          "rel": "loadbalancers",
                          "type": "application/vnd.abiquo.loadbalancers+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/loadbalancers"
                      },
                      {
                          "title": "vpns",
                          "rel": "vpns",
                          "type": "application/vnd.abiquo.vpnsipsec+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/vpns"
                      },
                      {
                          "title": "000AmazonDC-IReland",
                          "rel": "location",
                          "type": "application/vnd.abiquo.publiccloudregion+json",
                          "href": "https://example.com:443/api/cloud/locations/2"
                      },
                      {
                          "title": "tasks",
                          "rel": "tasks",
                          "type": "application/vnd.abiquo.tasks+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/tasks"
                      },
                      {
                          "title": "location limit",
                          "rel": "limit",
                          "type": "application/vnd.abiquo.limit+json",
                          "href": "https://example.com:443/api/admin/enterprises/15/limits/116"
                      },
                      {
                          "title": "externalnetworks",
                          "rel": "externalnetworks",
                          "type": "application/vnd.abiquo.vlans+json",
                          "href": "https://example.com:443/api/admin/enterprises/15/limits/116/externalnetworks"
                      },
                      {
                          "title": "virtual appliances specs",
                          "rel": "vappspecs",
                          "type": "application/vnd.abiquo.virtualappliancespecs+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/vappspecs"
                      },
                      {
                          "title": "Dollar - $",
                          "rel": "currency",
                          "type": "application/vnd.abiquo.currency+json",
                          "href": "https://example.com:443/api/config/currencies/1"
                      },
                      {
                          "title": "alarmssearch",
                          "rel": "alarmssearch",
                          "type": "application/vnd.abiquo.alarms+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/alarms"
                      },
                      {
                          "title": "default",
                          "rel": "defaultfirewallpolicy",
                          "type": "application/vnd.abiquo.firewallpolicy+json",
                          "href": "https://example.com:443/api/cloud/locations/2/devices/1/firewalls/1010"
                      }
                  ],
                  "ramSoft": 0,
                  "ramHard": 0,
                  "cpuSoft": 0,
                  "cpuHard": 0
              }
          ]
      }
    4. Keep the location link from the virtual datacenter to sync IPs and obtain a new IP

      				{
                          "title": "000AmazonDC-IReland",
                          "rel": "location",
                          "type": "application/vnd.abiquo.publiccloudregion+json",
                          "href": "https://example.com:443/api/cloud/locations/2"
                      },
    5. Keep the edit link of the virtual datacenter to attach the IP directly to the VDC

                      {
                          "title": "aws_vdc",
                          "rel": "edit",
                          "type": "application/vnd.abiquo.virtualdatacenter+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
                      },
    6. Also keep the "purchased" public IPs link for the VDC

                      {
                          "title": "ips purchased",
                          "rel": "purchased",
                          "type": "application/vnd.abiquo.publicips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased"
                      },
  3. Synchronize floating IPs in the public cloud region
    1. cURL

      curl -X GET https://example.com:443/api/cloud/locations/2/ips?source=remote \
           -H 'Accept:application/vnd.abiquo.publicips+json; version=4.7' \
           -u user:password --verbose
    2. In our location, the platform returned an empty collection with no IPs. Success status code: 200
  4. Obtain a floating IP
    1. To create an IP and attach it to the VDC in a single step, send a link with a "rel" value of "virtualdatacenter" in the body of the request. Use the URL from the edit link of the VDC and change the "rel" value. If you don't supply this link, then you will need to perform a PUT request to update the IP to add it to the VDC before you use it

      {
        "links": [
          {
             "rel": "virtualdatacenter",
             "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
          }
        ]
      }
    2. cURL

      curl -X POST http://example.com:443/api/cloud/locations/2/ips \
           -H 'Accept:application/vnd.abiquo.publicip+json; version=4.7' \
           -H 'Content-Type:application/vnd.abiquo.links+json; version=4.7' \
           -d @requestpayload.json \
           -u user:password --verbose
    3. Sample response. Success status code: 201

       Click here to expand...
      {
          "available": true,
          "id": 15182,
          "ip": "63.34.102.64",
          "ipv6": false,
          "quarantine": false,
          "providerId": "eipalloc-0ca9c55ba5611e0de",
          "links": [
              {
                  "title": "000AmazonDC-IReland",
                  "rel": "location",
                  "type": "application/vnd.abiquo.publiccloudregion+json",
                  "href": "https://example.com:443/api/cloud/locations/2"
              },
              {
                  "title": "63.34.102.64",
                  "rel": "self",
                  "type": "application/vnd.abiquo.publicip+json",
                  "href": "https://example.com:443/api/cloud/locations/2/ips/15182"
              },
              {
                  "title": "aws_vdc",
                  "rel": "virtualdatacenter",
                  "type": "application/vnd.abiquo.virtualdatacenter+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
              }
          ]
      }
  5. Get the purchased public IPs in the virtual datacenter
    1. Use the link from when you created the VDC
    2. cURL

      curl -X GET https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased \
           -H 'Accept:application/vnd.abiquo.publicips+json; version=4.7' \
           -u user:password --verbose
    3. Sample response. Success status code: 200

       Click here to expand...
      {
          "totalSize": 2,
          "links": [
              {
                  "rel": "first",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased?limit=25&by=ip&asc=true"
              },
              {
                  "rel": "last",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased?startwith=0&limit=25&by=ip&asc=true"
              }
          ],
          "collection": [
              {
                  "available": false,
                  "id": 15179,
                  "ip": "34.247.150.44",
                  "mac": "02:78:7d:BE:A9:81",
                  "name": "02787dBEA981_host",
                  "ipv6": false,
                  "usedBy": "eni-0526fbe84fdf23002",
                  "quarantine": false,
                  "providerId": "eipalloc-002cce5483182c1ea",
                  "links": [
                      {
                          "title": "000AmazonDC-IReland",
                          "rel": "location",
                          "type": "application/vnd.abiquo.publiccloudregion+json",
                          "href": "https://example.com:443/api/cloud/locations/2"
                      },
                      {
                          "title": "34.247.150.44",
                          "rel": "ip",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/locations/2/ips/15179"
                      },
                      {
                          "title": "purchased ips",
                          "rel": "purchased",
                          "type": "application/vnd.abiquo.publicips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased"
                      },
                      {
                          "title": "release ip",
                          "rel": "release",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/topurchase/15179"
                      },
                      {
                          "title": "34.247.150.44",
                          "rel": "self",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased/15179"
                      },
                      {
                          "title": "aws_vdc",
                          "rel": "virtualdatacenter",
                          "type": "application/vnd.abiquo.virtualdatacenter+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
                      }
                  ]
              },
              {
                  "available": true,
                  "id": 15182,
                  "ip": "63.34.102.64",
                  "ipv6": false,
                  "quarantine": false,
                  "providerId": "eipalloc-0ca9c55ba5611e0de",
                  "links": [
                      {
                          "title": "000AmazonDC-IReland",
                          "rel": "location",
                          "type": "application/vnd.abiquo.publiccloudregion+json",
                          "href": "https://example.com:443/api/cloud/locations/2"
                      },
                      {
                          "title": "63.34.102.64",
                          "rel": "ip",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/locations/2/ips/15182"
                      },
                      {
                          "title": "purchased ips",
                          "rel": "purchased",
                          "type": "application/vnd.abiquo.publicips+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased"
                      },
                      {
                          "title": "release ip",
                          "rel": "release",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/topurchase/15182"
                      },
                      {
                          "title": "63.34.102.64",
                          "rel": "self",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased/15182"
                      },
                      {
                          "title": "aws_vdc",
                          "rel": "virtualdatacenter",
                          "type": "application/vnd.abiquo.virtualdatacenter+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
                      }
                  ]
              }
          ]
      }
    4. The above response shows the public IP that AWS uses for NAT, which is not available for use on a VM. And the IP that we purchased earlier, which is available

    5. Keep the "self" link of the purchased public IP

                      {
                          "title": "63.34.102.64",
                          "rel": "self",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased/15182"
                      },
  6. Retrieve the VM object again, using the URL from the VM edit link. Keep the VM object
  7. Prepare the NIC link to add the NIC to the VM
    1. Change the "rel" value to "nicX" so that the public IP is added after the IP with the highest number. In this case, it will be nic1.

                      {
                          "title": "63.34.102.64",
                          "rel": "nic1",
                          "type": "application/vnd.abiquo.publicip+json",
                          "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased/15182"
                      },
    2. Add the nic link to the VM object

       Click here to expand...
      {
          "id": 16767,
          "uuid": "90b52e0e-7b96-4721-abfc-47bd746443f3",
          "description": "Amazon Linux AMI 2018.03.0.20190611 x86_64 HVM gp2",
          "coresPerSocket": 1,
          "idState": 1,
          "idType": 0,
          "type": "MANAGED",
          "highDisponibility": 0,
          "metadata": {
              "monitoring-metrics": [
                  {
                      "name": "CPUUtilization"
                  },
                  {
                      "name": "StatusCheckFailed"
                  },
                  {
                      "name": "StatusCheckFailed_Instance"
                  },
                  {
                      "name": "NetworkOut"
                  },
                  {
                      "name": "NetworkIn"
                  },
                  {
                      "name": "abq-ram_usage"
                  },
                  {
                      "name": "DiskWriteOps"
                  },
                  {
                      "name": "StatusCheckFailed_System"
                  },
                  {
                      "name": "DiskWriteBytes"
                  },
                  {
                      "name": "DiskReadBytes"
                  },
                  {
                      "name": "DiskReadOps"
                  },
                  {
                      "name": "abq-cpu_usage"
                  }
              ]
          },
          "monitored": true,
          "protected": false,
          "variables": {},
          "backuppolicies": [],
          "generateGuestInitialPassword": false,
          "natrules": [],
          "vdrpEnabled": true,
          "vdrpPort": 0,
          "password": "uy3S0IcA",
          "deallocated": false,
          "name": "ABQ_90b52e0e-7b96-4721-abfc-47bd746443f3",
          "label": "awsvm",
          "ram": 630,
          "cpu": 1,
          "state": "NOT_ALLOCATED",
          "creationTimestamp": 1578071240000,
          "iconUrl": "http://icons.abiquo.com/AWS-icon.png",
          "links": [
              {
                  "title": "Video_enterprise",
                  "rel": "enterprise",
                  "type": "application/vnd.abiquo.enterprise+json",
                  "href": "https://example.com:443/api/admin/enterprises/15"
              },
              {
                  "title": "ABQ_90b52e0e-7b96-4721-abfc-47bd746443f3",
                  "rel": "edit",
                  "type": "application/vnd.abiquo.virtualmachine+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767"
              },
              {
                  "title": "send mail",
                  "rel": "sendmail",
                  "type": "application/vnd.abiquo.mail+json",
                  "href": "https://example.com:443/api/admin/publiccloudregions/2/enterprises/15/virtualmachines/16767/action/sendmail"
              },
              {
                  "title": "cloudadmin cloudadmin",
                  "rel": "user",
                  "type": "application/vnd.abiquo.user+json",
                  "href": "https://example.com:443/api/admin/enterprises/15/users/10"
              },
              {
                  "title": "aws_vdc",
                  "rel": "virtualdatacenter",
                  "type": "application/vnd.abiquo.virtualdatacenter+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100"
              },
              {
                  "title": "aws_vapp",
                  "rel": "virtualappliance",
                  "type": "application/vnd.abiquo.virtualappliance+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620"
              },
              {
                  "title": "metadata",
                  "rel": "metadata",
                  "type": "application/vnd.abiquo.metadata+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/metadata"
              },
              {
                  "title": "vlan network configurations",
                  "rel": "configurations",
                  "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/network/configurations"
              },
              {
                  "title": "nics",
                  "rel": "nics",
                  "type": "application/vnd.abiquo.nics+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/network/nics"
              },
              {
                  "title": "disks",
                  "rel": "harddisks",
                  "type": "application/vnd.abiquo.harddisks+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/storage/disks"
              },
              {
                  "title": "NOT_ALLOCATED",
                  "rel": "state",
                  "type": "application/vnd.abiquo.virtualmachinestate+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/state"
              },
              {
                  "title": "virtual machine undeploy",
                  "rel": "undeploy",
                  "type": "application/vnd.abiquo.acceptedrequest+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/undeploy"
              },
              {
                  "title": "virtual machine deploy",
                  "rel": "deploy",
                  "type": "application/vnd.abiquo.acceptedrequest+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/deploy"
              },
              {
                  "title": "virtual machine reset",
                  "rel": "reset",
                  "type": "application/vnd.abiquo.acceptedrequest+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/reset"
              },
              {
                  "title": "virtual machine snapshot",
                  "rel": "instance",
                  "type": "application/vnd.abiquo.acceptedrequest+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/instance"
              },
              {
                  "title": "remote access",
                  "rel": "rdpaccess",
                  "type": "application/vnd.abiquo.virtualmachineconsole+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/config/rdpaccess"
              },
              {
                  "title": "tasks",
                  "rel": "tasks",
                  "type": "application/vnd.abiquo.tasks+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/tasks"
              },
              {
                  "title": "firewalls",
                  "rel": "firewalls",
                  "type": "application/vnd.abiquo.links+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/firewalls"
              },
              {
                  "title": "load balancers",
                  "rel": "loadbalancers",
                  "type": "application/vnd.abiquo.loadbalancers+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/loadbalancers"
              },
              {
                  "title": "request on demand backup",
                  "rel": "requestbackup",
                  "type": "application/vnd.abiquo.ondemandbackup+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/backup/action/request"
              },
              {
                  "title": "request a restore of a backup",
                  "rel": "requestrestore",
                  "type": "application/vnd.abiquo.restore+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/backup/action/restore"
              },
              {
                  "title": "move VM to a virtual appliance",
                  "rel": "vappmove",
                  "type": "application/vnd.abiquo.links+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/vappmove"
              },
              {
                  "title": "move VM to another virtual datacenter",
                  "rel": "move",
                  "type": "application/vnd.abiquo.movevm+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/move"
              },
              {
                  "title": "default",
                  "rel": "firewall",
                  "type": "application/vnd.abiquo.firewallpolicy+json",
                  "href": "https://example.com:443/api/cloud/locations/2/devices/1/firewalls/1010"
              },
              {
                  "title": "volumes",
                  "rel": "volumes",
                  "type": "application/vnd.abiquo.volumes+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/storage/volumes"
              },
              {
                  "title": "t1.micro",
                  "rel": "hardwareprofile",
                  "type": "application/vnd.abiquo.hardwareprofile+json",
                  "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/39579"
              },
              {
                  "diskControllerType": "IDE",
                  "length": "8192",
                  "title": "07c0d9ae-65ba-4e61-8722-8c61ce480819",
                  "rel": "disk0",
                  "type": "application/vnd.abiquo.harddisk+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/disks/15180"
              },
              {
                  "title": "192.168.1.5",
                  "rel": "nic0",
                  "type": "application/vnd.abiquo.privateip+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/privatenetworks/2843/ips/15183"
              },
              {
                  "title": "63.34.102.64",
                  "rel": "nic1",
                  "type": "application/vnd.abiquo.publicip+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/publicips/purchased/15182"
              },
              {
                  "title": "protect",
                  "rel": "protect",
                  "type": "text/plain",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/protect"
              },
              {
                  "title": "unprotect",
                  "rel": "unprotect",
                  "type": "text/plain",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/unprotect"
              },
              {
                  "title": "metricsmetadata",
                  "rel": "metricsmetadata",
                  "type": "application/vnd.abiquo.metricsmetadata+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/metrics"
              },
              {
                  "title": "enablemonitoringlevel",
                  "rel": "enablemonitoringlevel",
                  "type": "application/vnd.abiquo.monitoringlevel+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/enablemonitoringlevel"
              },
              {
                  "title": "disablemonitoring",
                  "rel": "disablemonitoring",
                  "type": "",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/disablemonitoring"
              },
              {
                  "title": "collectd",
                  "rel": "collectd",
                  "type": "application/json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/metrics/collectd"
              },
              {
                  "title": "alarmssearch",
                  "rel": "alarmssearch",
                  "type": "application/vnd.abiquo.alarms+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/alarms"
              },
              {
                  "title": "clone",
                  "rel": "clone",
                  "type": "application/vnd.abiquo.virtualmachinecloneoptions+json",
                  "href": "https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767/action/clone"
              },
              {
                  "title": "eu-west-1c",
                  "rel": "availabilityzone",
                  "type": "application/vnd.abiquo.availabilityzone+json",
                  "href": "https://example.com:443/api/cloud/locations/2/availabilityzones/33"
              },
              {
                  "title": "Amazon",
                  "rel": "hypervisortype",
                  "type": "application/vnd.abiquo.hypervisortype+json",
                  "href": "https://example.com:443/api/config/hypervisortypes/AMAZON"
              },
              {
                  "title": "amzn-ami-hvm-2018.03.0.20190611-x86_64-gp2",
                  "rel": "virtualmachinetemplate",
                  "type": "application/vnd.abiquo.virtualmachinetemplate+json",
                  "href": "https://example.com:443/api/admin/enterprises/15/datacenterrepositories/2/virtualmachinetemplates/1927"
              },
              {
                  "title": "Others",
                  "rel": "category",
                  "type": "application/vnd.abiquo.category+json",
                  "href": "https://example.com:443/api/config/categories/1"
              }
          ],
          "usageStatistics": []
      }
  8. Update the VM to add the public IP
    1. cURL

      curl -X PUT https://example.com:443/api/cloud/virtualdatacenters/2100/virtualappliances/2620/virtualmachines/16767 \ 
      	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.7' \ 
      	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.7' \ 
      	 -d @requestpayload.xml \ 
      	 -u user:password --verbose 
    2. Success status code for an undeployed VM: 204 - No Content

How to remove the IP address from the VM

To remove the public IP address from the VM, remove the NIC from the VM entity and perform another PUT request to the VM link.

How to release the IP address from the platform

To release the IP from the platform, you do not need to remove it from the VDC first. Just perform a DELETE request to the URL of the self link of the IP in the location. 

curl -X DELETE https://example.com:443/api/cloud/locations/2/ips/15182 \
     -u user:password --verbose

The successful request will return a status code of 204 with no content.