schedules
Creates, updates, deletes, gets or lists a schedules resource.
Overview​
| Name | schedules |
| Type | Resource |
| Id | oci.usage.schedules |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The saved schedule.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID representing a unique shedule. |
name | string (x-obmcs-ascii-identifier) | The unique name of the schedule created by the user. |
compartmentId | string | The customer tenancy. |
definedTags | object | Defined 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"}} |
description | string | The description of the schedule. |
freeformTags | object | Simple 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"} |
lifecycleState | string | The schedule lifecycle state. (ACTIVE, INACTIVE) |
outputFileFormat | string | Specifies the supported output file format. (CSV, PDF) (default: CSV) |
queryProperties | object | The query properties. |
resultLocation | object | The location where usage or cost CSVs will be uploaded defined by locationType, which corresponds with type-specific characteristics. |
savedReportId | string | The saved report ID which can also be used to generate a query. |
scheduleRecurrences | string (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. |
systemTags | object | Usage 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"}} |
timeCreated | string (date-time) | The date and time the schedule was created. |
timeNextRun | string (date-time) | The date and time of the next job execution. |
timeScheduled | string (date-time) | The date and time of the first time job execution. |
The saved schedule list.
| Name | Datatype | Description |
|---|---|---|
id | string | The schedule OCID. |
name | string | The unique name of the user-created schedule. |
definedTags | object | Defined 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"}} |
description | string | The description of the schedule. |
freeformTags | object | Simple 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"} |
lifecycleState | string | The schedule summary lifecycle state. (x-obmcs-enumref: #/definitions/Schedule/lifecycleState) |
scheduleRecurrences | string (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. |
systemTags | object | Usage 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"}} |
timeNextRun | string (date-time) | The date and time of the next job execution. |
timeScheduled | string (date-time) | The date and time of the first time job execution. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | scheduleId, region | opc-request-id | Returns the saved schedule.<br /> |
list | select | compartmentId, region | opc-request-id, page, limit, sortBy, sortOrder, name | Returns the saved schedule list.<br /> |
create | insert | region, name, compartmentId, resultLocation, scheduleRecurrences, timeScheduled | opc-request-id, opc-retry-token | Returns the created schedule.<br /> |
update | update | scheduleId, region | opc-request-id, if-match | Update a saved schedule.<br /> |
delete | delete | scheduleId, region | opc-request-id, if-match | Delete 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.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | The compartment ID in which to list resources. |
region | string | OCI 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) |
scheduleId | string | The schedule unique OCID. |
if-match | string | For 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. |
limit | integer | The maximum number of items to return. |
name | string | The query parameter for filtering by name. |
opc-request-id | string | Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. |
opc-retry-token | string | A 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. |
page | string | The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. |
sortBy | string | The field to sort by. If not specified, the default is timeCreated. |
sortOrder | string | The sort order to use, whether 'asc' or 'desc'. |
SELECT examples​
- get
- list
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 }}'
;
Returns the saved schedule list.<br />
SELECT
id,
name,
definedTags,
description,
freeformTags,
lifecycleState,
scheduleRecurrences,
systemTags,
timeNextRun,
timeScheduled
FROM oci.usage.schedules
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND name = '{{ name }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: schedules
props:
- name: region
value: "{{ region }}"
description: Required parameter for the schedules resource.
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The customer tenancy.
- name: definedTags
value: "{{ definedTags }}"
description: |
Defined 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"}}`
- name: description
value: "{{ description }}"
description: |
The description of the schedule.
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Simple 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"}`
- name: name
value: "{{ name }}"
description: |
The unique name of the user-created schedule.
- name: outputFileFormat
value: "{{ outputFileFormat }}"
description: |
Specifies the supported output file format.
valid_values: ['CSV', 'PDF']
default: CSV
- name: queryProperties
description: |
The query properties.
value:
compartmentDepth: {{ compartmentDepth }}
dateRange:
dateRangeType: "{{ dateRangeType }}"
filter:
dimensions:
- key: "{{ key }}"
value: "{{ value }}"
filters:
- dimensions: "{{ dimensions }}"
filters: "{{ filters }}"
operator: "{{ operator }}"
tags: "{{ tags }}"
operator: "{{ operator }}"
tags:
- key: "{{ key }}"
namespace: "{{ namespace }}"
value: "{{ value }}"
granularity: "{{ granularity }}"
groupBy:
- "{{ groupBy }}"
groupByTag:
- key: "{{ key }}"
namespace: "{{ namespace }}"
value: "{{ value }}"
isAggregateByTime: {{ isAggregateByTime }}
queryType: "{{ queryType }}"
- name: resultLocation
description: |
The location where usage or cost CSVs will be uploaded defined by `locationType`,
which corresponds with type-specific characteristics.
value:
locationType: "{{ locationType }}"
- name: savedReportId
value: "{{ savedReportId }}"
description: |
The saved report ID which can also be used to generate a query.
- name: scheduleRecurrences
value: "{{ scheduleRecurrences }}"
description: |
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.
- name: timeScheduled
value: "{{ timeScheduled }}"
description: |
The date and time of the first time job execution.
- name: opc-request-id
value: "{{ opc-request-id }}"
description: Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
description: Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: A 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.
description: A 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.
UPDATE examples​
- update
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
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 }}'
;