# 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).
require '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::ConfigFileLoader.load_config
# Initialize service client with default config file
logging_client = OCI::Logging::LoggingManagementClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
update_unified_agent_configuration_response =
logging_client.update_unified_agent_configuration(
'ocid1.test.oc1..<unique_ID>EXAMPLE-unifiedAgentConfigurationId-Value',
OCI::Logging::Models::UpdateUnifiedAgentConfigurationDetails.new(
display_name: 'EXAMPLE-displayName-Value',
is_enabled: false,
service_configuration:
OCI::Logging::Models::UnifiedAgentMonitoringConfigurationDetails.new(
configuration_type: 'MONITORING',
application_configurations: [
OCI::Logging::Models::UnifiedAgentKubernetesConfigurationDetails
.new(
source_type: 'KUBERNETES',
source:
OCI::Logging::Models::UnifiedAgentKubernetesSource.new(
name: 'EXAMPLE-name-Value',
scrape_targets: [
OCI::Logging::Models::UnifiedAgentKubernetesScrapeTarget
.new(
resource_type: 'NODES',
k8s_namespace: 'EXAMPLE-k8sNamespace-Value',
service_name: 'EXAMPLE-serviceName-Value',
resource_group: 'EXAMPLE-resourceGroup-Value'
)
]
),
destination:
OCI::Logging::Models::UnifiedAgentMonitoringDestination.new(
compartment_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
metrics_namespace: 'EXAMPLE-metricsNamespace-Value'
),
filter:
OCI::Logging::Models::UnifiedAgentKubernetesFilter.new(
filter_type: 'KUBERNETES_FILTER',
name: 'EXAMPLE-name-Value',
allow_list: %w[EXAMPLE--Value],
deny_list: %w[EXAMPLE--Value]
)
)
]
),
defined_tags: {
'EXAMPLE_KEY_u2Aqy' => { 'EXAMPLE_KEY_RCkTy' => 'EXAMPLE--Value' }
},
freeform_tags: {
'EXAMPLE_KEY_nR3HU' => 'EXAMPLE_VALUE_JtaTLzidpKlBXPKWcuUo'
},
description: 'EXAMPLE-description-Value',
group_association:
OCI::Logging::Models::GroupAssociationDetails.new(
group_list: %w[EXAMPLE--Value]
)
)
)
# Get the data from response
puts "#{update_unified_agent_configuration_response.headers}"