# 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_suppression_response = monitoring_client.create_alarm_suppression(
create_alarm_suppression_details=oci.monitoring.models.CreateAlarmSuppressionDetails(
alarm_suppression_target=oci.monitoring.models.AlarmSuppressionAlarmTarget(
target_type="ALARM",
alarm_id="ocid1.test.oc1..<unique_ID>EXAMPLE-alarmId-Value"),
display_name="EXAMPLE-displayName-Value",
dimensions={
'EXAMPLE_KEY_5RATk': 'EXAMPLE_VALUE_AYTX2dpc0zroMvFfNOds'},
time_suppress_from=datetime.strptime(
"2039-02-17T11:31:24.717Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_suppress_until=datetime.strptime(
"2033-08-14T06:08:20.878Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
description="EXAMPLE-description-Value",
freeform_tags={
'EXAMPLE_KEY_R3J8J': 'EXAMPLE_VALUE_9Nkgdp3LUZAI1pzsuvrR'},
defined_tags={
'EXAMPLE_KEY_BAt35': {
'EXAMPLE_KEY_ocITH': 'EXAMPLE--Value'}}),
opc_request_id="LF5WPGHLC95LZKOQRJGY<unique_ID>",
opc_retry_token="EXAMPLE-opcRetryToken-Value")
# Get the data from response
print(create_alarm_suppression_response.data)