runzero.api.tasks
¶
Management of runZero tasks.
Module Contents¶
Classes¶
Management of runZero tasks. |
- class runzero.api.tasks.Tasks(client: runzero.client.Client)[source]¶
Management of runZero tasks.
- Parameters:
client (runzero.client.Client) – A handle to the
runzero.Client
client which manages interactions with the runZero server.
Constructor method
- get(org_id: uuid.UUID, name: str | None = None, task_id: uuid.UUID | None = None) runzero.types.Task | None [source]¶
Retrieves the runZero Task with the provided name or id, if it exists in your organization.
- Parameters:
- Raises:
AuthError, ClientError, ServerError ValueError if neither task_id nor name are provided.
- Return type:
Optional[runzero.types.Task]
- get_all(org_id: uuid.UUID, status: str | None = None, query: str | None = None) List[runzero.types.Task] [source]¶
Retrieves all runZero Tasks available within the given Organization
- Parameters:
org_id (uuid.UUID) – The unique ID of the organization to retrieve the tasks from.
status (Optional[str]) – An optional status value to filter tasks by. This is a case-insensitive string match, stripped of surrounding whitespace.
query (Optional[str]) – An optional query to filter returned tasks. Query string format is the same as in-UI search. See https://www.runzero.com/docs/search-query-tasks/
- Returns:
A list of all tasks
- Return type:
List[runzero.types.Task]
- get_status(org_id: uuid.UUID, task_id: uuid.UUID) str | None [source]¶
Retrieves the status of a runZero Task with the provided id, if it exists in your organization.
The org_id should be provided if using an Account level api key.
- hide(org_id: uuid.UUID, task_id: uuid.UUID) runzero.types.Task [source]¶
Signal that a completed task should be hidden.
- stop(org_id: uuid.UUID, task_id: uuid.UUID) runzero.types.Task [source]¶
Signals an explorer to stop a currently running task, or signals server to remove a future or recurring task.