sfrest 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15479e6a51a10f89f8f3781596249d3b76fdde1a
4
- data.tar.gz: 0f8a50cf29c4e01da2ec9c11af20bfbd354f2fe2
3
+ metadata.gz: 22a23bb499156611238ac336d4e07e0d54a3e6aa
4
+ data.tar.gz: b1c3251938898986d6fa5862e23a028b28beef05
5
5
  SHA512:
6
- metadata.gz: 44dd528ef1f87c70db42353353189a2fdacdd151933919de3017e27683042f9492c1621d1f0e50675896898710cb1a6c6339109b35da7f0a979b1c7a2c95c4b2
7
- data.tar.gz: e9df105697051ef4853ce63910ea03c8509de9ec540edc2a92a6c8d19baa4b299e2c6d73aa87a209bccb206f7d0beaf98929f3784e83f0ec28a6eef8cf9ef0de
6
+ metadata.gz: 47ceb7b2c2ccda1e4b2ccac64dfe1b2d311542cbb033d6068dcfbfd56cae18d6d1d20122b6176185379833fff777837310ab195c377f6dac737ab320ea09e9a6
7
+ data.tar.gz: 585e87cf5b7945ae2af4183e63c85ce8115c29a6f796cddbd90c4dba83baddb6322b371fce3f4d35698bce8622a3de456f2f0a4c6581d6908c8e424995ad49f5
data/lib/sfrest/usage.rb CHANGED
@@ -1,42 +1,52 @@
1
1
  module SFRest
2
2
  # Get all the audit devents.
3
3
  class Usage
4
- attr_reader :pb
5
-
6
4
  # @param [SFRest::Connection] conn
7
5
  def initialize(conn)
8
6
  @conn = conn
9
- @pb = SFRest::Pathbuilder.new
10
7
  end
11
8
 
12
9
  # Gets the montly usage data.
13
- # @param [Integer] stack_id
14
- # @param [Hash] datum Optional filter parameters
15
- # 'start_from' => "YYYY-MM", # String
16
- # 'sort_order' => "acs|desc", # String
17
- # 'limit' => Integer, # Number of months to list (max 120)
18
- # 'page' => Integer #Page number to show
19
- # @return [Hash] {'count' => Integer, 'time' => String date,
20
- # 'most_recent_data' => 'YYYY-MM-DD',
21
- # 'dynamic_requests' => {
22
- # '2016-10' => {
23
- # 'date' => '2016-10',
24
- # 'stack_id' => 1,
25
- # 'total_dynamic_requests'=> 106,
26
- # '2xx_dynamic_requests'=> 100,
27
- # '3xx_dynamic_requests'=> 3,
28
- # '4xx_dynamic_requests'=> 2,
29
- # '5xx_dynamic_requests'=> 1,
30
- # 'total_runtime'=> 101.4,
31
- # '2xx_runtime'=> 100,
32
- # '3xx_runtime'=> 0.9,
33
- # '4xx_runtime'=> 0.4,
34
- # '5xx_runtime'=> 0.1 }
35
- # }
10
+ # @param stack_id [Integer] The stack of sites of interest
11
+ # @param datum [Hash] Optional filter parameters
12
+ #
13
+ # 'start_from' => "YYYY-MM", # String
14
+ # 'sort_order' => "acs|desc", # String
15
+ # 'limit' => Integer, # Number of months to list (max 120)
16
+ # 'page' => Integer # Page number to show
17
+ #
18
+ # @return [Hash] The dynamic request data.
19
+ #
20
+ # { 'count' => Integer,
21
+ # 'time' => String date,
22
+ # 'most_recent_data' => 'YYYY-MM-DD',
23
+ # 'dynamic_requests' => {
24
+ # '2016-10' => {
25
+ # 'date' => '2016-10',
26
+ # 'stack_id' => 1,
27
+ # 'total_dynamic_requests'=> 106,
28
+ # '2xx_dynamic_requests'=> 100,
29
+ # '3xx_dynamic_requests'=> 3,
30
+ # '4xx_dynamic_requests'=> 2,
31
+ # '5xx_dynamic_requests'=> 1,
32
+ # 'total_runtime'=> 101.4,
33
+ # '2xx_runtime'=> 100,
34
+ # '3xx_runtime'=> 0.9,
35
+ # '4xx_runtime'=> 0.4,
36
+ # '5xx_runtime'=> 0.1 }
37
+ # }
36
38
  def monthly(stack_id = 1, datum = {})
37
39
  datum[stack_id] = stack_id
38
40
  current_path = '/api/v1/dynamic-requests/monthly'
39
41
  @conn.get URI.parse(URI.encode(pb.build_url_query(current_path, datum))).to_s
40
42
  end
43
+
44
+ # returns a Pathbuilder object for manipulating the query parameters
45
+ # @return [SFRest::Pathbuilder]
46
+ def pb
47
+ @pb ||= SFRest::Pathbuilder.new
48
+ end
49
+
50
+ private :pb
41
51
  end
42
52
  end
@@ -1,4 +1,4 @@
1
1
  module SFRest
2
2
  # Just tracks the version of sfrest.
3
- VERSION = '0.0.9'.freeze
3
+ VERSION = '0.0.10'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - ACSF Engineering
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.5.1
127
+ rubygems_version: 2.6.10
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Acquia Site Factory Rest API.