ActionsClient
- class ResourceActionsClient(client: ResourceClientBase | Client, resource: str | None)[source]
- get_all(status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None) list[BoundAction][source]
Returns all Actions.
- Parameters:
status – Filter the Actions by status.
sort – Sort Actions by field and direction.
- get_by_id(id: int) BoundAction[source]
Returns a specific Action by its ID.
- Parameters:
id – ID of the Action.
- get_list(status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult[source]
Returns a paginated list of Actions.
- Parameters:
status – Filter the Actions by status.
sort – Sort Actions by field and direction.
page – Page number to get.
per_page – Maximum number of Actions returned per page.
- class ActionsClient(client: Client)[source]
- get_all(status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None) list[BoundAction][source]
Deprecated since version 1.28: Use
client.<resource>.actions.get_all()instead, e.g. usinghcloud.certificates.client.CertificatesClient.actions.
- get_by_id(id: int) BoundAction
Returns a specific Action by its ID.
- Parameters:
id – ID of the Action.
- get_list(status: list[Literal['running', 'success', 'error']] | None = None, sort: list[Literal['id', 'id:asc', 'id:desc', 'command', 'command:asc', 'command:desc', 'status', 'status:asc', 'status:desc', 'started', 'started:asc', 'started:desc', 'finished', 'finished:asc', 'finished:desc']] | None = None, page: int | None = None, per_page: int | None = None) ActionsPageResult[source]
Deprecated since version 1.28: Use
client.<resource>.actions.get_list()instead, e.g. usinghcloud.certificates.client.CertificatesClient.actions.
- class BoundAction(client: ResourceClientBase, data: dict[str, Any], complete: bool = True)[source]
-
- wait_until_finished(max_retries: int | None = None) None[source]
Wait until the specific action has status=finished.
- Parameters:
max_retries – int Specify how many retries will be performed before an ActionTimeoutException will be raised.
- Raises:
ActionFailedException when action is finished with status==error
- Raises:
ActionTimeoutException when Action is still in status==running after max_retries is reached.
- class Action(id: int, command: str | None = None, status: Literal['running', 'success', 'error'] | None = None, progress: int | None = None, started: str | None = None, finished: str | None = None, resources: list[ActionResource] | None = None, error: ActionError | None = None)[source]
Action Domain
- Parameters:
id – int ID of an action
command – Command executed in the action
status – Status of the action
progress – Progress of action in percent
started – Point in time when the action was started
finished (datetime,None) – Point in time when the action was finished. Only set if the action is finished otherwise None
resources – Resources the action relates to
error – Error message for the action if error occurred, otherwise None.
- STATUS_ERROR = 'error'
Action Status error
- STATUS_RUNNING = 'running'
Action Status running
- STATUS_SUCCESS = 'success'
Action Status success