lib/oci/ocvp/esxi_host_client.rb
def list_esxi_hosts(opts = {})
      logger.debug 'Calling operation EsxiHostClient#list_esxi_hosts.' if logger


      if opts[:sort_order] && !OCI::Ocvp::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of the values in OCI::Ocvp::Models::SORT_ORDERS_ENUM.'
      end

      if opts[:sort_by] && !%w[timeCreated displayName].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.'
      end

      if opts[:lifecycle_state] && !OCI::Ocvp::Models::LIFECYCLE_STATES_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Ocvp::Models::LIFECYCLE_STATES_ENUM.'
      end

      path = '/esxiHosts'
      operation_signing_strategy = :standard

      # rubocop:disable Style/NegatedIf
      # Query Params
      query_params = {}
      query_params[:sddcId] = opts[:sddc_id] if opts[:sddc_id]
      query_params[:computeInstanceId] = opts[:compute_instance_id] if opts[:compute_instance_id]
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

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

      post_body = nil

      # rubocop:disable Metrics/BlockLength
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EsxiHostClient#list_esxi_hosts') 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: 'OCI::Ocvp::Models::EsxiHostCollection'
        )
      end
      # rubocop:enable Metrics/BlockLength
    end
# Lists the ESXi hosts in the specified SDDC. The list can be filtered
# by Compute instance OCID or ESXi display name.
#
# Remember that in terms of implementation, an ESXi host is a Compute instance that
# is configured with the chosen bundle of VMware software. Each `EsxiHost`
# object has its own OCID (`id`), and a separate attribute for the OCID of
# the Compute instance (`computeInstanceId`). When filtering the list of
# ESXi hosts, you can specify the OCID of the Compute instance, not the
# ESXi host OCID.
#
# @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] :sddc_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC.
#
# @option opts [String] :compute_instance_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Compute instance.
#
# @option opts [String] :display_name A filter to return only resources that match the given display name exactly.
# @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).
#    (default to 10)
# @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] :sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order
#   is case sensitive.
#    (default to ASC)
# @option opts [String] :sort_by The field to sort by. You can provide one sort order (`sortOrder`). Default order for
#   TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME
#   sort order is case sensitive.
#
#   **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you
#   optionally filter by availability domain if the scope of the resource type is within a
#   single availability domain. If you call one of these \"List\" operations without specifying
#   an availability domain, the resources are grouped by availability domain, then sorted.
#    (default to timeCreated)
#   Allowed values are: timeCreated, displayName
# @option opts [String] :opc_request_id Unique identifier for the request. If you need to contact Oracle about a particular
#   request, please provide the request ID.
#
# @option opts [String] :lifecycle_state The lifecycle state of the resource.
# @return [Response] A Response object with data of type {OCI::Ocvp::Models::EsxiHostCollection EsxiHostCollection}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/ocvp/list_esxi_hosts.rb.html) to see an example of how to use list_esxi_hosts API.
Lists the ESXi hosts in the specified SDDC. The list can be filtered
by Compute instance OCID or ESXi display name.

Remember that in terms of implementation, an ESXi host is a Compute instance that
is configured with the chosen bundle of VMware software.
Lists the ESXi hosts in the specified SDDC . The list can be filtered by Compute instance OCID or ESXi display name . Remember that in terms of implementation an ESXi host is a Compute instance that is configured with the chosen bundle of VMware software .
def list_esxi_hosts(opts = {})
      logger.debug 'Calling operation EsxiHostClient#list_esxi_hosts.' if logger
      if opts[:sort_order] && !OCI::Ocvp::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of the values in OCI::Ocvp::Models::SORT_ORDERS_ENUM.'
      end
      if opts[:sort_by] && !%w[timeCreated displayName].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.'
      end
      if opts[:lifecycle_state] && !OCI::Ocvp::Models::LIFECYCLE_STATES_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Ocvp::Models::LIFECYCLE_STATES_ENUM.'
      end
      path = '/esxiHosts'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:sddcId] = opts[:sddc_id] if opts[:sddc_id]
      query_params[:computeInstanceId] = opts[:compute_instance_id] if opts[:compute_instance_id]
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
      post_body = nil
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EsxiHostClient#list_esxi_hosts') 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: 'OCI::Ocvp::Models::EsxiHostCollection'
        )
      end
    end
def list_esxi_hosts ( opts = { } ) logger . debug 'Calling operation EsxiHostClient#list_esxi_hosts.' if logger if opts [ :sort_order ] && ! OCI :: Ocvp :: Models :: SORT_ORDERS_ENUM . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of the values in OCI::Ocvp::Models::SORT_ORDERS_ENUM.' end if opts [ :sort_by ] && ! %w[ timeCreated displayName ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.' end if opts [ :lifecycle_state ] && ! OCI :: Ocvp :: Models :: LIFECYCLE_STATES_ENUM . include? ( opts [ :lifecycle_state ] ) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Ocvp::Models::LIFECYCLE_STATES_ENUM.' end path = '/esxiHosts' operation_signing_strategy = :standard query_params = { } query_params [ :sddcId ] = opts [ :sddc_id ] if opts [ :sddc_id ] query_params [ :computeInstanceId ] = opts [ :compute_instance_id ] if opts [ :compute_instance_id ] query_params [ :displayName ] = opts [ :display_name ] if opts [ :display_name ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] query_params [ :lifecycleState ] = opts [ :lifecycle_state ] if opts [ :lifecycle_state ] header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' header_params [ :' opc-request-id ' ] = opts [ :opc_request_id ] if opts [ :opc_request_id ] post_body = nil OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'EsxiHostClient#list_esxi_hosts' ) 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 : 'OCI::Ocvp::Models::EsxiHostCollection' ) end end
Lists the ESXi hosts in the specified SDDC.
Lists the ESXi hosts in the specified SDDC .
# 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::Ocvp::Models::EsxiHostCollection EsxiHostCollection}
A Response object with data of type { OCI :: Ocvp :: Models :: EsxiHostCollection EsxiHostCollection }
Response
opts
:lifecycle_state The lifecycle state of the resource.
: lifecycle_state The lifecycle state of the resource .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_esxi_hosts API.
Click [ here ] to see an example of how to use list_esxi_hosts API .