air_sdk.endpoints.ssh_keys#

Stub file for ssh_keys endpoint type hints.

Classes#

SSHKey

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

SSHKeyEndpointAPI

API client for SSH key endpoints.

Module Contents#

class air_sdk.endpoints.ssh_keys.SSHKey[source]#

Bases: air_sdk.air_model.AirModel

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

The string representation shows: id, name

id#

Unique identifier for the SSH key

created#

Timestamp when the SSH key was created

name#

Human-readable name for the SSH key

fingerprint#

SSH key fingerprint (automatically generated)

id: str#
created: datetime.datetime#
name: str#
fingerprint: str#
classmethod get_model_api() type[SSHKeyEndpointAPI][source]#

Returns the respective AirModelAPI type for this model.

property 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(
api: air_sdk.AirApi,
default_filters: dict[str, Any] | None = None,
)[source]#

Bases: air_sdk.air_model.BaseEndpointAPI[SSHKey]

API client for SSH key endpoints.

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

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: air_sdk.air_model.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: air_sdk.air_model.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')