magellan-cli 0.2.5 → 0.2.6
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/lib/magellan/cli/command.rb +6 -6
- data/lib/magellan/cli/resources.rb +3 -6
- data/lib/magellan/cli/resources/{container_instance.rb → container.rb} +1 -1
- data/lib/magellan/cli/resources/{container_image.rb → image.rb} +1 -1
- data/lib/magellan/cli/resources/{worker_version.rb → worker.rb} +17 -1
- data/lib/magellan/cli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc92cf3e0e0141eb19280700221219f1b82a6190
|
4
|
+
data.tar.gz: a20713db85336209e9f92be4663d0d32ba76b56e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 353448bf17405cb8310baade3384c0c99756448f80831d9ca28b399342ca51aa300ea746be12b668d01c596f4d51b40353d278880e349ff037bc0210c4ab9bfe
|
7
|
+
data.tar.gz: c096fd8bc9bbb8146a3715af8f24059690924f6675f5b5ffc1ec1af037a07f8821111635ca93586a9fb14a339d3dd1a3b1d3394feefe3ae82b54cd366288769e
|
data/Gemfile.lock
CHANGED
data/lib/magellan/cli/command.rb
CHANGED
@@ -14,18 +14,18 @@ module Magellan
|
|
14
14
|
"project" => "Project",
|
15
15
|
"stage" => "Stage",
|
16
16
|
"client_version" => "ClientVersion",
|
17
|
-
"tr" => "TransactionRouter",
|
18
|
-
"worker" => "
|
19
|
-
"image" => "
|
20
|
-
"container" => "
|
17
|
+
#"tr" => "TransactionRouter",
|
18
|
+
"worker" => "Worker",
|
19
|
+
"image" => "Image",
|
20
|
+
"container" => "Container",
|
21
21
|
"cloudsql" => "Cloudsql",
|
22
22
|
}.each do |name, classname|
|
23
23
|
desc "#{name} SUBCOMMAND ...ARGS", "manage #{name}"
|
24
24
|
subcommand name, ::Magellan::Cli::Resources.const_get(classname)
|
25
25
|
end
|
26
26
|
|
27
|
-
desc "direct SUBCOMMAND ...ARGS", "send request directly"
|
28
|
-
subcommand "direct", ::Magellan::Cli::Direct
|
27
|
+
#desc "direct SUBCOMMAND ...ARGS", "send request directly"
|
28
|
+
#subcommand "direct", ::Magellan::Cli::Direct
|
29
29
|
|
30
30
|
desc "login", "login to a Magellan API server"
|
31
31
|
def login
|
@@ -17,13 +17,10 @@ module Magellan
|
|
17
17
|
autoload :ClientVersion , "magellan/cli/resources/client_version"
|
18
18
|
|
19
19
|
autoload :TransactionRouter, "magellan/cli/resources/transaction_router"
|
20
|
-
autoload :
|
20
|
+
autoload :Worker , "magellan/cli/resources/worker"
|
21
21
|
|
22
|
-
autoload :
|
23
|
-
|
24
|
-
autoload :ContainerImage , "magellan/cli/resources/container_image"
|
25
|
-
autoload :ContainerInstance, "magellan/cli/resources/container_instance"
|
26
|
-
autoload :ContainerAssignment, "magellan/cli/resources/container_assignment"
|
22
|
+
autoload :Image , "magellan/cli/resources/image"
|
23
|
+
autoload :Container , "magellan/cli/resources/container"
|
27
24
|
|
28
25
|
autoload :Cloudsql, "magellan/cli/resources/cloudsql"
|
29
26
|
end
|
@@ -5,7 +5,7 @@ module Magellan
|
|
5
5
|
module Cli
|
6
6
|
module Resources
|
7
7
|
|
8
|
-
class
|
8
|
+
class Container < Base
|
9
9
|
self.resource_name = "container~instance"
|
10
10
|
self.resource_dependency = {"stage" => "stage-version"}
|
11
11
|
self.hidden_fields = %w[created_at updated_at].map(&:freeze).freeze
|
@@ -5,7 +5,7 @@ module Magellan
|
|
5
5
|
module Cli
|
6
6
|
module Resources
|
7
7
|
|
8
|
-
class
|
8
|
+
class Image < Base
|
9
9
|
self.resource_name = "container~image"
|
10
10
|
self.resource_dependency = {"stage" => "stage-version"}
|
11
11
|
self.hidden_fields = %w[function_id function_type created_at updated_at].map(&:freeze).freeze
|
@@ -5,7 +5,7 @@ module Magellan
|
|
5
5
|
module Cli
|
6
6
|
module Resources
|
7
7
|
|
8
|
-
class
|
8
|
+
class Worker < Base
|
9
9
|
self.resource_name = "functions~worker"
|
10
10
|
self.resource_dependency = {"stage" => "stage-version"}
|
11
11
|
self.hidden_fields = %w[created_at updated_at].map(&:freeze).freeze
|
@@ -33,6 +33,22 @@ module Magellan
|
|
33
33
|
post_json("/admin/#{self.resource_name}/new.json", params)
|
34
34
|
end
|
35
35
|
|
36
|
+
desc "update ATTRIBUTE", "update selected worker with ATTRIBUTE(filename or JSON)"
|
37
|
+
def update(attrs)
|
38
|
+
if File.readable?(attrs)
|
39
|
+
attrs = YAML.load_file(attrs)
|
40
|
+
else
|
41
|
+
attrs = JSON.parse(attrs)
|
42
|
+
end
|
43
|
+
w = load_selection(parameter_name)
|
44
|
+
self.class.hidden_fields.each do |f| attrs.delete(f) end
|
45
|
+
self.class.field_associations.keys.each do |f| attrs.delete(f) end
|
46
|
+
params = {
|
47
|
+
parameter_name => attrs
|
48
|
+
}
|
49
|
+
put_json("/admin/#{resource_name}/#{w["id"]}/edit.js", params)
|
50
|
+
end
|
51
|
+
|
36
52
|
end
|
37
53
|
|
38
54
|
end
|
data/lib/magellan/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magellan-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akm2000
|
@@ -152,14 +152,14 @@ files:
|
|
152
152
|
- lib/magellan/cli/resources/base.rb
|
153
153
|
- lib/magellan/cli/resources/client_version.rb
|
154
154
|
- lib/magellan/cli/resources/cloudsql.rb
|
155
|
-
- lib/magellan/cli/resources/
|
156
|
-
- lib/magellan/cli/resources/
|
155
|
+
- lib/magellan/cli/resources/container.rb
|
156
|
+
- lib/magellan/cli/resources/image.rb
|
157
157
|
- lib/magellan/cli/resources/organization.rb
|
158
158
|
- lib/magellan/cli/resources/project.rb
|
159
159
|
- lib/magellan/cli/resources/stage.rb
|
160
160
|
- lib/magellan/cli/resources/team.rb
|
161
161
|
- lib/magellan/cli/resources/transaction_router.rb
|
162
|
-
- lib/magellan/cli/resources/
|
162
|
+
- lib/magellan/cli/resources/worker.rb
|
163
163
|
- lib/magellan/cli/sample_launch_options.json
|
164
164
|
- lib/magellan/cli/ssl.rb
|
165
165
|
- lib/magellan/cli/version.rb
|