lib/oci/core/virtual_network_client.rb
# Lists the {PublicIp} objects
# in the specified compartment. You can filter the list by using query parameters.
#
# To list your reserved public IPs:
#   * Set `scope` = `REGION`  (required)
#   * Leave the `availabilityDomain` parameter empty
#   * Set `lifetime` = `RESERVED`
#
# To list the ephemeral public IPs assigned to a regional entity such as a NAT gateway:
#   * Set `scope` = `REGION`  (required)
#   * Leave the `availabilityDomain` parameter empty
#   * Set `lifetime` = `EPHEMERAL`
#
# To list the ephemeral public IPs assigned to private IPs:
#   * Set `scope` = `AVAILABILITY_DOMAIN` (required)
#   * Set the `availabilityDomain` parameter to the desired availability domain (required)
#   * Set `lifetime` = `EPHEMERAL`
#
# **Note:** An ephemeral public IP assigned to a private IP
# is always in the same availability domain and compartment as the private IP.
#
# @param [String] scope Whether the public IP is regional or specific to a particular availability domain.
#
#   * `REGION`: The public IP exists within a region and is assigned to a regional entity
#   (such as a {NatGateway}), or can be assigned to a private IP
#   in any availability domain in the region. Reserved public IPs have `scope` = `REGION`, as do
#   ephemeral public IPs assigned to a regional entity.
#
#   * `AVAILABILITY_DOMAIN`: The public IP exists within the availability domain of the entity
#   it's assigned to, which is specified by the `availabilityDomain` property of the public IP object.
#   Ephemeral public IPs that are assigned to private IPs have `scope` = `AVAILABILITY_DOMAIN`.
#
#   Allowed values are: REGION, AVAILABILITY_DOMAIN
# @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment.
# @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 [Integer] :limit For list pagination. The maximum number of results per page, or items to return in a paginated
#   \"List\" call. For important details about how pagination works, see
#   [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
#
#   Example: `50`
#
# @option opts [String] :page For list pagination. The value of the `opc-next-page` response header from the previous \"List\"
#   call. For important details about how pagination works, see
#   [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
#
# @option opts [String] :availability_domain The name of the availability domain.
#
#   Example: `Uocm:PHX-AD-1`
#
# @option opts [String] :lifetime A filter to return only public IPs that match given lifetime.
#
#   Allowed values are: EPHEMERAL, RESERVED
# @return [Response] A Response object with data of type Array<{OCI::Core::Models::PublicIp PublicIp}>
Lists the {PublicIp} objects
in the specified compartment. You can filter the list by using query parameters.







An ephemeral public IP assigned to a private IP
is always in the same availability domain and compartment as the private IP.
Lists the { PublicIp } objects in the specified compartment . You can filter the list by using query parameters . An ephemeral public IP assigned to a private IP is always in the same availability domain and compartment as the private IP .
def list_public_ips(scope, compartment_id, opts = {})
      logger.debug 'Calling operation VirtualNetworkClient#list_public_ips.' if logger
      raise "Missing the required parameter 'scope' when calling list_public_ips." if scope.nil?
      unless %w[REGION AVAILABILITY_DOMAIN].include?(scope)
        raise "Invalid value for 'scope', must be one of REGION, AVAILABILITY_DOMAIN."
      end
      raise "Missing the required parameter 'compartment_id' when calling list_public_ips." if compartment_id.nil?
      if opts[:lifetime] && !%w[EPHEMERAL RESERVED].include?(opts[:lifetime])
        raise 'Invalid value for "lifetime", must be one of EPHEMERAL, RESERVED.'
      end
      path = '/publicIps'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:scope] = scope
      query_params[:compartmentId] = compartment_id
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain]
      query_params[:lifetime] = opts[:lifetime] if opts[:lifetime]
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      post_body = nil
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'VirtualNetworkClient#list_public_ips') do
        @api_client.call_api(
          :GET,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'Array<OCI::Core::Models::PublicIp>'
        )
      end
    end
def list_public_ips ( scope , compartment_id , opts = { } ) logger . debug 'Calling operation VirtualNetworkClient#list_public_ips.' if logger raise "Missing the required parameter 'scope' when calling list_public_ips." if scope . nil? unless %w[ REGION AVAILABILITY_DOMAIN ] . include? ( scope ) raise "Invalid value for 'scope', must be one of REGION, AVAILABILITY_DOMAIN." end raise "Missing the required parameter 'compartment_id' when calling list_public_ips." if compartment_id . nil? if opts [ :lifetime ] && ! %w[ EPHEMERAL RESERVED ] . include? ( opts [ :lifetime ] ) raise 'Invalid value for "lifetime", must be one of EPHEMERAL, RESERVED.' end path = '/publicIps' operation_signing_strategy = :standard query_params = { } query_params [ :scope ] = scope query_params [ :compartmentId ] = compartment_id query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :availabilityDomain ] = opts [ :availability_domain ] if opts [ :availability_domain ] query_params [ :lifetime ] = opts [ :lifetime ] if opts [ :lifetime ] header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' post_body = nil OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'VirtualNetworkClient#list_public_ips' ) do @api_client . call_api ( :GET , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'Array<OCI::Core::Models::PublicIp>' ) end end
Lists the {PublicIp} objects
in the specified compartment.
Lists the { PublicIp } objects in the specified compartment .
# 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 Array<{OCI::Core::Models::PublicIp PublicIp}>
A Response object with data of type Array< { OCI :: Core :: Models :: PublicIp PublicIp } >
Response
scope
<not_specific>
compartment_id
<not_specific>
opts
:lifetime A filter to return only public IPs that match given lifetime. Allowed values are: EPHEMERAL, RESERVED
: lifetime A filter to return only public IPs that match given lifetime . Allowed values are : EPHEMERAL RESERVED
<not_specific>
opts the optional parameters
opts the optional parameters