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 –
Operationsitebuilder_zone_alter
-
site.count(apikey[, opts=nil])¶ Count sites.
New in version 3.2.14.
Parameters: - apikey (string) – API connection key
- opts (struct) –
Filtering options
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
catalog listingsto get the price.Parameters: - apikey (string) – API connection key
- params (struct) –
Parameters
Returns: struct –
Operationsitebuilder_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 –
Operationsitebuilder_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: - apikey (string) – API connection key
- opts (struct) –
Filtering options
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
catalog listingsto get the price.Parameters: - apikey (string) – API connection key
- site (string) – site unique identifier
- params (struct) –
renew information
Returns: struct –
Operationsitebuilder_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
catalog listingsto get the price.Parameters: - apikey (string) – API connection key
- site (string) – site unique identifier
- params (struct) –
Parameters
Returns: struct –
Operationsitebuilder_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 –
1if 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: - apikey (string) – API connection key
- opts (struct) –
Filtering options
Returns: struct –
list of package for a given provider
Parameters¶
RenewOptions¶parameter of
site.renew()
Name Default Type Mandatory duration string yes fixed boolean yes
PackageName¶used by
PackageListOptions,SiteCreate,SiteListOptions,SitePackageListReturn,SiteReturnandSiteUpdate
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 basekit6 - basekit6_whitelabel - basekit_whitelabel associated site must contain a bk-site.net vhost basekit_zh_hans - basekit_zh_hant -
ProviderName¶used by
PackageListOptions,SiteCreate,SiteListOptionsandSitePackageListReturn
Name Description basekit associated site must contain a gandi.ws vhost basekit6 - basekit6_whitelabel - basekit_whitelabel associated site must contain a bk-site.net vhost basekit_zh_hans - basekit_zh_hant -
Site¶parameter of
site.autorenew.activate(),site.autorenew.deactivate(),site.delete(),site.edit(),site.info(),site.key.create(),site.key.list(),site.renew()andsite.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 vhostsarray of string yes list of virtualhosts, the first one is the preferred duration 1m string no subscription period, used to calculate the date_endfixed False boolean no override False boolean no Define the behaviour when a DNS record already exists ( zone_altermust also be set)owner string no handle of the site owner packagefree string no providerbasekit 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 providerstring 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()andsite.list()
Name Default Type Mandatory contact string no date_end string no id int no items_per_page 100 int no number of items returned for the pagination name string no packagestring no page 0 int no page number for pagination offset providerstring no sharing_id string no sort_by string no used to sort returned items: contact, date_end, id, name, package, provider, sharing_id, status statusstring no ~name string no ~vhost string no
SiteStatus¶used by
SiteListOptionsandSiteReturn
Name Description active the site is running expired the site must be renew to be activelocked 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_endfixed 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_altermust also be set)packagestring no upgrade the package. you cannot downgrade vhostsarray 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 providerstring yes provider name >namestring no use to get available packages for an upgrade. 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: provider
Returns¶
SiteOperationReturn¶returned by
site.alter_zone(),site.create(),site.delete(),site.renew()andsite.update()
Name Type date_created dateTime.iso8601 date_start dateTime.iso8601 date_updated dateTime.iso8601 errortypestruct 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 infosarray 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 stepstring current step of the operation typestring 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 site:invalid_operation fatal The operation is not valid. site:wrong_status fatal Site need to be deleted to be restored. timeout temporary The query timeout unknown unknown Unknown
SiteReturn¶returned by
site.info()andsite.list()
Name Type autorenewstruct 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()entity_id string 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()packagestring subscribed package provider string site builder tool provider statusstring 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()andsite.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 namestring providerstring