class Wavefront::ExternalLink

Manage and query Wavefront external links.

Public Instance Methods

api_base() click to toggle source
# File lib/wavefront-sdk/externallink.rb, line 10
def api_base
  '/extlink'
end
create(body) click to toggle source

POST /api/v2/extlink Create a specific external link.

@param body [Hash] a description of the external link. @return [Wavefront::Response]

# File lib/wavefront-sdk/externallink.rb, line 35
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/extlink/id Delete a specific external link.

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

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

GET /api/v2/extlink/id Get a specific external link.

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

# File lib/wavefront-sdk/externallink.rb, line 58
def describe(id)
  wf_link_id?(id)
  api.get(id)
end
list(offset = 0, limit = 100) click to toggle source

GET /api/v2/extlink Get all external links for a customer

@param offset [Int] link at which the list begins @param limit [Int] the number of link to return

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

PUT /api/v2/extlink/id Update a specific external link.

@param id [String] a Wavefront external link ID @param body [Hash] key-value hash of the parameters you wish

to change

@param modify [true, false] if true, use {#describe()} to get

a hash describing the existing object, and modify that with
the new body. If false, pass the new body straight through.

@return [Wavefront::Response]

# File lib/wavefront-sdk/externallink.rb, line 74
def update(id, body, modify = true)
  wf_link_id?(id)
  raise ArgumentError unless body.is_a?(Hash)

  return api.put(id, body, 'application/json') unless modify

  api.put(id, hash_for_update(describe(id).response, body),
          'application/json')
end
update_keys() click to toggle source
# File lib/wavefront-sdk/externallink.rb, line 14
def update_keys
  %i[id name template description metricFilterRegex
     sourceFilterRegex pointTagFilterRegexes]
end