# 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).
require 'date'
require '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::ConfigFileLoader.load_config
# Initialize service client with default config file
stack_monitoring_client =
OCI::StackMonitoring::StackMonitoringClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_maintenance_window_response =
stack_monitoring_client.create_maintenance_window(
OCI::StackMonitoring::Models::CreateMaintenanceWindowDetails.new(
name: 'EXAMPLE-name-Value',
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
resources: [
OCI::StackMonitoring::Models::CreateMaintenanceWindowResourceDetails
.new(
resource_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-resourceId-Value',
are_members_included: false
)
],
schedule:
OCI::StackMonitoring::Models::RecurrentMaintenanceWindowSchedule.new(
schedule_type: 'RECURRENT',
maintenance_window_recurrences:
'EXAMPLE-maintenanceWindowRecurrences-Value',
time_maintenance_window_start:
DateTime.parse('2003-08-12T22:05:32.497Z'),
time_maintenance_window_end:
DateTime.parse('2033-10-17T03:08:32.863Z'),
maintenance_window_duration: 'EXAMPLE-maintenanceWindowDuration-Value'
),
description: 'EXAMPLE-description-Value',
freeform_tags: {
'EXAMPLE_KEY_Fj2wk' => 'EXAMPLE_VALUE_98HOU7KNuA9Fa8CNkgfZ'
},
defined_tags: {
'EXAMPLE_KEY_CIQTQ' => { 'EXAMPLE_KEY_SjzkM' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{create_maintenance_window_response.data}"