Abiquo 5.0

Skip to end of metadata
Go to start of metadata

This tutorial shows how to reconfigure a VM to add a NIC using the API. This tutorial should be used in a test environment. You can set up the following basic environment in the GUI and then work on the tutorial using the API. After you have finished, you should see the new NIC on your VM in the UI.

Prerequisites

To work through this tutorial, you will need:

  • A deployed VM that is powered off (unless you are working with hot-add / hot-reconfigure enabled on ESXi)
    • Optional: a second VM that contains the type of IP that you would like to add so you can easily check the network configuration of your VM
  • A private or external network with just a few NICs created and in the case of an external network, made available to users 
  • The API IDs of your enterprise and datacenter, which you can find using the UI (in the Browser console) or the API
  • User with appropriate privileges. If you work with a CLOUD_ADMIN or ENTERPRISE_ADMIN user, no extra privileges are required. Otherwise, the user will need the following, as defined in Manage Roles#Privileges table
    • ROLE_VDC_ENUMERATE
    • ROLE_VAPP_CUSTOMISE_SETTINGS
    • ROLE_VDC_MANAGE_VAPP
    • VDC_MANAGE_NETWORK 

Preparation

Retrieve all of your VMs from the cloud and select the desired VM.

Get all VMs

Get all the VMs that you can access in your enterprise in the cloud. If you are the cloud admin, and you can't see the right machines, you may need to switch enterprise. Choose the VM that you wish to reconfigure. The following example contains two VMs. One of the machines has a NIC in an external network attached. The other machine only has one NIC in a private network.

Notice that the VM contains links with valuable information about the datacenter, rack, machine, enterprise, virtualdatacenter and so on.

API Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource VirtualMachineResource.

GET all Virtual Machines in the Cloud
* No special privileges are required to get all the VMs that your user can access
curl -X GET https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualmachines \
	-H "Accept: application/vnd.abiquo.virtualmachines+json; version=4.2" \ 
	-u user:password --verbose | pjson
 Click here to show or hide the API response example

Success status code: 200

Response:

{
    "links": [
        {
            "rel": "first",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualmachines?limit=25&by=name&asc=true"
        },
        {
            "rel": "last",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualmachines?startwith=0&limit=25&by=name&asc=true"
        }
    ],
    "collection": [
        {
            "id": 88,
            "uuid": "365c53e0-0b8a-4e3a-964c-8b057e55ad6e",
            "name": "ABQ_365c53e0-0b8a-4e3a-964c-8b057e55ad6e",
            "label": "yVM_MJ",
            "description": "A virtual machine",
            "cpu": 1,
            "ram": 48,
            "vdrpEnabled": true,
            "vdrpPort": 5901,
            "vdrpIP": "10.60.13.190",
            "idState": 6,
            "state": "OFF",
            "idType": 0,
            "type": "MANAGED",
            "highDisponibility": 0,
            "password": "OTIFepkU",
            "metadata": null,
            "monitored": false,
            "protected": false,
            "variables": {},
            "creationTimestamp": 1510093594000,
            "backuppolicies": [],
            "lastSynchronize": 1510571079000,
            "generateGuestInitialPassword": false,
            "links": [
                {
                    "title": "KVM",
                    "rel": "machine",
                    "type": "application/vnd.abiquo.machine+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1"
                },
                {
                    "title": "BCDC",
                    "rel": "location",
                    "type": "application/vnd.abiquo.datacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1"
                },
                {
                    "title": "ABQ_365c53e0-0b8a-4e3a-964c-8b057e55ad6e",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.virtualmachine+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88"
                },
                {
                    "title": "send mail",
                    "rel": "sendmail",
                    "type": "application/vnd.abiquo.mail+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1/virtualmachines/88/action/sendmail"
                },
                {
                    "title": "Abiquo",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
                },
                {
                    "title": "Cloud Administrator",
                    "rel": "user",
                    "type": "application/vnd.abiquo.user+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1"
                },
                {
                    "title": "bcdcvdc01",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
                },
                {
                    "title": "vapp_bcdcvdc01",
                    "rel": "virtualappliance",
                    "type": "application/vnd.abiquo.virtualappliance+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1"
                },
                {
                    "title": "metadata",
                    "rel": "metadata",
                    "type": "application/vnd.abiquo.metadata+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/metadata"
                },
                {
                    "title": "vlan network configurations",
                    "rel": "configurations",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/network/configurations"
                },
                {
                    "title": "192.168.0.0/24",
                    "rel": "network_configuration",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfiguration+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/network/configurations/1"
                },
                {
                    "title": "nics",
                    "rel": "nics",
                    "type": "application/vnd.abiquo.nics+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/network/nics"
                },
                {
                    "title": "disks",
                    "rel": "harddisks",
                    "type": "application/vnd.abiquo.harddisks+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/storage/disks"
                },
                {
                    "title": "OFF",
                    "rel": "state",
                    "type": "application/vnd.abiquo.virtualmachinestate+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/state"
                },
                {
                    "title": "virtual machine undeploy",
                    "rel": "undeploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/undeploy"
                },
                {
                    "title": "virtual machine deploy",
                    "rel": "deploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/deploy"
                },
                {
                    "title": "virtual machine reset",
                    "rel": "reset",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/reset"
                },
                {
                    "title": "virtual machine snapshot",
                    "rel": "instance",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/instance"
                },
                {
                    "title": "remote access",
                    "rel": "rdpaccess",
                    "type": "application/vnd.abiquo.virtualmachineconsole+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/config/rdpaccess"
                },
                {
                    "title": "tasks",
                    "rel": "tasks",
                    "type": "application/vnd.abiquo.tasks+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/tasks"
                },
                {
                    "title": "firewalls",
                    "rel": "firewalls",
                    "type": "application/vnd.abiquo.links+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/firewalls"
                },
                {
                    "title": "load balancers",
                    "rel": "loadbalancers",
                    "type": "application/vnd.abiquo.loadbalancers+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/loadbalancers"
                },
                {
                    "title": "request on demand backup",
                    "rel": "requestbackup",
                    "type": "application/vnd.abiquo.ondemandbackup+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/backup/action/request"
                },
                {
                    "title": "request a restore of a backup",
                    "rel": "requestrestore",
                    "type": "application/vnd.abiquo.restore+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/backup/action/restore"
                },
                {
                    "title": "volumes",
                    "rel": "volumes",
                    "type": "application/vnd.abiquo.volumes+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/storage/volumes"
                },
                {
                    "diskControllerType": "IDE",
                    "diskLabel": "Hard disk 1",
                    "length": "64",
                    "title": "3f55a906-c0dc-41e4-885f-933a838563a8",
                    "rel": "disk0",
                    "type": "application/vnd.abiquo.harddisk+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/disks/76"
                },
                {
                    "title": "Default Tier",
                    "rel": "datastoretier0",
                    "type": "application/vnd.abiquo.datastoretier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/1"
                },
                {
                    "title": "192.168.0.2",
                    "rel": "nic0",
                    "type": "application/vnd.abiquo.privateip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/4"
                },
                {
                    "title": "protect",
                    "rel": "protect",
                    "type": "text/plain",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/protect"
                },
                {
                    "title": "unprotect",
                    "rel": "unprotect",
                    "type": "text/plain",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/unprotect"
                },
                {
                    "title": "metricsmetadata",
                    "rel": "metricsmetadata",
                    "type": "application/vnd.abiquo.metricsmetadata+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/metrics"
                },
                {
                    "title": "enablemonitoring",
                    "rel": "enablemonitoring",
                    "type": "",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/enablemonitoring"
                },
                {
                    "title": "collectd",
                    "rel": "collectd",
                    "type": "application/json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/metrics/collectd"
                },
                {
                    "title": "alarms",
                    "rel": "alarms",
                    "type": "application/vnd.abiquo.alarms+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/alarms"
                },
                {
                    "title": "actionplans",
                    "rel": "actionplans",
                    "type": "application/vnd.abiquo.virtualmachineactionplans+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/actionplans"
                },
                {
                    "title": "actionplansflat",
                    "rel": "actionplansflat",
                    "type": "application/vnd.abiquo.virtualmachineactionplansflat+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/actionplans"
                },
                {
                    "title": "clone",
                    "rel": "clone",
                    "type": "application/vnd.abiquo.virtualmachinecloneoptions+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/clone"
                },
                {
                    "title": "KVM",
                    "rel": "hypervisortype",
                    "type": "application/vnd.abiquo.hypervisortype+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/KVM"
                },
                {
                    "title": "yVM_MJ",
                    "rel": "virtualmachinetemplate",
                    "type": "application/vnd.abiquo.virtualmachinetemplate+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/76"
                },
                {
                    "title": "Others",
                    "rel": "category",
                    "type": "application/vnd.abiquo.category+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/categories/1"
                }
            ]
        },
        {
            "id": 89,
            "uuid": "dfcf89fa-a5a7-4b1c-82a4-6f98548761ac",
            "name": "ABQ_dfcf89fa-a5a7-4b1c-82a4-6f98548761ac",
            "label": "yVM_New",
            "description": "A virtual machine",
            "cpu": 1,
            "ram": 48,
            "vdrpEnabled": true,
            "vdrpPort": 5902,
            "vdrpIP": "10.60.13.190",
            "idState": 6,
            "state": "OFF",
            "idType": 0,
            "type": "MANAGED",
            "highDisponibility": 0,
            "password": "o8sWRl0I",
            "metadata": null,
            "monitored": false,
            "protected": false,
            "variables": {},
            "creationTimestamp": 1510097773000,
            "backuppolicies": [],
            "lastSynchronize": 1510571087000,
            "generateGuestInitialPassword": false,
            "links": [
                {
                    "title": "KVM",
                    "rel": "machine",
                    "type": "application/vnd.abiquo.machine+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1"
                },
                {
                    "title": "BCDC",
                    "rel": "location",
                    "type": "application/vnd.abiquo.datacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1"
                },
                {
                    "title": "ABQ_dfcf89fa-a5a7-4b1c-82a4-6f98548761ac",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.virtualmachine+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89"
                },
                {
                    "title": "send mail",
                    "rel": "sendmail",
                    "type": "application/vnd.abiquo.mail+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1/virtualmachines/89/action/sendmail"
                },
                {
                    "title": "Abiquo",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
                },
                {
                    "title": "Cloud Administrator",
                    "rel": "user",
                    "type": "application/vnd.abiquo.user+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1"
                },
                {
                    "title": "bcdcvdc01",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
                },
                {
                    "title": "vapp_bcdcvdc01",
                    "rel": "virtualappliance",
                    "type": "application/vnd.abiquo.virtualappliance+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1"
                },
                {
                    "title": "metadata",
                    "rel": "metadata",
                    "type": "application/vnd.abiquo.metadata+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/metadata"
                },
                {
                    "title": "vlan network configurations",
                    "rel": "configurations",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/network/configurations"
                },
                {
                    "title": "192.168.0.0/24",
                    "rel": "network_configuration",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfiguration+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/network/configurations/1"
                },
                {
                    "title": "nics",
                    "rel": "nics",
                    "type": "application/vnd.abiquo.nics+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/network/nics"
                },
                {
                    "title": "disks",
                    "rel": "harddisks",
                    "type": "application/vnd.abiquo.harddisks+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/storage/disks"
                },
                {
                    "title": "OFF",
                    "rel": "state",
                    "type": "application/vnd.abiquo.virtualmachinestate+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/state"
                },
                {
                    "title": "virtual machine undeploy",
                    "rel": "undeploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/action/undeploy"
                },
                {
                    "title": "virtual machine deploy",
                    "rel": "deploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/action/deploy"
                },
                {
                    "title": "virtual machine reset",
                    "rel": "reset",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/action/reset"
                },
                {
                    "title": "virtual machine snapshot",
                    "rel": "instance",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/action/instance"
                },
                {
                    "title": "remote access",
                    "rel": "rdpaccess",
                    "type": "application/vnd.abiquo.virtualmachineconsole+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/config/rdpaccess"
                },
                {
                    "title": "tasks",
                    "rel": "tasks",
                    "type": "application/vnd.abiquo.tasks+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/tasks"
                },
                {
                    "title": "firewalls",
                    "rel": "firewalls",
                    "type": "application/vnd.abiquo.links+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/firewalls"
                },
                {
                    "title": "load balancers",
                    "rel": "loadbalancers",
                    "type": "application/vnd.abiquo.loadbalancers+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/loadbalancers"
                },
                {
                    "title": "request on demand backup",
                    "rel": "requestbackup",
                    "type": "application/vnd.abiquo.ondemandbackup+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/backup/action/request"
                },
                {
                    "title": "request a restore of a backup",
                    "rel": "requestrestore",
                    "type": "application/vnd.abiquo.restore+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/backup/action/restore"
                },
                {
                    "title": "volumes",
                    "rel": "volumes",
                    "type": "application/vnd.abiquo.volumes+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/storage/volumes"
                },
                {
                    "diskControllerType": "IDE",
                    "diskLabel": "Hard disk 1",
                    "length": "64",
                    "title": "5a0b6a14-aa89-477b-bf0a-53a711e02487",
                    "rel": "disk0",
                    "type": "application/vnd.abiquo.harddisk+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/disks/80"
                },
                {
                    "title": "Default Tier",
                    "rel": "datastoretier0",
                    "type": "application/vnd.abiquo.datastoretier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/1"
                },
                {
                    "title": "192.168.0.3",
                    "rel": "nic0",
                    "type": "application/vnd.abiquo.privateip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/81"
                },
                {
                    "title": "protect",
                    "rel": "protect",
                    "type": "text/plain",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/action/protect"
                },
                {
                    "title": "unprotect",
                    "rel": "unprotect",
                    "type": "text/plain",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/action/unprotect"
                },
                {
                    "title": "metricsmetadata",
                    "rel": "metricsmetadata",
                    "type": "application/vnd.abiquo.metricsmetadata+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/metrics"
                },
                {
                    "title": "enablemonitoring",
                    "rel": "enablemonitoring",
                    "type": "",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/enablemonitoring"
                },
                {
                    "title": "collectd",
                    "rel": "collectd",
                    "type": "application/json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/metrics/collectd"
                },
                {
                    "title": "alarms",
                    "rel": "alarms",
                    "type": "application/vnd.abiquo.alarms+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/alarms"
                },
                {
                    "title": "actionplans",
                    "rel": "actionplans",
                    "type": "application/vnd.abiquo.virtualmachineactionplans+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/actionplans"
                },
                {
                    "title": "actionplansflat",
                    "rel": "actionplansflat",
                    "type": "application/vnd.abiquo.virtualmachineactionplansflat+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/actionplans"
                },
                {
                    "title": "clone",
                    "rel": "clone",
                    "type": "application/vnd.abiquo.virtualmachinecloneoptions+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/89/action/clone"
                },
                {
                    "title": "KVM",
                    "rel": "hypervisortype",
                    "type": "application/vnd.abiquo.hypervisortype+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/KVM"
                },
                {
                    "title": "yVM_MJ",
                    "rel": "virtualmachinetemplate",
                    "type": "application/vnd.abiquo.virtualmachinetemplate+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/76"
                },
                {
                    "title": "Others",
                    "rel": "category",
                    "type": "application/vnd.abiquo.category+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/categories/1"
                }
            ]
        }
    ],
    "totalSize": 2
}

Retrieve IP addresses

To attach a NIC, first decide whether you wish to attach it in a datacenter network (public, external, unmanaged) or virtualdatacenter network (private) and do the steps in the following sections. When you retrieve the required IP, you will need to copy its "self" link to create the link to the IP in the VM. 

Available IPs

 In Abiquo public and external networks, "available" IPs are the IPs that users can obtain for their virtual datacenter networks. Administrators can make Available (or Unavailable) the IPs in public and external networks. In this tutorial, we distinguish between IPs that are "available" and IPs that are "not in use"

Retrieve Available IPs from External Networks in an Enterprise's Datacenter

A cloud admin can retrieve the external networks directly from the datacenter. An enterprise administrator can retrieve external networks using the enterprise limits and this is the approach we will use here. 

Retrieve the limits for the enterprise. There should be one limit for each datacenter or public cloud region (location) that the enterprise can access. In this case, the enterprise id = 1 and the datacenter id = 1.

* Roles required are: ROLE_USERS_MANAGE_ENTERPRISE, ROLE_VDC_ENUMERATE, ROLE_APPLIB_VIEW, ROLE_PHYS_DC_ALLOW_MODIFY_NETWORK
curl -X GET http://mjsabiquo.bcn.abiquo.com/api/admin/enterprises/1/limits \
	-H 'Accept: application/vnd.abiquo.limits+json;version=4.2' \
	-u user:password --verbose 
 Click here to expand...

Success status code: 200

Response:

{
    "links": [],
    "collection": [
        {
            "id": 1,
            "enabledHardwareProfiles": false,
            "links": [
                {
                    "title": "Abiquo",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
                },
                {
                    "title": "edit datacenter limits 1",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.limit+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1"
                },
                {
                    "title": "external networks",
                    "rel": "externalnetworks",
                    "type": "application/vnd.abiquo.vlans+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks"
                },
                {
                    "title": "virtualappliances",
                    "rel": "action",
                    "type": "application/vnd.abiquo.virtualappliances+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/action/virtualappliances"
                },
                {
                    "title": "BCDC",
                    "rel": "location",
                    "type": "application/vnd.abiquo.datacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1"
                },
                {
                    "title": "Default Tier 1",
                    "rel": "tier",
                    "type": "application/vnd.abiquo.tier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/storage/tiers/1"
                },
                {
                    "title": "Default Tier 2",
                    "rel": "tier",
                    "type": "application/vnd.abiquo.tier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/storage/tiers/2"
                },
                {
                    "title": "Default Tier 3",
                    "rel": "tier",
                    "type": "application/vnd.abiquo.tier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/storage/tiers/3"
                },
                {
                    "title": "Default Tier 4",
                    "rel": "tier",
                    "type": "application/vnd.abiquo.tier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/storage/tiers/4"
                },
                {
                    "title": "Default Tier",
                    "rel": "datastoretier",
                    "type": "application/vnd.abiquo.datastoretier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/datastoretiers/1"
                },
                {
                    "title": "Gold tier",
                    "rel": "datastoretier",
                    "type": "application/vnd.abiquo.datastoretier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/datastoretiers/2"
                },
                {
                    "title": "a2",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/hardwareprofiles/56"
                },
                {
                    "title": "a3",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/hardwareprofiles/57"
                },
                {
                    "title": "a4",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/hardwareprofiles/58"
                },
                {
                    "title": "ABQ_HP_1_48_ec9c4cd9",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/hardwareprofiles/63"
                },
                {
                    "title": "b2",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/hardwareprofiles/59"
                },
                {
                    "title": "b3",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/hardwareprofiles/60"
                },
                {
                    "title": "b4",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/hardwareprofiles/61"
                }
            ],
            "diskSoftLimitInMb": 0,
            "diskHardLimitInMb": 0,
            "storageSoftInMb": 0,
            "storageHardInMb": 0,
            "vlansSoft": 0,
            "vlansHard": 0,
            "publicIpsSoft": 0,
            "publicIpsHard": 0,
            "repositorySoftInMb": 0,
            "repositoryHardInMb": 0,
            "ramSoft": 0,
            "ramHard": 0,
            "cpuSoft": 0,
            "cpuHard": 0
        },
        {
            "id": 2,
            "enabledHardwareProfiles": true,
            "links": [
                {
                    "title": "Abiquo",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
                },
                {
                    "title": "edit datacenter limits 2",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.limit+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/2"
                },
                {
                    "title": "external networks",
                    "rel": "externalnetworks",
                    "type": "application/vnd.abiquo.vlans+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/2/externalnetworks"
                },
                {
                    "title": "virtualappliances",
                    "rel": "action",
                    "type": "application/vnd.abiquo.virtualappliances+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/2/action/virtualappliances"
                },
                {
                    "title": "AWS",
                    "rel": "location",
                    "type": "application/vnd.abiquo.publiccloudregion+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2"
                },
                {
                    "title": "c1.medium",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/12"
                },
                {
                    "title": "c1.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/13"
                },
                {
                    "title": "c3.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/16"
                },
                {
                    "title": "c3.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/17"
                },
                {
                    "title": "c3.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/18"
                },
                {
                    "title": "c3.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/14"
                },
                {
                    "title": "c3.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/15"
                },
                {
                    "title": "c4.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/21"
                },
                {
                    "title": "c4.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/22"
                },
                {
                    "title": "c4.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/23"
                },
                {
                    "title": "c4.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/19"
                },
                {
                    "title": "c4.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/20"
                },
                {
                    "title": "cc1.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/1"
                },
                {
                    "title": "cc2.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/3"
                },
                {
                    "title": "cg1.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/2"
                },
                {
                    "title": "cr1.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/53"
                },
                {
                    "title": "d2.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/50"
                },
                {
                    "title": "d2.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/51"
                },
                {
                    "title": "d2.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/52"
                },
                {
                    "title": "d2.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/49"
                },
                {
                    "title": "g2.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/6"
                },
                {
                    "title": "g2.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/54"
                },
                {
                    "title": "hi1.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/4"
                },
                {
                    "title": "hs1.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/5"
                },
                {
                    "title": "i2.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/25"
                },
                {
                    "title": "i2.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/26"
                },
                {
                    "title": "i2.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/27"
                },
                {
                    "title": "i2.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/24"
                },
                {
                    "title": "m1.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/28"
                },
                {
                    "title": "m1.medium",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/30"
                },
                {
                    "title": "m1.small",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/29"
                },
                {
                    "title": "m1.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/31"
                },
                {
                    "title": "m2.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/33"
                },
                {
                    "title": "m2.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/34"
                },
                {
                    "title": "m2.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/32"
                },
                {
                    "title": "m3.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/38"
                },
                {
                    "title": "m3.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/36"
                },
                {
                    "title": "m3.medium",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/35"
                },
                {
                    "title": "m3.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/37"
                },
                {
                    "title": "m4.10xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/43"
                },
                {
                    "title": "m4.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/41"
                },
                {
                    "title": "m4.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/42"
                },
                {
                    "title": "m4.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/39"
                },
                {
                    "title": "m4.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/40"
                },
                {
                    "title": "r3.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/46"
                },
                {
                    "title": "r3.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/47"
                },
                {
                    "title": "r3.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/48"
                },
                {
                    "title": "r3.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/44"
                },
                {
                    "title": "r3.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/45"
                },
                {
                    "title": "t1.micro",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/7"
                },
                {
                    "title": "t2.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/11"
                },
                {
                    "title": "t2.medium",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/10"
                },
                {
                    "title": "t2.micro",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/8"
                },
                {
                    "title": "t2.nano",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/55"
                },
                {
                    "title": "t2.small",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/2/hardwareprofiles/9"
                }
            ],
            "diskSoftLimitInMb": 0,
            "diskHardLimitInMb": 0,
            "storageSoftInMb": 0,
            "storageHardInMb": 0,
            "vlansSoft": 0,
            "vlansHard": 0,
            "publicIpsSoft": 0,
            "publicIpsHard": 0,
            "repositorySoftInMb": 0,
            "repositoryHardInMb": 0,
            "ramSoft": 0,
            "ramHard": 0,
            "cpuSoft": 0,
            "cpuHard": 0
        }
    ]
}

Retrieve the external networks for the limit. You can see from the externalnetworks link in the above example that the request will retrieve the vlans DTO. 

 

* Retrieving the list of external networks for a limit requires the privileges ROLE_USERS_MANAGE_ENTERPRISE, ROLE_VDC_ENUMERATE
curl -X GET https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks \
	-H 'Accept: application/vnd.abiquo.vlans+json;version=4.2' \
	-u user:password --verbose | pjson
 Click here to expand...

Success status code: 200

Response:

{
    "links": [
        {
            "title": "default external network",
            "rel": "getdefault",
            "type": "application/vnd.abiquo.vlan+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/action/default"
        }
    ],
    "collection": [
        {
            "id": 10,
            "name": "External_NW",
            "address": "10.10.10.0",
            "mask": 24,
            "gateway": "10.10.10.1",
            "primaryDNS": "8.8.8.8",
            "secondaryDNS": "8.8.4.4",
            "tag": 10,
            "defaultNetwork": false,
            "type": "EXTERNAL",
            "dhcpOptions": {
                "links": [],
                "collection": []
            },
            "ipv6": false,
            "strict": false,
            "restricted": false,
            "internetGatewayRole": false,
            "ipRanges": [],
            "excludedFromFirewall": false,
            "links": [
                {
                    "title": "External_NW",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10"
                },
                {
                    "title": "set default",
                    "rel": "setdefault",
                    "type": "",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/action/default"
                },
                {
                    "title": "ips",
                    "rel": "ips",
                    "type": "application/vnd.abiquo.externalips+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips"
                },
                {
                    "title": "configuration",
                    "rel": "configuration",
                    "type": "application/vnd.abiquo.networkconfiguration+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/configuration"
                },
                {
                    "title": "10.10.10.0/24",
                    "rel": "network_configuration",
                    "type": "application/vnd.abiquo.networkconfiguration+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/configuration/10"
                },
                {
                    "title": "Service Network",
                    "rel": "networkservicetype",
                    "type": "application/vnd.abiquo.networkservicetype+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/networkservicetypes/1"
                },
                {
                    "title": "disable a set of ips",
                    "rel": "disableips",
                    "type": "application/vnd.abiquo.ipliterals+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10/ips/action/disable"
                },
                {
                    "title": "enable a set of ips",
                    "rel": "enableips",
                    "type": "application/vnd.abiquo.ipliterals+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10/ips/action/enable"
                },
                {
                    "title": "disable all ips",
                    "rel": "disableallips",
                    "type": "",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10/ips/action/disableall"
                },
                {
                    "title": "enable all ips",
                    "rel": "enableallips",
                    "type": "",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10/ips/action/enableall"
                }
            ]
        }
    ]
}


Retrieve the IPs in the external network. Note that an IP that is in use on a VM has extra links to the virtual datacenter, virtual appliance and VM.

In this query you can use the parameter "free=true"  to filter and retrieve only IPs that are not currently in use.

GET all IPs in an External Network in an Enterprise-Datacenter Limit
* Retrieving the list of available IPs for an external limit requires the privileges ROLE_USERS_MANAGE_ENTERPRISE, ROLE_VDC_ENUMERATE
curl -X GET 'http://abiquo.example.com/api/admin/enterprises/1/limits/1/externalnetworks/7/ips' \
 	-H 'Accept:application/vnd.abiquo.externalips+json;version=4.2' \ 
	-u user:password --verbose | pjson
 Click here to show or hide the API response example

Success status code: 200

Response:

{
    "links": [
        {
            "rel": "first",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips?limit=25&by=ip&asc=true"
        },
        {
            "rel": "last",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips?startwith=0&limit=25&by=ip&asc=true"
        }
    ],
    "collection": [
        {
            "available": true,
            "quarantine": false,
            "links": [
                {
                    "title": "External_NW",
                    "rel": "externalnetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10"
                },
                {
                    "title": "ips",
                    "rel": "ips",
                    "type": "application/vnd.abiquo.externalips+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips"
                },
                {
                    "title": "10.10.10.1",
                    "rel": "self",
                    "type": "application/vnd.abiquo.externalip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips/83"
                }
            ],
            "id": 83,
            "ip": "10.10.10.1",
            "networkName": "External_NW",
            "ipv6": false
        },
        {
            "available": true,
            "quarantine": false,
            "links": [
                {
                    "title": "External_NW",
                    "rel": "externalnetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10"
                },
                {
                    "title": "ips",
                    "rel": "ips",
                    "type": "application/vnd.abiquo.externalips+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips"
                },
                {
                    "title": "10.10.10.2",
                    "rel": "self",
                    "type": "application/vnd.abiquo.externalip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips/84"
                }
            ],
            "id": 84,
            "ip": "10.10.10.2",
            "networkName": "External_NW",
            "ipv6": false
        },
        {
            "available": true,
            "quarantine": false,
            "links": [
                {
                    "title": "External_NW",
                    "rel": "externalnetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10"
                },
                {
                    "title": "ips",
                    "rel": "ips",
                    "type": "application/vnd.abiquo.externalips+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips"
                },
                {
                    "title": "10.10.10.3",
                    "rel": "self",
                    "type": "application/vnd.abiquo.externalip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips/85"
                }
            ],
            "id": 85,
            "ip": "10.10.10.3",
            "networkName": "External_NW",
            "ipv6": false
        }
    ],
    "totalSize": 3
}

Here is an example of a "self" link from the above collection of IPs. This is the link we will add to the VM below.

                {
                    "title": "10.10.10.2",
                    "rel": "self",
                    "type": "application/vnd.abiquo.externalip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips/84"
                }

 

 

Get external networks at Datacenter level

A cloud administrator can also get all the IPs available in the external networks in the datacenter.

Here we filter by the network name using the "has" parameter. 

By default, the following query returns only the available IPs.

Again, IPs that are in use will contain links to a virtual appliance and a VM.

* This action requires the privilege ROLE_PHYS_DC_RETRIEVE_DETAILS
curl -X GET 'https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/action/externalips?has=External_NW' \
	-H 'Accept:application/vnd.abiquo.externalips+json;version=4.2' \
    -u user:password --verbose | pjson  
 Click here to show or hide the API response example

Success status code: 200

Response:

Retrieve all virtual machines in a virtual appliance
{
    "links": [
        {
            "rel": "first",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/action/externalips?limit=25&has=External_NW&by=ip&asc=true"
        },
        {
            "rel": "last",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/action/externalips?startwith=0&limit=25&has=External_NW&by=ip&asc=true"
        }
    ],
    "collection": [
        {
            "available": true,
            "quarantine": false,
            "links": [
                {
                    "title": "External_NW",
                    "rel": "externalnetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10"
                },
                {
                    "title": "Abiquo",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
                },
                {
                    "title": "10.10.10.1",
                    "rel": "self",
                    "type": "application/vnd.abiquo.externalip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10/ips/83"
                }
            ],
            "id": 83,
            "ip": "10.10.10.1",
            "networkName": "External_NW",
            "ipv6": false
        },
        {
            "available": true,
            "quarantine": false,
            "links": [
                {
                    "title": "External_NW",
                    "rel": "externalnetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10"
                },
                {
                    "title": "Abiquo",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
                },
                {
                    "title": "10.10.10.2",
                    "rel": "self",
                    "type": "application/vnd.abiquo.externalip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10/ips/84"
                }
            ],
            "id": 84,
            "ip": "10.10.10.2",
            "networkName": "External_NW",
            "ipv6": false
        },
        {
            "available": true,
            "quarantine": false,
            "links": [
                {
                    "title": "External_NW",
                    "rel": "externalnetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10"
                },
                {
                    "title": "Abiquo",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
                },
                {
                    "title": "10.10.10.3",
                    "rel": "self",
                    "type": "application/vnd.abiquo.externalip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/network/10/ips/85"
                }
            ],
            "id": 85,
            "ip": "10.10.10.3",
            "networkName": "External_NW",
            "ipv6": false
        }
    ],
    "totalSize": 3
}

Retrieve Private Networks

If you want to use an IP on a private network, get all the private networks available in the virtual datacenter.

GET all Private Networks in Virtual Datacenter
* This action requires the privilege ROLE_VDC_ENUMERATE
curl -X GET 'https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks' \
	-H 'Accept:application/vnd.abiquo.vlans+json;version=4.2' \
	-u user:password --verbose | pjson 
 Click here to show or hide the API response example

Success status code: 200

Response:

Retrieve available IPs in private networks
{
    "links": [
        {
            "title": "bcdc_vdc_001_kvm",
            "rel": "virtualdatacenter",
            "type": "application/vnd.abiquo.virtualdatacenter+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
        },
        {
            "title": "default_private_network",
            "rel": "edit",
            "type": "application/vnd.abiquo.vlan+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1"
        },
        {
            "title": "ips",
            "rel": "ips",
            "type": "application/vnd.abiquo.privateips+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/ips"
        },
        {
            "title": "Service Network",
            "rel": "networkservicetype",
            "type": "application/vnd.abiquo.networkservicetype+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/networkservicetypes/1"
        },
        {
            "title": "load balancers",
            "rel": "loadbalancers",
            "type": "application/vnd.abiquo.loadbalancers+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/loadbalancers"
        },
        {
            "title": "configuration",
            "rel": "configuration",
            "type": "application/vnd.abiquo.networkconfiguration+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/configuration"
        },
        {
            "title": "192.168.0.0/22",
            "rel": "network_configuration",
            "type": "application/vnd.abiquo.networkconfiguration+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/configuration/1"
        }
    ],
    "id": 1,
    "name": "default_private_network",
    "tag": 2,
    "gateway": "192.168.0.1",
    "address": "192.168.0.0",
    "mask": 22,
    "primaryDNS": "",
    "secondaryDNS": "",
    "sufixDNS": "",
    "defaultNetwork": false,
    "type": "INTERNAL",
    "dhcpOptions": {
        "links": [],
        "collection": []
    },
    "ipv6": false,
    "strict": false
}

Retrieve the IPs in a Private Network that are not in use

Now get all the IPs available from the IPs link of the non-default private network in the virtual datacenter. The query uses the request parameter free = true to only retrieve the IP addresses that are not already in use.

GET all available IPs in a private network
* This action requires the privilege ROLE_VDC_ENUMERATE

curl -X GET https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6/ips?free=true \
 	-H 'Accept:application/vnd.abiquo.privateips+json;version=4.2' \
	-u user:password --verbose  
 Click here to show or hide the API response example

Sucecss status code: 200

Response:

{
    "links": [
        {
            "rel": "first",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6/ips?free=true&limit=25&by=ip&asc=true"
        },
        {
            "rel": "last",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6/ips?free=true&startwith=0&limit=25&by=ip&asc=true"
        }
    ],
    "collection": [
        {
            "id": 63,
            "ip": "192.168.1.1",
            "mac": "52:54:00:B2:68:70",
            "name": "525400B26870_host",
            "networkName": "PrivateNetwork2",
            "ipv6": false,
            "links": [
                {
                    "title": "PrivateNetwork2",
                    "rel": "privatenetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6"
                },
                {
                    "title": "privateip",
                    "rel": "self",
                    "type": "application/vnd.abiquo.privateip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6/ips/63"
                },
                {
                    "title": "bcdcvdc01",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
                }
            ],
            "available": true
        },
        {
            "id": 77,
            "ip": "192.168.1.2",
            "mac": "52:54:00:7E:C8:C3",
            "name": "5254007EC8C3_host",
            "networkName": "PrivateNetwork2",
            "ipv6": false,
            "links": [
                {
                    "title": "PrivateNetwork2",
                    "rel": "privatenetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6"
                },
                {
                    "title": "privateip",
                    "rel": "self",
                    "type": "application/vnd.abiquo.privateip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6/ips/77"
                },
                {
                    "title": "bcdcvdc01",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
                }
            ],
            "available": true
        },
        {
            "id": 78,
            "ip": "192.168.1.3",
            "mac": "52:54:00:88:85:C6",
            "name": "5254008885C6_host",
            "networkName": "PrivateNetwork2",
            "ipv6": false,
            "links": [
                {
                    "title": "PrivateNetwork2",
                    "rel": "privatenetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6"
                },
                {
                    "title": "privateip",
                    "rel": "self",
                    "type": "application/vnd.abiquo.privateip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6/ips/78"
                },
                {
                    "title": "bcdcvdc01",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
                }
            ],
            "available": true
        },
        {
            "id": 79,
            "ip": "192.168.1.4",
            "mac": "52:54:00:0B:6D:23",
            "name": "5254000B6D23_host",
            "networkName": "PrivateNetwork2",
            "ipv6": false,
            "links": [
                {
                    "title": "PrivateNetwork2",
                    "rel": "privatenetwork",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6"
                },
                {
                    "title": "privateip",
                    "rel": "self",
                    "type": "application/vnd.abiquo.privateip+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/6/ips/79"
                },
                {
                    "title": "bcdcvdc01",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
                }
            ],
            "available": true
        }
    ],
    "totalSize": 4
}

Retrieve the VM

Retrieve one of the available VMs from the first request. Check that it is powered off.

Update the VM DTO to add the NIC.

* This action requires the privileges ROLE_VDC_MANAGE_VAPP, ROLE_VAPP_CUSTOMISE_SETTINGS, ROLE_VAPP_PERFORM_ACTIONS, ROLE_VAPP_DEPLOY_UNDEPLOY, ROLE_VAPP_CREATE_STATEFUL, ROLE_VAPP_ASSIGN_VOLUME, ROLE_MANAGE_HARD_DISKS, ROLE_VAPP_CREATE_INSTANCE
curl -X GET https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88 \
	-H 'Accept:application/vnd.abiquo.virtualmachine+json;version=4.2' \ 
	-u user:password --verbose | pjson
 Click here to show or hide the API response example

Success status code: 200

Response:

{
    "id": 88,
    "uuid": "365c53e0-0b8a-4e3a-964c-8b057e55ad6e",
    "name": "ABQ_365c53e0-0b8a-4e3a-964c-8b057e55ad6e",
    "label": "yVM_MJ",
    "description": "A virtual machine",
    "cpu": 1,
    "ram": 48,
    "vdrpEnabled": true,
    "vdrpPort": 5901,
    "vdrpIP": "10.60.13.190",
    "idState": 6,
    "state": "OFF",
    "idType": 0,
    "type": "MANAGED",
    "highDisponibility": 0,
    "password": "OTIFepkU",
    "metadata": null,
    "monitored": false,
    "protected": false,
    "variables": {},
    "creationTimestamp": 1510093594000,
    "backuppolicies": [],
    "lastSynchronize": 1510571079000,
    "generateGuestInitialPassword": false,
    "links": [
        {
            "title": "KVM",
            "rel": "machine",
            "type": "application/vnd.abiquo.machine+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1"
        },
        {
            "title": "BCDC",
            "rel": "location",
            "type": "application/vnd.abiquo.datacenter+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1"
        },
        {
            "title": "ABQ_365c53e0-0b8a-4e3a-964c-8b057e55ad6e",
            "rel": "edit",
            "type": "application/vnd.abiquo.virtualmachine+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88"
        },
        {
            "title": "send mail",
            "rel": "sendmail",
            "type": "application/vnd.abiquo.mail+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1/virtualmachines/88/action/sendmail"
        },
        {
            "title": "Abiquo",
            "rel": "enterprise",
            "type": "application/vnd.abiquo.enterprise+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
        },
        {
            "title": "Cloud Administrator",
            "rel": "user",
            "type": "application/vnd.abiquo.user+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1"
        },
        {
            "title": "bcdcvdc01",
            "rel": "virtualdatacenter",
            "type": "application/vnd.abiquo.virtualdatacenter+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
        },
        {
            "title": "vapp_bcdcvdc01",
            "rel": "virtualappliance",
            "type": "application/vnd.abiquo.virtualappliance+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1"
        },
        {
            "title": "metadata",
            "rel": "metadata",
            "type": "application/vnd.abiquo.metadata+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/metadata"
        },
        {
            "title": "vlan network configurations",
            "rel": "configurations",
            "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/network/configurations"
        },
        {
            "title": "192.168.0.0/24",
            "rel": "network_configuration",
            "type": "application/vnd.abiquo.virtualmachinenetworkconfiguration+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/network/configurations/1"
        },
        {
            "title": "nics",
            "rel": "nics",
            "type": "application/vnd.abiquo.nics+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/network/nics"
        },
        {
            "title": "disks",
            "rel": "harddisks",
            "type": "application/vnd.abiquo.harddisks+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/storage/disks"
        },
        {
            "title": "OFF",
            "rel": "state",
            "type": "application/vnd.abiquo.virtualmachinestate+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/state"
        },
        {
            "title": "virtual machine undeploy",
            "rel": "undeploy",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/undeploy"
        },
        {
            "title": "virtual machine deploy",
            "rel": "deploy",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/deploy"
        },
        {
            "title": "virtual machine reset",
            "rel": "reset",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/reset"
        },
        {
            "title": "virtual machine snapshot",
            "rel": "instance",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/instance"
        },
        {
            "title": "remote access",
            "rel": "rdpaccess",
            "type": "application/vnd.abiquo.virtualmachineconsole+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/config/rdpaccess"
        },
        {
            "title": "tasks",
            "rel": "tasks",
            "type": "application/vnd.abiquo.tasks+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/tasks"
        },
        {
            "title": "firewalls",
            "rel": "firewalls",
            "type": "application/vnd.abiquo.links+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/firewalls"
        },
        {
            "title": "load balancers",
            "rel": "loadbalancers",
            "type": "application/vnd.abiquo.loadbalancers+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/loadbalancers"
        },
        {
            "title": "request on demand backup",
            "rel": "requestbackup",
            "type": "application/vnd.abiquo.ondemandbackup+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/backup/action/request"
        },
        {
            "title": "request a restore of a backup",
            "rel": "requestrestore",
            "type": "application/vnd.abiquo.restore+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/backup/action/restore"
        },
        {
            "title": "volumes",
            "rel": "volumes",
            "type": "application/vnd.abiquo.volumes+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/storage/volumes"
        },
        {
            "diskControllerType": "IDE",
            "diskLabel": "Hard disk 1",
            "length": "64",
            "title": "3f55a906-c0dc-41e4-885f-933a838563a8",
            "rel": "disk0",
            "type": "application/vnd.abiquo.harddisk+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/disks/76"
        },
        {
            "title": "Default Tier",
            "rel": "datastoretier0",
            "type": "application/vnd.abiquo.datastoretier+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/1"
        },
        {
            "title": "192.168.0.2",
            "rel": "nic0",
            "type": "application/vnd.abiquo.privateip+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/4"
        },
        {
            "title": "protect",
            "rel": "protect",
            "type": "text/plain",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/protect"
        },
        {
            "title": "unprotect",
            "rel": "unprotect",
            "type": "text/plain",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/unprotect"
        },
        {
            "title": "metricsmetadata",
            "rel": "metricsmetadata",
            "type": "application/vnd.abiquo.metricsmetadata+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/metrics"
        },
        {
            "title": "enablemonitoring",
            "rel": "enablemonitoring",
            "type": "",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/enablemonitoring"
        },
        {
            "title": "collectd",
            "rel": "collectd",
            "type": "application/json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/metrics/collectd"
        },
        {
            "title": "alarms",
            "rel": "alarms",
            "type": "application/vnd.abiquo.alarms+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/alarms"
        },
        {
            "title": "actionplans",
            "rel": "actionplans",
            "type": "application/vnd.abiquo.virtualmachineactionplans+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/actionplans"
        },
        {
            "title": "actionplansflat",
            "rel": "actionplansflat",
            "type": "application/vnd.abiquo.virtualmachineactionplansflat+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/actionplans"
        },
        {
            "title": "clone",
            "rel": "clone",
            "type": "application/vnd.abiquo.virtualmachinecloneoptions+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/action/clone"
        },
        {
            "title": "KVM",
            "rel": "hypervisortype",
            "type": "application/vnd.abiquo.hypervisortype+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/KVM"
        },
        {
            "title": "yVM_MJ",
            "rel": "virtualmachinetemplate",
            "type": "application/vnd.abiquo.virtualmachinetemplate+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/76"
        },
        {
            "title": "Others",
            "rel": "category",
            "type": "application/vnd.abiquo.category+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/categories/1"
        }
    ]
}

Reconfigure the VM

API Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource EnterpriseResource.

Remember to power off the VM before reconfiguring it

If it is not configured to support hot-add and hot-reconfigure, a VM must be powered OFF before you can reconfigure it. You should perform a graceful shutdown of the machine before you reconfigure it, for example, connect to the VM via SSH and use the shutdown -h command.

Below the nic0 entry of the VM, paste the "self" link section of the new NIC, and change "self" to "nic1".

Here we added a NIC from an external network that we retrieved above.

        {
            "title": "192.168.0.2",
            "rel": "nic0",
            "type": "application/vnd.abiquo.privateip+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/4"
        },
        {
            "title": "10.10.10.2",
            "rel": "self",
            "type": "application/vnd.abiquo.externalip+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips/84"
        }

Then we can perform the API call to update the VM with the NIC from the new network.

PUT the Virtual Machine
* This action requires the privilege ROLE_VAPP_CUSTOMISE_SETTINGS
curl --verbose -X PUT -u user:password \
'https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88'
-H 'Accept:application/vnd.abiquo.acceptedrequest+json;version=4.2' \
-H 'Content-type:application/vnd.abiquo.virtualmachine+json;version=4.2' \
-d virtualMachineNewNIC.json | jsonindent -f -nbe
 Click here to show or hide the XML example
The Virtual Machine entity in virtualMachineNewNIC.xml
{
    "links": [
        {
            "title": "KVM",
            "rel": "machine",
            "type": "application/vnd.abiquo.machine+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1"
        },
        {
            "title": "BCDC",
            "rel": "location",
            "type": "application/vnd.abiquo.datacenter+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1"
        },
        {
            "title": "ABQ_a5cbae23-f901-43ed-b3b6-373b7ff82b01",
            "rel": "edit",
            "type": "application/vnd.abiquo.virtualmachine+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11"
        },
        {
            "title": "send mail",
            "rel": "sendmail",
            "type": "application/vnd.abiquo.mail+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1/virtualmachines/11/action/sendmail"
        },
        {
            "title": "Abiquo",
            "rel": "enterprise",
            "type": "application/vnd.abiquo.enterprise+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1"
        },
        {
            "title": "Cloud Administrator",
            "rel": "user",
            "type": "application/vnd.abiquo.user+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1"
        },
        {
            "title": "bcdc_vdc_001_kvm",
            "rel": "virtualdatacenter",
            "type": "application/vnd.abiquo.virtualdatacenter+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1"
        },
        {
            "title": "vapp_bcdc_vdc_001",
            "rel": "virtualappliance",
            "type": "application/vnd.abiquo.virtualappliance+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1"
        },
        {
            "title": "metadata",
            "rel": "metadata",
            "type": "application/vnd.abiquo.metadata+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/metadata"
        },
        {
            "title": "vlan network configurations",
            "rel": "configurations",
            "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/network/configurations"
        },
        {
            "title": "192.168.0.0/22",
            "rel": "network_configuration",
            "type": "application/vnd.abiquo.virtualmachinenetworkconfiguration+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/network/configurations/1"
        },
        {
            "title": "nics",
            "rel": "nics",
            "type": "application/vnd.abiquo.nics+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/network/nics"
        },
        {
            "title": "disks",
            "rel": "harddisks",
            "type": "application/vnd.abiquo.harddisks+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/storage/disks"
        },
        {
            "title": "OFF",
            "rel": "state",
            "type": "application/vnd.abiquo.virtualmachinestate+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/state"
        },
        {
            "title": "VM undeploy",
            "rel": "undeploy",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/action/undeploy"
        },
        {
            "title": "VM deploy",
            "rel": "deploy",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/action/deploy"
        },
        {
            "title": "VM reset",
            "rel": "reset",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/action/reset"
        },
        {
            "title": "VM snapshot",
            "rel": "instance",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/action/instance"
        },
        {
            "title": "VM restore backup",
            "rel": "restorebackup",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/action/restorebackup"
        },
        {
            "title": "remote access",
            "rel": "rdpaccess",
            "type": "text/plain",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/config/rdpaccess"
        },
        {
            "title": "tasks",
            "rel": "tasks",
            "type": "application/vnd.abiquo.tasks+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/tasks"
        },
        {
            "title": "firewalls",
            "rel": "firewalls",
            "type": "application/vnd.abiquo.links+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/firewalls"
        },
        {
            "title": "load balancers",
            "rel": "loadbalancers",
            "type": "application/vnd.abiquo.loadbalancers+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/loadbalancers"
        },
        {
            "title": "volumes",
            "rel": "volumes",
            "type": "application/vnd.abiquo.volumes+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/storage/volumes"
        },
        {
            "diskController": "lsilogic",
            "diskControllerType": "SCSI",
            "length": "1024",
            "title": "4159dde4-6ceb-489a-96d0-9c414e3e6ef5",
            "rel": "disk0",
            "type": "application/vnd.abiquo.harddisk+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/disks/37"
        },
        {
            "title": "Default Tier",
            "rel": "datastoretier0",
            "type": "application/vnd.abiquo.datastoretier+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/1"
        },
        {
            "title": "192.168.0.2",
            "rel": "nic0",
            "type": "application/vnd.abiquo.privateip+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/4"
        },
        {
            "title": "10.10.10.2",
            "rel": "nic1",
            "type": "application/vnd.abiquo.externalip+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/limits/1/externalnetworks/10/ips/84"
        }, 
        {
            "title": "metrics",
            "rel": "metrics",
            "type": "application/vnd.abiquo.metrics+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/metrics"
        },
        {
            "title": "metricsmetadata",
            "rel": "metricsmetadata",
            "type": "application/vnd.abiquo.metricsmetadata+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/metrics"
        },
        {
            "title": "createcustommetric",
            "rel": "createcustommetric",
            "type": "application/vnd.abiquo.custommetric+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/metrics"
        },
        {
            "title": "enablemonitoring",
            "rel": "enablemonitoring",
            "type": "",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/enablemonitoring"
        },
        {
            "title": "collectd",
            "rel": "collectd",
            "type": "application/json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/collectd"
        },
        {
            "title": "alarms",
            "rel": "alarms",
            "type": "application/vnd.abiquo.alarms+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/alarms"
        },
        {
            "title": "protect",
            "rel": "protect",
            "type": "text/plain",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/action/protect"
        },
        {
            "title": "unprotect",
            "rel": "unprotect",
            "type": "text/plain",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/action/unprotect"
        },
        {
            "title": "metrics",
            "rel": "metrics",
            "type": "application/vnd.abiquo.metrics+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/metrics"
        },
        {
            "title": "metricsmetadata",
            "rel": "metricsmetadata",
            "type": "application/vnd.abiquo.metricsmetadata+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/metrics"
        },
        {
            "title": "createcustommetric",
            "rel": "createcustommetric",
            "type": "application/vnd.abiquo.custommetric+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/metrics"
        },
        {
            "title": "enablemonitoring",
            "rel": "enablemonitoring",
            "type": "",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/enablemonitoring"
        },
        {
            "title": "collectd",
            "rel": "collectd",
            "type": "application/json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/collectd"
        },
        {
            "title": "alarms",
            "rel": "alarms",
            "type": "application/vnd.abiquo.alarms+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/11/alarms"
        },
        {
            "title": "KVM",
            "rel": "hypervisortype",
            "type": "application/vnd.abiquo.hypervisortype+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/KVM"
        },
        {
            "title": "grml-sync",
            "rel": "virtualmachinetemplate",
            "type": "application/vnd.abiquo.virtualmachinetemplate+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/14"
        },
        {
            "title": "Others",
            "rel": "category",
            "type": "application/vnd.abiquo.category+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/categories/1"
        }
    ],
    "id": 11,
    "name": "ABQ_a5cbae23-f901-43ed-b3b6-373b7ff82b01",
    "ram": 128,
    "cpu": 1,
    "vdrpPort": 5001,
    "vdrpIP": "10.60.13.190",
    "vdrpEnabled": true,
    "idState": 6,
    "state": "OFF",
    "highDisponibility": 0,
    "idType": 0,
    "type": "MANAGED",
    "password": "PmQ6vS1J",
    "uuid": "a5cbae23-f901-43ed-b3b6-373b7ff82b01",
    "label": "grml-sync",
    "monitored": false,
    "variables": {},
    "protected": false
}

The request will return a link that can be used to check the progress of the task.

{
    "message": "You can keep track of the progress in the link",
    "links": [
        {
            "rel": "status",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/tasks/88bdbc0e-2698-4ebd-9e78-3a36998d49db"
        }
    ]
}

Check Progress

We can check the progress of the task using the following API call.

The task
* This action requires the privilege ROLE_VAPP_CUSTOMISE_SETTINGS
curl -X GET 'https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/tasks/88bdbc0e-2698-4ebd-9e78-3a36998d49db'
	-H 'Accept:application/vnd.abiquo.task+json;version=4.2'  | pjson
{
    "taskId": "88bdbc0e-2698-4ebd-9e78-3a36998d49db",
    "userId": "1",
    "type": "RECONFIGURE",
    "ownerId": "88",
    "state": "FINISHED_SUCCESSFULLY",
    "creationTimestamp": 1510572795,
    "timestamp": 1510572799,
    "jobs": {
        "links": [],
        "collection": [
            {
                "id": "88bdbc0e-2698-4ebd-9e78-3a36998d49db.c9124d94-9258-4229-b665-2067eb6f3452",
                "parentTaskId": "88bdbc0e-2698-4ebd-9e78-3a36998d49db",
                "type": "UPDATE_RESOURCES",
                "description": "UPD-OK - Update resources OK",
                "state": "DONE",
                "rollbackState": "UNKNOWN",
                "creationTimestamp": 1510572795,
                "timestamp": 1510572795,
                "links": []
            },
            {
                "id": "88bdbc0e-2698-4ebd-9e78-3a36998d49db.c1285e87-1e45-483d-94a0-cf36643f38b3",
                "parentTaskId": "88bdbc0e-2698-4ebd-9e78-3a36998d49db",
                "type": "RECONFIGURE",
                "description": "Reconfigure task's reconfigure on virtual machine with id 88",
                "state": "WARNING",
                "rollbackState": "UNKNOWN",
                "creationTimestamp": 1510572795,
                "timestamp": 1510572799,
                "links": []
            }
        ]
    },
    "links": [
        {
            "rel": "self",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/tasks/88bdbc0e-2698-4ebd-9e78-3a36998d49db"
        },
        {
            "rel": "parent",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88/tasks"
        },
        {
            "rel": "result",
            "type": "application/vnd.abiquo.virtualmachine+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88"
        },
        {
            "title": "admin",
            "rel": "user",
            "type": "application/vnd.abiquo.user+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1"
        },
        {
            "title": "ABQ_365c53e0-0b8a-4e3a-964c-8b057e55ad6e",
            "rel": "virtualmachine",
            "type": "application/vnd.abiquo.virtualmachine+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/88"
        }
    ]
}

Completed tutorial

When the reconfigure is done, you have completed this tutorial. 

Check that the NIC has been successfully added to your VM using the UI or by retrieving the VM through the API.