Gandi

Table Of Contents

Previous topic

PaaS API

Next topic

Gandi Security API

PaaS API Reference

Methods

paas.count(apikey[, opts=nil])

Count PaaS instances associated to contact represented by apikey.

New in version 3.1.1.

Parameters:
Returns:

int – Number of instances

paas.create(apikey, params)

Create a PaaS instance.

Warning

If you are not using Gandi DNS, a DNS record must be created for this host name separately. see paas-api-dns-check for more information.

New in version 3.1.1.

New in version 3.3.36: constraint PaasCreateVisibility

Warning

This is not a free operation. Please ensure your prepaid account has enough credit. Look at the catalog listings to get the price.

Parameters:
  • apikey (string) – API connection key
  • params (struct) – Parameters
Returns:

list of struct – Operations paas_vm_create, paas_disk_create and

paas.delete(apikey, paas_id)

Delete a PaaS instance.

New in version 3.1.1.

Parameters:
  • apikey (string) – API connection key
  • paas_id (int) – ID of the instance
Returns:

list of struct – Operations paas_vm_delete and paas_disk_delete

paas.info(apikey, paas_id)

Get PaaS instance information.

New in version 3.1.1.

Parameters:
  • apikey (string) – API connection key
  • paas_id (int) – ID of the instance
Returns:

struct – Instance information

paas.list(apikey[, opts=nil])

List PaaS instances associated to contact represented by apikey.

New in version 3.1.1.

Parameters:
Returns:

list of struct – Instance information

paas.renew(apikey, paas_id, params)

Renew a PaaS instance.

New in version 3.1.1.

Warning

This is not a free operation. Please ensure your prepaid account has enough credit. Look at the catalog listings to get the price.

Parameters:
  • apikey (string) – API connection key
  • paas_id (int) – ID of the instance
  • params (struct) – Parameters
Returns:

list of struct – Operations paas_vm_renew and paas_disk_renew

paas.restart(apikey, paas_id)

Restart a PaaS instance.

New in version 3.1.1.

Parameters:
  • apikey (string) – API connection key
  • paas_id (int) – ID of the instance
Returns:

struct – Operation paas_restart

paas.update(apikey, paas_id, params)

Update a PaaS instance.

New in version 3.1.1.

Warning

This is not a free operation. Please ensure your prepaid account has enough credit. Look at the catalog listings to get the price.

Parameters:
  • apikey (string) – API connection key
  • paas_id (int) – ID of the instance
  • params (struct) – Parameters
Returns:

list of struct – Operations paas_vm_update, paas_disk_update, rproxy_update or paas_console

paas.vhost.count(apikey[, opts=nil])

Count virtual hosts associated to contact represented by apikey.

New in version 3.1.1.

Parameters:
Returns:

int – Number of virtual hosts

paas.vhost.create(apikey, params)

Create a virtual host.

Note

The virtual host will be declared in the instance paas_id and a new folder will be created in the /lamp0/web/vhosts folder of the instance’s disk.

Warning

If you are not using Gandi DNS, a DNS record must be created for this host name separately. see paas-api-dns-check for more information.

New in version 3.1.1.

Parameters:
  • apikey (string) – API connection key
  • params (struct) – Parameters
Returns:

struct – Operation rproxy_update

paas.vhost.delete(apikey, vhost)

Delete a virtual host.

Note

The files will be kept in a new folder in /lamp0/web/trash.

New in version 3.1.1.

Parameters:
  • apikey (string) – API connection key
  • vhost (string) – FQDN of the virtual host
Returns:

struct – Operation rproxy_update

paas.vhost.get_dns_entries(apikey, params)

Get the keys you need to put in your zone (including the TXT record). If vhost is a domain name, you have to put @=key. Otherwise, you have to put subdomain=key.

New in version 3.2.3.

Parameters:
  • apikey (string) – API connection key
  • params (struct) – Parameters
Returns:

struct – Information on the dns entries you need to add

paas.vhost.info(apikey, vhost)

Get virtual host information.

New in version 3.1.1.

Parameters:
  • apikey (string) – API connection key
  • vhost (string) – FQDN of the virtual host
Returns:

struct – Virtual host information

paas.vhost.list(apikey[, opts=nil])

List virtual hosts associated to contact represented by apikey.

New in version 3.1.1.

Parameters:
Returns:

struct – Virtual host information

paas.snapshot.count(apikey[, opts=nil])

Count PaaS snapshot associated to contact represented by apikey.

New in version 3.2.1.

Parameters:
Returns:

int – number of snapshots

paas.snapshot.info(apikey, snapshot)

Get PaaS paas snaphost information.

New in version 3.2.1.

Parameters:
  • apikey (string) – API connection key
  • snapshot (int) – ID of the snapshot
Returns:

struct – Snapshot information

paas.snapshot.list(apikey[, opts=nil])

List PaaS snapshot associated to the contact represented by apikey.

New in version 3.2.1.

Parameters:
Returns:

list of struct – Snapshot information

paas.type.count(apikey[, opts=nil])

Count PaaS types.

New in version 3.2.2.

Parameters:
Returns:

int – The number of PaaS types

paas.type.list(apikey[, opts=nil])

List PaaS types.

New in version 3.2.2.

Parameters:
Returns:

list of struct – PaaS types

Parameters

Paas

parameter of paas.delete(), paas.info(), paas.renew(), paas.restart() and paas.update()

used by PaasVhost and VhostListOptions

PaasCountOptions

parameter of paas.count()

Name Default Type Mandatory
<data_disk_additional_size   int no
<date_end   string no
>data_disk_additional_size   int no
>date_end   string no
contact   array of string or string no
data_disk_additional_size   int no
datacenter_id   int or array of int no
date_end   string no
date_start   string no
id   int or array of int no
name   array of string or string no
size   array of string or string no
state   string no
type   array of string or string no
vhost   array of string or string no
~name   array of string or string no
~vhost   array of string or string no
PaasCreateParams

parameter of paas.create()

Changed in version 3.3.20: key keys has been added.
keys parameter.

Changed in version 3.3.12: key ssh_key has been added.
ssh_key parameter.

Changed in version 3.2.12: key snapshot_profile has been added.
snapshot_profile parameter.

Name Default Type Mandatory
datacenter_id   int yes
id of the datacenter of the instance
duration   string yes
1m for 1 month, 12m for 1 year, and so on
name   string yes
Name of the instance
password   string yes
Password of the instance
size   string yes
Size of the instance
type   string yes
Type of the instance
fixed False boolean no
Subscription type (annual commitment)
keys   array of int no
Ids of existing ssh keys to use
override False boolean no
quantity 0 int no
Additional disk amount (in GB)
snapshot_profile   int no
Set a snapshot profile associated to this paas disk
ssh_key   array of string or string no
Authorize ssh authentication for the given ssh keys
trial   boolean no
vhosts   array of string no
List of virtual hosts to be linked to the instance
zone_alter False boolean no
PaasListOptions

parameter of paas.list()

Name Default Type Mandatory
<data_disk_additional_size   int no
<date_end   string no
>data_disk_additional_size   int no
>date_end   string no
contact   array of string or string no
data_disk_additional_size   int no
datacenter_id   int or array of int no
date_end   string no
date_start   string no
id   int or array of int no
items_per_page 100 int no
number of items returned for the pagination
name   array of string or string no
page 0 int no
page number for pagination offset
size   array of string or string no
sort_by   string no
used to sort returned items: contact, data_disk_additional_size, datacenter_id, date_end, date_start, id, name, size, state, type, vhost
state   string no
type   array of string or string no
vhost   array of string or string no
~name   array of string or string no
~vhost   array of string or string no
PaasSizeEnum

used by PaasCreateParams, PaasListReturn, PaasReturn and PaasUpdateParams

Name Description
s -
s+ -
m -
l -
xl -
xxl -
PaasState

used by PaasCountOptions, PaasListOptions, PaasListReturn, PaasReturn and VhostListOptions

Name Description
running -
being_created -
locked -
deleted -
paused -
PaasTypeServiceName

used by PaasCreateParams

Name Description
php5.4mysql -
php5.4pgsql -
nodejspgsql -
nodejsmongodb -
php5.4mongodb -
nodejsmysql -
pythonmysql -
pythonpgsql -
pythonmongodb -
rubymysql -
rubypgsql -
rubymongodb -
phpmysql -
phppgsql -
phpmongodb -
nodejsmysql5.6 -
nodejspgsql9.4 -
nodejsmongodb2.4 -
php7mysql5.6 -
php7pgsql9.4 -
php7mongodb2.4 -
php5.6mysql5.6 -
php5.6pgsql9.4 -
php5.6mongodb2.4 -
nodejs6mongodb3.2 -
nodejs6mysql5.6 -
nodejs6mysql5.7 -
nodejs6pgsql9.6 -
php5.6mongodb3.2 -
php5.6mysql5.7 -
php5.6pgsql9.6 -
php7.1mongodb3.2 -
php7.1mysql5.6 -
php7.1mysql5.7 -
php7.1pgsql9.6 -
python2.7mongodb3.2 -
python2.7mysql5.6 -
python2.7mysql5.7 -
python2.7pgsql9.6 -
python3.6mongodb3.2 -
python3.6mysql5.6 -
python3.6mysql5.7 -
python3.6pgsql9.6 -
ruby2.3mysql5.6 -
ruby2.3mysql5.7 -
ruby2.3pgsql9.6 -
ruby2.3pgsql9.7 -
ruby2.4mongodb3.2 -
ruby2.4mysql5.6 -
ruby2.4mysql5.7 -
ruby2.4pgsql9.6 -
PaasUpdateParams

parameter of paas.update()

Changed in version 3.3.4: key name has been added.
name parameter.

Changed in version 3.3.20: key keys has been added.
keys parameter.

Changed in version 3.3.13: key ssh_key has been added.
ssh_key parameter.

Name Default Type Mandatory
console   boolean no
Activate or deactivate the Console
keys   array of int no
Ids of existing ssh keys to use
name   string no
Name of the instance
password   string no
Password of the instance
quantity   int no
Additional disk amount (in GB)
reset_mysql_password   boolean no
Reset mysql password for root
size   string no
Size of the instance
snapshot_profile   int or string no
Set or unset the snapshot profile
ssh_key   array of string or string no
Append the ssh key in the list of ssh authorized keys
upgrade   boolean no
Upgrade the instance to the last system image if needed
RenewOptions

parameter of paas.renew() and site.renew()

Name Default Type Mandatory
duration   string yes
fixed   boolean yes
PaasTypeService

used by PaasListReturn and PaasReturn

Name Description
php5.4mysql -
php5.4pgsql -
nodejspgsql -
nodejsmongodb -
php5.4mongodb -
nodejsmysql -
pythonmysql -
pythonpgsql -
pythonmongodb -
rubymysql -
rubypgsql -
rubymongodb -
phpmysql -
phppgsql -
phpmongodb -
nodejsmysql5.6 -
nodejspgsql9.4 -
nodejsmongodb2.4 -
php7mysql5.6 -
php7pgsql9.4 -
php7mongodb2.4 -
php5.6mysql5.6 -
php5.6pgsql9.4 -
php5.6mongodb2.4 -
nodejs6mongodb3.2 -
nodejs6mysql5.6 -
nodejs6mysql5.7 -
nodejs6pgsql9.6 -
php5.6mongodb3.2 -
php5.6mysql5.7 -
php5.6pgsql9.6 -
php7.1mongodb3.2 -
php7.1mysql5.6 -
php7.1mysql5.7 -
php7.1pgsql9.6 -
python2.7mongodb3.2 -
python2.7mysql5.6 -
python2.7mysql5.7 -
python2.7pgsql9.6 -
python3.6mongodb3.2 -
python3.6mysql5.6 -
python3.6mysql5.7 -
python3.6pgsql9.6 -
ruby2.3mysql5.6 -
ruby2.3mysql5.7 -
ruby2.3pgsql9.6 -
ruby2.3pgsql9.7 -
ruby2.4mongodb3.2 -
ruby2.4mysql5.6 -
ruby2.4mysql5.7 -
ruby2.4pgsql9.6 -
PaasDnsEntry

parameter of paas.vhost.get_dns_entries()

Name Default Type Mandatory
datacenter   int yes
vhost   string yes
PaasVhost

parameter of paas.vhost.create()

Name Default Type Mandatory
paas_id   int yes
vhost   string yes
Virtual hosts to be linked to the instance
override False boolean no
Define the behaviour when a DNS record already exists (zone_alter must also be set)
zone_alter False boolean no
Define if the PaaS backend should modify the domain’s zone to add virtual hosts (you must have permissions on the domain)
VhostListOptions

parameter of paas.vhost.count() and paas.vhost.list()

Name Default Type Mandatory
<date_creation   string no
>date_creation   string no
date_creation   string no
id   int or array of int no
items_per_page 100 int no
number of items returned for the pagination
name   string no
paas_id   int no
page 0 int no
page number for pagination offset
sort_by   string no
used to sort returned items: date_creation, id, name, paas_id, state
state   string no
~name   string no
PaasSnapshotListOptions

parameter of paas.snapshot.count() and paas.snapshot.list()

Name Default Type Mandatory
<date_created   string no
<size   int no
>date_created   string no
>size   int no
date_created   string no
items_per_page 100 int no
number of items returned for the pagination
name   string no
paas_id   int no
page 0 int no
page number for pagination offset
size   int no
sort_by   string no
used to sort returned items: date_created, name, paas_id, size, type
type   string no
~name   string no
PaasTypeListOptions

parameter of paas.type.count() and paas.type.list()

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

Name Default Type Mandatory
catalog_prefix   array of string or string no
PaaS type catalog_prefix
category   array of string or string no
PaaS type category
database   array of string or string no
PaaS embedded database engine
id   int or array of int no
PaaS type id
items_per_page 100 int no
number of items returned for the pagination
name   array of string or string no
PaaS type name
page 0 int no
page number for pagination offset
sort_by   string no
used to sort returned items: catalog_prefix, category, database, id, name, visibility
visibility   string no
PaasTypeVisibility

used by PaasTypeListOptions

Name Description
all the normal image
beta a new image, to test everything is working well (will be soon ‘all’)
deprecated no longer supported by Gandi, will be soon unavailable
alpha -
internal -

Returns

ConsoleInfo

used by PaasReturn

Name Type
date_end dateTime.iso8601
enabled boolean
is the emergency console curently enable.
MinimalServerReturn

used by PaasListReturn

Name Type
id int
PaasListReturn

returned by paas.list()

Changed in version 3.2.1: key add has changed.
add snapshot_profile field.

Name Type
catalog_name string
Name of the product in the catalog
console string
The console url if any (that does not mean it’s activated)
data_disk_additional_size int
Amount of additional disk (in GB)
datacenter_id int
id of the datacenter of the instance
date_end dateTime.iso8601
Expiration date of the instance
date_end_commitment dateTime.iso8601
Date of the end of the commitment
date_start dateTime.iso8601
Creation date of the instance
entity_id string
id int
ID of the instance
name string
Name of the instance
need_upgrade boolean
Whether or not the instance needs to be upgraded
servers array of struct
List of servers in the instance
size string
Size of the instance
snapshot_profile struct
Snapshot profile affected to this instance
state string
Administrative state of the instance
type string
Type of the instance
PaasOwnerReturn

used by PaasReturn

Name Type
handle string
id int
PaasReturn

returned by paas.info()

Name Type
autorenew struct
Autorenew state of the instance
catalog_name string
console string
console_info struct
data_disk_additional_size int
datacenter struct
Datacenter of the instance
datadisk_total_size string
total size of disks in megabytes including additional disks and snapshot profile
date_end dateTime.iso8601
date_end_commitment dateTime.iso8601
date_start dateTime.iso8601
entity_id string
ftp_server string
hostname of the SFTP server to access the instance
git_server string
hostname of the git server to update the instance
id int
name string
need_upgrade boolean
owner struct
Gandi handle of the owner
servers array of struct
List of servers in the instance
size string
snapshot_profile struct
state string
type string
user int
User to login to the SFTP server
vhosts array of struct
List of virtual hosts linked to the instance
PaasVHostShortReturn

used by PaasReturn

Name Type
cert_entity_id string
date_creation dateTime.iso8601
id int
name string
state string
ServerReturn

used by PaasReturn

Changed in version 3.3.25: key graph_urls is deprecated and will be removed in the next major release.
.

Name Type
graph_urls struct
id int
uuid int
SnapshotProfile

used by PaasListReturn and PaasReturn

Name Type
id int
name string
PaasVHostReturn

returned by paas.vhost.info() and paas.vhost.list()

Name Type
cert_id int
date_creation dateTime.iso8601
id int
name string
paas_id int
state string
PaasDiskReturn

used by PaasSnapshotReturn

Name Type
datacenter_id int
id of the datacenter of the data disk
paas_id int
Data disk’s paas instance id
state string
Data disk state
PaasSnapshotReturn

returned by paas.snapshot.info() and paas.snapshot.list()

Name Type
date_created dateTime.iso8601
Snapshot creation date
name string
Snapshot name
size int
Snapshot size
source struct
Snapshot data disk source
type string
Snapshot type
PaasTypeReturn

returned by paas.type.list()

Changed in version 3.3.36: key visibility has been added.
visibility parameter.

Changed in version 3.3.34: key catalog_prefix has been added.
catalog_prefix parameter.

Changed in version 3.3.24: keys language, database have been added.
language parameter.
database parameter.

Name Type
catalog_prefix string
prefix to be used with the description field of ProductSearchOptions
database string
Database engine embedded by this PaaS type
language string
Programming language embedded by this PaaS type
name string
Name of the PaaS type
visibility string
the status of the image see PaasTypeVisibility