Jobs¶
Accessed via client.jobs.
pyawe.client.JobsClient
¶
Methods for the /jobs resource.
list
¶
Return all jobs, optionally filtered by team.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team_id
|
Optional[Union[UUID, str]]
|
When supplied, returns only jobs for this team. |
None
|
Returns:
| Type | Description |
|---|---|
List[Job]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
create
¶
create(name: str, *, status: Optional[Union[Status, str]] = None, schedule_status: Optional[Union[ScheduleStatus, str]] = None, team_id: Optional[Union[UUID, str]] = None, project_id: Optional[Union[UUID, str]] = None, job_type: Optional[str] = None, start_date: Optional[str] = None, end_date: Optional[str] = None) -> Job
Create a new job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Job name. |
required |
status
|
Optional[Union[Status, str]]
|
Initial status (default |
None
|
schedule_status
|
Optional[Union[ScheduleStatus, str]]
|
Initial schedule status (default |
None
|
team_id
|
Optional[Union[UUID, str]]
|
Assign to a team. |
None
|
project_id
|
Optional[Union[UUID, str]]
|
Associate with a project. |
None
|
job_type
|
Optional[str]
|
|
None
|
start_date
|
Optional[str]
|
Sprint start date (ISO 8601, e.g. |
None
|
end_date
|
Optional[str]
|
Sprint end date (ISO 8601). |
None
|
Returns:
| Type | Description |
|---|---|
Job
|
The newly created :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
AweValidationError
|
On a 400 response. |
get
¶
Fetch a job with its associated workflows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
Union[UUID, str]
|
UUID of the job. |
required |
Returns:
| Type | Description |
|---|---|
JobWithWorkflows
|
class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the job does not exist. |
AweAuthError
|
If not authenticated. |
update
¶
update(job_id: Union[UUID, str], *, name: Optional[str] = None, status: Optional[Union[Status, str]] = None, schedule_status: Optional[Union[ScheduleStatus, str]] = None, archived: Optional[bool] = None, project_id: Optional[Union[UUID, str]] = None, job_type: Optional[str] = None, start_date: Optional[str] = None, end_date: Optional[str] = None) -> Job
Update a job; only supplied fields are changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
Union[UUID, str]
|
UUID of the job to update. |
required |
name
|
Optional[str]
|
New name. |
None
|
status
|
Optional[Union[Status, str]]
|
New status. |
None
|
schedule_status
|
Optional[Union[ScheduleStatus, str]]
|
New schedule status. |
None
|
archived
|
Optional[bool]
|
Archive flag. |
None
|
project_id
|
Optional[Union[UUID, str]]
|
Reassign to a different project. |
None
|
job_type
|
Optional[str]
|
|
None
|
start_date
|
Optional[str]
|
Sprint start date (ISO 8601). |
None
|
end_date
|
Optional[str]
|
Sprint end date (ISO 8601). |
None
|
Returns:
| Type | Description |
|---|---|
Job
|
The updated :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the job does not exist. |
AweAuthError
|
If not authenticated. |
delete
¶
Delete a job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
Union[UUID, str]
|
UUID of the job to delete. |
required |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the job does not exist. |
AweAuthError
|
If not authenticated. |
clone_workflow
¶
Clone a workflow template into a job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
Union[UUID, str]
|
UUID of the target job. |
required |
workflow_id
|
Union[UUID, str]
|
UUID of the workflow template to clone. |
required |
Returns:
| Type | Description |
|---|---|
WorkflowWithTasks
|
The new :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the job or workflow does not exist. |
AweAuthError
|
If not authenticated. |
set_team
¶
Assign a job to a team.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
Union[UUID, str]
|
UUID of the job. |
required |
team_id
|
Union[UUID, str]
|
UUID of the team. |
required |
Returns:
| Type | Description |
|---|---|
Job
|
The updated :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the job does not exist. |
AweAuthError
|
If not authenticated. |
clear_team
¶
Remove the team assignment from a job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
Union[UUID, str]
|
UUID of the job. |
required |
Returns:
| Type | Description |
|---|---|
Job
|
The updated :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the job does not exist. |
AweAuthError
|
If not authenticated. |