cloudflare_client_rb 4.5.0 → 5.0.0
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/namespace/value.rb +1 -1
- data/lib/cloudflare_client/namespace.rb +1 -1
- data/lib/cloudflare_client/organization.rb +1 -1
- data/lib/cloudflare_client/railgun.rb +0 -5
- data/lib/cloudflare_client/version.rb +1 -1
- data/lib/cloudflare_client/virtual_dns_cluster/analytic.rb +1 -1
- data/lib/cloudflare_client/virtual_dns_cluster.rb +1 -1
- data/lib/cloudflare_client/zone/base.rb +1 -1
- data/lib/cloudflare_client/zone/firewall/waf_package/base.rb +1 -1
- data/lib/cloudflare_client/zone/log.rb +3 -3
- data/lib/cloudflare_client/zone.rb +0 -6
- data/lib/cloudflare_client.rb +5 -3
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 867624e2f37d6cf2f1709c151e9bd51cba5526863486debbaa7dfc99430950e1
|
4
|
+
data.tar.gz: 40ee55b856e35a064872391bbe4ec105b5cc149546ca6d9592e5ef0c67820c90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 715cdb2ae1c2c8a4f37ae47665ffd1d146e1e31147984e57431aae7bc2afab9da6f1e155229db3aacba9ad45ae245dbfe46d6464d7ada0d72208dfc8c6adcdfb
|
7
|
+
data.tar.gz: 7ad6cf31ed7bfd150c99392d9213a50bf6a3fe1b949db77f3470a60b014c604b30ac99451ac35173d522582cc9834ae9de099b6c987bcfced9bbff275c5fabae
|
@@ -7,7 +7,7 @@ class CloudflareClient::VirtualDnsCluster::Analytic < CloudflareClient::VirtualD
|
|
7
7
|
def initialize(args)
|
8
8
|
@virtual_dns_id = args.delete(:virtual_dns_id)
|
9
9
|
id_check(:virtual_dns_id, virtual_dns_id)
|
10
|
-
super
|
10
|
+
super(**args)
|
11
11
|
end
|
12
12
|
|
13
13
|
def report(dimensions:, metrics:, since_ts:, until_ts:, filters: nil, sort: nil, limit: nil)
|
@@ -10,10 +10,10 @@ class CloudflareClient::Zone::Log < CloudflareClient::Zone::Base
|
|
10
10
|
timestamp_check(:end_time, end_time) unless end_time.nil?
|
11
11
|
|
12
12
|
params = Hash.new
|
13
|
-
|
13
|
+
minute = 60
|
14
14
|
|
15
15
|
if start_time.nil?
|
16
|
-
params[:start] = (Time.now - 20
|
16
|
+
params[:start] = (Time.now - (20 * minute)).to_i
|
17
17
|
else
|
18
18
|
timestamp_check(:start_time, start_time)
|
19
19
|
params[:start] = start_time
|
@@ -21,7 +21,7 @@ class CloudflareClient::Zone::Log < CloudflareClient::Zone::Base
|
|
21
21
|
|
22
22
|
|
23
23
|
if end_time.nil?
|
24
|
-
params[:end] = (Time.now - 5
|
24
|
+
params[:end] = (Time.now - (5 * minute)).to_i
|
25
25
|
else
|
26
26
|
timestamp_check(:end_time, end_time)
|
27
27
|
params[:end] = end_time
|
@@ -5,12 +5,6 @@ class CloudflareClient
|
|
5
5
|
|
6
6
|
VALID_ZONE_STATUSES = %w[active pending initializing moved deleted deactivated].freeze
|
7
7
|
|
8
|
-
##
|
9
|
-
# Zone based operations
|
10
|
-
def initialize(*args)
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
8
|
##
|
15
9
|
# list_zones will either list all zones or search for zones based on params
|
16
10
|
# results are paginated!
|
data/lib/cloudflare_client.rb
CHANGED
@@ -133,7 +133,7 @@ class CloudflareClient
|
|
133
133
|
def build_client(params)
|
134
134
|
# we need multipart form encoding for some of these operations
|
135
135
|
client = Faraday.new(url: API_BASE) do |conn|
|
136
|
-
conn.request :multipart
|
136
|
+
# conn.request :multipart
|
137
137
|
conn.request :url_encoded
|
138
138
|
conn.use Middleware::Response::RaiseError
|
139
139
|
end
|
@@ -183,7 +183,9 @@ class CloudflareClient
|
|
183
183
|
def cf_put(path: nil, data: nil, params: nil)
|
184
184
|
result = @cf_client.put do |request|
|
185
185
|
request.url(API_BASE + path) unless path.nil?
|
186
|
-
|
186
|
+
unless data.nil?
|
187
|
+
request.body = data.kind_of?(String) ? data : data.to_json
|
188
|
+
end
|
187
189
|
unless params.nil?
|
188
190
|
request.params = params if params.values.any? { |i| !i.nil? }
|
189
191
|
end
|
@@ -192,7 +194,7 @@ class CloudflareClient
|
|
192
194
|
end
|
193
195
|
|
194
196
|
def cf_patch(path: nil, data: {})
|
195
|
-
result
|
197
|
+
result = @cf_client.patch do |request|
|
196
198
|
request.url(API_BASE + path) unless path.nil?
|
197
199
|
request.body = data.to_json unless data.empty?
|
198
200
|
end
|
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
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ian waters
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: iwaters@zendesk.com
|
@@ -65,15 +65,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 3.1.0
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
|
76
|
-
rubygems_version: 2.6.11
|
75
|
+
rubygems_version: 3.3.7
|
77
76
|
signing_key:
|
78
77
|
specification_version: 4
|
79
78
|
summary: lightweight cloudflare api client
|