Skip to content

keys

Accessed as client.admin.users.keys; the async client mirrors it.

AdminUsersKeys

The admin.users.keys namespace.

create

create(username: str, *, key: str, read_only: bool | None = None, title: str) -> PublicKey

Add an SSH public key to user's account.

Parameters:

Name Type Description Default
username str

username of the user

required
key str

An armored SSH key to add

required
read_only bool | None

Describe if the key has only read access or read/write

None
title str

Title of the key to add

required

Returns:

Type Description
PublicKey

PublicKey.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: adminCreatePublicKey

delete

delete(username: str, id: int) -> None

Remove a public key from user's account.

Parameters:

Name Type Description Default
username str

username of user

required
id int

id of the key to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: adminDeleteUserPublicKey

AsyncAdminUsersKeys

The admin.users.keys namespace.

create

create(username: str, *, key: str, read_only: bool | None = None, title: str) -> PublicKey

Add an SSH public key to user's account.

Parameters:

Name Type Description Default
username str

username of the user

required
key str

An armored SSH key to add

required
read_only bool | None

Describe if the key has only read access or read/write

None
title str

Title of the key to add

required

Returns:

Type Description
PublicKey

PublicKey.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: adminCreatePublicKey

delete

delete(username: str, id: int) -> None

Remove a public key from user's account.

Parameters:

Name Type Description Default
username str

username of user

required
id int

id of the key to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: adminDeleteUserPublicKey