Gandi

Table Of Contents

Previous topic

Product API Reference

Next topic

Metric API Reference

SSH API Reference

The hosting.ssh API is used to handle user ssh keys.

Methods

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

Count ssh keys for a hosting account

New in version 3.3.19.

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

int – number of ssh keys found

hosting.ssh.create(apikey, params)

Create a new ssh key.

New in version 3.3.19.

Parameters:
Returns:

struct – ssh key information

hosting.ssh.delete(apikey, key_id)

Delete an ssh key

New in version 3.3.19.

Parameters:
  • apikey (string) – API connection key
  • key_id (struct) – Id of ssh key
Returns:

boolean – 1 if the ssh key has been created

hosting.ssh.info(apikey, key_id)

Return information about a public ssh key

New in version 3.3.19.

Parameters:
  • apikey (string) – API connection key
  • key_id (struct) – Id of ssh key
Returns:

struct – ssh key information

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

List ssh keys for a hosting account

New in version 3.3.19.

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

struct – list of ssh keys

Parameters

SshKey

parameter of hosting.ssh.delete() and hosting.ssh.info()

SshKeyCreateParam

parameter of hosting.ssh.create()

Name Default Type Mandatory
value   string yes
name   string no
SshKeyFilterParam

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

Name Default Type Mandatory
fingerprint   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: fingerprint, name

Returns

SshKeyReturn

returned by hosting.ssh.create(), hosting.ssh.info() and hosting.ssh.list()

Name Type
fingerprint string
id int
ssh key unique identifier
name string
ssh key name
value string
only returned with method hosting.ssh.info()