lib/oci/core/virtual_network_client.rb
# Lists the {PrivateIp} objects based
# on one of these filters:
#
#   - Subnet OCID.
#   - VNIC OCID.
#   - Both private IP address and subnet OCID: This lets
#   you get a `privateIP` object based on its private IP
#   address (for example, 10.0.3.3) and not its OCID. For comparison,
#   {#get_private_ip get_private_ip}
#   requires the OCID.
#
# If you're listing all the private IPs associated with a given subnet
# or VNIC, the response includes both primary and secondary private IPs.
#
# If you are an Oracle Cloud VMware Solution customer and have VLANs
# in your VCN, you can filter the list by VLAN OCID. See {Vlan}.
#
# @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] :ip_address An IP address. This could be either IPv4 or IPv6, depending on the resource.
#   Example: `10.0.3.3`
#
# @option opts [String] :subnet_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet.
# @option opts [String] :vnic_id The OCID of the VNIC.
# @option opts [String] :vlan_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN.
# @return [Response] A Response object with data of type Array<{OCI::Core::Models::PrivateIp PrivateIp}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/core/list_private_ips.rb.html) to see an example of how to use list_private_ips API.
Lists the {PrivateIp} objects based
on one of these filters.

Subnet OCID.
VNIC OCID.
Both private IP address and subnet OCID: This lets
you get a `privateIP` object based on its private IP
address (for example, 10.0.3.3) and not its OCID. For comparison,
{#get_private_ip get_private_ip}
requires the OCID.

If you're listing all the private IPs associated with a given subnet
or VNIC, the response includes both primary and secondary private IPs.

If you are an Oracle Cloud VMware Solution customer and have VLANs
in your VCN, you can filter the list by VLAN OCID. See {Vlan}.
Lists the { PrivateIp } objects based on one of these filters . Subnet OCID . VNIC OCID . Both private IP address and subnet OCID : This lets you get a ` privateIP ` object based on its private IP address ( for example 10 . 0 . 3 . 3 ) and not its OCID . For comparison { #get_private_ip get_private_ip } requires the OCID . If you ' re listing all the private IPs associated with a given subnet or VNIC the response includes both primary and secondary private IPs . If you are an Oracle Cloud VMware Solution customer and have VLANs in your VCN you can filter the list by VLAN OCID . See { Vlan } .
def list_private_ips(opts = {})
      logger.debug 'Calling operation VirtualNetworkClient#list_private_ips.' if logger
      path = '/privateIps'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:ipAddress] = opts[:ip_address] if opts[:ip_address]
      query_params[:subnetId] = opts[:subnet_id] if opts[:subnet_id]
      query_params[:vnicId] = opts[:vnic_id] if opts[:vnic_id]
      query_params[:vlanId] = opts[:vlan_id] if opts[:vlan_id]
      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_private_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::PrivateIp>'
        )
      end
    end
def list_private_ips ( opts = { } ) logger . debug 'Calling operation VirtualNetworkClient#list_private_ips.' if logger path = '/privateIps' operation_signing_strategy = :standard query_params = { } query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :ipAddress ] = opts [ :ip_address ] if opts [ :ip_address ] query_params [ :subnetId ] = opts [ :subnet_id ] if opts [ :subnet_id ] query_params [ :vnicId ] = opts [ :vnic_id ] if opts [ :vnic_id ] query_params [ :vlanId ] = opts [ :vlan_id ] if opts [ :vlan_id ] 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_private_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::PrivateIp>' ) end end
Lists the {PrivateIp} objects based
on one of these filters:
Lists the { PrivateIp } objects based on one of these filters :
# 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::PrivateIp PrivateIp}>
A Response object with data of type Array< { OCI :: Core :: Models :: PrivateIp PrivateIp } >
Response
opts
:vlan_id The [OCID] of the VLAN.
: vlan_id The [ OCID ] of the VLAN .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_private_ips API.
Click [ here ] to see an example of how to use list_private_ips API .