# 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
fleet_apps_management_client = oci.fleet_apps_management.FleetAppsManagementMaintenanceWindowClient(
config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_maintenance_window_response = fleet_apps_management_client.update_maintenance_window(
maintenance_window_id="ocid1.test.oc1..<unique_ID>EXAMPLE-maintenanceWindowId-Value",
update_maintenance_window_details=oci.fleet_apps_management.models.UpdateMaintenanceWindowDetails(
display_name="EXAMPLE-displayName-Value",
description="EXAMPLE-description-Value",
maintenance_window_type="OPEN_ENDED",
is_outage=True,
time_schedule_start=datetime.strptime(
"2045-08-28T04:04:25.916Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
duration="EXAMPLE-duration-Value",
is_recurring=False,
recurrences="EXAMPLE-recurrences-Value",
task_initiation_cutoff=174,
freeform_tags={
'EXAMPLE_KEY_FDQnp': 'EXAMPLE_VALUE_HhBf1Nu15MSLkeWqoRHh'},
defined_tags={
'EXAMPLE_KEY_zvnQl': {
'EXAMPLE_KEY_tCzIb': 'EXAMPLE--Value'}}),
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="A6JRGILP5Y6NKJHAVKE3<unique_ID>")
# Get the data from response
print(update_maintenance_window_response.headers)