# 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
core_client = OCI::Core::VirtualNetworkClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
update_security_list_response =
core_client.update_security_list(
'ocid1.test.oc1..<unique_ID>EXAMPLE-securityListId-Value',
OCI::Core::Models::UpdateSecurityListDetails.new(
defined_tags: {
'EXAMPLE_KEY_jFDXO' => { 'EXAMPLE_KEY_4s2mH' => 'EXAMPLE--Value' }
},
display_name: 'EXAMPLE-displayName-Value',
egress_security_rules: [
OCI::Core::Models::EgressSecurityRule.new(
destination: 'EXAMPLE-destination-Value',
protocol: 'EXAMPLE-protocol-Value',
destination_type: 'SERVICE_CIDR_BLOCK',
icmp_options: OCI::Core::Models::IcmpOptions.new(type: 72, code: 15),
is_stateless: true,
tcp_options:
OCI::Core::Models::TcpOptions.new(
destination_port_range:
OCI::Core::Models::PortRange.new(max: 40_472, min: 20_206),
source_port_range:
OCI::Core::Models::PortRange.new(max: 60_431, min: 4204)
),
udp_options:
OCI::Core::Models::UdpOptions.new(
destination_port_range:
OCI::Core::Models::PortRange.new(max: 6169, min: 59_974),
source_port_range:
OCI::Core::Models::PortRange.new(max: 25_255, min: 62_264)
),
description: 'EXAMPLE-description-Value'
)
],
freeform_tags: {
'EXAMPLE_KEY_nmZRL' => 'EXAMPLE_VALUE_iTaPtpfpv5iVMhSMZCwl'
},
ingress_security_rules: [
OCI::Core::Models::IngressSecurityRule.new(
protocol: 'EXAMPLE-protocol-Value',
source: 'EXAMPLE-source-Value',
icmp_options: OCI::Core::Models::IcmpOptions.new(type: 162, code: 1),
is_stateless: true,
source_type: 'SERVICE_CIDR_BLOCK',
tcp_options:
OCI::Core::Models::TcpOptions.new(
destination_port_range:
OCI::Core::Models::PortRange.new(max: 12_954, min: 55_914),
source_port_range:
OCI::Core::Models::PortRange.new(max: 8775, min: 38_946)
),
udp_options:
OCI::Core::Models::UdpOptions.new(
destination_port_range:
OCI::Core::Models::PortRange.new(max: 56_388, min: 60_959),
source_port_range:
OCI::Core::Models::PortRange.new(max: 34_931, min: 7633)
),
description: 'EXAMPLE-description-Value'
)
]
)
)
# Get the data from response
puts "#{update_security_list_response.data}"