WorkRequest

class oci.pss.models.WorkRequest(**kwargs)

Bases: object

An asynchronous work request. Work requests help you monitor long-running operations. When you start a long-running operation, the service creates a work request. A work request is an activity log that lets you track each step in the operation’s progress. Each work request has an OCID that lets you interact with it programmatically and use it for automation.

Attributes:

OPERATION_TYPE_CREATE_INSTANCE

A constant which can be used with the operation_type property of a WorkRequest.

OPERATION_TYPE_DELETE_INSTANCE

A constant which can be used with the operation_type property of a WorkRequest.

OPERATION_TYPE_MOVE_INSTANCE

A constant which can be used with the operation_type property of a WorkRequest.

OPERATION_TYPE_UPDATE_INSTANCE

A constant which can be used with the operation_type property of a WorkRequest.

STATUS_ACCEPTED

A constant which can be used with the status property of a WorkRequest.

STATUS_CANCELED

A constant which can be used with the status property of a WorkRequest.

STATUS_CANCELING

A constant which can be used with the status property of a WorkRequest.

STATUS_FAILED

A constant which can be used with the status property of a WorkRequest.

STATUS_IN_PROGRESS

A constant which can be used with the status property of a WorkRequest.

STATUS_NEEDS_ATTENTION

A constant which can be used with the status property of a WorkRequest.

STATUS_SUCCEEDED

A constant which can be used with the status property of a WorkRequest.

STATUS_WAITING

A constant which can be used with the status property of a WorkRequest.

compartment_id

[Required] Gets the compartment_id of this WorkRequest.

id

[Required] Gets the id of this WorkRequest.

operation_type

[Required] Gets the operation_type of this WorkRequest.

percent_complete

[Required] Gets the percent_complete of this WorkRequest.

resources

[Required] Gets the resources of this WorkRequest.

status

[Required] Gets the status of this WorkRequest.

time_accepted

[Required] Gets the time_accepted of this WorkRequest.

time_finished

Gets the time_finished of this WorkRequest.

time_started

Gets the time_started of this WorkRequest.

time_updated

[Required] Gets the time_updated of this WorkRequest.

Methods:

__init__(**kwargs)

Initializes a new WorkRequest object with values from keyword arguments.

OPERATION_TYPE_CREATE_INSTANCE = 'CREATE_INSTANCE'

A constant which can be used with the operation_type property of a WorkRequest. This constant has a value of “CREATE_INSTANCE”

OPERATION_TYPE_DELETE_INSTANCE = 'DELETE_INSTANCE'

A constant which can be used with the operation_type property of a WorkRequest. This constant has a value of “DELETE_INSTANCE”

OPERATION_TYPE_MOVE_INSTANCE = 'MOVE_INSTANCE'

A constant which can be used with the operation_type property of a WorkRequest. This constant has a value of “MOVE_INSTANCE”

OPERATION_TYPE_UPDATE_INSTANCE = 'UPDATE_INSTANCE'

A constant which can be used with the operation_type property of a WorkRequest. This constant has a value of “UPDATE_INSTANCE”

STATUS_ACCEPTED = 'ACCEPTED'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “ACCEPTED”

STATUS_CANCELED = 'CANCELED'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “CANCELED”

STATUS_CANCELING = 'CANCELING'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “CANCELING”

STATUS_FAILED = 'FAILED'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “FAILED”

STATUS_IN_PROGRESS = 'IN_PROGRESS'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “IN_PROGRESS”

STATUS_NEEDS_ATTENTION = 'NEEDS_ATTENTION'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “NEEDS_ATTENTION”

STATUS_SUCCEEDED = 'SUCCEEDED'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “SUCCEEDED”

STATUS_WAITING = 'WAITING'

A constant which can be used with the status property of a WorkRequest. This constant has a value of “WAITING”

__init__(**kwargs)

Initializes a new WorkRequest object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters
  • operation_type (str) – The value to assign to the operation_type property of this WorkRequest. Allowed values for this property are: “CREATE_INSTANCE”, “UPDATE_INSTANCE”, “DELETE_INSTANCE”, “MOVE_INSTANCE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • status (str) – The value to assign to the status property of this WorkRequest. Allowed values for this property are: “ACCEPTED”, “IN_PROGRESS”, “WAITING”, “NEEDS_ATTENTION”, “FAILED”, “SUCCEEDED”, “CANCELING”, “CANCELED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • id (str) – The value to assign to the id property of this WorkRequest.

  • compartment_id (str) – The value to assign to the compartment_id property of this WorkRequest.

  • resources (list[oci.pss.models.WorkRequestResource]) – The value to assign to the resources property of this WorkRequest.

  • percent_complete (float) – The value to assign to the percent_complete property of this WorkRequest.

  • time_accepted (datetime) – The value to assign to the time_accepted property of this WorkRequest.

  • time_started (datetime) – The value to assign to the time_started property of this WorkRequest.

  • time_finished (datetime) – The value to assign to the time_finished property of this WorkRequest.

  • time_updated (datetime) – The value to assign to the time_updated property of this WorkRequest.

property compartment_id

[Required] Gets the compartment_id of this WorkRequest. The OCID of the compartment that contains the work request.

Returns

The compartment_id of this WorkRequest.

Return type

str

property id

[Required] Gets the id of this WorkRequest. The OCID of the work request.

Returns

The id of this WorkRequest.

Return type

str

property operation_type

[Required] Gets the operation_type of this WorkRequest. The asynchronous operation tracked by this work request.

Allowed values for this property are: “CREATE_INSTANCE”, “UPDATE_INSTANCE”, “DELETE_INSTANCE”, “MOVE_INSTANCE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The operation_type of this WorkRequest.

Return type

str

property percent_complete

[Required] Gets the percent_complete of this WorkRequest. Shows the progress of the operation tracked by the work request, as a percentage of the total work that must be performed.

Returns

The percent_complete of this WorkRequest.

Return type

float

property resources

[Required] Gets the resources of this WorkRequest. The resources that are affected by the work request.

Returns

The resources of this WorkRequest.

Return type

list[oci.pss.models.WorkRequestResource]

property status

[Required] Gets the status of this WorkRequest. The status of the work request.

Allowed values for this property are: “ACCEPTED”, “IN_PROGRESS”, “WAITING”, “NEEDS_ATTENTION”, “FAILED”, “SUCCEEDED”, “CANCELING”, “CANCELED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The status of this WorkRequest.

Return type

str

property time_accepted

[Required] Gets the time_accepted of this WorkRequest. The date and time the work request was created, in the format defined by RFC 3339.

Returns

The time_accepted of this WorkRequest.

Return type

datetime

property time_finished

Gets the time_finished of this WorkRequest. The date and time the work request was finished, in the format defined by RFC 3339.

Returns

The time_finished of this WorkRequest.

Return type

datetime

property time_started

Gets the time_started of this WorkRequest. The date and time the work request was started, in the format defined by RFC 3339.

Returns

The time_started of this WorkRequest.

Return type

datetime

property time_updated

[Required] Gets the time_updated of this WorkRequest. The date and time the work request was updated, in the format defined by RFC 3339.

Returns

The time_updated of this WorkRequest.

Return type

datetime