class ZAWS::Newrelicapi

Attributes

home[RW]

Public Class Methods

new(shellout) click to toggle source
# File lib/zaws/external/newrelicapi/newrelicapi.rb, line 6
def initialize(shellout)
  @shellout=shellout
end

Public Instance Methods

client() click to toggle source
# File lib/zaws/external/newrelicapi/newrelicapi.rb, line 34
def client
  fail("Home is null! Make sure its set before getting the client.") if @home== nil
  creds = ZAWS::Newrelicapi::NewrelicCreds::Creds::YamlFile.new(@home)
  @_client ||= (ZAWS::Newrelicapi::NewrelicClient.new(creds))
end
data_servers() click to toggle source
# File lib/zaws/external/newrelicapi/newrelicapi.rb, line 40
def data_servers
  @_data_servers ||= (ZAWS::Newrelicapi::Data::Servers.new(@shellout, self))
  return @_data_servers
end
filestore() click to toggle source
# File lib/zaws/external/newrelicapi/newrelicapi.rb, line 10
def filestore
  @filestore ||= ZAWS::Repository::Filestore.new()
  @filestore.location="#{@home}/.newrelicapi"
  unless File.directory?(@filestore.location)
    FileUtils.mkdir_p(@filestore.location)
  end
  @filestore.timeout = 600
  return @filestore
end
remove_creds() click to toggle source
# File lib/zaws/external/newrelicapi/newrelicapi.rb, line 20
def remove_creds
  if File.directory?("#{@home}/.newrelicapi")
    FileUtils.rmtree("#{@home}/.newrelicapi")
  end
  if File.exist?("#{@home}/.newrelic.yml")
    File.delete("#{@home}/.newrelic.yml")
  end
end
resource_servers() click to toggle source
# File lib/zaws/external/newrelicapi/newrelicapi.rb, line 29
def resource_servers
  @_resource_servers ||= (ZAWS::Newrelicapi::Resources::Servers.new(@shellout, self))
  return @_resource_servers
end