Gandi

Table Of Contents

Previous topic

Site API

Next topic

Gandi PaaS API

Site API Reference

Methods

site.alter_zone(apikey, host, params)

Create a record in the domain zone for all this site’s host

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

struct – Operation sitebuilder_zone_alter

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

Count sites.

New in version 3.2.14.

Parameters:
Returns:

int – Number of sites

site.create(apikey, params)

Create a site.

New in version 3.2.14.

Warning

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

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

struct – Operation sitebuilder_create

site.delete(apikey, site)

Delete a site.

New in version 3.2.14.

Parameters:
  • apikey (string) – API connection key
  • site (string) – site unique identifier
Returns:

struct – Operation sitebuilder_delete

site.edit(apikey, site, token)

Edit a site.

New in version 3.2.14.

Parameters:
  • apikey (string) – API connection key
  • site (string) – site unique identifier
  • token (struct) – Token of the key
Returns:

string – An url that let edit site

site.get_dns_entries(apikey, params)

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

New in version 3.2.14.

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

struct – Information on the dns entries you need to add

site.info(apikey, site)

Get site information.

New in version 3.2.14.

Parameters:
  • apikey (string) – API connection key
  • site (string) – site unique identifier
Returns:

struct – Informations about the site.

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

List sites.

New in version 3.2.14.

Parameters:
Returns:

struct – list of sites

site.renew(apikey, site, params)

Renew a site.

New in version 3.2.14.

Warning

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

Parameters:
  • apikey (string) – API connection key
  • site (string) – site unique identifier
  • params (struct) – renew information
Returns:

struct – Operation sitebuilder_renew

site.update(apikey, site, params)

Update a site. Updating the package is a site package upgrade and is not a free operation.. In other case, this operation is free.

New in version 3.2.14.

Warning

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

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

struct – Operation sitebuilder_update

site.key.create(apikey, site, params)

Create a key for a given site.

New in version 3.2.14.

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

struct – list of package for a given provider

site.key.delete(apikey, token)

Delete a key.

New in version 3.2.14.

Parameters:
  • apikey (string) – API connection key
  • token (string) – Token of the key
Returns:

boolean – 1 if succeed

site.key.list(apikey, site)

List keys for a given site.

New in version 3.2.14.

Parameters:
  • apikey (string) – API connection key
  • site (int) – site unique identifier
Returns:

struct – list of keys for a given site

site.key.update(apikey, token, params)

Update a key.

New in version 3.2.14.

Parameters:
  • apikey (string) – API connection key
  • token (string) – Token of the key
  • params (struct) – Parameters
Returns:

struct – list of package for a given provider

site.package.list(apikey, opts)

List packages.

New in version 3.2.14.

Parameters:
Returns:

struct – list of package for a given provider

Parameters

PackageName

used by PackageListOptions, SiteCreate, SiteListOptions, SitePackageListReturn, SiteReturn and SiteUpdate

Name Description
business The free package with unlimited web pages
free The free package with 3 web pages include
personal The free package that includes 10 web pages
professional The free package that includes 100 web pages
Provider

used by SiteDnsEntry

Name Description
basekit associated site must contain a gandi.ws vhost
basekit_whitelabel associated site must contain a bk-site.net vhost
ProviderName

used by PackageListOptions, SiteCreate, SiteListOptions and SitePackageListReturn

Name Description
basekit associated site must contain a gandi.ws vhost
basekit_whitelabel associated site must contain a bk-site.net vhost
Site

parameter of site.autorenew.activate(), site.autorenew.deactivate(), site.delete(), site.edit(), site.info(), site.key.create(), site.key.list(), site.renew() and site.update()

SiteAlterZone

parameter of site.alter_zone()

Name Default Type Mandatory
override False boolean no
SiteCreate

parameter of site.create()

Name Default Type Mandatory
name   string yes
given name of the site
vhosts   array of string yes
list of virtualhosts, the first one is the preferred
duration 1m string no
subscription period, used to calculate the date_end
fixed False boolean no
override False boolean no
Define the behaviour when a DNS record already exists (zone_alter must also be set)
owner   string no
handle of the site owner
package free string no
provider basekit string no
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)
SiteDnsEntry

parameter of site.get_dns_entries()

Name Default Type Mandatory
provider   string yes
name of the provider that host the site
vhost   string yes
FQDN of the DNS Domain Zone that must set the TXT record
SiteListOptions

parameter of site.count() and site.list()

Name Default Type Mandatory
contact   string no
date_end   string no
id   int no
items_per_page 100 int no
number of items returns for the pagination
name   string no
package   string no
page 0 int no
page number for pagination offset
provider   string no
sort_by   string no
used to sort returned items: contact, date_end, id, name, package, provider, status
status   string no
~name   string no
~vhost   string no
SiteStatus

used by SiteListOptions and SiteReturn

Name Description
active the site is running
expired the site must be renew to be active
locked the site is locked for complaints
SiteUpdate

parameter of site.update()

Name Default Type Mandatory
duration   string no
subscription period, used to calculate the date_end
fixed False boolean no
name   string no
given name of the site
override False boolean no
Define the behaviour when a DNS record already exists (zone_alter must also be set)
package   string no
upgrade the package. you cannot downgrade
vhosts   array of string no
list of virtualhosts, the first one is the preferred
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)
SiteEditKeyCreate

parameter of site.key.create()

Name Default Type Mandatory
name   string yes
given name for the key
date_end None string no
expiration date, never expire if omitted
SiteEditKeyEdit

parameter of site.key.update()

Name Default Type Mandatory
date_end None string no
expiration date, never expire if set to nil
name   string no
given name for the key
PackageListOptions

parameter of site.package.list()

Name Default Type Mandatory
provider   string yes
provider name
>name   string no
use to get available packages for an upgrade.
items_per_page 100 int no
number of items returns for the pagination
page 0 int no
page number for pagination offset
sort_by   string no
used to sort returned items: provider

Returns

SiteReturn

returned by site.info() and site.list()

Name Type
autorenew struct
only returned with method site.info()
date_end dateTime.iso8601
expiration date of the site
date_end_commitment dateTime.iso8601
end of commitment date
edit_url string
url to browse in order to edit the site
only returned with method site.info()
host string
preferred virtual hostname
only returned with method site.list()
id int
site unique identifier
name string
given name of the site
owner string
handle of the site owner
only returned with method site.info()
package string
subscribed package
provider string
site builder tool provider
status string
current status of the site
vhosts array
list of all virtual hosts
only returned with method site.info()
SiteKeyReturn

returned by site.key.create(), site.key.list() and site.key.update()

Name Type
count_use int
number of times that the token has been consumed
date_created dateTime.iso8601
creation date
date_end dateTime.iso8601
expiration date of the token
date_last_used dateTime.iso8601
last time that the token has been consumed
name string
given name of the key
token string
token to consume to retrieve a site edition url
SitePackageListReturn

returned by site.package.list()

Name Type
name string
provider string