# 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
# 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
stack_monitoring_client = oci.stack_monitoring.StackMonitoringClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_monitored_resource_response = stack_monitoring_client.update_monitored_resource(
monitored_resource_id="ocid1.test.oc1..<unique_ID>EXAMPLE-monitoredResourceId-Value",
update_monitored_resource_details=oci.stack_monitoring.models.UpdateMonitoredResourceDetails(
display_name="EXAMPLE-displayName-Value",
host_name="EXAMPLE-hostName-Value",
resource_time_zone="EXAMPLE-resourceTimeZone-Value",
properties=[
oci.stack_monitoring.models.MonitoredResourceProperty(
name="EXAMPLE-name-Value",
value="EXAMPLE-value-Value")],
database_connection_details=oci.stack_monitoring.models.ConnectionDetails(
protocol="TCPS",
port=7471,
service_name="EXAMPLE-serviceName-Value",
connector_id="ocid1.test.oc1..<unique_ID>EXAMPLE-connectorId-Value",
db_unique_name="EXAMPLE-dbUniqueName-Value",
db_id="ocid1.test.oc1..<unique_ID>EXAMPLE-dbId-Value",
ssl_secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sslSecretId-Value"),
credentials=oci.stack_monitoring.models.PlainTextCredentials(
credential_type="PLAINTEXT",
properties=[
oci.stack_monitoring.models.CredentialProperty(
name="EXAMPLE-name-Value",
value="EXAMPLE-value-Value")],
source="EXAMPLE-source-Value",
name="EXAMPLE-name-Value",
type="EXAMPLE-type-Value",
description="EXAMPLE-description-Value"),
aliases=oci.stack_monitoring.models.MonitoredResourceAliasCredential(
source="EXAMPLE-source-Value",
name="EXAMPLE-name-Value",
credential=oci.stack_monitoring.models.MonitoredResourceAliasSourceCredential(
source="EXAMPLE-source-Value",
name="EXAMPLE-name-Value",
service="EXAMPLE-service-Value")),
additional_credentials=[
oci.stack_monitoring.models.PreExistingCredentials(
credential_type="EXISTING",
source="EXAMPLE-source-Value",
name="EXAMPLE-name-Value",
type="EXAMPLE-type-Value",
description="EXAMPLE-description-Value")],
additional_aliases=[
oci.stack_monitoring.models.MonitoredResourceAliasCredential(
source="EXAMPLE-source-Value",
name="EXAMPLE-name-Value",
credential=oci.stack_monitoring.models.MonitoredResourceAliasSourceCredential(
source="EXAMPLE-source-Value",
name="EXAMPLE-name-Value",
service="EXAMPLE-service-Value"))],
freeform_tags={
'EXAMPLE_KEY_3u3bo': 'EXAMPLE_VALUE_ZO82Np3q35TJZalXSfUM'},
defined_tags={
'EXAMPLE_KEY_nifUn': {
'EXAMPLE_KEY_Tob2a': 'EXAMPLE--Value'}}),
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="8M8SFTJRELMMALWGYVAZ<unique_ID>")
# Get the data from response
print(update_monitored_resource_response.headers)