lib/oci/apm_synthetics/apm_synthetic_client.rb
# Returns a list of monitors.
#
# @param [String] apm_domain_id The APM domain ID the request is intended for.
#
# @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] :display_name A filter to return only resources that match the entire display name given.
# @option opts [String] :script_id A filter to return only monitors using scriptId.
# @option opts [String] :monitor_type A filter to return only monitors that match the given monitor type.
#   Supported values are SCRIPTED_BROWSER, BROWSER, SCRIPTED_REST and REST.
#
# @option opts [String] :status A filter to return only monitors that match the status given.
# @option opts [Integer] :limit The maximum number of items to return. (default to 100)
# @option opts [String] :page 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] :sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`). Default sort order is ascending.
#    (default to ASC)
# @option opts [String] :sort_by The field to sort by. Only one sort order may be provided.
#   Default order of displayName is ascending.
#   Default order of timeCreated and timeUpdated is descending.
#   The displayName sort by is case insensitive.
#    (default to displayName)
#   Allowed values are: displayName, timeCreated, timeUpdated, status, monitorType
# @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.
#
# @return [Response] A Response object with data of type {OCI::ApmSynthetics::Models::MonitorCollection MonitorCollection}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/apmsynthetics/list_monitors.rb.html) to see an example of how to use list_monitors API.
Returns a list of monitors.
Returns a list of monitors .
def list_monitors(apm_domain_id, opts = {})
      logger.debug 'Calling operation ApmSyntheticClient#list_monitors.' if logger
      raise "Missing the required parameter 'apm_domain_id' when calling list_monitors." if apm_domain_id.nil?
      if opts[:status] && !OCI::ApmSynthetics::Models::MONITOR_STATUS_ENUM.include?(opts[:status])
        raise 'Invalid value for "status", must be one of the values in OCI::ApmSynthetics::Models::MONITOR_STATUS_ENUM.'
      end
      if opts[:sort_order] && !OCI::ApmSynthetics::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of the values in OCI::ApmSynthetics::Models::SORT_ORDERS_ENUM.'
      end
      if opts[:sort_by] && !%w[displayName timeCreated timeUpdated status monitorType].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of displayName, timeCreated, timeUpdated, status, monitorType.'
      end
      path = '/monitors'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:apmDomainId] = apm_domain_id
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:scriptId] = opts[:script_id] if opts[:script_id]
      query_params[:monitorType] = opts[:monitor_type] if opts[:monitor_type]
      query_params[:status] = opts[:status] if opts[:status]
      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]
      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: 'ApmSyntheticClient#list_monitors') 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::ApmSynthetics::Models::MonitorCollection'
        )
      end
    end
def list_monitors ( apm_domain_id , opts = { } ) logger . debug 'Calling operation ApmSyntheticClient#list_monitors.' if logger raise "Missing the required parameter 'apm_domain_id' when calling list_monitors." if apm_domain_id . nil? if opts [ :status ] && ! OCI :: ApmSynthetics :: Models :: MONITOR_STATUS_ENUM . include? ( opts [ :status ] ) raise 'Invalid value for "status", must be one of the values in OCI::ApmSynthetics::Models::MONITOR_STATUS_ENUM.' end if opts [ :sort_order ] && ! OCI :: ApmSynthetics :: Models :: SORT_ORDERS_ENUM . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of the values in OCI::ApmSynthetics::Models::SORT_ORDERS_ENUM.' end if opts [ :sort_by ] && ! %w[ displayName timeCreated timeUpdated status monitorType ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of displayName, timeCreated, timeUpdated, status, monitorType.' end path = '/monitors' operation_signing_strategy = :standard query_params = { } query_params [ :apmDomainId ] = apm_domain_id query_params [ :displayName ] = opts [ :display_name ] if opts [ :display_name ] query_params [ :scriptId ] = opts [ :script_id ] if opts [ :script_id ] query_params [ :monitorType ] = opts [ :monitor_type ] if opts [ :monitor_type ] query_params [ :status ] = opts [ :status ] if opts [ :status ] 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 ] 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 : 'ApmSyntheticClient#list_monitors' ) 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::ApmSynthetics::Models::MonitorCollection' ) end end
Returns a list of monitors.
Returns a list of monitors .
# 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::ApmSynthetics::Models::MonitorCollection MonitorCollection}
A Response object with data of type { OCI :: ApmSynthetics :: Models :: MonitorCollection MonitorCollection }
Response
apm_domain_id
opts
:opc_request_id Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
: opc_request_id Unique identifier for the request . If you need to contact Oracle about a particular request please provide the request ID .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_monitors API.
Click [ here ] to see an example of how to use list_monitors API .