SSHKeysClient

class SSHKeysClient(client: Client)[source]
create(name: str, public_key: str, labels: dict[str, str] | None = None) BoundSSHKey[source]

Creates a new SSH key with the given name and public_key.

Parameters:
  • name – str

  • public_key – str Public Key of the SSH Key you want create

  • labels – Dict[str, str] (optional) User-defined labels (key-value pairs)

Returns:

BoundSSHKey

delete(ssh_key: SSHKey | BoundSSHKey) bool[source]

Deletes an SSH key. It cannot be used anymore.

Parameters:

ssh_keyBoundSSHKey or SSHKey

Returns:

True

get_all(name: str | None = None, fingerprint: str | None = None, label_selector: str | None = None) list[BoundSSHKey][source]

Get all SSH keys from the account

Parameters:
  • name – str (optional) Can be used to filter SSH keys by their name. The response will only contain the SSH key matching the specified name.

  • fingerprint – str (optional) Can be used to filter SSH keys by their fingerprint. The response will only contain the SSH key matching the specified fingerprint.

  • label_selector – str (optional) Can be used to filter SSH keys by labels. The response will only contain SSH keys matching the label selector.

Returns:

List[BoundSSHKey]

get_by_fingerprint(fingerprint: str) BoundSSHKey | None[source]

Get ssh key by fingerprint

Parameters:

fingerprint – str Used to get ssh key by fingerprint.

Returns:

BoundSSHKey

get_by_id(id: int) BoundSSHKey[source]

Get a specific SSH Key by its ID

Parameters:

id – int

Returns:

BoundSSHKey

get_by_name(name: str) BoundSSHKey | None[source]

Get ssh key by name

Parameters:

name – str Used to get ssh key by name.

Returns:

BoundSSHKey

get_list(name: str | None = None, fingerprint: str | None = None, label_selector: str | None = None, page: int | None = None, per_page: int | None = None) SSHKeysPageResult[source]

Get a list of SSH keys from the account

Parameters:
  • name – str (optional) Can be used to filter SSH keys by their name. The response will only contain the SSH key matching the specified name.

  • fingerprint – str (optional) Can be used to filter SSH keys by their fingerprint. The response will only contain the SSH key matching the specified fingerprint.

  • label_selector – str (optional) Can be used to filter SSH keys by labels. The response will only contain SSH keys matching the label selector.

  • page – int (optional) Specifies the page to fetch

  • per_page – int (optional) Specifies how many results are returned by page

Returns:

(List[BoundSSHKey], Meta)

update(ssh_key: SSHKey | BoundSSHKey, name: str | None = None, labels: dict[str, str] | None = None) BoundSSHKey[source]

Updates an SSH key. You can update an SSH key name and an SSH key labels.

Parameters:
  • ssh_keyBoundSSHKey or SSHKey

  • name – str (optional) New Description to set

  • labels – Dict[str, str] (optional) User-defined labels (key-value pairs)

Returns:

BoundSSHKey

class BoundSSHKey(client: ClientEntityBase, data: dict, complete: bool = True)[source]
delete() bool[source]

Deletes an SSH key. It cannot be used anymore. :return: boolean

model

alias of SSHKey

update(name: str | None = None, labels: dict[str, str] | None = None) BoundSSHKey[source]

Updates an SSH key. You can update an SSH key name and an SSH key labels.

Parameters:
  • description – str (optional) New Description to set

  • labels – Dict[str, str] (optional) User-defined labels (key-value pairs)

Returns:

BoundSSHKey

class SSHKey(id: int | None = None, name: str | None = None, fingerprint: str | None = None, public_key: str | None = None, labels: dict[str, str] | None = None, created: str | None = None)[source]

SSHKey Domain

Parameters:
  • id – int ID of the SSH key

  • name – str Name of the SSH key (must be unique per project)

  • fingerprint – str Fingerprint of public key

  • public_key – str Public Key

  • labels – Dict User-defined labels (key-value pairs)

  • created – datetime Point in time when the SSH Key was created