Job¶
-
class
oci.resource_manager.models.
Job
(**kwargs)¶ Bases:
object
The properties that define a job. Jobs perform the actions that are defined in your configuration. - 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.
Attributes
LIFECYCLE_STATE_ACCEPTED
A constant which can be used with the lifecycle_state property of a Job. LIFECYCLE_STATE_CANCELED
A constant which can be used with the lifecycle_state property of a Job. LIFECYCLE_STATE_CANCELING
A constant which can be used with the lifecycle_state property of a Job. LIFECYCLE_STATE_FAILED
A constant which can be used with the lifecycle_state property of a Job. LIFECYCLE_STATE_IN_PROGRESS
A constant which can be used with the lifecycle_state property of a Job. LIFECYCLE_STATE_SUCCEEDED
A constant which can be used with the lifecycle_state property of a Job. OPERATION_APPLY
A constant which can be used with the operation property of a Job. OPERATION_DESTROY
A constant which can be used with the operation property of a Job. OPERATION_IMPORT_TF_STATE
A constant which can be used with the operation property of a Job. OPERATION_PLAN
A constant which can be used with the operation property of a Job. apply_job_plan_resolution
Gets the apply_job_plan_resolution of this Job. compartment_id
Gets the compartment_id of this Job. config_source
Gets the config_source of this Job. defined_tags
Gets the defined_tags of this Job. display_name
Gets the display_name of this Job. failure_details
Gets the failure_details of this Job. freeform_tags
Gets the freeform_tags of this Job. id
Gets the id of this Job. job_operation_details
Gets the job_operation_details of this Job. lifecycle_state
Gets the lifecycle_state of this Job. operation
Gets the operation of this Job. resolved_plan_job_id
Gets the resolved_plan_job_id of this Job. stack_id
Gets the stack_id of this Job. time_created
Gets the time_created of this Job. time_finished
Gets the time_finished of this Job. variables
Gets the variables of this Job. working_directory
Gets the working_directory of this Job. Methods
__init__
(**kwargs)Initializes a new Job object with values from keyword arguments. -
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 (oci.resource_manager.models.JobOperationDetails) – The value to assign to the job_operation_details property of this Job.
- apply_job_plan_resolution (oci.resource_manager.models.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 (oci.resource_manager.models.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.
- config_source (oci.resource_manager.models.ConfigSourceRecord) – The value to assign to the config_source 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.
Returns: The apply_job_plan_resolution of this Job. Return type: oci.resource_manager.models.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
-
config_source
¶ Gets the config_source of this Job.
Returns: The config_source of this Job. Return type: oci.resource_manager.models.ConfigSourceRecord
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: oci.resource_manager.models.FailureDetails
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)
-
job_operation_details
¶ Gets the job_operation_details of this Job.
Returns: The job_operation_details of this Job. Return type: oci.resource_manager.models.JobOperationDetails
-
lifecycle_state
¶ Gets the lifecycle_state of this Job. Current state of the specified job. For more information about job lifecycle states in Resource Manager, see Key Concepts.
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 when the job was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
Returns: The time_created of this Job. Return type: datetime
-
time_finished
¶ Gets the time_finished of this Job. The date and time when the job stopped running, irrespective of whether the job ran successfully. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
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 250. 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. File path to the directory from which Terraform runs. If not specified, the root directory is used. This parameter is ignored for the configSourceType value of COMPARTMENT_CONFIG_SOURCE.
Returns: The working_directory of this Job. Return type: str
-