# 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
update_maintenance_window_response =
stack_monitoring_client.update_maintenance_window(
'ocid1.test.oc1..<unique_ID>EXAMPLE-maintenanceWindowId-Value',
OCI::StackMonitoring::Models::UpdateMaintenanceWindowDetails.new(
description: 'EXAMPLE-description-Value',
resources: [
OCI::StackMonitoring::Models::CreateMaintenanceWindowResourceDetails
.new(
resource_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-resourceId-Value',
are_members_included: true
)
],
schedule:
OCI::StackMonitoring::Models::OneTimeMaintenanceWindowSchedule.new(
schedule_type: 'ONE_TIME',
time_maintenance_window_start:
DateTime.parse('2013-07-31T09:28:10.989Z'),
time_maintenance_window_end:
DateTime.parse('2012-02-06T08:37:27.879Z')
),
freeform_tags: {
'EXAMPLE_KEY_fIy1P' => 'EXAMPLE_VALUE_1CKeR7WKk0EgxbmmPGUB'
},
defined_tags: {
'EXAMPLE_KEY_X2N2y' => { 'EXAMPLE_KEY_cjZ7u' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{update_maintenance_window_response.headers}"