# 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
functions_client = OCI::Functions::FunctionsManagementClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
update_function_response =
functions_client.update_function(
'ocid1.test.oc1..<unique_ID>EXAMPLE-functionId-Value',
OCI::Functions::Models::UpdateFunctionDetails.new(
image: 'EXAMPLE-image-Value',
image_digest: 'EXAMPLE-imageDigest-Value',
memory_in_mbs: 372,
config: { 'EXAMPLE_KEY_IlJRG' => 'EXAMPLE_VALUE_j3rIcAfxVWFU9HtbKPut' },
timeout_in_seconds: 773,
provisioned_concurrency_config:
OCI::Functions::Models::ConstantProvisionedConcurrencyConfig.new(
strategy: 'CONSTANT', count: 792
),
detached_mode_timeout_in_seconds: 408,
failure_destination:
OCI::Functions::Models::NotificationFailureDestinationDetails.new(
kind: 'NOTIFICATION',
topic_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-topicId-Value'
),
success_destination:
OCI::Functions::Models::QueueSuccessDestinationDetails.new(
kind: 'QUEUE',
queue_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-queueId-Value',
channel_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-channelId-Value'
),
trace_config:
OCI::Functions::Models::FunctionTraceConfig.new(is_enabled: false),
freeform_tags: {
'EXAMPLE_KEY_CuPR0' => 'EXAMPLE_VALUE_4rjziV3TdaPp0sMEruTS'
},
defined_tags: {
'EXAMPLE_KEY_ETRWY' => { 'EXAMPLE_KEY_0LH2Z' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{update_function_response.data}"