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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c13c32f3226faf3753407dd0fd68c3af6bc6c06
4
- data.tar.gz: 3bd0ddc7f620abef224619fad0ba000d1199c4db
3
+ metadata.gz: dc92cf3e0e0141eb19280700221219f1b82a6190
4
+ data.tar.gz: a20713db85336209e9f92be4663d0d32ba76b56e
5
5
  SHA512:
6
- metadata.gz: 96b7c9142b542d96ac6580b38a39d4a2bc5502764e948f992959797b85baaf81258069d4ea3b8ec73ffd9b204f7483f09cb06539050d726c865ddc072a91b02d
7
- data.tar.gz: 121894c0a5da3f1fda537bd88724cfb3205150c532095fda82b1e911465739a2c797982de153273344f24485c91efd25eaf9b485e032b26406d1bd8cfb6ffbfc
6
+ metadata.gz: 353448bf17405cb8310baade3384c0c99756448f80831d9ca28b399342ca51aa300ea746be12b668d01c596f4d51b40353d278880e349ff037bc0210c4ab9bfe
7
+ data.tar.gz: c096fd8bc9bbb8146a3715af8f24059690924f6675f5b5ffc1ec1af037a07f8821111635ca93586a9fb14a339d3dd1a3b1d3394feefe3ae82b54cd366288769e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- magellan-cli (0.2.5)
4
+ magellan-cli (0.2.6)
5
5
  activesupport (~> 4.1.4)
6
6
  httpclient
7
7
  nokogiri
@@ -14,18 +14,18 @@ module Magellan
14
14
  "project" => "Project",
15
15
  "stage" => "Stage",
16
16
  "client_version" => "ClientVersion",
17
- "tr" => "TransactionRouter",
18
- "worker" => "WorkerVersion",
19
- "image" => "ContainerImage",
20
- "container" => "ContainerInstance",
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 :WorkerVersion , "magellan/cli/resources/worker_version"
20
+ autoload :Worker , "magellan/cli/resources/worker"
21
21
 
22
- autoload :VmInstance , "magellan/cli/resources/vm_instance"
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 ContainerInstance < Base
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 ContainerImage < Base
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 WorkerVersion < Base
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
@@ -1,5 +1,5 @@
1
1
  module Magellan
2
2
  module Cli
3
- VERSION = "0.2.5"
3
+ VERSION = "0.2.6"
4
4
  end
5
5
  end
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.5
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/container_image.rb
156
- - lib/magellan/cli/resources/container_instance.rb
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/worker_version.rb
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