# 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
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_IOV57': 'EXAMPLE_VALUE_JnPr5Zaimvf5ckINAWkC'},
time_suppress_from=datetime.strptime(
"2015-09-11T04:35:06.952Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_suppress_until=datetime.strptime(
"2005-08-17T12:18:37.678Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
description="EXAMPLE-description-Value",
freeform_tags={
'EXAMPLE_KEY_wF6j6': 'EXAMPLE_VALUE_Aq8j6Uv3pSbqzEKSOT96'},
defined_tags={
'EXAMPLE_KEY_CsF5w': {
'EXAMPLE_KEY_fnXfl': 'EXAMPLE--Value'}}),
opc_request_id="3IWMQVUAKTKYGSMNFKOW<unique_ID>",
opc_retry_token="EXAMPLE-opcRetryToken-Value")
# Get the data from response
print(create_alarm_suppression_response.data)