Gandi

Table Of Contents

Previous topic

Disk API Reference

Next topic

IP Address API Reference

Network Interface API Reference

Changed in version 3.2.2: The following methods are not available anymore : hosting.iface.ip_attach, hosting.iface.ip_detach

Methods

hosting.iface.count(apikey[, opts=nil])

Count network interfaces.

Parameters:
Returns:

int – number of network interfaces

hosting.iface.create(apikey, iface_spec)
Create a network interface using attributes specified by iface_spec.
Parameters:
Returns:

struct – iface_create operation

hosting.iface.delete(apikey, iface_id)

Delete a network interface.

Parameters:
  • apikey (string) – API connection key
  • iface_id (int) – unique identifier of the network interface to delete
Returns:

struct – iface_delete operation

hosting.iface.info(apikey, iface_id)

Get information about a network interface.

Parameters:
  • apikey (string) – API connection key
  • iface_id (int) – network interface unique identifier
Returns:

struct – network interface information

hosting.iface.list(apikey[, opts=nil])

List network interfaces.

Parameters:
Returns:

list of struct – list of network interfaces descriptions

hosting.iface.update(apikey, iface_id, iface_spec)
Updates a network interface using attributes specified by iface_spec.
Parameters:
Returns:

struct – iface_update operation

hosting.vlan.count(apikey[, opts=nil])

Count private VLAN handled by this account.

Parameters:
Returns:

int – number of private VLAN

hosting.vlan.create(apikey, params)

Create a private VLAN using attributes specified by params.

The private VLAN name is uniq.

Parameters:
Returns:

struct – vlan_create operation

hosting.vlan.delete(apikey, vlan)

Delete a private VLAN if nothing is associated.

Parameters:
  • apikey (string) – API connection key
  • vlan (int) – private VLAN unique identifier
Returns:

struct – vlan_delete operation

hosting.vlan.info(apikey, vlan)

Get information about a private VLAN.

Parameters:
  • apikey (string) – API connection key
  • vlan (int) – private VLAN unique identifier
Returns:

struct – private VLAN information

hosting.vlan.list(apikey[, opts=nil])

List private VLAN handled by this account.

Parameters:
Returns:

struct – list of private VLAN

hosting.vlan.update(apikey, vlan, params)

Update a private VLAN name.

/!the return changed from the vlan to an update operation.

Parameters:
Returns:

struct – vlan_update operation

Parameters

IfaceCountOptions

parameter of hosting.iface.count() and iface.count()

Name Default Type Mandatory
datacenter_id   int or array of int no
id of the datacenter
id   int or array of int no
id of the interface
ip.address   array of string or string no
IP Address
ip.reverse   array of string or string no
PTR record of the address
state   string no
type   string no
vlan   string no
name of the vlan
vlan_id   int or array of int no
id of the vlan
vm_id   int or array of int no
id of the vm
~vlan   string no
match the name of the vlan
IfaceDescription

parameter of hosting.iface.create() and iface.create()

Changed in version 3.3.24: key ip has been added.
ip parameter.

Changed in version 3.2.0: key vlan has been added.
vlan parameter.

Changed in version 3.2.0: key ip_version has changed.
ip_version optional parameter.

Name Default Type Mandatory
datacenter_id   int yes
id of the datacenter
bandwidth   double no
network bandwidth in bit/s
ip   string no
private vlan ip
ip_version   string no
IP version
vlan   int no
private vlan if specified
IfaceListOptions

parameter of hosting.iface.list() and iface.list()

Name Default Type Mandatory
datacenter_id   int or array of int no
id of the datacenter
id   int or array of int no
id of the interface
ip.address   array of string or string no
IP Address
ip.reverse   array of string or string no
PTR record of the address
items_per_page 100 int no
number of items returned for the pagination
page 0 int no
page number for pagination offset
sort_by   string no
used to sort returned items: datacenter_id, id, ip.address, ip.reverse, state, type, vlan, vlan_id, vm_id
state   string no
type   string no
vlan   string no
name of the vlan
vlan_id   int or array of int no
id of the vlan
vm_id   int or array of int no
id of the vm
~vlan   string no
match the name of the vlan
IfaceState

used by IfaceCountOptions, IfaceListOptions and IfaceReturn

Name Description
used Interface is currently attached to a vm
free Interface is not attached to a vm
IfaceType

used by IfaceCountOptions, IfaceListOptions and IfaceReturn

Name Description
public public iface
private private iface
IfaceUpdate

parameter of hosting.iface.update() and iface.update()

Changed in version 3.3.24: key ip has been added.
ip parameter.

Changed in version 3.3.24: key bandwidth has changed.
bandwidth optional parameter.

Name Default Type Mandatory
bandwidth   double no
network bandwidth to apply in bit/s
ip   string no
private vlan ip
IPState

used by IPCountOptions, IPListOptions and IPReturn

Name Description
being_created The IP address is not allocated yet
created the IP is allocated
recyclable The IP has been deleted, and is still allocated to this account
releasing The IP is no longer allocated to this account
PrivateVlanCreate

parameter of hosting.vlan.create()

Changed in version 3.3.24: keys subnet, gateway have been added.
.
.

Name Default Type Mandatory
datacenter_id   int yes
id of the datacenter of the instance
name   string yes
name of the private VLAN
gateway   string no
private network gateway
subnet   string no
private network subnet
PrivateVlanListOptions

parameter of hosting.vlan.count() and hosting.vlan.list()

Name Default Type Mandatory
datacenter_id   int or array of int no
id   int or array of int no
items_per_page 100 int no
number of items returned for the pagination
name   string no
page 0 int no
page number for pagination offset
sort_by   string no
used to sort returned items: datacenter_id, id, name
~name   string no
PrivateVlanUpdate

parameter of hosting.vlan.update()

Changed in version 3.3.24: key gateway has been added.
.

Name Default Type Mandatory
gateway   string no
private network gateway
name   string no
name of the private VLAN

Returns

IfaceReturn

returned by hosting.iface.info(), hosting.iface.list(), iface.info() and iface.list()

used by VMReturn

Name Type
bandwidth double
Network bandwidth in bit/s
datacenter_id int
id of the datecenter where the interface is available.
date_created dateTime.iso8601
date_updated dateTime.iso8601
id int
Network Interface unique identifier
ips array of struct
only returned with method hosting.iface.info() and iface.info()
ips_id struct
id of the IP attached with this interface.
num int
state string
type string
vlan struct
private vlan where the iface exists or nil for public interface.
vm_id int
id of the vm attached with this interface.
IPReturn

returned by hosting.ip.info(), hosting.ip.list(), ip.info() and ip.list()

used by IfaceReturn

Changed in version 3.3.36: key key: has been added.
key: vm_id, type, bandwidth and iface_num.

Name Type
bandwidth double
bandwidth of the interface
datacenter_id int
id of the datecenter where the IP is available.
date_created dateTime.iso8601
date_updated dateTime.iso8601
id int
unique identifier of the ip
iface_id int
id of the associated interface
iface_num int
position of the interface
ip string
num int
position of the address in its interface interface
reverse string
hostname in the PTR record of the IP Address
state string
type string
public or private
version string
4 or 6
vm_id int
id of the vm attached with this interface.
PrivateVlanReturn

returned by hosting.vlan.info() and hosting.vlan.list()

used by IfaceReturn

Name Type
datacenter struct
private VLAN datacenter
only returned with method hosting.vlan.info()
datacenter_id int
id of the datacenter where the private VLAN is available
only returned with method hosting.vlan.list()
gateway string
only returned with method hosting.vlan.info() and hosting.vlan.list()
id int
private VLAN unique identifier
name string
private VLAN name
state string
private VLAN administrative state
only returned with method hosting.vlan.info() and hosting.vlan.list()
subnet string
only returned with method hosting.vlan.info() and hosting.vlan.list()
uuid int
private VLAN uuid
only returned with method hosting.vlan.info() and hosting.vlan.list()
OperationReturn

returned by account.credit(), domain.contacts.set(), domain.mailbox.purge(), domain.mailbox.responder.activate(), domain.mailbox.responder.deactivate(), domain.packmail.autorenew(), domain.packmail.create(), domain.packmail.delete(), domain.packmail.renew(), domain.packmail.update(), domain.reseller.set(), hosting.account.credit(), hosting.rproxy.create(), hosting.rproxy.delete(), hosting.rproxy.probe.disable(), hosting.rproxy.probe.enable(), hosting.rproxy.probe.update(), hosting.rproxy.server.create(), hosting.rproxy.server.delete(), hosting.rproxy.server.disable(), hosting.rproxy.server.enable(), hosting.rproxy.update(), hosting.rproxy.vhost.alter_zone(), hosting.rproxy.vhost.create(), hosting.rproxy.vhost.delete(), hosting.vlan.create(), hosting.vlan.delete(), hosting.vlan.update(), notification.subscription.create(), notification.subscription.delete(), operation.info(), paas.create(), paas.delete(), paas.renew(), paas.restart(), paas.update(), paas.vhost.create() and paas.vhost.delete()

Name Type
date_created dateTime.iso8601
date_start dateTime.iso8601
date_updated dateTime.iso8601
errortype struct
classification of the error cause if the operation is in error (possible values for errortype defined behind)
eta int
estimated time of processing the operation
id int
infos array of struct
last_error string
last error of the operation
last_support_error string
last “support” error of the operation (that should be handled manually by the support team)
params struct
session_id int
session number for the operation
source string
contact who create the operation
step string
current step of the operation
type string
Possible Errors
Error identifier Type
authorization_error support_recoverable
An authorization error happened
duplicate fatal
The wanted object is duplicate
missing_parameter client_recoverable
There is a missing parameter
ratelimit temporary
The query was ratelimited
timeout temporary
The query timeout
unknown unknown
Unknown