Allocate an IP Address

Allocate an IP address to a virtual machine, automatically determining the network interface.

POST
https://api.katapult.io/core/v1/virtual_machines/{virtual_machine}/allocate_ip

If successful, this endpoint will return a 200 OK status.

Scopes

One of the following scopes are required to use this endpoint.

Arguments

The following arguments are supported for this endpoint.

Name Type Default Value

virtual_machine Required

The virtual machine to allocate the IP address to

VirtualMachine Lookup None

ip_address Required

The IP address to allocate

IP Address Lookup None

Potential Errors

The following errors may occur during this request.

Details HTTP status

ip_address_not_found

No IP addresses were found matching any of the criteria provided in the arguments

404 Not Found

ip_already_allocated

This IP address has already been allocated to another resource

422 Unprocessable Entity

no_interface_available

This virtual machine does not have a network interface that is compatible with the provided IP address

422 Unprocessable Entity

object_in_trash

The object found is in the trash and therefore cannot be manipulated through the API. It should be restored in order to run this operation.

406 Not Acceptable

virtual_machine_not_found

No virtual machine was found matching any of the criteria provided in the arguments

404 Not Found

Returned Object

When the request is successful, you can expect an object matching the specification below to be returned.

{
    ip_address: IPAddress {
        id: String
        address: String
        reverse_dns: String
        vip: Boolean
        label: String?
        address_with_mask: String
        network: Network {
            id: String
            name: String
            permalink: String?
            data_center: DataCenter {
                id: String
                name: String
                permalink: String?
                country: Country {
                    id: String
                    name: String
                    iso_code2: String
                    iso_code3: String
                    time_zone: String?
                    eu: Boolean
                }
            }
        }
        allocation_id: String?
        allocation_type: String?
    }
}