# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).
import oci
from datetime import datetime
# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()
# Initialize service client with default config file
resource_scheduler_client = oci.resource_scheduler.ScheduleClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_schedule_response = resource_scheduler_client.update_schedule(
schedule_id="ocid1.test.oc1..<unique_ID>EXAMPLE-scheduleId-Value",
update_schedule_details=oci.resource_scheduler.models.UpdateScheduleDetails(
display_name="EXAMPLE-displayName-Value",
description="EXAMPLE-description-Value",
action="START_RESOURCE",
recurrence_details="EXAMPLE-recurrenceDetails-Value",
recurrence_type="CRON",
resource_filters=[
oci.resource_scheduler.models.DefinedTagsResourceFilter(
attribute="DEFINED_TAGS",
value=[
oci.resource_scheduler.models.DefinedTagFilterValue(
namespace="EXAMPLE-namespace-Value",
tag_key="EXAMPLE-tagKey-Value",
value="EXAMPLE-value-Value")])],
resources=[
oci.resource_scheduler.models.Resource(
id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
metadata={
'EXAMPLE_KEY_wrpVd': 'EXAMPLE_VALUE_jj1zb8dVcuT4NqSjt1jE'},
parameters=[
oci.resource_scheduler.models.QueryParameter(
parameter_type="QUERY",
value={
'EXAMPLE_KEY_5ARVF': 'EXAMPLE_VALUE_jRveyEg8jt0gG6XFQ3Yb'})])],
time_starts=datetime.strptime(
"2011-10-03T22:21:52.502Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_ends=datetime.strptime(
"2040-11-05T23:37:57.572Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
freeform_tags={
'EXAMPLE_KEY_2j9hH': 'EXAMPLE_VALUE_E0MPlGhLQwHLQPgtzP39'},
defined_tags={
'EXAMPLE_KEY_zIh0v': {
'EXAMPLE_KEY_0ZNjM': 'EXAMPLE--Value'}}),
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="DIOTJO6PSWJ9RC1EHSA0<unique_ID>")
# Get the data from response
print(update_schedule_response.headers)