Skip to main content

job_logs

Creates, updates, deletes, gets or lists a job_logs resource.

Overview​

Namejob_logs
TypeResource
Idoci.resource_manager.job_logs

Fields​

The following fields are returned by SELECT queries:

Log entry for an operation resulting from a job's execution.

NameDatatypeDescription
levelstringSpecifies the severity level of the log entry. (TRACE, DEBUG, INFO, WARN, ERROR, FATAL)
messagestringThe log entry value.
timestampstring (date-time)The date and time of the log entry. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
typestringSpecifies the log type for the log entry. (TERRAFORM_CONSOLE)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectjobId, regionopc-request-id, type, levelGreaterThanOrEqualTo, sortOrder, limit, page, timestampGreaterThanOrEqualTo, timestampLessThanOrEqualToReturns console log entries for the specified job in JSON format.<br />For more information, see<br />[Getting Logs for a Job](/iaas/Content/ResourceManager/Tasks/get-job-logs.htm).<br />

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
jobIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the job.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
levelGreaterThanOrEqualTostringA filter that returns only log entries that match a given severity level or greater.
limitintegerThe number of items returned in a paginated List call. For information about pagination, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).
opc-request-idstringUnique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
pagestringThe value of the opc-next-page response header from the preceding List call. For information about pagination, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).
sortOrderstringThe sort order to use when sorting returned resources. Ascending (ASC) or descending (DESC).
timestampGreaterThanOrEqualTostring (date-time)Time stamp specifying the lower time limit for which logs are returned in a query. Format is defined by RFC3339. Example: 2020-01-01T12:00:00.000Z
timestampLessThanOrEqualTostring (date-time)Time stamp specifying the upper time limit for which logs are returned in a query. Format is defined by RFC3339. Example: 2020-02-01T12:00:00.000Z
typearrayA filter that returns only logs of a specified type.

SELECT examples​

Returns console log entries for the specified job in JSON format.<br />For more information, see<br />[Getting Logs for a Job](/iaas/Content/ResourceManager/Tasks/get-job-logs.htm).<br />

SELECT
level,
message,
timestamp,
type
FROM oci.resource_manager.job_logs
WHERE jobId = '{{ jobId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
AND type = '{{ type }}'
AND levelGreaterThanOrEqualTo = '{{ levelGreaterThanOrEqualTo }}'
AND sortOrder = '{{ sortOrder }}'
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND timestampGreaterThanOrEqualTo = '{{ timestampGreaterThanOrEqualTo }}'
AND timestampLessThanOrEqualTo = '{{ timestampLessThanOrEqualTo }}'
;