air_sdk.endpoints.ssh_keys#
Stub file for ssh_keys endpoint type hints.
Classes#
SSH Key model representing a user's SSH public key. |
|
API client for SSH key endpoints. |
Module Contents#
- class air_sdk.endpoints.ssh_keys.SSHKey[source]#
Bases:
air_sdk.air_model.AirModelSSH 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)
- created: datetime.datetime#
- classmethod get_model_api() type[SSHKeyEndpointAPI][source]#
Returns the respective AirModelAPI type for this model.
- property model_api: SSHKeyEndpointAPI#
- class air_sdk.endpoints.ssh_keys.SSHKeyEndpointAPI(
- api: air_sdk.AirApi,
- default_filters: dict[str, Any] | None = None,
Bases:
air_sdk.air_model.BaseEndpointAPI[SSHKey]API client for SSH key endpoints.
- list( ) 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)