# 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).

from datetime import datetime
import oci

# 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
create_schedule_response = resource_scheduler_client.create_schedule(
    create_schedule_details=oci.resource_scheduler.models.CreateScheduleDetails(
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        action="START_RESOURCE",
        recurrence_details="EXAMPLE-recurrenceDetails-Value",
        recurrence_type="CRON",
        display_name="EXAMPLE-displayName-Value",
        description="EXAMPLE-description-Value",
        resource_filters=[
            oci.resource_scheduler.models.CompartmentIdResourceFilter(
                attribute="COMPARTMENT_ID",
                value="EXAMPLE-value-Value",
                should_include_child_compartments=False)],
        resources=[
            oci.resource_scheduler.models.Resource(
                id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
                metadata={
                    'EXAMPLE_KEY_uXtLi': 'EXAMPLE_VALUE_4IweKhMPJ3XDSdk0MEyB'})],
        time_starts=datetime.strptime(
            "2040-05-17T16:08:27.628Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        time_ends=datetime.strptime(
            "2042-04-17T01:05:44.717Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        freeform_tags={
            'EXAMPLE_KEY_MEx4G': 'EXAMPLE_VALUE_0bTq2wUejB1MBMt7s3lZ'},
        defined_tags={
            'EXAMPLE_KEY_jdGZk': {
                'EXAMPLE_KEY_PILV0': 'EXAMPLE--Value'}}),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="XTY4ZQEPHVQKP1OCTC0P<unique_ID>")

# Get the data from response
print(create_schedule_response.data)