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

import oci
from datetime import datetime

# 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
monitoring_client = oci.monitoring.MonitoringClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
update_alarm_response = monitoring_client.update_alarm(
    alarm_id="ocid1.test.oc1..<unique_ID>EXAMPLE-alarmId-Value",
    update_alarm_details=oci.monitoring.models.UpdateAlarmDetails(
        display_name="EXAMPLE-displayName-Value",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        metric_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-metricCompartmentId-Value",
        metric_compartment_id_in_subtree=False,
        namespace="EXAMPLE-namespace-Value",
        resource_group="EXAMPLE-resourceGroup-Value",
        query="EXAMPLE-query-Value",
        resolution="EXAMPLE-resolution-Value",
        pending_duration="EXAMPLE-pendingDuration-Value",
        severity="CRITICAL",
        body="EXAMPLE-body-Value",
        is_notifications_per_metric_dimension_enabled=True,
        message_format="RAW",
        destinations=["EXAMPLE--Value"],
        repeat_notification_duration="EXAMPLE-repeatNotificationDuration-Value",
        suppression=oci.monitoring.models.Suppression(
            time_suppress_from=datetime.strptime(
                "2023-09-20T01:34:26.643Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_suppress_until=datetime.strptime(
                "2003-02-16T15:14:50.201Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            description="EXAMPLE-description-Value"),
        is_enabled=False,
        freeform_tags={
            'EXAMPLE_KEY_D5x7W': 'EXAMPLE_VALUE_mzn5alm1fWS5G4lbLyhd'},
        defined_tags={
            'EXAMPLE_KEY_P3cct': {
                'EXAMPLE_KEY_QlLCp': 'EXAMPLE--Value'}}),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="OCQMXBOWVHOWLLKA1AMI<unique_ID>")

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