lib/oci/core/virtual_network_client.rb
# Unassigns and deletes the specified public IP (either ephemeral or reserved).
# You must specify the object's OCID. The public IP address is returned to the
# Oracle Cloud Infrastructure public IP pool.
#
# **Note:** You cannot update, unassign, or delete the public IP that Oracle automatically
# assigned to an entity for you (such as a load balancer or NAT gateway). The public IP is
# automatically deleted if the assigned entity is terminated.
#
# For an assigned reserved public IP, the initial unassignment portion of this operation
# is asynchronous. Poll the public IP's `lifecycleState` to determine
# if the operation succeeded.
#
# If you want to simply unassign a reserved public IP and return it to your pool
# of reserved public IPs, instead use
# {#update_public_ip update_public_ip}.
#
# @param [String] public_ip_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the public IP.
# @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 nil
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/core/delete_public_ip.rb.html) to see an example of how to use delete_public_ip API.
Unassigns and deletes the specified public IP (either ephemeral or reserved).
You must specify the object's OCID. The public IP address is returned to the
Oracle Cloud Infrastructure public IP pool.

You cannot update, unassign, or delete the public IP that Oracle automatically
assigned to an entity for you (such as a load balancer or NAT gateway). The public IP is
automatically deleted if the assigned entity is terminated.

For an assigned reserved public IP, the initial unassignment portion of this operation
is asynchronous. Poll the public IP's `lifecycleState` to determine
if the operation succeeded.

If you want to simply unassign a reserved public IP and return it to your pool
of reserved public IPs, instead use
{#update_public_ip update_public_ip}.
Unassigns and deletes the specified public IP ( either ephemeral or reserved ) . You must specify the object ' s OCID . The public IP address is returned to the Oracle Cloud Infrastructure public IP pool . You cannot update unassign or delete the public IP that Oracle automatically assigned to an entity for you ( such as a load balancer or NAT gateway ) . The public IP is automatically deleted if the assigned entity is terminated . For an assigned reserved public IP the initial unassignment portion of this operation is asynchronous . Poll the public IP ' s ` lifecycleState ` to determine if the operation succeeded . If you want to simply unassign a reserved public IP and return it to your pool of reserved public IPs instead use { #update_public_ip update_public_ip } .
def delete_public_ip(public_ip_id, opts = {})
      logger.debug 'Calling operation VirtualNetworkClient#delete_public_ip.' if logger
      raise "Missing the required parameter 'public_ip_id' when calling delete_public_ip." if public_ip_id.nil?
      raise "Parameter value for 'public_ip_id' must not be blank" if OCI::Internal::Util.blank_string?(public_ip_id)
      path = '/publicIps/{publicIpId}'.sub('{publicIpId}', public_ip_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 = nil
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'VirtualNetworkClient#delete_public_ip') do
        @api_client.call_api(
          :DELETE,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body
        )
      end
    end
def delete_public_ip ( public_ip_id , opts = { } ) logger . debug 'Calling operation VirtualNetworkClient#delete_public_ip.' if logger raise "Missing the required parameter 'public_ip_id' when calling delete_public_ip." if public_ip_id . nil? raise "Parameter value for 'public_ip_id' must not be blank" if OCI :: Internal :: Util . blank_string? ( public_ip_id ) path = '/publicIps/{publicIpId}' . sub ( '{publicIpId}' , public_ip_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 = nil OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'VirtualNetworkClient#delete_public_ip' ) do @api_client . call_api ( :DELETE , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body ) end end
Unassigns and deletes the specified public IP (either ephemeral or reserved).
Unassigns and deletes the specified public IP ( either ephemeral or reserved ) .
# 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 nil
A Response object with data of type nil
Response
public_ip_id
<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 delete_public_ip API.
Click [ here ] to see an example of how to use delete_public_ip API .