Method: OCI::ApmConfig::ConfigClient#update_config

Defined in:
lib/oci/apm_config/config_client.rb

#update_config(apm_domain_id, config_id, update_config_details, opts = {}) ⇒ Response

Note:

Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/apmconfig/update_config.rb.html) to see an example of how to use update_config API.

Updates the details of the configuration item identified by the OCID.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_dry_run (String)

    Indicates that the request is a dry run, if set to "true". A dry run request does not modify the configuration item details and is used only to perform validation on the submitted data.

    (default to false)
    

Returns:



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/oci/apm_config/config_client.rb', line 411

def update_config(apm_domain_id, config_id, update_config_details, opts = {})
  logger.debug 'Calling operation ConfigClient#update_config.' if logger

  raise "Missing the required parameter 'apm_domain_id' when calling update_config." if apm_domain_id.nil?
  raise "Missing the required parameter 'config_id' when calling update_config." if config_id.nil?
  raise "Missing the required parameter 'update_config_details' when calling update_config." if update_config_details.nil?
  raise "Parameter value for 'config_id' must not be blank" if OCI::Internal::Util.blank_string?(config_id)

  path = '/configs/{configId}'.sub('{configId}', config_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:apmDomainId] = apm_domain_id

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-dry-run'] = opts[:opc_dry_run] if opts[:opc_dry_run]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_config_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ConfigClient#update_config') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::ApmConfig::Models::Config'
    )
  end
  # rubocop:enable Metrics/BlockLength
end