oracle.oci.oci_usage_schedule_facts – Fetches details about one or multiple Schedule resources in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 5.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_usage_schedule_facts.

New in version 2.9.0: of oracle.oci

Synopsis

  • Fetches details about one or multiple Schedule resources in Oracle Cloud Infrastructure

  • Returns the saved schedule list.

  • If schedule_id is specified, the details of a single Schedule will be returned.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
  • security_token
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string
The compartment ID in which to list resources.
Required to list multiple schedules.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
name
string
Query parameter for filtering by name
realm_specific_endpoint_template_enabled
boolean
    Choices:
  • no
  • yes
Enable/Disable realm specific endpoint template for service client. By Default, realm specific endpoint template is disabled. If not set, then the value of the OCI_REALM_SPECIFIC_SERVICE_ENDPOINT_TEMPLATE_ENABLED variable, if any, is used.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
schedule_id
string
The schedule unique OCID.
Required to get a specific schedule.

aliases: id
sort_by
string
    Choices:
  • name
  • timeCreated
The field to sort by. If not specified, the default is timeCreated.
sort_order
string
    Choices:
  • ASC
  • DESC
The sort order to use, whether 'asc' or 'desc'.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm

Examples

- name: Get a specific schedule
  oci_usage_schedule_facts:
    # required
    schedule_id: "ocid1.schedule.oc1..xxxxxxEXAMPLExxxxxx"

- name: List schedules
  oci_usage_schedule_facts:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    sort_by: name
    sort_order: ASC
    name: name_example

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
schedules
complex
on success
List of Schedule resources

Sample:
[{'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'description': 'description_example', 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'lifecycle_state': 'ACTIVE', 'name': 'name_example', 'output_file_format': 'CSV', 'query_properties': {'compartment_depth': 10, 'date_range': {'date_range_type': 'STATIC', 'dynamic_date_range_type': 'LAST_7_DAYS', 'time_usage_ended': '2013-10-20T19:20:30+01:00', 'time_usage_started': '2013-10-20T19:20:30+01:00'}, 'filter': {'dimensions': [{'key': 'key_example', 'value': 'value_example'}], 'filters': [{'dimensions': [], 'filters': [], 'operator': 'AND', 'tags': []}], 'operator': 'AND', 'tags': [{'key': 'key_example', 'namespace': 'namespace_example', 'value': 'value_example'}]}, 'granularity': 'DAILY', 'group_by': [], 'group_by_tag': [{'key': 'key_example', 'namespace': 'namespace_example', 'value': 'value_example'}], 'is_aggregate_by_time': True, 'query_type': 'USAGE'}, 'result_location': {'bucket_name': 'bucket_name_example', 'location_type': 'OBJECT_STORAGE', 'namespace': 'namespace_example', 'region': 'us-phoenix-1'}, 'saved_report_id': 'ocid1.savedreport.oc1..xxxxxxEXAMPLExxxxxx', 'schedule_recurrences': 'schedule_recurrences_example', 'system_tags': {}, 'time_created': '2013-10-20T19:20:30+01:00', 'time_next_run': '2013-10-20T19:20:30+01:00', 'time_scheduled': '2013-10-20T19:20:30+01:00'}]
 
compartment_id
string
on success
The customer tenancy.
Returned for get operation

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: `{"foo-namespace": {"bar-key": "value"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
 
description
string
on success
The description of the schedule.

Sample:
description_example
 
freeform_tags
dictionary
on success
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: `{"bar-key": "value"}`

Sample:
{'Department': 'Finance'}
 
id
string
on success
The OCID representing a unique shedule.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
lifecycle_state
string
on success
The schedule lifecycle state.

Sample:
ACTIVE
 
name
string
on success
The unique name of the schedule created by the user.

Sample:
name_example
 
output_file_format
string
on success
Specifies supported output file format.
Returned for get operation

Sample:
CSV
 
query_properties
complex
on success
Returned for get operation

   
compartment_depth
float
on success
The depth level of the compartment.

Sample:
10
   
date_range
complex
on success

     
date_range_type
string
on success
Defines whether the schedule date range is STATIC or DYNAMIC.

Sample:
STATIC
     
dynamic_date_range_type
string
on success

Sample:
LAST_7_DAYS
     
time_usage_ended
string
on success
The usage end time.

Sample:
2013-10-20T19:20:30+01:00
     
time_usage_started
string
on success
The usage start time.

Sample:
2013-10-20T19:20:30+01:00
   
filter
complex
on success

     
dimensions
complex
on success
The dimensions to filter on.

       
key
string
on success
The dimension key.

Sample:
key_example
       
value
string
on success
The dimension value.

Sample:
value_example
     
filters
complex
on success
The nested filter object.

       
dimensions
list / elements=string
on success
The dimensions to filter on.

       
filters
list / elements=string
on success
The nested filter object.

       
operator
string
on success
The filter operator. Example: 'AND', 'OR', 'NOT'.

Sample:
AND
       
tags
list / elements=string
on success
The tags to filter on.

     
operator
string
on success
The filter operator. Example: 'AND', 'OR', 'NOT'.

Sample:
AND
     
tags
complex
on success
The tags to filter on.

       
key
string
on success
The tag key.

Sample:
key_example
       
namespace
string
on success
The tag namespace.

Sample:
namespace_example
       
value
string
on success
The tag value.

Sample:
value_example
   
granularity
string
on success
The usage granularity. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. Allowed values are: DAILY MONTHLY

Sample:
DAILY
   
group_by
list / elements=string
on success
Aggregate the result by. For example: [ "tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName" ]

   
group_by_tag
complex
on success
GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [ { "namespace": "oracle", "key": "createdBy" ]

     
key
string
on success
The tag key.

Sample:
key_example
     
namespace
string
on success
The tag namespace.

Sample:
namespace_example
     
value
string
on success
The tag value.

Sample:
value_example
   
is_aggregate_by_time
boolean
on success
Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.

Sample:
True
   
query_type
string
on success
The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Allowed values are: USAGE COST USAGE_AND_COST

Sample:
USAGE
 
result_location
complex
on success
Returned for get operation

   
bucket_name
string
on success
The bucket name where usage or cost CSVs will be uploaded.

Sample:
bucket_name_example
   
location_type
string
on success
Defines the type of location where the usage or cost CSVs will be stored.

Sample:
OBJECT_STORAGE
   
namespace
string
on success
The namespace needed to determine the object storage bucket.

Sample:
namespace_example
   
region
string
on success
The destination Object Store Region specified by the customer.

Sample:
us-phoenix-1
 
saved_report_id
string
on success
The saved report id which can also be used to generate query.
Returned for get operation

Sample:
ocid1.savedreport.oc1..xxxxxxEXAMPLExxxxxx
 
schedule_recurrences
string
on success
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. Supported values are : ONE_TIME, DAILY, WEEKLY and MONTHLY.

Sample:
schedule_recurrences_example
 
system_tags
dictionary
on success
Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`

 
time_created
string
on success
The date and time the schedule was created.
Returned for get operation

Sample:
2013-10-20T19:20:30+01:00
 
time_next_run
string
on success
The date and time of the next job execution.

Sample:
2013-10-20T19:20:30+01:00
 
time_scheduled
string
on success
The date and time of the first time job execution.

Sample:
2013-10-20T19:20:30+01:00


Authors

  • Oracle (@oracle)