KeyPair Functions

class ai.backend.client.func.keypair.KeyPair(access_key)[source]

Provides interactions with keypairs.

session = None

The client session instance that this function class is bound to.

classmethod await create(user_id, is_active=True, is_admin=False, resource_policy=None, rate_limit=None, fields=None)[source]

Creates a new keypair with the given options. You need an admin privilege for this operation.

Return type

dict

classmethod await update(access_key, is_active=None, is_admin=None, resource_policy=None, rate_limit=None)[source]

Creates a new keypair with the given options. You need an admin privilege for this operation.

Return type

dict

classmethod await delete(access_key)[source]

Deletes an existing keypair with given ACCESSKEY.

classmethod await list(user_id=None, is_active=None, fields=None)[source]

Lists the keypairs. You need an admin privilege for this operation.

Return type

Sequence[dict]

await info(fields=None)[source]

Returns the keypair’s information such as resource limits.

Parameters

fields (Optional[Iterable[str]]) – Additional per-agent query fields to fetch.

New in version 18.12.

Return type

dict

classmethod await activate(access_key)[source]

Activates this keypair. You need an admin privilege for this operation.

Return type

dict

classmethod await deactivate(access_key)[source]

Deactivates this keypair. Deactivated keypairs cannot make any API requests unless activated again by an administrator. You need an admin privilege for this operation.

Return type

dict