fastlyctl 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fastlyctl/clone_utils.rb +10 -4
- data/lib/fastlyctl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fa41e6ea6712a1065c4d81c9113ab86451adcff4b586ad63b6d1449ac3a0a54
|
4
|
+
data.tar.gz: 8640eee6253a25aab53c21b98c32d588209e782d3085f11e67bef9af42e51fc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84327784e9592df352398ba26b6e5b498693fabdf9b0717bf098c2b02014a1ed8c5e7c88be6323f4193d60c05ada4c1a6fd45546b0ae501ee68a54159ec52037
|
7
|
+
data.tar.gz: 51321b1f519aca18a50dcdd7ce478808472adfedbec53833452925374eb07b75bf141883732b40031bf81ec24e35f0043c2f880eb2d150c9f30f8c551e7d680b
|
data/README.md
CHANGED
@@ -44,10 +44,10 @@ module FastlyCTL
|
|
44
44
|
source_sid = obj["service_id"]
|
45
45
|
abort "No version on object" unless obj.key?("version")
|
46
46
|
source_version = obj["version"]
|
47
|
+
main = false
|
47
48
|
|
48
|
-
if type == "director"
|
49
|
-
|
50
|
-
end
|
49
|
+
backends = obj["backends"].dup if type == "director"
|
50
|
+
main = true if type == "vcl" && obj["main"] === true
|
51
51
|
|
52
52
|
if type == "snippet" && obj["dynamic"] == "1"
|
53
53
|
obj.merge!(FastlyCTL::Fetcher.api_request(:get, "/service/#{source_sid}/snippet/#{obj["id"]}"))
|
@@ -58,6 +58,11 @@ module FastlyCTL
|
|
58
58
|
|
59
59
|
obj = FastlyCTL::Fetcher.api_request(meta.key?(:method) ? meta[:method] : :post, "/service/#{sid}/version/#{version}/#{type}", body: obj )
|
60
60
|
|
61
|
+
if main === true
|
62
|
+
# the "main-ness" of the vcl does not get carried over during creation. must explicitly set main
|
63
|
+
FastlyCTL::Fetcher.api_request(:put, "/service/#{sid}/version/#{version}/vcl/#{obj["name"]}/main")
|
64
|
+
end
|
65
|
+
|
61
66
|
if type == "director"
|
62
67
|
backends.each do |b|
|
63
68
|
FastlyCTL::Fetcher.api_request(:post, "/service/#{sid}/version/#{version}/director/#{obj["name"]}/backend/#{b}", body: obj )
|
@@ -72,6 +77,7 @@ module FastlyCTL
|
|
72
77
|
|
73
78
|
items = []
|
74
79
|
entries = []
|
80
|
+
# build some batch requests for dictionaries and ACLs to save on API rate limit
|
75
81
|
FastlyCTL::Fetcher.api_request(:get, "#{path}/#{type}/#{obj_id}/#{FastlyCTL::CloneUtils.pluralize(child)}").each do |child_obj|
|
76
82
|
case child
|
77
83
|
when "item"
|
@@ -81,7 +87,7 @@ module FastlyCTL
|
|
81
87
|
next
|
82
88
|
when "entry"
|
83
89
|
entries.push({
|
84
|
-
"op" => "create","ip" => child_obj["ip"],"subnet" => child_obj["subnet"]
|
90
|
+
"op" => "create","ip" => child_obj["ip"],"subnet" => child_obj["subnet"], "negate" => child_obj["negate"]
|
85
91
|
})
|
86
92
|
next
|
87
93
|
end
|
data/lib/fastlyctl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlyctl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Basile
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|