Gandi

Table Of Contents

Previous topic

Virtual Machine API Reference

Next topic

Hosting Catalog API Reference

Http Reverse proxy API Reference

The hosting.rproxy API methods are used to manage http reverse proxy instances.

Methods

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

Count reverse proxies.

New in version 3.3.7.

Parameters:
Returns:

int – number of reverse proxies found

hosting.rproxy.create(apikey, params)

Create a reverse proxy.

New in version 3.3.7.

New in version 3.3.35: opened datacenter constraint

Parameters:
Returns:

list of struct – Operation rproxy_iaas_create and possibly a

hosting.rproxy.delete(apikey, rproxy)

Delete a reverse proxy.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • rproxy (int) – The reverse proxy id
Returns:

struct – Operation rproxy_iaas_delete

hosting.rproxy.info(apikey, rproxy)

Get reverse proxy information.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • rproxy (int) – The reverse proxy id
Returns:

struct – Reverse proxy description

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

List reverse proxies.

New in version 3.3.7.

Parameters:
Returns:

struct – list of reverse proxies description

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

Update a reverse proxy.

New in version 3.3.7.

Parameters:
Returns:

struct – Operation rproxy_iaas_update

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

Count reverse proxy servers.

New in version 3.3.7.

Parameters:
Returns:

int – Number of servers

hosting.rproxy.server.create(apikey, rproxy, params)

Create a server for a reverse proxy.

New in version 3.3.7.

Note

The server will be declared in the instance rproxy_id

Parameters:
  • apikey (string) – API connection key
  • rproxy (struct) – the reverse proxy id
  • params (struct) – Parameters
Returns:

struct – Operation rproxy_server_create

hosting.rproxy.server.delete(apikey, server)

Delete a server of a reverse proxy.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • server (int) – the server id
Returns:

struct – Operation rproxy_server_delete

hosting.rproxy.server.disable(apikey, server)

Disable a server.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • server (int) – the server id
Returns:

struct – Operation rproxy_server_update

hosting.rproxy.server.enable(apikey, server)

Enable a server.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • server (int) – the server id
Returns:

struct – Operation rproxy_server_update

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

List reverse proxy servers.

New in version 3.3.7.

Parameters:
Returns:

struct – servers information

hosting.rproxy.vhost.alter_zone(apikey, vhost, params)

Create a record in the domain zone for this virtual host.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • vhost (string) – FQDN of the virtual host
  • params (struct) – Zone alter parameters
Returns:

struct – Operation rproxy_iaas_zone_alter

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

Count virtual hosts related to reverse proxy.

New in version 3.3.7.

Parameters:
Returns:

int – Number of virtual hosts

hosting.rproxy.vhost.create(apikey, rproxy, params)

Create a virtual host.

New in version 3.3.7.

Note

The virtual host will be declared in the instance rproxy_id

Warning

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

Parameters:
  • apikey (string) – API connection key
  • rproxy (struct) – the reverse proxy id
  • params (struct) – FQDN of the virtual host
Returns:

list of struct – Operation rproxy_vhost_create and possibly a

hosting.rproxy.vhost.delete(apikey, vhost)

Delete a virtual host.

New in version 3.3.7.

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

struct – Operation rproxy_host_delete

hosting.rproxy.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.3.7.

Parameters:
Returns:

struct – Information on the dns entries you need to add

hosting.rproxy.vhost.info(apikey, vhost)

Get virtual host information.

New in version 3.3.7.

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

struct – Virtual host information

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

List virtual hosts related to reverse proxy.

New in version 3.3.7.

Parameters:
Returns:

struct – Virtual host information

hosting.rproxy.probe.check_server(apikey, server)

Test the current probe on a server.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • server (int) – The server id
Returns:

struct – result of probe on server

hosting.rproxy.probe.disable(apikey, rproxy)

Disable probe for a reverse proxy.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • rproxy (int) – The reverse proxy id
Returns:

struct – Operation rproxy_iaas_update

hosting.rproxy.probe.enable(apikey, rproxy)

Enable probe for a reverse proxy.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • rproxy (int) – The reverse proxy id
Returns:

struct – Operation rproxy_iaas_update

hosting.rproxy.probe.test(apikey, rproxy, params)

Test a given probe on all active servers of a reverse proxy.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • rproxy (int) – The reverse proxy id
  • params (struct) – Probe description
Returns:

struct – Result of test done

hosting.rproxy.probe.update(apikey, rproxy, params)

Update probe definition for a reverse proxy.

New in version 3.3.7.

Parameters:
  • apikey (string) – API connection key
  • rproxy (int) – reverse proxy id
  • params (struct) – Probe description
Returns:

struct – Operation rproxy_iaas_update

Parameters

LbAlgorithm

used by LbDescription

Name Description
round-robin basic round robin load balancing
client-ip load balancing using client ip address
LbDescription

used by RproxyCreate and RproxyUpdate

Name Default Type Mandatory
algorithm round-robin string no
RproxyCreate

parameter of hosting.rproxy.create()

Name Default Type Mandatory
datacenter_id   int yes
id of the datacenter of the instance
name   string yes
name of the reverse proxy
lb   struct no
Load balancing parameters
override False boolean no
Define the behaviour when a DNS record already exists (zone_alter must also be set)
probe   struct no
probe parameters
servers   array of struct no
initial servers to use
ssl_enable   boolean no
Enable SSL support
vhosts   array of string no
initial virtual hosts to manage
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)
RproxyId

parameter of hosting.rproxy.delete(), hosting.rproxy.info(), hosting.rproxy.probe.disable(), hosting.rproxy.probe.enable(), hosting.rproxy.probe.test(), hosting.rproxy.probe.update(), hosting.rproxy.server.create(), hosting.rproxy.update() and hosting.rproxy.vhost.create()

used by RproxyVhostListOptions and ServerListOptions

RproxyListOptions

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

Name Default Type Mandatory
<date_created   string no
>date_created   string 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: name, vhost
vhost   array of string or string no
~name   string no
RproxyProbeCreateDescription

used by RproxyCreate

Name Default Type Mandatory
enable False boolean no
enable or disable the probe
host 127.0.0.1 string no
virtual host to test
interval 10 int no
probe interval in seconds
method OPTIONS string no
HTTP method for probe
response 200 int no
HTTP response expected
threshold 3 int no
number of probes to consider in the window
timeout 5 int no
probe timeout in seconds
url   string no
probe url on the virtual host
window 5 int no
total number of probes to consider for health decisions
RproxyUpdate

parameter of hosting.rproxy.update()

Name Default Type Mandatory
lb   struct no
load balancing parameter
name   string no
name of the reverse proxy
ssl_enable   boolean no
enable or disable of ssl
RproxyState

used by RproxyVhostListOptions and ServerListOptions

Name Description
running rproxy is alive and running
being_created rproxy does not exist yet
locked rproxy is paused by Gandi for a legal reason
deleted rproxy is deleted
paused rproxy is alive but not running
ServerCreate

parameter of hosting.rproxy.server.create()

Name Default Type Mandatory
ip   string yes
Ip (v4 or v6) address for the server
port   int yes
Tcp port for the server
fallback   boolean no
ServerListOptions

parameter of hosting.rproxy.server.count() and hosting.rproxy.server.list()

Name Default Type Mandatory
id   int or array of int no
ip   string no
items_per_page 100 int no
number of items returned for the pagination
page 0 int no
page number for pagination offset
port   int no
rproxy_id   int no
sort_by   string no
used to sort returned items: id, ip, port, rproxy_id, state
state   string no
RproxyDnsEntry

parameter of hosting.rproxy.vhost.get_dns_entries()

Name Default Type Mandatory
datacenter   int yes
id of the datacenter where this virtual host will be located
vhost   string yes
virtual host name
RproxyVhostAlterZone

parameter of hosting.rproxy.vhost.alter_zone()

Name Default Type Mandatory
override False boolean no
RproxyVhostCreate

parameter of hosting.rproxy.vhost.create()

Name Default Type Mandatory
vhost   string yes
override False boolean no
zone_alter False boolean no
RproxyVhostListOptions

parameter of hosting.rproxy.vhost.count() and hosting.rproxy.vhost.list()

Name Default Type Mandatory
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
rproxy_id   int no
sort_by   string no
used to sort returned items: id, name, rproxy_id, state
state   string no
~name   string no
HttpVerb

used by RproxyProbeCreateDescription, RproxyProbeDescription and RproxyProbeUpdateDescription

Name Description
GET -
POST -
PUT -
DELETE -
OPTIONS -
RproxyProbeDescription

parameter of hosting.rproxy.probe.test()

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

Name Default Type Mandatory
enable   boolean no
useless parameter
host   string no
interval   int no
method   string no
response   int no
threshold   int no
timeout   int no
url   string no
window   int no
RproxyProbeUpdateDescription

parameter of hosting.rproxy.probe.update()

Name Default Type Mandatory
enable   boolean no
enable or disable the probe
host   string no
virtual host to test
interval   int no
probe interval in seconds
method   string no
HTTP method for probe
response   int no
HTTP response expected
threshold   int no
number of probes to consider in the window
timeout   int no
probe timeout in seconds
url   string no
probe url on the virtual host
window   int no
total number of probes to consider for health decisions

Returns

RproxyReturn

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

Name Type
datacenter struct
only returned with method hosting.rproxy.info()
datacenter_id int
id of the datacenter of the reverse proxy
only returned with method hosting.rproxy.list()
date_created dateTime.iso8601
entity_id string
id int
reverse proxy unique identifier
lb string
only returned with method hosting.rproxy.info()
name string
name of the reverse proxy
probe string
servers array of struct
ssl_enable boolean
state string
state of the reverse proxy
uuid int
technical uuid of this reverse proxy
vhosts array of struct
RproxyServerReturn

returned by hosting.rproxy.server.list()

used by RproxyReturn

Name Type
id int
server unique identifier
ip string
server ip address
port int
server tcp port
rproxy_id int
id of related reverse proxy
state string
server state
RproxyVhostReturn

returned by hosting.rproxy.vhost.info() and hosting.rproxy.vhost.list()

used by RproxyReturn

Name Type
cert_id string
related hosted certificate id
id int
virtual host unique identifier
name string
virtual host name
rproxy_id int
id of related reverse proxy
state string
virtual host state
ProbeTestGlobalReturn

returned by hosting.rproxy.probe.test()

Name Type
servers array of struct
all tested servers
status int
global status of probe testing
timeout double
estimated minimum timeout in seconds
ProbeTestReturn

returned by hosting.rproxy.probe.check_server()

used by ProbeTestGlobalReturn

Name Type
status int
status of probe on this server
timeout double
estimated minimum timeout in seconds