idcfcloud 1.0.0 → 1.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
- SHA1:
3
- metadata.gz: 6941bbdef01e10485802468bf365d7d105146ba1
4
- data.tar.gz: a32b22a5411de149cf8fd792e5b79c0df512ec89
2
+ SHA256:
3
+ metadata.gz: c426a591993dc4f91689733ed42dd7b74fa318997b7bd10e2aed2e79419de34b
4
+ data.tar.gz: cbb9b32e9562df3117435d076667ca8900c07f1916f6d68fb970f8f48ca44696
5
5
  SHA512:
6
- metadata.gz: 18b046b27be00e1770388bd6067b5d37748a5ed56862e27a5e68cc995fd944a1d15649a5a6206695708f5f61b360b439e1d9c82f210f71c21f892cd78d86e00e
7
- data.tar.gz: b1af470e7aac83d807b319e7308851e513541207b9993f65a4cf1ec5bd2047c7640d7bbde2b68c86596ed1731c13afb3a15c5f7726cbda7977ad3b1c91356fa3
6
+ metadata.gz: 8cc9e4688089eba3db58999522f1d1020b3c95ef42ae202f2633b263dd2b7b44ebff927c27a761f721d569e4abfa7951f19cdaf9f3ba0958d5739a349b59c66e
7
+ data.tar.gz: 9f7265ea8993df575d658e336ae13dab0afebf02fd092e048f2deb5eae370f9a50896edb10aa3013ca037d3543def691b7f23ed458dc9fae018547dba86ea06e
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 1.1.2
4
+
5
+ * Add the `jp-east-3` region as an option for: `ilb` and `compute`
data/README.md CHANGED
@@ -70,8 +70,6 @@ idcfcloud your list_billing_history --json-path '$.data[?(@.month=="2017-10")]'
70
70
 
71
71
  [ILB](#ilb)
72
72
 
73
- [CDN](#cdn)
74
-
75
73
  [DNS](#dns)
76
74
 
77
75
  [Your](#your)
@@ -80,7 +78,7 @@ idcfcloud your list_billing_history --json-path '$.data[?(@.month=="2017-10")]'
80
78
 
81
79
  versions
82
80
 
83
- Get a supported API version.
81
+ Get a supported API version.
84
82
 
85
83
  ```code
86
84
  $ idcfcloud your versions
@@ -126,10 +124,6 @@ sslalgorithms_ids
126
124
  $ idcfcloud ilb sslalgorithms_ids
127
125
  ```
128
126
 
129
- ### CDN<a name="cdn"></a>
130
-
131
- https://www.idcf.jp/help/cache/docs/pdf/cache_api.pdf?cl=rd_0046
132
-
133
127
  ### DNS<a name="dns"></a>
134
128
 
135
129
  http://docs.idcf.jp/cloud/dns/#s_fid=4FEB16B56007BA5C-0BFB42ABA668ADA8
@@ -138,16 +132,29 @@ http://docs.idcf.jp/cloud/dns/#s_fid=4FEB16B56007BA5C-0BFB42ABA668ADA8
138
132
 
139
133
  http://docs.idcf.jp/cloud/billing/
140
134
 
141
- ## Development
135
+ ## Development && Test
142
136
 
143
137
  Running the following test code is possible, but not recommended nor supported. Run only a code of a target.
144
138
 
139
+ 🚨NOTE 🚨
140
+
141
+ - Be sure to specify `test/run_test.rb` before the test target.
142
+ - The test environment is not standalone. You need to apply for services and prepare your own environment.
143
+ At least an [ILB](https://www.idcf.jp/cloud/ilb/) is required to pass all tests.
144
+ - If you do not specify the region properly with the environment variable `TEST_REGION (default: jp-east)`, the test will not pass.
145
+
145
146
  ```code
146
- $ bundle exec ruby test/run_test.rb idcf/cli/controller/test_your.rb
147
+ $ TEST_REGION=your_region bundle exec ruby test/run_test.rb idcf/cli/controller/test_your.rb
147
148
  ```
148
149
 
149
150
  In order to avoid collapsed setting in ILB, make sure you understand how things work before running a code.
150
151
 
152
+ #### environments
153
+
154
+ |name|description|
155
+ |----|-----------|
156
+ |`TEST_REGION`|Region used in the test. (jp-east・jp-east-2・jp-west)|
157
+
151
158
  ## Contributing
152
159
 
153
160
  1. Fork it ( https://github.com/idcf/idcfcloud-cli/fork )
@@ -22,19 +22,20 @@ Gem::Specification.new do |spec|
22
22
  spec.bindir = 'exe'
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
+ spec.required_ruby_version = '>= 2.5.0'
25
26
 
26
- spec.add_development_dependency 'bundler', '~> 1.14'
27
- spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'bundler', '>= 1.14'
28
+ spec.add_development_dependency 'rake', '>= 10.0'
28
29
  spec.add_development_dependency 'test-unit', '~> 3.2', '>= 3.2.5'
29
30
  spec.add_development_dependency 'test-unit-notify', '~> 1.0', '>= 1.0.4'
30
31
 
31
- spec.add_dependency 'activemodel', '~> 4.2', '>= 4.2.3'
32
- spec.add_dependency 'activesupport', '~> 4.2', '>= 4.2.3'
32
+ spec.add_dependency 'activemodel', '>= 5.2.4.1'
33
+ spec.add_dependency 'activesupport', '>= 5.2.4.1'
33
34
  spec.add_dependency 'builder', '~> 3.1'
34
35
  spec.add_dependency 'CFPropertyList', '~> 2.3.5'
35
36
  spec.add_dependency 'facter', '~> 2.5.1'
36
37
  spec.add_dependency 'idcf-faraday_middleware', '~> 0.0.2'
37
- spec.add_dependency 'idcf-json_hyper_schema', '~> 0.2.0'
38
+ spec.add_dependency 'idcf-json_hyper_schema', '~> 0.3.1'
38
39
  spec.add_dependency 'inifile', '~> 3.0', '>= 3.0.0'
39
40
  spec.add_dependency 'jsonpath', '~> 0.8.10'
40
41
  spec.add_dependency 'kosi', '~> 1.0', '>= 1.0.0'
@@ -9,6 +9,9 @@ ilb:
9
9
  jp-east-2:
10
10
  schema: https://ilb.jp-east-2.idcfcloud.com/api/v1/schema
11
11
  host: ilb.jp-east-2.idcfcloud.com
12
+ jp-east-3:
13
+ schema: https://ilb.jp-east-3.idcfcloud.com/api/v1/schema
14
+ host: ilb.jp-east-3.idcfcloud.com
12
15
  jp-west:
13
16
  schema: https://ilb.jp-west.idcfcloud.com/api/v1/schema
14
17
  host: ilb.jp-west.idcfcloud.com
@@ -18,12 +21,6 @@ your:
18
21
  default:
19
22
  schema: https://your.idcfcloud.com/api/v1/schema
20
23
  host: your.idcfcloud.com
21
- cdn:
22
- v0:
23
- region:
24
- default:
25
- schema: https://cdn.idcfcloud.com/api/v1/schema
26
- host: cdn.idcfcloud.com
27
24
  dns:
28
25
  v1:
29
26
  region:
@@ -39,6 +36,9 @@ compute:
39
36
  jp-east-2:
40
37
  schema: https://compute.jp-east-2.idcfcloud.com/api/v1/schema
41
38
  host: compute.jp-east-2.idcfcloud.com
39
+ jp-east-3:
40
+ schema: https://compute.jp-east-3.idcfcloud.com/api/v1/schema
41
+ host: compute.jp-east-3.idcfcloud.com
42
42
  jp-west:
43
43
  schema: https://compute.jp-west.idcfcloud.com/api/v1/schema
44
44
  host: compute.jp-west.idcfcloud.com
@@ -5,10 +5,10 @@ module Idcf
5
5
  module Conf
6
6
  # const
7
7
  class Const
8
- DOCUMENT_URL = 'https://www.idcf.jp/api-docs/'.freeze
9
- DOCUMENT_ID_PREFIX = 'reference'.freeze
8
+ DOCUMENT_URL = 'https://www.idcf.jp/api-docs/apis/'.freeze
10
9
  DOCUMENT_ID_SEP = '_'.freeze
11
10
  DOCUMENT_SPACE_CONVERSION = '-'.freeze
11
+ DOCUMENT_ID_PREFIX_FORMAT = 'docs_%<service>s_reference%<version>s'.freeze
12
12
  VERSION_STR = "idcfcloud version #{Idcf::Cli::VERSION}".freeze
13
13
  now = Time.now.strftime('%Y%m%d%H%M%S%6N')
14
14
  dir_path = File.dirname(__FILE__)
@@ -23,7 +23,7 @@ module Idcf
23
23
  CODE_CONF_PATH = "#{BASE_PATH}/idcf/cli/conf/conf.yml".freeze
24
24
  USER_CONF_PATH = "#{USER_DIR_PATH}/config.ini".freeze
25
25
  USER_CONF_GLOBAL = "#{BASE_PATH}/../config/config.ini".freeze
26
- REGIONS = %w[jp-east jp-east-2 jp-west].freeze
26
+ REGIONS = %w[jp-east jp-east-2 jp-east-3 jp-west].freeze
27
27
  GLOBAL_CONF_ITEMS =
28
28
  {
29
29
  output_log: {
@@ -1,5 +1,4 @@
1
1
  require_relative './base'
2
- require 'idcf/faraday_middleware/cdn_signature'
3
2
 
4
3
  module Idcf
5
4
  module Cli
@@ -12,7 +11,7 @@ module Idcf
12
11
  type: :string,
13
12
  aliases: '-r',
14
13
  require: true,
15
- desc: 'region: jp-east/jp-east-2/jp-west'
14
+ desc: 'region: jp-east/jp-east-2/jp-east-3/jp-west'
16
15
 
17
16
  class << self
18
17
  def description
@@ -11,7 +11,7 @@ module Idcf
11
11
  type: :string,
12
12
  aliases: '-r',
13
13
  require: true,
14
- desc: 'region: jp-east/jp-east-2/jp-west'
14
+ desc: 'region: jp-east/jp-east-2/jp-east-3/jp-west'
15
15
 
16
16
  class << self
17
17
  def description
@@ -154,7 +154,7 @@ module Idcf
154
154
  def output_manual_writing(paths)
155
155
  puts 'please write in'
156
156
  Idcf::Cli::Conf::Const::COMP_PATHS.each do |k, v|
157
- puts v, paths[k]
157
+ puts v, "source #{paths[k]}"
158
158
  end
159
159
  end
160
160
 
@@ -7,8 +7,17 @@ module Idcf
7
7
  module Extend
8
8
  # update file
9
9
  module UpdateFile
10
- BROKEN_UPDATE_FILE = 'The update file is damaged. '\
11
- 'Please consult with the administrator.'.freeze
10
+ BROKEN_UPDATE_FILE = <<-TEXT.strip_heredoc.freeze
11
+ The update file is damaged.
12
+ Please consult with the administrator.
13
+ TEXT
14
+ BROKEN_JSON_SCHEMA = <<-TEXT.strip_heredoc.freeze
15
+ Failed to verify the update file.
16
+ Use the following commands to try updating the gem.
17
+
18
+ # gem update idcfcloud
19
+ # idcfcloud init
20
+ TEXT
12
21
 
13
22
  protected
14
23
 
@@ -51,13 +60,13 @@ module Idcf
51
60
  analyst.schema_links(j)
52
61
  rescue StandardError => e
53
62
  Idcf::Cli::Lib::Util::CliLogger.info('json-schema format error')
54
- log_msg = "#{BROKEN_UPDATE_FILE}:#{e.message}"
63
+ log_msg = "#{BROKEN_JSON_SCHEMA}:#{e.message}"
55
64
  Idcf::Cli::Lib::Util::CliLogger.error(log_msg)
56
- raise Idcf::Cli::Error::CliError, BROKEN_UPDATE_FILE
65
+ raise Idcf::Cli::Error::CliError, BROKEN_JSON_SCHEMA
57
66
  end
58
67
 
59
68
  def file_load(path)
60
- open(path).read
69
+ URI.open(path).read
61
70
  rescue StandardError => _e
62
71
  nil
63
72
  end
@@ -66,8 +75,10 @@ module Idcf
66
75
  {}.tap do |result|
67
76
  Idcf::Cli::Lib::Configure.get_code_conf(cls.service_name).each do |k, v|
68
77
  regions = {}
69
- v['region'].each do |region, info|
70
- regions[region] = create_schema_url(info['schema'])
78
+ v['region'].each_key do |region|
79
+ target = "#{cls.service_name}.#{k}.region.#{region}.schema"
80
+ url = Idcf::Cli::Lib::Configure.get_code_conf(target)
81
+ regions[region] = create_schema_url(url)
71
82
  end
72
83
 
73
84
  result[k] = regions
@@ -27,10 +27,13 @@ module Idcf
27
27
  end
28
28
 
29
29
  def make_document_id(link)
30
- results = [Idcf::Cli::Conf::Const::DOCUMENT_ID_PREFIX]
31
- titles = link.parent_titles
32
- results << titles.shift.downcase
33
- results << (@region.present? && @region != 'default' ? @region : @version)
30
+ titles = link.parent_titles
31
+ service_str = titles.shift.downcase
32
+ version_str = "#{Idcf::Cli::Conf::Const::DOCUMENT_SPACE_CONVERSION}#{@version}"
33
+ version_str = (@region.present? && @region != 'default' ? '' : version_str)
34
+ id_format = Idcf::Cli::Conf::Const::DOCUMENT_ID_PREFIX_FORMAT
35
+ prefix = format(id_format, service: service_str, version: version_str)
36
+ results = [prefix]
34
37
  results.concat(titles)
35
38
  result = results.join(Idcf::Cli::Conf::Const::DOCUMENT_ID_SEP)
36
39
  result.gsub(/ /, Idcf::Cli::Conf::Const::DOCUMENT_SPACE_CONVERSION)
@@ -1,5 +1,5 @@
1
1
  module Idcf
2
2
  module Cli
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.1.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idcfcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - IDC Frontier Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-29 00:00:00.000000000 Z
11
+ date: 2020-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.14'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
@@ -82,42 +82,30 @@ dependencies:
82
82
  name: activemodel
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '4.2'
88
85
  - - ">="
89
86
  - !ruby/object:Gem::Version
90
- version: 4.2.3
87
+ version: 5.2.4.1
91
88
  type: :runtime
92
89
  prerelease: false
93
90
  version_requirements: !ruby/object:Gem::Requirement
94
91
  requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '4.2'
98
92
  - - ">="
99
93
  - !ruby/object:Gem::Version
100
- version: 4.2.3
94
+ version: 5.2.4.1
101
95
  - !ruby/object:Gem::Dependency
102
96
  name: activesupport
103
97
  requirement: !ruby/object:Gem::Requirement
104
98
  requirements:
105
- - - "~>"
106
- - !ruby/object:Gem::Version
107
- version: '4.2'
108
99
  - - ">="
109
100
  - !ruby/object:Gem::Version
110
- version: 4.2.3
101
+ version: 5.2.4.1
111
102
  type: :runtime
112
103
  prerelease: false
113
104
  version_requirements: !ruby/object:Gem::Requirement
114
105
  requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '4.2'
118
106
  - - ">="
119
107
  - !ruby/object:Gem::Version
120
- version: 4.2.3
108
+ version: 5.2.4.1
121
109
  - !ruby/object:Gem::Dependency
122
110
  name: builder
123
111
  requirement: !ruby/object:Gem::Requirement
@@ -180,14 +168,14 @@ dependencies:
180
168
  requirements:
181
169
  - - "~>"
182
170
  - !ruby/object:Gem::Version
183
- version: 0.2.0
171
+ version: 0.3.1
184
172
  type: :runtime
185
173
  prerelease: false
186
174
  version_requirements: !ruby/object:Gem::Requirement
187
175
  requirements:
188
176
  - - "~>"
189
177
  - !ruby/object:Gem::Version
190
- version: 0.2.0
178
+ version: 0.3.1
191
179
  - !ruby/object:Gem::Dependency
192
180
  name: inifile
193
181
  requirement: !ruby/object:Gem::Requirement
@@ -280,6 +268,7 @@ files:
280
268
  - ".codeclimate.yml"
281
269
  - ".gitignore"
282
270
  - ".rubocop.yml"
271
+ - CHANGELOG.md
283
272
  - Gemfile
284
273
  - LICENSE.txt
285
274
  - README.md
@@ -292,7 +281,6 @@ files:
292
281
  - lib/idcf/cli/conf/conf.yml
293
282
  - lib/idcf/cli/conf/const.rb
294
283
  - lib/idcf/cli/controller/base.rb
295
- - lib/idcf/cli/controller/cdn.rb
296
284
  - lib/idcf/cli/controller/compute.rb
297
285
  - lib/idcf/cli/controller/dns.rb
298
286
  - lib/idcf/cli/controller/extend/command.rb
@@ -364,16 +352,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
364
352
  requirements:
365
353
  - - ">="
366
354
  - !ruby/object:Gem::Version
367
- version: '0'
355
+ version: 2.5.0
368
356
  required_rubygems_version: !ruby/object:Gem::Requirement
369
357
  requirements:
370
358
  - - ">="
371
359
  - !ruby/object:Gem::Version
372
360
  version: '0'
373
361
  requirements: []
374
- rubyforge_project:
375
- rubygems_version: 2.6.13
376
- signing_key:
362
+ rubygems_version: 3.1.4
363
+ signing_key:
377
364
  specification_version: 4
378
365
  summary: IDCF Cli tools
379
366
  test_files: []
@@ -1,40 +0,0 @@
1
- require_relative './base'
2
- require 'idcf/faraday_middleware/cdn_signature'
3
-
4
- module Idcf
5
- module Cli
6
- module Controller
7
- # CDN
8
- class Cdn < Base
9
- default_command :help
10
-
11
- class_option :version,
12
- desc: 'API Version'
13
-
14
- class << self
15
- def description
16
- 'Contents Cache Service'
17
- end
18
- end
19
-
20
- protected
21
-
22
- # signeture
23
- #
24
- # @return String
25
- def signature
26
- Idcf::FaradayMiddleware::CdnSignature
27
- end
28
-
29
- # raise api error msg
30
- #
31
- # @param res [Faraday::Responce]
32
- # @return [String]
33
- def raise_api_error_msg(res)
34
- "HTTP status code: #{res.status}, " \
35
- "Error message: #{res.body['messages']}, "
36
- end
37
- end
38
- end
39
- end
40
- end