lib/oci/core/virtual_network_client.rb
# Removes the specified {Service} from the list of enabled
# `Service` objects for the specified gateway. You do not need to remove any route
# rules that specify this `Service` object's `cidrBlock` as the destination CIDR. However, consider
# removing the rules if your intent is to permanently disable use of the `Service` through this
# service gateway.
#
# **Note:** The `DetachServiceId` operation is an easy way to remove an individual `Service` from
# the service gateway. Compare it with
# {#update_service_gateway update_service_gateway}, which replaces
# the entire existing list of enabled `Service` objects with the list that you provide in the
# `Update` call. `UpdateServiceGateway` also lets you block all traffic through the service
# gateway without having to remove each of the individual `Service` objects.
#
# @param [String] service_gateway_id The service gateway's [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
# @param [OCI::Core::Models::ServiceIdRequestDetails] detach_service_details ServiceId of Service to be detached from a service gateway.
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config 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
# @option opts [String] :if_match 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.
#
# @return [Response] A Response object with data of type {OCI::Core::Models::ServiceGateway ServiceGateway}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/core/detach_service_id.rb.html) to see an example of how to use detach_service_id API.
Removes the specified {Service} from the list of enabled
`Service` objects for the specified gateway. You do not need to remove any route
rules that specify this `Service` object's `cidrBlock` as the destination CIDR. However, consider
removing the rules if your intent is to permanently disable use of the `Service` through this
service gateway.

The `DetachServiceId` operation is an easy way to remove an individual `Service` from
the service gateway. Compare it with
{#update_service_gateway update_service_gateway}, which replaces
the entire existing list of enabled `Service` objects with the list that you provide in the
`Update` call. `UpdateServiceGateway` also lets you block all traffic through the service
gateway without having to remove each of the individual `Service` objects.
Removes the specified { Service } from the list of enabled ` Service ` objects for the specified gateway . You do not need to remove any route rules that specify this ` Service ` object ' s ` cidrBlock ` as the destination CIDR . However consider removing the rules if your intent is to permanently disable use of the ` Service ` through this service gateway . The ` DetachServiceId ` operation is an easy way to remove an individual ` Service ` from the service gateway . Compare it with { #update_service_gateway update_service_gateway } which replaces the entire existing list of enabled ` Service ` objects with the list that you provide in the ` Update ` call . ` UpdateServiceGateway ` also lets you block all traffic through the service gateway without having to remove each of the individual ` Service ` objects .
def detach_service_id(service_gateway_id, detach_service_details, opts = {})
      logger.debug 'Calling operation VirtualNetworkClient#detach_service_id.' if logger
      raise "Missing the required parameter 'service_gateway_id' when calling detach_service_id." if service_gateway_id.nil?
      raise "Missing the required parameter 'detach_service_details' when calling detach_service_id." if detach_service_details.nil?
      raise "Parameter value for 'service_gateway_id' must not be blank" if OCI::Internal::Util.blank_string?(service_gateway_id)
      path = '/serviceGateways/{serviceGatewayId}/actions/detachService'.sub('{serviceGatewayId}', service_gateway_id.to_s)
      operation_signing_strategy = :standard
      query_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]
      post_body = @api_client.object_to_http_body(detach_service_details)
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'VirtualNetworkClient#detach_service_id') do
        @api_client.call_api(
          :POST,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'OCI::Core::Models::ServiceGateway'
        )
      end
    end
def detach_service_id ( service_gateway_id , detach_service_details , opts = { } ) logger . debug 'Calling operation VirtualNetworkClient#detach_service_id.' if logger raise "Missing the required parameter 'service_gateway_id' when calling detach_service_id." if service_gateway_id . nil? raise "Missing the required parameter 'detach_service_details' when calling detach_service_id." if detach_service_details . nil? raise "Parameter value for 'service_gateway_id' must not be blank" if OCI :: Internal :: Util . blank_string? ( service_gateway_id ) path = '/serviceGateways/{serviceGatewayId}/actions/detachService' . sub ( '{serviceGatewayId}' , service_gateway_id . to_s ) operation_signing_strategy = :standard query_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 ] post_body = @api_client . object_to_http_body ( detach_service_details ) OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'VirtualNetworkClient#detach_service_id' ) do @api_client . call_api ( :POST , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'OCI::Core::Models::ServiceGateway' ) end end
Removes the specified {Service} from the list of enabled
`Service` objects for the specified gateway.
Removes the specified { Service } from the list of enabled ` Service ` objects for the specified gateway .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type {OCI::Core::Models::ServiceGateway ServiceGateway}
A Response object with data of type { OCI :: Core :: Models :: ServiceGateway ServiceGateway }
Response
service_gateway_id
<not_specific>
detach_service_details
<not_specific>
opts
:if_match 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.
: if_match 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 .
<not_specific>
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use detach_service_id API.
Click [ here ] to see an example of how to use detach_service_id API .