air_sdk.endpoints.ssh_keys

View as Markdown

Stub file for ssh_keys endpoint type hints.

Classes

NameDescription
SSHKeySSH Key model representing a user’s SSH public key.
SSHKeyEndpointAPIAPI client for SSH key endpoints.

Module Contents

class air_sdk.endpoints.ssh_keys.SSHKey

Bases: air_sdk.air_model.AirModel

SSH Key model representing a user’s SSH public key.

The string representation shows: id, name

id: str

Unique identifier for the SSH key

Timestamp when the SSH key was created

name: str

Human-readable name for the SSH key

fingerprint: str

SSH key fingerprint (automatically generated)

get_model_api() -> type[SSHKeyEndpointAPI]
model_api: SSHKeyEndpointAPI
delete() -> None

Delete this SSH key.

After deletion, the instance’s id will be set to None.

Example:

>>> ssh_key = api.ssh_keys.get('key-id')
>>> ssh_key.delete()
class air_sdk.endpoints.ssh_keys.SSHKeyEndpointAPI

Bases: air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.ssh_keys.SSHKey]

API client for SSH key endpoints.

API_PATH: str
model: type[SSHKey]
list(
*,
limit: int = ...,
offset: int = ...,
ordering: str = ...,
search: str = ...

List all SSH keys with optional filtering.

Parameters:

  • limit – Maximum number of results to return per page
  • offset – The initial index from which to return the results
  • ordering – Order objects by field. Prefix with ”-” for desc order
  • search – Search by name

Returns:

Iterator of SSHKey instances

Example:

>>> # List all SSH keys
>>> for key in api.ssh_keys.list():
... print(key.name, key.fingerprint)
>>> # Search by name
>>> for key in api.ssh_keys.list(search='my-key'):
... print(key.name)
>>> # Order by name descending
>>> for key in api.ssh_keys.list(ordering='-name'):
... print(key.name)
create(
*,
name: str,
public_key: str
) -> SSHKey

Create a new SSH key.

Parameters:

  • name – Human-readable name for the SSH key
  • public_key – The SSH public key content (e.g., “ssh-rsa AAAA…”)

Returns:

The created SSHKey instance

Example:

>>> ssh_key = api.ssh_keys.create(
name='my-laptop-key', public_key='ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB...'
)
>>> print(ssh_key.fingerprint)
get(pk: PrimaryKey) -> SSHKey

Get a specific SSH key by ID.

Parameters:

  • pk – The SSH key ID (string or UUID)

Returns:

The SSHKey instance

Example:

>>> ssh_key = api.ssh_keys.get('key-id')
>>> print(ssh_key.name, ssh_key.fingerprint)
delete(pk: PrimaryKey) -> None

Delete an SSH key by ID.

Parameters:

  • pk – The SSH key ID (string or UUID)

Returns:

None

Example:

>>> # Delete by ID
>>> api.ssh_keys.delete('key-id')