idcfcloud 0.1.1 → 0.1.2

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: ec0b879b36c60944ea5e5c278eff5a3b178cd3a8
4
- data.tar.gz: '08e781d8fcc34e24cc50756454ec4a0d2d53a6d4'
3
+ metadata.gz: d9002c0097f25095d5180e53113ee7a7bb981196
4
+ data.tar.gz: e0c35e333e920df1765766340ba791046a591566
5
5
  SHA512:
6
- metadata.gz: 0c632d06f6f0e8d0a77e60dfd0f15c68de2e928d65abeb87084357610e41c3c46fddb8771e1d46624b5dce57d6566d2c748f17bb7ca47dae4b7f31baa0964d4b
7
- data.tar.gz: 3069813a2a204c285cd5dc2523b3f17cc89e73d5e59f6ea27c66d6fe4528008e31aae325d5185efd324714668388025335162849aec841bb50f536774d884b8d
6
+ metadata.gz: 5dfd861977b99e1a493193df3290e69ca2e9069d7a820db66c8fb3468d251d94999fa08bc07ca9b7f6745575d34bb1614fdaf19ee740278fec33ea70219de020
7
+ data.tar.gz: 52c9d239651b50df847250ed474e97c01971404627dde719440b417e97df8957a6cfb1d120660a27b1709b23cf643fe42231f23e3d45eda67a0c3d360b4eab99
data/README.md CHANGED
@@ -7,7 +7,7 @@ Note: requires Ruby 2.2.7 or higher.
7
7
  Carry out the next command to initialize.
8
8
 
9
9
  ```
10
- bin/idcfcloud init
10
+ $ idcfcloud init
11
11
  ```
12
12
 
13
13
  If you want each user to have their own configuration file, use the "--no-global" option and have the file created in the following:
@@ -30,7 +30,7 @@ $ bundle install --path vendor/bundle
30
30
  ## Usage
31
31
 
32
32
  ```
33
- $ bin/idcfcloud <serviceName> <command> [attributes] [option]
33
+ $ idcfcloud <serviceName> <command> [attributes] [option]
34
34
  ```
35
35
 
36
36
  If you want to set more than one attribute, use the json form.
@@ -53,7 +53,7 @@ https://github.com/idcf/idcf-ilb-ruby
53
53
  add server
54
54
 
55
55
  ``` code
56
- bin/idcfcloud ilb add_server_for_protocol <lb_id> <protocol> <protocol_port> <data> [option]
56
+ $ idcfcloud ilb add_server_for_protocol <lb_id> <protocol> <protocol_port> <data> [option]
57
57
  ```
58
58
 
59
59
  | data | type | example | note |
@@ -64,7 +64,7 @@ bin/idcfcloud ilb add_server_for_protocol <lb_id> <protocol> <protocol_port> <da
64
64
  delete server
65
65
 
66
66
  ``` code
67
- bin/idcfcloud ilb delete_server_for_protocol <lb_id> <protocol> <protocol_port> <data> [option]
67
+ $ idcfcloud ilb delete_server_for_protocol <lb_id> <protocol> <protocol_port> <data> [option]
68
68
  ```
69
69
 
70
70
  #### <a name="your"></a>Your
@@ -77,7 +77,7 @@ http://docs.idcf.jp/cloud/billing/
77
77
  Running the following test code is possible, but not recommended nor supported. Run only a code of a target.
78
78
 
79
79
  ```code
80
- bundle exec ruby test/run_test.rb idcf/cli/controller/test_billing.rb
80
+ $ bundle exec ruby test/run_test.rb idcf/cli/controller/test_billing.rb
81
81
  ```
82
82
 
83
83
  In order to avoid collapsed setting in ILB, make sure you understand how things work before running a code.
@@ -88,4 +88,4 @@ In order to avoid collapsed setting in ILB, make sure you understand how things
88
88
  2. Create your feature branch (git checkout -b my-new-feature)
89
89
  3. Commit your changes (git commit -am 'Add some feature')
90
90
  4. Push the branch (git push origin my-new-feature)
91
- 5. Create a new Pull Request
91
+ 5. Create a new Pull Request
@@ -23,19 +23,30 @@ module Idcf
23
23
  end
24
24
 
25
25
  def client_send(client, command, *args)
26
- arg = set_headers(client.public_method(command.to_sym), *args.dup)
27
-
26
+ method = client.public_method(command.to_sym)
27
+ arg = set_headers(method, args.dup)
28
+ arg = check_job_arg(method, arg) if command.to_s == 'check_job'
28
29
  client.__send__(command.to_sym, *arg)
29
30
  end
30
31
 
31
- def set_headers(method, *args)
32
- method.parameters.each do |k, v|
32
+ def set_headers(method, args)
33
+ method.parameters.each_with_index do |v, k|
33
34
  case v[1].to_s
34
- when 'attributes'
35
- args[k] = {} unless args[k].class == Hash
36
- when 'headers'
35
+ when 'attributes', 'headers'
37
36
  args[k] = {} unless args[k].class == Hash
38
- args[k].merge!(Idcf::Cli::Conf::Const::HEADERS)
37
+ args[k].merge!(Idcf::Cli::Conf::Const::HEADERS) if v[1].to_s == 'headers'
38
+ end
39
+ end
40
+ args
41
+ end
42
+
43
+ def check_job_arg(method, args)
44
+ method.parameters.each_with_index do |v, k|
45
+ case v[1].to_s
46
+ when 'specify_res_id'
47
+ args[k] = false
48
+ when 'callback_and_args'
49
+ args[k] = []
39
50
  end
40
51
  end
41
52
  args
@@ -1,5 +1,5 @@
1
1
  module Idcf
2
2
  module Cli
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '0.1.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idcfcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - IDC Frontier Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-31 00:00:00.000000000 Z
11
+ date: 2017-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler