# 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
create_alarm_response = monitoring_client.create_alarm(
    create_alarm_details=oci.monitoring.models.CreateAlarmDetails(
        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",
        namespace="EXAMPLE-namespace-Value",
        query="EXAMPLE-query-Value",
        severity="INFO",
        destinations=["EXAMPLE--Value"],
        is_enabled=True,
        metric_compartment_id_in_subtree=False,
        resource_group="EXAMPLE-resourceGroup-Value",
        resolution="EXAMPLE-resolution-Value",
        pending_duration="EXAMPLE-pendingDuration-Value",
        body="EXAMPLE-body-Value",
        repeat_notification_duration="EXAMPLE-repeatNotificationDuration-Value",
        suppression=oci.monitoring.models.Suppression(
            time_suppress_from=datetime.strptime(
                "2036-07-10T12:26:56.618Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_suppress_until=datetime.strptime(
                "2012-04-18T03:57:58.238Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            description="EXAMPLE-description-Value"),
        freeform_tags={
            'EXAMPLE_KEY_wcKit': 'EXAMPLE_VALUE_J9FpXqkRs8KXlTMLs5Kh'},
        defined_tags={
            'EXAMPLE_KEY_12Ln0': {
                'EXAMPLE_KEY_Ilsbl': 'EXAMPLE--Value'}}),
    opc_request_id="ZDUNIRTLPR4PVVQDZCG0/OpcRequestIdExample/<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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