cloudflair 0.2.4 → 0.2.5
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/README.md +1 -0
- data/VERSION +1 -1
- data/lib/cloudflair/api/zone/custom_hostname.rb +17 -0
- data/lib/cloudflair/api/zone.rb +1 -0
- data/lib/cloudflair/api/zone__custom_hostnames.rb +29 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2a69b1e26a488661affa4013c362307968f083f6e688bc3d63519de57415b58
|
4
|
+
data.tar.gz: c3383bd0be796d11c49e11da606fbe4bbc6e2ae75c89a20c159b3479ebf9f629
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 130d30780e3df7779780f9240371fe936e24e99c4ba5e97203a3b15af88a978d1ad85a39d1738786068d1431cd9cc93fb2ab49e186a342b231f8360bbca26c9b
|
7
|
+
data.tar.gz: 1d4737127f23eac7423dcf43f6be698e379d91fcd1402607477efd1fad7c6949897b3946962c6ca8803d8d28d2c0d3f0808ec3184d16ba593c741d886e587aca
|
data/README.md
CHANGED
@@ -112,6 +112,7 @@ A good reference on how to use this wrapper are also the Rspecs.
|
|
112
112
|
* `/zones/:zone_id/available_plans` GET
|
113
113
|
* `/zones/:zone_id/available_plans/:plan_id` GET
|
114
114
|
* `/zones/:zone_id/available_rate_plans`
|
115
|
+
* `/zones/:zone_id/custom_hostnames` GET, POST, PATCH
|
115
116
|
* `/zones/:zone_id/dns_records` GET, POST
|
116
117
|
* `/zones/:zone_id/dns_records/:record_id` GET, DELETE (PUT not implemented)
|
117
118
|
* `/zones/:zone_id/purge_cache` POST
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'cloudflair/entity'
|
2
|
+
|
3
|
+
module Cloudflair
|
4
|
+
class CustomHostname
|
5
|
+
include Cloudflair::Entity
|
6
|
+
|
7
|
+
attr_reader :zone_id, :custom_hostname_id
|
8
|
+
deletable true
|
9
|
+
patchable_fields :ssl, :custom_origin_server, :custom_metadata
|
10
|
+
path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
|
11
|
+
|
12
|
+
def initialize(zone_id, custom_hostname_id)
|
13
|
+
@zone_id = zone_id
|
14
|
+
@custom_hostname_id = custom_hostname_id
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/cloudflair/api/zone.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'cloudflair/api/zone/custom_hostname'
|
2
|
+
|
3
|
+
module Cloudflair
|
4
|
+
class Zone
|
5
|
+
def custom_hostnames(filter = {})
|
6
|
+
raw_hostnames = response connection.get("#{path}/custom_hostnames", filter)
|
7
|
+
|
8
|
+
raw_hostnames.map { |raw_hostname| build_custom_hostname(raw_hostname) }
|
9
|
+
end
|
10
|
+
|
11
|
+
def custom_hostname(custom_hostname_id)
|
12
|
+
Cloudflair::CustomHostname.new zone_id, custom_hostname_id
|
13
|
+
end
|
14
|
+
|
15
|
+
def new_custom_hostname(hostname_data)
|
16
|
+
raw_hostname = response connection.post("#{path}/custom_hostnames", hostname_data)
|
17
|
+
|
18
|
+
build_custom_hostname raw_hostname
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def build_custom_hostname(raw_hostname)
|
24
|
+
hostname = custom_hostname raw_hostname['id']
|
25
|
+
hostname.data = raw_hostname
|
26
|
+
hostname
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudflair
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Mäder
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- lib/cloudflair/api/zone/analytics.rb
|
178
178
|
- lib/cloudflair/api/zone/available_plan.rb
|
179
179
|
- lib/cloudflair/api/zone/available_rate_plan.rb
|
180
|
+
- lib/cloudflair/api/zone/custom_hostname.rb
|
180
181
|
- lib/cloudflair/api/zone/dns_record.rb
|
181
182
|
- lib/cloudflair/api/zone/purge_cache.rb
|
182
183
|
- lib/cloudflair/api/zone/railgun.rb
|
@@ -212,6 +213,7 @@ files:
|
|
212
213
|
- lib/cloudflair/api/zone/settings/waf.rb
|
213
214
|
- lib/cloudflair/api/zone/settings/websockets.rb
|
214
215
|
- lib/cloudflair/api/zone__available_plans.rb
|
216
|
+
- lib/cloudflair/api/zone__custom_hostnames.rb
|
215
217
|
- lib/cloudflair/api/zone__dns_records.rb
|
216
218
|
- lib/cloudflair/api/zone__railguns.rb
|
217
219
|
- lib/cloudflair/communication.rb
|
@@ -240,8 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
242
|
- !ruby/object:Gem::Version
|
241
243
|
version: '0'
|
242
244
|
requirements: []
|
243
|
-
|
244
|
-
rubygems_version: 2.7.7
|
245
|
+
rubygems_version: 3.0.3
|
245
246
|
signing_key:
|
246
247
|
specification_version: 4
|
247
248
|
summary: Wrapper to CloudFlare's v4 REST API.
|