Class: FastlyCTL::LoggingSubCmd

Inherits:
Thor
  • Object
show all
Defined in:
lib/fastlyctl/commands/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

bit of a monkey patch to fix –help output



8
9
10
# File 'lib/fastlyctl/commands/logging.rb', line 8

def self.banner(command, namespace = nil, subcommand = false)
  "#{basename} logging #{command.usage}"
end

Instance Method Details

#bigquery(action) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fastlyctl/commands/logging.rb', line 29

def bigquery(action)
  case action 
  when "create"
    BigQuery.create(options)
  when "list"
    BigQuery.list(options)
  when "update"
    BigQuery.update(options)
  when "show"
    BigQuery.show(options)
  when "delete"
    BigQuery.delete(options)  
  else
    abort "Sorry, invalid action #{action} supplied, only create, update, delete and show are valid."
  end

end

#statusObject



60
61
62
63
64
# File 'lib/fastlyctl/commands/logging.rb', line 60

def status
  id = options[:service]
  resp = FastlyCTL::Fetcher.api_request(:get, "/service/#{id}/logging_status")      
  say(JSON.pretty_generate(resp))
end