Class: RogIQ::Remote::Billing

Inherits:
CommandBase show all
Defined in:
lib/rogiq/remote/billing.rb

Instance Method Summary collapse

Instance Method Details

#coins(identifier) ⇒ Object



9
10
11
# File 'lib/rogiq/remote/billing.rb', line 9

def coins(identifier)
  emit(api.get("/api/v1/cli/billing/coins", { identifier: identifier }))
end

#invoices(identifier) ⇒ Object



21
22
23
# File 'lib/rogiq/remote/billing.rb', line 21

def invoices(identifier)
  emit(api.get("/api/v1/cli/billing/invoices", { identifier: identifier, limit: options[:limit] }))
end

#overagesObject



15
16
17
# File 'lib/rogiq/remote/billing.rb', line 15

def overages
  emit(api.get("/api/v1/cli/billing/overages", { limit: options[:limit] }))
end

#summaryObject



28
29
30
31
32
33
34
35
36
# File 'lib/rogiq/remote/billing.rb', line 28

def summary
  unless options[:yes]
    exit 1 unless yes?("Enqueue Billing::DailyBillingSummaryJob?")
  end

  body = { confirm: true }
  body[:date] = options[:date] unless options[:date].to_s.strip.empty?
  emit(api.post("/api/v1/cli/billing/summary", body))
end