Sha256: 577496defaa28247a3ac8a6b8bfab5786d2a6e2620ee6c49e76e40253a6f52f7

Contents?: true

Size: 861 Bytes

Versions: 1

Compression:

Stored size: 861 Bytes

Contents

# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2011-Present Datadog, Inc.

module Dogapi
  class V1 # for namespacing

    class SearchService < Dogapi::APIService

      API_VERSION = 'v1'

      def search(query)
        # Deprecating search for hosts
        split_query = query.split(':')
        if split_query.length > 1 && split_query[0] == 'hosts'
          warn '[DEPRECATION] Dogapi::V1::SearchService::search has been '\
            'deprecated for hosts in favor of Dogapi::V1::HostsService::search'
        end

        extra_params = {
          :q => query
        }

        request(Net::HTTP::Get, "/api/#{API_VERSION}/search", extra_params, nil, false)
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dogapi-1.45.0 lib/dogapi/v1/search.rb