Sha256: 3c5aa0a3efc2540ab6028b41339902483e917bc5594019b0f692ee7cdaaaedfd

Contents?: true

Size: 621 Bytes

Versions: 1

Compression:

Stored size: 621 Bytes

Contents

module Datacentred
  module Request
    # RESTful API requests for the usage endpoints.
    class Usage < Base
      # Retrieve account usage data for a given year/month.
      #
      #   GET /api/usage/2017/9
      #
      # @param [Integer] year The year.
      # @param [Integer] month The month.
      # @raise [Errors::NotFound] Raised if no usage data found for given year/month pair.
      # @raise [Errors::Unauthorized] Raised if credentials aren't valid.
      # @return [Hash] Usage for given year/month pair.
      def self.show(year, month)
        get("usage/#{year}/#{month}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datacentred-1.1.1 lib/datacentred/request/usage.rb