class Wavefront::SavedSearch

View and manage Cloud Integrations. These are identified by a UUID.

Public Instance Methods

create(body) click to toggle source

POST /api/v2/savedsearch Create a saved search. Refer to the Swagger API docs for valid keys.

@param body [Hash] description of saved search @return [Wavefront::Response]

# File lib/wavefront-sdk/savedsearch.rb, line 29
def create(body)
  raise ArgumentError unless body.is_a?(Hash)

  api.post('', body, 'application/json')
end
delete(id) click to toggle source

DELETE /api/v2/savedsearch/id Delete a specific saved search.

@param id [String] ID of the saved search @return [Wavefront::Response]

# File lib/wavefront-sdk/savedsearch.rb, line 41
def delete(id)
  wf_savedsearch_id?(id)
  api.delete(id)
end
describe(id) click to toggle source

GET /api/v2/savedsearch/id Get a specific saved search.

@param id [String] ID of the saved search @return [Wavefront::Response]

# File lib/wavefront-sdk/savedsearch.rb, line 52
def describe(id)
  wf_savedsearch_id?(id)
  api.get(id)
end
entity(entitytype, offset = 0, limit = 100) click to toggle source

GET /api/v2/savedsearch/type/entitytype Get all saved searches for a specific entity type for a user.

@param entitytype [String] type of entity to retrieve @param offset [Int] saved search at which the list begins @param limit [Int] the number of saved searches to return @return [Wavefront::Response]

# File lib/wavefront-sdk/savedsearch.rb, line 78
def entity(entitytype, offset = 0, limit = 100)
  wf_savedsearch_entity?(entitytype)
  api.get(['type', entitytype].uri_concat, offset: offset,
                                           limit: limit)
end
list(offset = 0, limit = 100) click to toggle source

GET /api/v2/savedsearch Get all saved searches for a user.

@param offset [Int] saved search at which the list begins @param limit [Int] the number of saved searches to return @return [Wavefront::Response]

# File lib/wavefront-sdk/savedsearch.rb, line 18
def list(offset = 0, limit = 100)
  api.get('', offset: offset, limit: limit)
end
update(id, body) click to toggle source

PUT /api/v2/savedsearch/id Update a specific saved search.

@param id [String] ID of the saved search @param body [Wavefront::Response]

# File lib/wavefront-sdk/savedsearch.rb, line 63
def update(id, body)
  wf_savedsearch_id?(id)
  raise ArgumentError unless body.is_a?(Hash)

  api.put(id, body)
end
update_keys() click to toggle source
# File lib/wavefront-sdk/savedsearch.rb, line 84
def update_keys
  %i[query entityType]
end