Job

class oci.resource_manager.models.Job(**kwargs)

Bases: object

Jobs perform the actions that are defined in your configuration. There are three job types - Plan job. A plan job takes your Terraform configuration, parses it, and creates an execution plan. - Apply job. The apply job takes your execution plan, applies it to the associated stack, then executes the configuration's instructions. - Destroy job. To clean up the infrastructure controlled by the stack, you run a destroy job. A destroy job does not delete the stack or associated job resources, but instead releases the resources managed by the stack. - Import_TF_State job. An import Terraform state job takes a Terraform state file and sets it as the current state of the stack. This is used to migrate local Terraform environments to Resource Manager.

LIFECYCLE_STATE_ACCEPTED = 'ACCEPTED'

A constant which can be used with the lifecycle_state property of a Job. This constant has a value of "ACCEPTED"

LIFECYCLE_STATE_CANCELED = 'CANCELED'

A constant which can be used with the lifecycle_state property of a Job. This constant has a value of "CANCELED"

LIFECYCLE_STATE_CANCELING = 'CANCELING'

A constant which can be used with the lifecycle_state property of a Job. This constant has a value of "CANCELING"

LIFECYCLE_STATE_FAILED = 'FAILED'

A constant which can be used with the lifecycle_state property of a Job. This constant has a value of "FAILED"

LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'

A constant which can be used with the lifecycle_state property of a Job. This constant has a value of "IN_PROGRESS"

LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED'

A constant which can be used with the lifecycle_state property of a Job. This constant has a value of "SUCCEEDED"

OPERATION_APPLY = 'APPLY'

A constant which can be used with the operation property of a Job. This constant has a value of "APPLY"

OPERATION_DESTROY = 'DESTROY'

A constant which can be used with the operation property of a Job. This constant has a value of "DESTROY"

OPERATION_IMPORT_TF_STATE = 'IMPORT_TF_STATE'

A constant which can be used with the operation property of a Job. This constant has a value of "IMPORT_TF_STATE"

OPERATION_PLAN = 'PLAN'

A constant which can be used with the operation property of a Job. This constant has a value of "PLAN"

__init__(**kwargs)

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

Parameters:
  • id (str) -- The value to assign to the id property of this Job.
  • stack_id (str) -- The value to assign to the stack_id property of this Job.
  • compartment_id (str) -- The value to assign to the compartment_id property of this Job.
  • display_name (str) -- The value to assign to the display_name property of this Job.
  • operation (str) -- The value to assign to the operation property of this Job. Allowed values for this property are: "PLAN", "APPLY", "DESTROY", "IMPORT_TF_STATE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • job_operation_details (JobOperationDetails) -- The value to assign to the job_operation_details property of this Job.
  • apply_job_plan_resolution (ApplyJobPlanResolution) -- The value to assign to the apply_job_plan_resolution property of this Job.
  • resolved_plan_job_id (str) -- The value to assign to the resolved_plan_job_id property of this Job.
  • time_created (datetime) -- The value to assign to the time_created property of this Job.
  • time_finished (datetime) -- The value to assign to the time_finished property of this Job.
  • lifecycle_state (str) -- The value to assign to the lifecycle_state property of this Job. Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • failure_details (FailureDetails) -- The value to assign to the failure_details property of this Job.
  • working_directory (str) -- The value to assign to the working_directory property of this Job.
  • variables (dict(str, str)) -- The value to assign to the variables property of this Job.
  • freeform_tags (dict(str, str)) -- The value to assign to the freeform_tags property of this Job.
  • defined_tags (dict(str, dict(str, object))) -- The value to assign to the defined_tags property of this Job.
apply_job_plan_resolution

Gets the apply_job_plan_resolution of this Job. Deprecated. Use the property executionPlanStrategy in jobOperationDetails instead.

Returns:The apply_job_plan_resolution of this Job.
Return type:ApplyJobPlanResolution
compartment_id

Gets the compartment_id of this Job. The OCID of the compartment in which the job's associated stack resides.

Returns:The compartment_id of this Job.
Return type:str
defined_tags

Gets the defined_tags of this Job. Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations": {"CostCenter": "42"}}

Returns:The defined_tags of this Job.
Return type:dict(str, dict(str, object))
display_name

Gets the display_name of this Job. The job's display name.

Returns:The display_name of this Job.
Return type:str
failure_details

Gets the failure_details of this Job.

Returns:The failure_details of this Job.
Return type:FailureDetails
freeform_tags

Gets the freeform_tags of this Job. Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

Returns:The freeform_tags of this Job.
Return type:dict(str, str)
id

Gets the id of this Job. The job's OCID.

Returns:The id of this Job.
Return type:str
job_operation_details

Gets the job_operation_details of this Job. Job details that are specific to the operation type.

Returns:The job_operation_details of this Job.
Return type:JobOperationDetails
lifecycle_state

Gets the lifecycle_state of this Job. Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The lifecycle_state of this Job.
Return type:str
operation

Gets the operation of this Job. The type of job executing.

Allowed values for this property are: "PLAN", "APPLY", "DESTROY", "IMPORT_TF_STATE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The operation of this Job.
Return type:str
resolved_plan_job_id

Gets the resolved_plan_job_id of this Job. Deprecated. Use the property executionPlanJobId in jobOperationDetails instead. The plan job OCID that was used (if this was an apply job and was not auto-approved).

Returns:The resolved_plan_job_id of this Job.
Return type:str
stack_id

Gets the stack_id of this Job. The OCID of the stack that is associated with the job.

Returns:The stack_id of this Job.
Return type:str
time_created

Gets the time_created of this Job. The date and time at which the job was created.

Returns:The time_created of this Job.
Return type:datetime
time_finished

Gets the time_finished of this Job. The date and time at which the job stopped running, irrespective of whether the job ran successfully.

Returns:The time_finished of this Job.
Return type:datetime
variables

Gets the variables of this Job. Terraform variables associated with this resource. Maximum number of variables supported is 100. The maximum size of each variable, including both name and value, is 4096 bytes. Example: {"CompartmentId": "compartment-id-value"}

Returns:The variables of this Job.
Return type:dict(str, str)
working_directory

Gets the working_directory of this Job. The file path to the directory within the configuration from which the job runs.

Returns:The working_directory of this Job.
Return type:str