cloudflare_client_rb 4.2.1 → 4.2.2

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
- SHA256:
3
- metadata.gz: '09e6fe54df49efdacfd5c63ca1327bab32d590ce363d86eab0679c02fbaa973b'
4
- data.tar.gz: 915ba08346e6f95166854ebc2a364b9379f366b24fea00618b4c011d7d0a77cc
2
+ SHA1:
3
+ metadata.gz: 7253ec4a8135244732a1fe80650ae17ae40739bb
4
+ data.tar.gz: 94f288b2003670ff9c4443413a92b567c5419e2c
5
5
  SHA512:
6
- metadata.gz: 057dd8b22adcf77962101d2851da0cba7506bacb082ea23e8297b0890271dda45779b3909f4f4aea1d49a23b74dac7a5261bece286070f7479ffd7edb9a02e24
7
- data.tar.gz: 53f2e065849d4f4852a1e31cab7e14df8c598ace3940497d4acd15b02471e64fd92a1c368a6357798980d4679fe9066d8eef267d0328824f82f1ae7f8f1f9eda
6
+ metadata.gz: 7fb5f774fc1878c1e99c66ee73ae021ceae8ca27035a60d526b017589eaffb135a321efea6eb2e7870671e851606945150e082fb4c676c3cf555e750c2135c5d
7
+ data.tar.gz: a6f51c51ebc2a32d9bc06f719fc69c431503c0449e74fcd7ca51ebeb438815c6cf6ca56398865180fd2c97a87f51bb7412f7e0a8d906c18ba08535aa5b65e6b4
@@ -1,3 +1,3 @@
1
1
  class CloudflareClient
2
- VERSION = '4.2.1'
2
+ VERSION = '4.2.2'
3
3
  end
@@ -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:, end_time: nil, count: nil)
10
- id_check(:start_time, start_time)
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 = {start: start_time}
12
+ params = Hash.new
14
13
 
15
- unless end_time.nil?
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/requests", params: params, extra_headers: {'Accept-encoding': 'gzip'})
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/requests/#{ray_id}",
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.1
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-03-29 00:00:00.000000000 Z
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.7.6
73
+ rubygems_version: 2.6.11
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: lightweight cloudflare api client