# 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
os_management_hub_client = oci.os_management_hub.ScheduledJobClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
create_scheduled_job_response = os_management_hub_client.create_scheduled_job(
create_scheduled_job_details=oci.os_management_hub.models.CreateScheduledJobDetails(
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
schedule_type="RECURRING",
time_next_execution=datetime.strptime(
"2003-05-19T14:26:03.401Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
operations=[
oci.os_management_hub.models.ScheduledJobOperation(
operation_type="INSTALL_ENHANCEMENT_WINDOWS_UPDATES",
package_names=["EXAMPLE--Value"],
windows_update_names=["EXAMPLE--Value"],
manage_module_streams_details=oci.os_management_hub.models.ManageModuleStreamsInScheduledJobDetails(
enable=[
oci.os_management_hub.models.ModuleStreamDetails(
module_name="EXAMPLE-moduleName-Value",
stream_name="EXAMPLE-streamName-Value",
software_source_id="ocid1.test.oc1..<unique_ID>EXAMPLE-softwareSourceId-Value")],
disable=[
oci.os_management_hub.models.ModuleStreamDetails(
module_name="EXAMPLE-moduleName-Value",
stream_name="EXAMPLE-streamName-Value",
software_source_id="ocid1.test.oc1..<unique_ID>EXAMPLE-softwareSourceId-Value")],
install=[
oci.os_management_hub.models.ModuleStreamProfileDetails(
module_name="EXAMPLE-moduleName-Value",
stream_name="EXAMPLE-streamName-Value",
profile_name="EXAMPLE-profileName-Value",
software_source_id="ocid1.test.oc1..<unique_ID>EXAMPLE-softwareSourceId-Value")],
remove=[
oci.os_management_hub.models.ModuleStreamProfileDetails(
module_name="EXAMPLE-moduleName-Value",
stream_name="EXAMPLE-streamName-Value",
profile_name="EXAMPLE-profileName-Value",
software_source_id="ocid1.test.oc1..<unique_ID>EXAMPLE-softwareSourceId-Value")]),
switch_module_streams_details=oci.os_management_hub.models.ModuleStreamDetails(
module_name="EXAMPLE-moduleName-Value",
stream_name="EXAMPLE-streamName-Value",
software_source_id="ocid1.test.oc1..<unique_ID>EXAMPLE-softwareSourceId-Value"),
software_source_ids=["EXAMPLE--Value"])],
display_name="EXAMPLE-displayName-Value",
description="EXAMPLE-description-Value",
locations=[
"ON_PREMISE",
"OCI_COMPUTE",
"AZURE",
"EC2",
"GCP"],
recurring_rule="EXAMPLE-recurringRule-Value",
managed_instance_ids=["EXAMPLE--Value"],
managed_instance_group_ids=["EXAMPLE--Value"],
managed_compartment_ids=["EXAMPLE--Value"],
lifecycle_stage_ids=["EXAMPLE--Value"],
is_subcompartment_included=True,
freeform_tags={
'EXAMPLE_KEY_yoZ5c': 'EXAMPLE_VALUE_RsIxArEgcFjac6VirawP'},
defined_tags={
'EXAMPLE_KEY_b3re4': {
'EXAMPLE_KEY_dQ6Iw': 'EXAMPLE--Value'}},
retry_intervals=[285],
is_managed_by_autonomous_linux=False),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="IFIGH0OUBPZ5ONQWYPLA<unique_ID>")
# Get the data from response
print(create_scheduled_job_response.data)