Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Open the browser console to the Network tab and record actions
  2. Edit the VM and go to Network → Private → select network → drag an IP address into the NICs panel, and Save
  3. Find the PUT request and copy it, or get the NIC link and VM data object

...

titleClick here to show/hide the screenshot

Image Modified




Obtain the link to the NIC

...

  1. From the link to the NIC in the previous step, get only the networks IPs link

    Code Block
    https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips


  2. Use a GET request to obtain the first 3 IP addresses in this network, with the parameter "limit=3".  

    To
    Code Block
    curl --verbose 'href":"https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips?limit=3' \
         -H 'Accept: application/vnd.abiquo.privateips+json; version=5.2' \
    	 -u user:password -k | jq . 
    Tip


    (tick) To only retrieve IPs that are available for use, you can use the query parameter "free=true".


  3. The response has 3 IP addresses: the gateway and the IP addresses we created specifically for this exercise.

    Code Block
    √ Abiquo % curl --verbose 'https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips?limit=3' \  
         -H 'Accept: application/vnd.abiquo.privateips+json; version=5.2' \
             -u user:password  -k | jq .
     
    > GET /api/cloud/virtualdatacenters/42/privatenetworks/53/ips?limit=3 HTTP/1.1
    > Host: linatest.bcn.abiquo.com
    > Authorization: Basic XXXXXXX
    > User-Agent: curl/7.64.1
    > Accept: application/vnd.abiquo.privateips+json; version=5.2
    > 
    < HTTP/1.1 200 200
    < Date: Fri, 16 Apr 2021 19:00:47 GMT
    < Server: Apache
    < Set-Cookie: ABQSESSIONID=3701578778846185265; Max-Age=1800; Expires=Fri, 16-Apr-2021 19:30:48 GMT; Path=/; Secure; HttpOnly; SameSite=strict
    < X-Abiquo-TracerContext: aff6905e-3a00-47e5-a640-e70556ab7ffc
    < X-Abiquo-Token: a2e19816735381c1d074441cbd002aa0b2dfac898841de657740584d88f344f6868d440ef8c65b7687ac23cb388ca40e78f93c9d3156bff79e474f6222358857
    < Cache-Control: no-cache, no-store, max-age=0, must-revalidate
    < Pragma: no-cache
    < Expires: 0
    < Strict-Transport-Security: max-age=31536000 ; includeSubDomains
    < X-XSS-Protection: 1; mode=block
    < X-Frame-Options: DENY
    < X-Content-Type-Options: nosniff
    < Content-Type: application/vnd.abiquo.privateips+json; version=5.2
    < Transfer-Encoding: chunked
    < 
    
    {
      "totalSize": 10,
      "links": [
        {
          "rel": "first",
          "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips?limit=3&by=ip&asc=true"
        },
        {
          "rel": "next",
          "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips?startwith=3&limit=3&by=ip&asc=true"
        },
        {
          "rel": "last",
          "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips?startwith=7&limit=3&by=ip&asc=true"
        }
      ],
      "collection": [
        {
          "id": 324,
          "ip": "192.168.0.1",
          "mac": "00:50:56:2B:4D:8D",
          "name": "0050562B4D8D_host",
          "networkName": "default_private_network",
          "ipv6": false,
          "quarantine": false,
          "available": true,
          "links": [
            {
              "title": "default_private_network",
              "rel": "privatenetwork",
              "type": "application/vnd.abiquo.vlan+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53"
            },
            {
              "title": "privateip",
              "rel": "self",
              "type": "application/vnd.abiquo.privateip+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips/324"
            },
            {
              "title": "vdc_ESXI_vCenter",
              "rel": "virtualdatacenter",
              "type": "application/vnd.abiquo.virtualdatacenter+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42"
            }
          ]
        },
        {
          "id": 326,
          "ip": "192.168.0.2",
          "mac": "00:50:56:05:FE:8F",
          "name": "00505605FE8F_host",
          "networkName": "default_private_network",
          "ipv6": false,
          "usedBy": "ABQ_039b03e9-1639-4c46-a915-b53af7ea3445",
          "quarantine": false,
          "available": true,
          "links": [
            {
              "title": "default_private_network",
              "rel": "privatenetwork",
              "type": "application/vnd.abiquo.vlan+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53"
            },
            {
              "title": "privateip",
              "rel": "self",
              "type": "application/vnd.abiquo.privateip+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips/326"
            },
            {
              "title": "vdc_ESXI_vCenter",
              "rel": "virtualdatacenter",
              "type": "application/vnd.abiquo.virtualdatacenter+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42"
            },
            {
              "title": "vapp_web",
              "rel": "virtualappliance",
              "type": "application/vnd.abiquo.virtualappliance+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/virtualappliances/110"
            },
            {
              "title": "ABQ_039b03e9-1639-4c46-a915-b53af7ea3445",
              "rel": "virtualmachine",
              "type": "application/vnd.abiquo.virtualmachine+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/virtualappliances/110/virtualmachines/1918"
            }
          ]
        },
        {
          "id": 335,
          "ip": "192.168.0.3",
          "mac": "00:50:56:0D:BE:B9",
          "name": "0050560DBEB9_host",
          "networkName": "default_private_network",
          "ipv6": false,
          "quarantine": false,
          "available": true,
          "links": [
            {
              "title": "default_private_network",
              "rel": "privatenetwork",
              "type": "application/vnd.abiquo.vlan+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53"
            },
            {
              "title": "privateip",
              "rel": "self",
              "type": "application/vnd.abiquo.privateip+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42/privatenetworks/53/ips/335"
            },
            {
              "title": "vdc_ESXI_vCenter",
              "rel": "virtualdatacenter",
              "type": "application/vnd.abiquo.virtualdatacenter+json",
              "href": "https://linatest.bcn.abiquo.com:443/api/cloud/virtualdatacenters/42"
            }
          ]
        }
      ]
    }
    
    
    


...

Go the end of the links section and add the NIC from the previous step.

(warning)(warning) If this is the last link, add a comma before it, and remove any comma after it.

...