Skip to main content

schedules

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

Overview​

Nameschedules
TypeResource
Idoci.usage.schedules

Fields​

The following fields are returned by SELECT queries:

The saved schedule.

NameDatatypeDescription
idstringThe OCID representing a unique shedule.
namestring (x-obmcs-ascii-identifier)The unique name of the schedule created by the user.
compartmentIdstringThe customer tenancy.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"foo-namespace": {"bar-key": "value"}}
descriptionstringThe description of the schedule.
freeformTagsobjectSimple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"bar-key": "value"}
lifecycleStatestringThe schedule lifecycle state. (ACTIVE, INACTIVE)
outputFileFormatstringSpecifies the supported output file format. (CSV, PDF) (default: CSV)
queryPropertiesobjectThe query properties.
resultLocationobjectThe location where usage or cost CSVs will be uploaded defined by locationType, which corresponds with type-specific characteristics.
savedReportIdstringThe saved report ID which can also be used to generate a query.
scheduleRecurrencesstring (x-obmcs-recurring-time)Specifies the frequency according to when the schedule will be run, in the x-obmcs-recurring-time format described in [RFC 5545 section 3.3.10](https:​//datatracker.ietf.org/doc/html/rfc5545#section-3.3.10). Supported values are : ONETIME, DAILY, WEEKLY and MONTHLY.
systemTagsobjectUsage of system tag keys. These predefined keys are scoped to namespaces. See [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"orcl-cloud": {"free-tier-retained": "true"}}
timeCreatedstring (date-time)The date and time the schedule was created.
timeNextRunstring (date-time)The date and time of the next job execution.
timeScheduledstring (date-time)The date and time of the first time job execution.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscheduleId, regionopc-request-idReturns the saved schedule.<br />
listselectcompartmentId, regionopc-request-id, page, limit, sortBy, sortOrder, nameReturns the saved schedule list.<br />
createinsertregion, name, compartmentId, resultLocation, scheduleRecurrences, timeScheduledopc-request-id, opc-retry-tokenReturns the created schedule.<br />
updateupdatescheduleId, regionopc-request-id, if-matchUpdate a saved schedule.<br />
deletedeletescheduleId, regionopc-request-id, if-matchDelete a saved scheduled report by the OCID.<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
compartmentIdstringThe compartment ID in which to list resources.
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)
scheduleIdstringThe schedule unique OCID.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted, only if the etag you provide matches the resource's current etag value.
limitintegerThe maximum number of items to return.
namestringThe query parameter for filtering by name.
opc-request-idstringUnique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error, without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
pagestringThe page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
sortBystringThe field to sort by. If not specified, the default is timeCreated.
sortOrderstringThe sort order to use, whether 'asc' or 'desc'.

SELECT examples​

Returns the saved schedule.<br />

SELECT
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
lifecycleState,
outputFileFormat,
queryProperties,
resultLocation,
savedReportId,
scheduleRecurrences,
systemTags,
timeCreated,
timeNextRun,
timeScheduled
FROM oci.usage.schedules
WHERE scheduleId = '{{ scheduleId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

INSERT examples​

Returns the created schedule.<br />

INSERT INTO oci.usage.schedules (
compartmentId,
definedTags,
description,
freeformTags,
name,
outputFileFormat,
queryProperties,
resultLocation,
savedReportId,
scheduleRecurrences,
timeScheduled,
region,
opc-request-id,
opc-retry-token
)
SELECT
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ description }}',
'{{ freeformTags }}',
'{{ name }}' /* required */,
'{{ outputFileFormat }}',
'{{ queryProperties }}',
'{{ resultLocation }}' /* required */,
'{{ savedReportId }}',
'{{ scheduleRecurrences }}' /* required */,
'{{ timeScheduled }}' /* required */,
'{{ region }}',
'{{ opc-request-id }}',
'{{ opc-retry-token }}'
RETURNING
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
lifecycleState,
outputFileFormat,
queryProperties,
resultLocation,
savedReportId,
scheduleRecurrences,
systemTags,
timeCreated,
timeNextRun,
timeScheduled
;

UPDATE examples​

Update a saved schedule.<br />

UPDATE oci.usage.schedules
SET
definedTags = '{{ definedTags }}',
description = '{{ description }}',
freeformTags = '{{ freeformTags }}',
outputFileFormat = '{{ outputFileFormat }}',
resultLocation = '{{ resultLocation }}'
WHERE
scheduleId = '{{ scheduleId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id}}'
AND if-match = '{{ if-match}}'
RETURNING
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
lifecycleState,
outputFileFormat,
queryProperties,
resultLocation,
savedReportId,
scheduleRecurrences,
systemTags,
timeCreated,
timeNextRun,
timeScheduled;

DELETE examples​

Delete a saved scheduled report by the OCID.<br />

DELETE FROM oci.usage.schedules
WHERE scheduleId = '{{ scheduleId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id }}'
AND if-match = '{{ if-match }}'
;