cloudflare_client_rb 4.2.1 → 4.2.2
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 +5 -5
- data/lib/cloudflare_client/version.rb +1 -1
- data/lib/cloudflare_client/zone/log.rb +19 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7253ec4a8135244732a1fe80650ae17ae40739bb
|
4
|
+
data.tar.gz: 94f288b2003670ff9c4443413a92b567c5419e2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb5f774fc1878c1e99c66ee73ae021ceae8ca27035a60d526b017589eaffb135a321efea6eb2e7870671e851606945150e082fb4c676c3cf555e750c2135c5d
|
7
|
+
data.tar.gz: a6f51c51ebc2a32d9bc06f719fc69c431503c0449e74fcd7ca51ebeb438815c6cf6ca56398865180fd2c97a87f51bb7412f7e0a8d906c18ba08535aa5b65e6b4
|
@@ -6,20 +6,31 @@ class CloudflareClient::Zone::Log < CloudflareClient::Zone::Base
|
|
6
6
|
|
7
7
|
##
|
8
8
|
# get logs using only timestamps
|
9
|
-
def list_by_time(start_time
|
10
|
-
|
11
|
-
timestamp_check(:start_time, start_time)
|
9
|
+
def list_by_time(start_time: nil, end_time: nil, count: nil)
|
10
|
+
timestamp_check(:end_time, end_time) unless end_time.nil?
|
12
11
|
|
13
|
-
params =
|
12
|
+
params = Hash.new
|
14
13
|
|
15
|
-
|
14
|
+
|
15
|
+
if start_time.nil?
|
16
|
+
params[:start] = (Time.now - 20.minute).to_i
|
17
|
+
else
|
18
|
+
timestamp_check(:start_time, start_time)
|
19
|
+
params[:start] = start_time
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
if end_time.nil?
|
24
|
+
params[:end] = (Time.now - 5.minute).to_i
|
25
|
+
else
|
16
26
|
timestamp_check(:end_time, end_time)
|
17
27
|
params[:end] = end_time
|
18
28
|
end
|
19
29
|
|
30
|
+
params[:count] = 1000
|
20
31
|
params[:count] = count unless count.nil?
|
21
32
|
|
22
|
-
cf_get(path: "/zones/#{zone_id}/logs/
|
33
|
+
cf_get(path: "/zones/#{zone_id}/logs/received", params: params, extra_headers: {'Accept-encoding': 'gzip'})
|
23
34
|
end
|
24
35
|
|
25
36
|
##
|
@@ -41,9 +52,10 @@ class CloudflareClient::Zone::Log < CloudflareClient::Zone::Base
|
|
41
52
|
end
|
42
53
|
|
43
54
|
params[:count] = count unless count.nil?
|
55
|
+
params[:count] = 500
|
44
56
|
|
45
57
|
cf_get(
|
46
|
-
path: "/zones/#{zone_id}/logs/
|
58
|
+
path: "/zones/#{zone_id}/logs/received",
|
47
59
|
params: params,
|
48
60
|
extra_headers: {'Accept-encoding': 'gzip'}
|
49
61
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudflare_client_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ian waters
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: iwaters@zendesk.com
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project:
|
73
|
-
rubygems_version: 2.
|
73
|
+
rubygems_version: 2.6.11
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: lightweight cloudflare api client
|