sfrest 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sfrest/usage.rb +36 -26
- data/lib/sfrest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22a23bb499156611238ac336d4e07e0d54a3e6aa
|
|
4
|
+
data.tar.gz: b1c3251938898986d6fa5862e23a028b28beef05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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]
|
|
14
|
-
# @param [Hash]
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
# '
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
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
|
data/lib/sfrest/version.rb
CHANGED
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.
|
|
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.
|
|
127
|
+
rubygems_version: 2.6.10
|
|
128
128
|
signing_key:
|
|
129
129
|
specification_version: 4
|
|
130
130
|
summary: Acquia Site Factory Rest API.
|