fastlyctl 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -3
- data/lib/fastlyctl/commands/logging.rb +1 -0
- data/lib/fastlyctl/commands/snippet.rb +7 -5
- 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: 1c154207a0e8cd59c7181d3e4b49c14fe6e6a437b7b6e01a597e5e9f1657b0ec
|
4
|
+
data.tar.gz: 8dc202ac070b547244e84774a7d7383886317b69853c08b6f39408b995969e66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbcf3d02d17fea022de0d7fd573b52aeae06d529933f20848267ab6b73ed885774a3958d6f39812e51ea49f2cb29ca35b8a6aa4deea278b4b0727ff2f7cdd66d
|
7
|
+
data.tar.gz: a91b8cf084a34e5c2af34b4540fbe1622cede5590b7eef8c1e280414b2ac6112b7bfebf9964851236b6eb6b814ac99ecee588b4e629a3d088357180d9439c00c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# FastlyCTL [![Gem Version](https://img.shields.io/gem/v/fastlyctl.svg)](https://rubygems.org/gems/fastlyctl)
|
2
2
|
|
3
|
-
CLI for
|
3
|
+
A CLI for managing Fastly configurations with [Fastly's API](https://docs.fastly.com/api/config).
|
4
4
|
|
5
5
|
## Dependencies
|
6
6
|
|
7
7
|
* Ruby 2.2+
|
8
|
-
*
|
9
|
-
*
|
8
|
+
* [diffy](https://rubygems.org/gems/diffy)
|
9
|
+
* [launchy](https://rubygems.org/gems/launchy)
|
10
|
+
* [thor](https://rubygems.org/gems/thor)
|
11
|
+
* [typhoeus](https://rubygems.org/gems/typhoeus)
|
10
12
|
|
11
13
|
## Installation
|
12
14
|
|
@@ -317,6 +319,7 @@ Flags:
|
|
317
319
|
* --v: The version to use. Latest writable version is assumed.
|
318
320
|
* --t: The type of snippet to create. Types are named after subroutines--for instance a snippet for `vcl_recv` would be of type `recv`. Use `init` for snippets outside of a subroutine.
|
319
321
|
* --d: When used with the create command, specifies that the snippet should be dynamic.
|
322
|
+
* --y: Answer yes to all prompts
|
320
323
|
|
321
324
|
### token
|
322
325
|
|
@@ -9,6 +9,7 @@ module FastlyCTL
|
|
9
9
|
"#{basename} logging #{command.usage}"
|
10
10
|
end
|
11
11
|
|
12
|
+
|
12
13
|
desc "bigquery <action>", "Setup BigQuery As a logging provider, available actions are create, update, delete, list and show"
|
13
14
|
method_option :service, :aliases => ["--s","--service"], :banner => "Service ID to use", :required => true
|
14
15
|
method_option :version, :aliases => ["--v", "--version"], :banner => "Version of the service to use"
|
@@ -5,6 +5,7 @@ module FastlyCTL
|
|
5
5
|
method_option :version, :aliases => ["--v"]
|
6
6
|
method_option :type, :aliases => ["--t"]
|
7
7
|
method_option :dynamic, :aliases => ["--d"]
|
8
|
+
method_option :yes, :aliases => ["--y"]
|
8
9
|
def snippet(action,name=false)
|
9
10
|
id = FastlyCTL::Utils.parse_directory unless options[:service]
|
10
11
|
id ||= options[:service]
|
@@ -46,9 +47,10 @@ module FastlyCTL
|
|
46
47
|
|
47
48
|
new_content = File.read(filename)
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
50
|
+
unless options.key?(:yes)
|
51
|
+
say(FastlyCTL::Utils.get_diff(snippet["content"],new_content))
|
52
|
+
abort unless yes?("Given the above diff between the old dyanmic snippet content and the new content, are you sure you want to upload your changes? REMEMBER, THIS SNIPPET IS VERSIONLESS AND YOUR CHANGES WILL BE LIVE IMMEDIATELY!")
|
53
|
+
end
|
52
54
|
|
53
55
|
FastlyCTL::Fetcher.api_request(:put, "/service/#{id}/snippet/#{snippet["snippet_id"]}", {:endpoint => :api, body: {
|
54
56
|
content: new_content
|
@@ -77,7 +79,7 @@ module FastlyCTL
|
|
77
79
|
return
|
78
80
|
end
|
79
81
|
|
80
|
-
if yes?("Local file #{filename} found. Would you like to upload its content?")
|
82
|
+
if options.key?(:yes) || yes?("Local file #{filename} found. Would you like to upload its content?")
|
81
83
|
FastlyCTL::Fetcher.upload_snippet(id,version,File.read(filename),name)
|
82
84
|
say("Local snippet file content successfully uploaded.")
|
83
85
|
end
|
@@ -89,7 +91,7 @@ module FastlyCTL
|
|
89
91
|
|
90
92
|
return unless File.exists?(filename)
|
91
93
|
|
92
|
-
if yes?("Would you like to delete the local file #{name}.snippet associated with this snippet?")
|
94
|
+
if options.key?(:yes) || yes?("Would you like to delete the local file #{name}.snippet associated with this snippet?")
|
93
95
|
File.delete(filename)
|
94
96
|
say("Local snippet file #{filename} deleted.")
|
95
97
|
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.12
|
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-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|