nifty-cloud-sdk 1.11.beta1 → 1.11.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +103 -0
- data/README.rdoc +2 -2
- data/Rakefile +18 -18
- data/lib/NIFTY/Cloud/availability_zones.rb +1 -1
- data/lib/NIFTY/Cloud/certificates.rb +7 -3
- data/lib/NIFTY/Cloud/instances.rb +10 -6
- data/lib/NIFTY/Cloud/keypairs.rb +2 -1
- data/lib/NIFTY/Cloud/load_balancers.rb +22 -25
- data/lib/NIFTY/Cloud/security_groups.rb +1 -1
- data/lib/NIFTY/version.rb +1 -1
- data/test/test_Cloud.rb +6 -6
- data/test/test_Cloud_availability_zones.rb +1 -1
- data/test/test_Cloud_certificates.rb +1 -1
- data/test/test_Cloud_images.rb +1 -1
- data/test/test_Cloud_instances.rb +7 -6
- data/test/test_Cloud_keypairs.rb +2 -2
- data/test/test_Cloud_load_balancers.rb +16 -16
- data/test/test_Cloud_resources.rb +1 -1
- data/test/test_Cloud_responses.rb +2 -2
- data/test/test_Cloud_security_groups.rb +2 -2
- data/test/test_Cloud_uploads.rb +1 -1
- data/test/test_Cloud_volumes.rb +5 -5
- metadata +73 -127
data/CHANGELOG
CHANGED
@@ -2,6 +2,109 @@
|
|
2
2
|
ニフティクラウド SDK for Ruby
|
3
3
|
-----------------------------
|
4
4
|
|
5
|
+
2012-11-25 SDK for Ruby Version.1.11
|
6
|
+
-------------------------------------------------------------------------------
|
7
|
+
* 1.11リリース
|
8
|
+
* 細かいバグフィックス
|
9
|
+
|
10
|
+
* lib/NIFTY/Cloud/load_balancers.rb
|
11
|
+
* test/test_Cloud_load_balancers.rb
|
12
|
+
- バグがあったので修正する (see #10)
|
13
|
+
|
14
|
+
* lib/NIFTY/version.rb
|
15
|
+
- VERSIONを変更
|
16
|
+
|
17
|
+
2013-09-16 SDK for Ruby Version.1.11.beta2
|
18
|
+
-------------------------------------------------------------------------------
|
19
|
+
* 1.11.beta2リリース
|
20
|
+
* 優先度高めの項目に対応
|
21
|
+
|
22
|
+
* lib/NIFTY/Cloud/instances.rb
|
23
|
+
* test/test_Cloud_instances.rb
|
24
|
+
- 新しいサーバータイプに対応する (see #22)
|
25
|
+
|
26
|
+
* lib/NIFTY/Cloud/security_groups.rb
|
27
|
+
* test/test_Cloud_security_groups.rb
|
28
|
+
- セキュリティグループルールの ANY に対応する (see #22)
|
29
|
+
|
30
|
+
2012-11-24 SDK for Ruby Version.1.11.beta1
|
31
|
+
-------------------------------------------------------------------------------
|
32
|
+
* 1.11.beta1リリース
|
33
|
+
* API Version 1.11に対応
|
34
|
+
|
35
|
+
* lib/NIFTY/Cloud/images.rb
|
36
|
+
* test/test_Cloud_images.rb
|
37
|
+
- NIFTY::Cloud::Base#create_image でリージョン/ゾーンに対応する (see #17)
|
38
|
+
|
39
|
+
* lib/NIFTY/Cloud/security_groups.rb
|
40
|
+
* test/test_Cloud_security_groups.rb
|
41
|
+
- NIFTY::Cloud::Base#create_security_group でリージョン/ゾーンに対応する (see #17)
|
42
|
+
|
43
|
+
* lib/NIFTY/Cloud/availability_zones.rb
|
44
|
+
* test/test_Cloud_availability_zones.rb
|
45
|
+
- NIFTY::Cloud::Base#describe_availability_zones でリージョン/ゾーンに対応する (see #17)
|
46
|
+
- NIFTY::Cloud::Base#describe_regions を追加する (see #17)
|
47
|
+
|
48
|
+
* lib/NIFTY/Cloud/availability_zones.rb
|
49
|
+
* test/test_Cloud_images.rb
|
50
|
+
- NIFTY::Cloud::Base#describe_images でリージョン/ゾーンに対応する (see #17)
|
51
|
+
|
52
|
+
* test/test_Cloud_load_balancers.rb
|
53
|
+
- NIFTY::Cloud::Base#describe_load_balancers でリージョン/ゾーンに対応する (see #17)
|
54
|
+
- NIFTY::Cloud::Base#create_load_balancer でリージョン/ゾーンに対応する (see #17)
|
55
|
+
|
56
|
+
* lib/NIFTY/Cloud/instances.rb
|
57
|
+
* test/test_Cloud_instances.rb
|
58
|
+
- NIFTY::Cloud::Base#run_instances で :agreement オプションを指定できるようにする (see #18)
|
59
|
+
- NIFTY::Cloud::Base#describe_instances でリージョン/ゾーンに対応する (see #17)
|
60
|
+
- NIFTY::Cloud::Base#copy_instances でリージョン/ゾーンに対応する (see #17)
|
61
|
+
|
62
|
+
* README.rdoc
|
63
|
+
- ドキュメントにリージョン/ゾーンの指定方法を書く (see #17)
|
64
|
+
|
65
|
+
* lib/NIFTY/version.rb
|
66
|
+
- VERSIONを変更
|
67
|
+
|
68
|
+
|
69
|
+
2012-11-23 SDK for Ruby Version.1.9.beta1
|
70
|
+
-------------------------------------------------------------------------------
|
71
|
+
* 1.9.beta1リリース
|
72
|
+
* API Version 1.9に対応
|
73
|
+
|
74
|
+
* lib/NIFTY/Cloud/instances.rb
|
75
|
+
* test/test_Cloud_instances.rb
|
76
|
+
- modify_instance_attribute で accountingType を指定できるようにする (see #12)
|
77
|
+
- NIFTY::Cloud::Base#import_instanace を実装する (see #8)
|
78
|
+
|
79
|
+
* lib/NIFTY/Cloud/resources.rb
|
80
|
+
* test/test_Cloud_resources.rb
|
81
|
+
- 下記を追加する
|
82
|
+
NIFTY::Cloud::Base#describe_user_activities
|
83
|
+
NIFTY::Cloud::Base#describe_usage
|
84
|
+
NIFTY::Cloud::Base#describe_resources
|
85
|
+
NIFTY::Cloud::Base#describe_service_status
|
86
|
+
|
87
|
+
* lib/NIFTY/Cloud/uploads.rb
|
88
|
+
* test/test_Cloud_uploads.rb
|
89
|
+
- NIFTY::Cloud::Base#describe_uploads, #cancel_uploads を実装する (see #8)
|
90
|
+
|
91
|
+
* lib/NIFTY/Cloud/load_balancers.rb
|
92
|
+
* test/test_Cloud_load_balancers.rb
|
93
|
+
- 下記を追加する (see #10)
|
94
|
+
NIFTY::Cloud::Base#update_load_balancer_option
|
95
|
+
NIFTY::Cloud::Base#set_load_balancer_listener_ssl_certificate
|
96
|
+
NIFTY::Cloud::Base#unset_load_balancer_listener_ssl_certificate
|
97
|
+
NIFTY::Cloud::Base#clear_load_balancer_session を追加する
|
98
|
+
- NIFTY::Cloud::Base#describe_load_balancers を修正する (see #10)
|
99
|
+
|
100
|
+
* lib/NIFTY/Cloud/security_groups.rb
|
101
|
+
* test/test_Cloud_security_groups.rb
|
102
|
+
- NIFTY::Cloud::Base#update_security_group_option, #describe_security_group_option を追加する (see #11)
|
103
|
+
|
104
|
+
* lib/NIFTY/version.rb
|
105
|
+
- VERSIONを変更
|
106
|
+
|
107
|
+
|
5
108
|
2012-11-12 SDK for Ruby Version.1.8.beta1
|
6
109
|
-------------------------------------------------------------------------------
|
7
110
|
* 1.8.beta1リリース
|
data/README.rdoc
CHANGED
@@ -263,7 +263,7 @@ RunInstances の例)
|
|
263
263
|
|
264
264
|
==== レスポンス例
|
265
265
|
|
266
|
-
<RunInstancesResponse xmlns="https://cp.cloud.nifty.com/api/
|
266
|
+
<RunInstancesResponse xmlns="https://cp.cloud.nifty.com/api/">
|
267
267
|
<requestId>22e11cc4-0e5a-4815-9892-b1ed6aeed6c4</requestId>
|
268
268
|
<reservationId/>
|
269
269
|
<ownerId/>
|
@@ -287,7 +287,7 @@ RunInstances の例)
|
|
287
287
|
<instanceType>instanceType</instanceType>
|
288
288
|
<launchTime>2011-07-01T13:21:59.074+09:00</launchTime>
|
289
289
|
<placement>
|
290
|
-
<availabilityZone>
|
290
|
+
<availabilityZone>east-11</availabilityZone>
|
291
291
|
</placement>
|
292
292
|
<platform>centos</platform>
|
293
293
|
<monitoring>
|
data/Rakefile
CHANGED
@@ -24,24 +24,24 @@ end
|
|
24
24
|
|
25
25
|
task :default => :test
|
26
26
|
|
27
|
-
require 'rake/rdoctask'
|
28
|
-
Rake::RDocTask.new do |rdoc|
|
29
|
-
if File.exist?('VERSION.yml')
|
30
|
-
config = YAML.load(File.read('VERSION.yml'))
|
31
|
-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
32
|
-
else
|
33
|
-
version = ""
|
34
|
-
end
|
35
|
-
|
36
|
-
rdoc.rdoc_dir = 'rdoc'
|
37
|
-
rdoc.title = "NIFTY Cloud SDK documentation"
|
38
|
-
rdoc.main = "README.rdoc"
|
39
|
-
rdoc.rdoc_files.include('README*')
|
40
|
-
rdoc.rdoc_files.include('LICENSE*')
|
41
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
42
|
-
rdoc.options << '--line-numbers'
|
43
|
-
rdoc.options << '-c UTF-8'
|
44
|
-
end
|
27
|
+
#require 'rake/rdoctask'
|
28
|
+
#Rake::RDocTask.new do |rdoc|
|
29
|
+
# if File.exist?('VERSION.yml')
|
30
|
+
# config = YAML.load(File.read('VERSION.yml'))
|
31
|
+
# version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
32
|
+
# else
|
33
|
+
# version = ""
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# rdoc.rdoc_dir = 'rdoc'
|
37
|
+
# rdoc.title = "NIFTY Cloud SDK documentation"
|
38
|
+
# rdoc.main = "README.rdoc"
|
39
|
+
# rdoc.rdoc_files.include('README*')
|
40
|
+
# rdoc.rdoc_files.include('LICENSE*')
|
41
|
+
# rdoc.rdoc_files.include('lib/**/*.rb')
|
42
|
+
# rdoc.options << '--line-numbers'
|
43
|
+
# rdoc.options << '-c UTF-8'
|
44
|
+
#end
|
45
45
|
|
46
46
|
begin
|
47
47
|
require 'yard'
|
@@ -13,7 +13,7 @@ module NIFTY
|
|
13
13
|
# @return [Hash] レスポンスXML解析結果
|
14
14
|
#
|
15
15
|
# @example
|
16
|
-
# describe_availability_zones(:zone_name => '
|
16
|
+
# describe_availability_zones(:zone_name => 'east-1')
|
17
17
|
#
|
18
18
|
def describe_availability_zones( options={} )
|
19
19
|
params = {'Action' => 'DescribeAvailabilityZones'}
|
@@ -30,6 +30,7 @@ module NIFTY
|
|
30
30
|
# @option options [String] :location_name 事業所住所の市区町村名(必須)
|
31
31
|
# @return [Hash] レスポンスXML解析結果
|
32
32
|
#
|
33
|
+
# TODO: コメント直す
|
33
34
|
# @example
|
34
35
|
# create_ssl_certificate(:fqdn => 'aaa.aaa.aaa', :count => 2, :validity_term => 24, :key_length => 1024, :organization_name => 'NIFTY',
|
35
36
|
# :organization_unit_name => 'Center Department', :state_name => 'Tokyo', :location_name => 'Shinagawa-ku')
|
@@ -46,14 +47,14 @@ module NIFTY
|
|
46
47
|
raise ArgumentError, "No :state_name provided." if blank?(options[:state_name])
|
47
48
|
raise ArgumentError, "No :location_name provided." if blank?(options[:location_name])
|
48
49
|
end
|
49
|
-
raise ArgumentError, "Invalid :count provided." unless blank?(options[:count]) || ('
|
50
|
+
raise ArgumentError, "Invalid :count provided." unless blank?(options[:count]) || ('0'..'30').to_a.include?(options[:count].to_s)
|
50
51
|
raise ArgumentError, "Invalid :cert_authority provided." unless blank?(options[:cert_authority]) || CERT_AUTHORITY.include?(options[:cert_authority].to_s)
|
51
52
|
raise ArgumentError, "Invalid :validity_term provided." unless blank?(options[:validity_term]) ||
|
52
53
|
VALIDITY_TERM.include?(options[:validity_term].to_s)
|
53
54
|
raise ArgumentError, "Invalid :key_length provided." unless blank?(options[:key_length]) || KEY_LENGTH.include?(options[:key_length].to_s)
|
54
55
|
|
55
56
|
params = {'Action' => 'CreateSslCertificate'}
|
56
|
-
params.merge!(opts_to_prms(options, [:fqdn_id, :fqdn, :cert_authority, :count, :validity_term, :key_length]))
|
57
|
+
params.merge!(opts_to_prms(options, [:fqdn_id, :fqdn, :cert_authority, :count, :validity_term, :key_length, :approver_email_address]))
|
57
58
|
params.merge!(opts_to_prms(options, [:organization_name, :organization_unit_name, :country_name,
|
58
59
|
:state_name, :location_name, :email_address], 'CertInfo'))
|
59
60
|
|
@@ -249,13 +250,16 @@ module NIFTY
|
|
249
250
|
raise ArgumentError, "No :name2 provided." if blank?(options[:name2])
|
250
251
|
raise ArgumentError, "No :kana_name1 provided." if blank?(options[:kana_name1])
|
251
252
|
raise ArgumentError, "No :kana_name2 provided." if blank?(options[:kana_name2])
|
253
|
+
raise ArgumentError, "No :alphabet_name1 provided." if blank?(options[:alphabet_name1])
|
254
|
+
raise ArgumentError, "No :alphabet_name2 provided." if blank?(options[:alphabet_name2])
|
255
|
+
raise ArgumentError, "No :phone_number provided." if blank?(options[:phone_number])
|
252
256
|
raise ArgumentError, "No :post_name provided." if blank?(options[:post_name])
|
253
257
|
raise ArgumentError, "No :division_name provided." if blank?(options[:division_name])
|
254
258
|
|
255
259
|
params = {'Action' => 'RegisterCorporateInfoForCertificate'}
|
256
260
|
params.merge!(opts_to_prms(options,
|
257
261
|
[:agreement, :tdb_code, :corp_name, :corp_grade, :president_name1, :president_name2,
|
258
|
-
:zip1, :zip2, :pref, :city, :name1, :name2, :kana_name1, :kana_name2, :post_name, :division_name]))
|
262
|
+
:zip1, :zip2, :pref, :city, :name1, :name2, :kana_name1, :kana_name2, :alphabet_name1, :alphabet_name2, :phone_number, :email_address, :post_name, :division_name]))
|
259
263
|
|
260
264
|
return response_generator(params)
|
261
265
|
end
|
@@ -2,7 +2,8 @@ module NIFTY
|
|
2
2
|
module Cloud
|
3
3
|
class Base < NIFTY::Base
|
4
4
|
INSTANCE_TYPE = ['mini', 'small', 'small2', 'small4', 'small8', 'medium', 'medium4', 'medium8', 'medium16',
|
5
|
-
'large', 'large8', 'large16', 'large24', 'large32', 'extra-large16', 'extra-large24', 'extra-large32'
|
5
|
+
'large', 'large8', 'large16', 'large24', 'large32', 'extra-large16', 'extra-large24', 'extra-large32',
|
6
|
+
'double-large32', 'double-large48', 'double-large64']
|
6
7
|
ACCOUNTING_TYPE = ['1', '2']
|
7
8
|
BOOLEAN = ['true', 'false']
|
8
9
|
IP_TYPE = ['static', 'dynamic', 'none']
|
@@ -178,7 +179,8 @@ module NIFTY
|
|
178
179
|
raise ArgumentError, "Invalid :image_id provided." unless options[:image_id].to_s.to_i > 0
|
179
180
|
raise ArgumentError, "Invalid :key_name provided." unless blank?(options[:key_name]) || ALPHANUMERIC =~ options[:key_name].to_s
|
180
181
|
#raise ArgumentError, "No :security_group provided." if blank?(options[:security_group])
|
181
|
-
raise ArgumentError, "Invalid :security_group provided." unless blank?(options[:security_group]) ||
|
182
|
+
raise ArgumentError, "Invalid :security_group provided." unless blank?(options[:security_group]) ||
|
183
|
+
[options[:security_group]].flatten.all? {|x| GROUP_NAME =~ x.to_s }
|
182
184
|
raise ArgumentError, "No :password provided." if WINDOWS_IMAGE_ID.include?(options[:image_id].to_s) && blank?(options[:password])
|
183
185
|
raise ArgumentError, "Invalid :password provided." unless blank?(options[:password]) || ALPHANUMERIC =~ options[:password].to_s
|
184
186
|
raise ArgumentError, "Invalid :instance_type provided." unless blank?(options[:instance_type]) || INSTANCE_TYPE.include?(options[:instance_type].to_s)
|
@@ -353,7 +355,8 @@ module NIFTY
|
|
353
355
|
end
|
354
356
|
end
|
355
357
|
#raise ArgumentError, "No :security_group provided." if blank?(options[:security_group])
|
356
|
-
raise ArgumentError, "Invalid :security_group provided." unless blank?(options[:security_group]) ||
|
358
|
+
raise ArgumentError, "Invalid :security_group provided." unless blank?(options[:security_group]) ||
|
359
|
+
[options[:security_group]].flatten.all? {|x| GROUP_NAME =~ x.to_s }
|
357
360
|
raise ArgumentError, "Invalid :copy_count provided." unless blank?(options[:copy_count]) || options[:copy_count].to_s.to_i >= 1
|
358
361
|
|
359
362
|
params = {
|
@@ -397,7 +400,7 @@ module NIFTY
|
|
397
400
|
end
|
398
401
|
|
399
402
|
|
400
|
-
# API「
|
403
|
+
# API「ImportInstance」を実行し、指定したOVFファイルの情報に基づいて、サーバーインポートを予約します。
|
401
404
|
# 1回のリクエストで1台のサーバーが予約可能です。
|
402
405
|
#
|
403
406
|
# イメージ(VMDKファイル)は、別途アップロード領域へアップロードしてください(このAPIのレスポンスに含まれるタスクIDを指定します)。
|
@@ -427,12 +430,13 @@ module NIFTY
|
|
427
430
|
# @return [Hash] レスポンスXML解析結果
|
428
431
|
#
|
429
432
|
# @example
|
430
|
-
#
|
433
|
+
# import_instance(:ovf => "<?xml ersion='1.0' encoding='UTF-8'><ovf ovf:Enve…</ovf:Envelope>")
|
431
434
|
#
|
432
435
|
def import_instance( options={} )
|
433
436
|
raise ArgumentError, "No :ovf provided." if blank?(options[:ovf])
|
434
437
|
#raise ArgumentError, "No :security_group provided." if blank?(options[:security_group])
|
435
|
-
raise ArgumentError, "Invalid :security_group provided." unless blank?(options[:security_group]) ||
|
438
|
+
raise ArgumentError, "Invalid :security_group provided." unless blank?(options[:security_group]) ||
|
439
|
+
[options[:security_group]].flatten.all? {|x| GROUP_NAME =~ x.to_s }
|
436
440
|
raise ArgumentError, "Invalid :instance_type provided." unless blank?(options[:instance_type]) || INSTANCE_TYPE.include?(options[:instance_type].to_s)
|
437
441
|
raise ArgumentError, "Invalid :disable_api_termination provided." unless blank?(options[:disable_api_termination]) ||
|
438
442
|
BOOLEAN.include?(options[:disable_api_termination].to_s)
|
data/lib/NIFTY/Cloud/keypairs.rb
CHANGED
@@ -63,7 +63,8 @@ module NIFTY
|
|
63
63
|
# describe_keypairs(:key_name => ['key1', 'key2'])
|
64
64
|
#
|
65
65
|
def describe_key_pairs( options = {} )
|
66
|
-
raise ArgumentError, "Invalid :key_name provided." unless blank?(options[:key_name]) ||
|
66
|
+
raise ArgumentError, "Invalid :key_name provided." unless blank?(options[:key_name]) ||
|
67
|
+
[options[:key_name]].flatten.all? {|x| ALPHANUMERIC =~ x.to_s }
|
67
68
|
|
68
69
|
params = {'Action' => 'DescribeKeyPairs'}
|
69
70
|
params.merge!(pathlist('KeyName', options[:key_name]))
|
@@ -9,7 +9,7 @@ module NIFTY
|
|
9
9
|
LOAD_BALANCER_NAME = /^[a-zA-Z0-9]{1,15}$/
|
10
10
|
LOAD_BALANCERS_IGNORED_PARAMS = Regexp.union(/AvailabilityZones .member.*/,
|
11
11
|
/HealthCheck .Timeout/)
|
12
|
-
|
12
|
+
LOAD_BALANCER_SESSION_STICKINESS_POLICY_EXPIRATION_PERIOD = ['3', '5', '10', '15', '30']
|
13
13
|
LOAD_BALANCER_SORRY_PAGE_STATUS_CODE = ['200', '503']
|
14
14
|
|
15
15
|
# API「ConfigureHealthCheck」を実行し、指定したロードバランサーのヘルスチェックの設定を変更します。
|
@@ -448,19 +448,16 @@ module NIFTY
|
|
448
448
|
#
|
449
449
|
# Sorryページオプションを有効にするためには指定するロードバランサーの待ち受けポートが80番である必要があります。
|
450
450
|
#
|
451
|
-
# @option options [String] :load_balancer_name
|
452
|
-
# @option options [Integer] :load_balancer_port
|
453
|
-
# @option options [Integer] :instance_port
|
454
|
-
# @option options [
|
455
|
-
#
|
456
|
-
# <Hash> options [Integer] :expiration_period - セッション保持時間(セッション固定オプションが有効の場合必須)
|
451
|
+
# @option options [String] :load_balancer_name 変更対象のロードバランサー名(必須)
|
452
|
+
# @option options [Integer] :load_balancer_port 変更対象の待ち受けポート(必須)
|
453
|
+
# @option options [Integer] :instance_port 変更対象の宛先ポート(必須)
|
454
|
+
# @option options [Boolean] :session_stickiness_policy_enable セッション固定オプション利用設定
|
455
|
+
# @option options [Integer] :session_stickiness_policy_expiration_period セッション保持時間(セッション固定オプションが有効の場合必須)
|
457
456
|
# 許可値: 3 | 5 | 10 | 15 | 30
|
458
|
-
# @option options [
|
459
|
-
#
|
460
|
-
# <Hash> options [Integer] :status_code - レスポンスコード(Sorryページオプションが有効の場合必須)
|
457
|
+
# @option options [Boolean] :sorry_page_enable Sorryページオプション利用設定
|
458
|
+
# @option options [Integer] :sorry_page_status_code レスポンスコード(Sorryページオプションが有効の場合必須)
|
461
459
|
# 許可値: 200 | 503
|
462
|
-
# @option options [
|
463
|
-
# <Hash> options [Boolean] :enable - 携帯キャリアフィルターオプション利用設定
|
460
|
+
# @option options [Boolean] :enable 携帯キャリアフィルターオプション利用設定
|
464
461
|
# @return [Hash] レスポンスXML解析結果
|
465
462
|
#
|
466
463
|
# @example
|
@@ -468,8 +465,8 @@ module NIFTY
|
|
468
465
|
# :load_balancer_name => 'lb0001',
|
469
466
|
# :load_balancer_port => 80,
|
470
467
|
# :instance_port => 80,
|
471
|
-
# :
|
472
|
-
# :
|
468
|
+
# :session_stickiness_policy_enable => true,
|
469
|
+
# :session_stickiness_policy_expiration_period => 10,
|
473
470
|
# :sorry_page_enable => true,
|
474
471
|
# :sorry_page_status_code => 200,
|
475
472
|
# :mobile_filter_enable => true
|
@@ -484,12 +481,12 @@ module NIFTY
|
|
484
481
|
raise ArgumentError, "No :instance_port provided." if blank?(options[:instance_port]) && !blank?(options[:load_balancer_port])
|
485
482
|
raise ArgumentError, "Invalid :instance_port provided." unless blank?(options[:instance_port]) ||
|
486
483
|
valid_port?(options[:instance_port])
|
487
|
-
raise ArgumentError, "No :
|
488
|
-
!blank?(options[:
|
489
|
-
raise ArgumentError, "Invalid :
|
490
|
-
BOOLEAN.include?(options[:
|
491
|
-
raise ArgumentError, "Invalid :
|
492
|
-
|
484
|
+
raise ArgumentError, "No :session_stickiness_policy_expiration_period provided." if blank?(options[:session_stickiness_policy_expiration_period]) &&
|
485
|
+
!blank?(options[:session_stickiness_policy_enable]) && 'true' == options[:session_stickiness_policy_enable].to_s
|
486
|
+
raise ArgumentError, "Invalid :session_stickiness_policy_enable provided." unless blank?(options[:session_stickiness_policy_enable]) ||
|
487
|
+
BOOLEAN.include?(options[:session_stickiness_policy_enable].to_s)
|
488
|
+
raise ArgumentError, "Invalid :session_stickiness_policy_expiration_period provided." unless blank?(options[:session_stickiness_policy_expiration_period]) ||
|
489
|
+
LOAD_BALANCER_SESSION_STICKINESS_POLICY_EXPIRATION_PERIOD.include?(options[:session_stickiness_policy_expiration_period].to_s)
|
493
490
|
raise ArgumentError, "No :sorry_page_status_code provided." if blank?(options[:sorry_page_status_code]) &&
|
494
491
|
!blank?(options[:sorry_page_enable]) && 'true' == options[:sorry_page_enable].to_s
|
495
492
|
raise ArgumentError, "Invalid :sorry_page_enable provided." unless blank?(options[:sorry_page_enable]) ||
|
@@ -501,11 +498,11 @@ module NIFTY
|
|
501
498
|
|
502
499
|
params = {
|
503
500
|
'Action' => 'UpdateLoadBalancerOption',
|
504
|
-
'
|
505
|
-
'
|
506
|
-
'
|
507
|
-
'
|
508
|
-
'
|
501
|
+
'SessionStickinessPolicyUpdate.Enable' => options[:session_stickiness_policy_enable].to_s,
|
502
|
+
'SessionStickinessPolicyUpdate.ExpirationPeriod' => options[:session_stickiness_policy_expiration_period].to_s,
|
503
|
+
'SorryPageUpdate.Enable' => options[:sorry_page_enable].to_s,
|
504
|
+
'SorryPageUpdate.StatusCode' => options[:sorry_page_status_code].to_s,
|
505
|
+
'MobileFilterUpdate.Enable' => options[:mobile_filter_enable].to_s
|
509
506
|
}
|
510
507
|
params.merge!(opts_to_prms(options, [:load_balancer_name, :load_balancer_port, :instance_port]))
|
511
508
|
|
@@ -2,7 +2,7 @@ module NIFTY
|
|
2
2
|
module Cloud
|
3
3
|
class Base < NIFTY::Base
|
4
4
|
FILTER_NAME = ['description', 'group-name']
|
5
|
-
IP_PROTOCOL = ['TCP', 'UDP', 'ICMP', 'SSH', 'HTTP', 'HTTPS', 'SMTP', 'POP3', 'IMAP']
|
5
|
+
IP_PROTOCOL = ['TCP', 'UDP', 'ICMP', 'SSH', 'HTTP', 'HTTPS', 'SMTP', 'POP3', 'IMAP', 'ANY']
|
6
6
|
IN_OUT = ['IN', 'OUT']
|
7
7
|
DATE_FORMAT = %r!^(\d{8}|\d{4}-\d{2}-\d{2}|\d{4}/\d{2}/\d{2})$!
|
8
8
|
GROUP_NAME = Regexp.union(/^[a-zA-Z0-9]+$/, 'default(Linux)', 'default(Windows)')
|
data/lib/NIFTY/version.rb
CHANGED
data/test/test_Cloud.rb
CHANGED
@@ -38,7 +38,7 @@ context "Base" do
|
|
38
38
|
:secret_access_key => "secretkey",
|
39
39
|
:use_ssl => true,
|
40
40
|
:server => "cp.cloud.nifty.com",
|
41
|
-
:path => "/api/
|
41
|
+
:path => "/api/",
|
42
42
|
:proxy_server => nil,
|
43
43
|
:port => 443,
|
44
44
|
:connection_timeout => 30,
|
@@ -84,11 +84,11 @@ context "Base" do
|
|
84
84
|
|
85
85
|
specify "オプション正常" do
|
86
86
|
@options.merge!(:access_key_id => 'access', :secret_access_key => 'secret', :use_ssl => true,
|
87
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
87
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/')
|
88
88
|
@api = NIFTY::Cloud::Base.new(@options)
|
89
89
|
@api.use_ssl.should.equal true
|
90
90
|
@api.server.should.equal 'cp.cloud.nifty.com'
|
91
|
-
@api.path.should.equal '/api/
|
91
|
+
@api.path.should.equal '/api/'
|
92
92
|
|
93
93
|
# max retry
|
94
94
|
@options[:max_retry] = 3
|
@@ -159,21 +159,21 @@ context "Base" do
|
|
159
159
|
|
160
160
|
specify "pathhashlist引数不正" do
|
161
161
|
@options.merge!(:access_key_id => 'access', :secret_access_key => 'secret', :use_ssl => true,
|
162
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
162
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :signature_version => 2, :signature_method => 'HmacSHA256')
|
163
163
|
@api = NIFTY::Cloud::Base.new(@options)
|
164
164
|
lambda { @api.run_instances(:image_id => '1', :key_name => 'key', :password => 'pass', :instance_id => 'serv', :block_device_mapping => 'mapping') }.should.raise(NIFTY::ArgumentError)
|
165
165
|
end
|
166
166
|
|
167
167
|
specify "pathkvlist引数不正" do
|
168
168
|
@options.merge!(:access_key_id => 'access', :secret_access_key => 'secret', :use_ssl => true,
|
169
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
169
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :signature_version => 2, :signature_method => 'HmacSHA256')
|
170
170
|
@api = NIFTY::Cloud::Base.new(@options)
|
171
171
|
lambda { @api.describe_security_groups(:group_name => 'gr1', :filter => 'filter') }.should.raise(NIFTY::ArgumentError)
|
172
172
|
end
|
173
173
|
|
174
174
|
specify "レスポンスエラー" do
|
175
175
|
@options.merge!(:access_key_id => 'access', :secret_access_key => 'secret', :use_ssl => true,
|
176
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
176
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :signature_version => 2, :signature_method => 'HmacSHA256')
|
177
177
|
@api = NIFTY::Cloud::Base.new(@options)
|
178
178
|
@api.stubs(:exec_request).returns stub(:body => @error_response_body, :is_a? => false)
|
179
179
|
lambda { @api.describe_instances(:instance_id => 'noserver') }.should.raise(NIFTY::ResponseError)
|
@@ -15,7 +15,7 @@ context "availability_zones" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
|
21
21
|
@describe_availability_zones_response_body = <<-RESPONSE
|
@@ -14,7 +14,7 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
14
14
|
context "certificates" do
|
15
15
|
before do
|
16
16
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" ,
|
17
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
17
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
18
18
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
19
19
|
|
20
20
|
@basic_reg_corp_info_params = {
|
data/test/test_Cloud_images.rb
CHANGED
@@ -15,7 +15,7 @@ context "images" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
@valid_owner = %w(niftycloud self)
|
21
21
|
|
@@ -15,10 +15,11 @@ context "instances" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
@valid_instance_type = %w(mini small small2 small4 small8 medium medium4 medium8 medium16
|
21
|
-
large large8 large16 large24 large32 extra-large16 extra-large24 extra-large32
|
21
|
+
large large8 large16 large24 large32 extra-large16 extra-large24 extra-large32
|
22
|
+
double-large32 double-large48 double-large64)
|
22
23
|
@valid_ip_type = %w(static dynamic none)
|
23
24
|
@accounting_type = [1, 2, '1', '2']
|
24
25
|
@windows_image_id = [12, 16, '12', '16']
|
@@ -44,7 +45,7 @@ context "instances" do
|
|
44
45
|
<instanceType>medium</instanceType>
|
45
46
|
<launchTime>2010-05-17T11:22:33.456Z </launchTime>
|
46
47
|
<placement>
|
47
|
-
<availabilityZone>
|
48
|
+
<availabilityZone>east-11</availabilityZone>
|
48
49
|
</placement>
|
49
50
|
<privateIpAddress>10.0.5.113</privateIpAddress>
|
50
51
|
<ipAddress />
|
@@ -436,7 +437,7 @@ context "instances" do
|
|
436
437
|
response.instancesSet.item[0].admin.should.equal nil
|
437
438
|
response.instancesSet.item[0].instanceType.should.equal 'medium'
|
438
439
|
response.instancesSet.item[0].launchTime.should.equal '2010-05-17T11:22:33.456Z '
|
439
|
-
response.instancesSet.item[0].placement.availabilityZone.should.equal '
|
440
|
+
response.instancesSet.item[0].placement.availabilityZone.should.equal 'east-11'
|
440
441
|
response.instancesSet.item[0].privateIpAddress.should.equal '10.0.5.113'
|
441
442
|
response.instancesSet.item[0].ipAddress.should.equal nil
|
442
443
|
response.instancesSet.item[0].privateIpAddressV6.should.equal 'xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'
|
@@ -552,7 +553,7 @@ context "instances" do
|
|
552
553
|
|
553
554
|
specify "run_instances - :availability_zone正常" do
|
554
555
|
@api.stubs(:exec_request).returns stub(:body => @run_instances_response_body, :is_a? => true)
|
555
|
-
lambda { @api.run_instances(@basic_run_instances_options.merge(:availability_zone => '
|
556
|
+
lambda { @api.run_instances(@basic_run_instances_options.merge(:availability_zone => 'east-11')) }.should.not.raise(NIFTY::ArgumentError)
|
556
557
|
end
|
557
558
|
|
558
559
|
specify "run_instances - :group_name正常" do
|
@@ -1059,7 +1060,7 @@ context "instances" do
|
|
1059
1060
|
|
1060
1061
|
specify "import_instance - :availability_zone正常" do
|
1061
1062
|
@api.stubs(:exec_request).returns stub(:body => @import_instance_response_body, :is_a? => true)
|
1062
|
-
lambda { @api.import_instance(@basic_import_instance_options.merge(:availability_zone => '
|
1063
|
+
lambda { @api.import_instance(@basic_import_instance_options.merge(:availability_zone => 'east-11')) }.should.not.raise(NIFTY::ArgumentError)
|
1063
1064
|
end
|
1064
1065
|
|
1065
1066
|
specify "import_instance - :disable_api_termination正常" do
|
data/test/test_Cloud_keypairs.rb
CHANGED
@@ -15,11 +15,11 @@ context "key_pairs" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
|
21
21
|
@create_key_pair_response_body = <<-RESPONSE
|
22
|
-
<Createkey_pairResponse xmlns="http://cp.cloud.nifty.com/api/
|
22
|
+
<Createkey_pairResponse xmlns="http://cp.cloud.nifty.com/api/">
|
23
23
|
<keyName>gsg-key_pair</keyName>
|
24
24
|
<keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
|
25
25
|
<keyMaterial>-----BEGIN RSA PRIVATE KEY-----
|
@@ -14,7 +14,7 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
14
14
|
context "load_balancers" do
|
15
15
|
before do
|
16
16
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
17
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
17
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
18
18
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
19
19
|
|
20
20
|
@valid_protocol = %w(HTTP HTTPS FTP)
|
@@ -23,7 +23,7 @@ context "load_balancers" do
|
|
23
23
|
@valid_network_volume = [10, 20, 30, 40, 100, 200, '10', '20', '30', '40', '100', '200']
|
24
24
|
@valid_ip_version = %w(v4 v6)
|
25
25
|
@accounting_type = %w(1 2)
|
26
|
-
@
|
26
|
+
@session_stickiness_policy_expiration_period = %w(3 5 10 15 30)
|
27
27
|
@sorry_page_status_code = %w(200 503)
|
28
28
|
|
29
29
|
@basic_create_lb_params = {
|
@@ -1299,14 +1299,14 @@ context "load_balancers" do
|
|
1299
1299
|
"LoadBalancerName" => "a",
|
1300
1300
|
"LoadBalancerPort" => "80",
|
1301
1301
|
"InstancePort" => "80",
|
1302
|
-
"
|
1303
|
-
"
|
1304
|
-
"
|
1305
|
-
"
|
1306
|
-
"
|
1302
|
+
"SessionStickinessPolicyUpdate.Enable" => "true",
|
1303
|
+
"SessionStickinessPolicyUpdate.ExpirationPeriod" => "3",
|
1304
|
+
"SorryPageUpdate.Enable" => "true",
|
1305
|
+
"SorryPageUpdate.StatusCode" => "200",
|
1306
|
+
"MobileFilterUpdate.Enable" => "true"
|
1307
1307
|
).returns stub(:body => @update_load_balancer_option_response_body, :is_a? => true)
|
1308
1308
|
@api.stubs(:exec_request).returns stub(:body => @update_load_balancer_option_response_body, :is_a? => true)
|
1309
|
-
response = @api.update_load_balancer_option(:load_balancer_name => "a", :load_balancer_port => 80, :instance_port => 80, :
|
1309
|
+
response = @api.update_load_balancer_option(:load_balancer_name => "a", :load_balancer_port => 80, :instance_port => 80, :session_stickiness_policy_enable => true, :session_stickiness_policy_expiration_period => 3, :sorry_page_enable => true, :sorry_page_status_code => 200, :mobile_filter_enable => true)
|
1310
1310
|
end
|
1311
1311
|
|
1312
1312
|
specify "update_load_balancer_option - :load_balancer_port正常" do
|
@@ -1323,12 +1323,12 @@ context "load_balancers" do
|
|
1323
1323
|
end
|
1324
1324
|
end
|
1325
1325
|
|
1326
|
-
specify "update_load_balancer_option - :
|
1326
|
+
specify "update_load_balancer_option - :session_stickiness_policy_enable,:session_stickiness_policy_expiration_period正常" do
|
1327
1327
|
@api.stubs(:exec_request).returns stub(:body => @update_load_balancer_option_response_body, :is_a? => true)
|
1328
|
-
@
|
1329
|
-
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:
|
1328
|
+
@session_stickiness_policy_expiration_period.each do |period|
|
1329
|
+
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:session_stickiness_policy_enable => true, :session_stickiness_policy_expiration_period => period)) }.should.not.raise(NIFTY::ArgumentError)
|
1330
1330
|
end
|
1331
|
-
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:
|
1331
|
+
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:session_stickiness_policy_enable => false)) }.should.not.raise(NIFTY::ArgumentError)
|
1332
1332
|
end
|
1333
1333
|
|
1334
1334
|
specify "update_load_balancer_option - :sorry_page_enable,:sorry_page_status_code正常" do
|
@@ -1367,14 +1367,14 @@ context "load_balancers" do
|
|
1367
1367
|
lambda { @api.update_load_balancer_option(:load_balancer_name => 'lb1', :load_balancer_port => 80, :instance_port => 'foo') }.should.raise(NIFTY::ArgumentError)
|
1368
1368
|
end
|
1369
1369
|
|
1370
|
-
specify "update_load_balancer_option - :
|
1370
|
+
specify "update_load_balancer_option - :session_stickiness_policy_enable,:session_stickiness_policy_expiration_period不正" do
|
1371
1371
|
@api.stubs(:exec_request).returns stub(:body => @update_load_balancer_option_response_body, :is_a? => true)
|
1372
|
-
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:
|
1372
|
+
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:session_stickiness_policy_enable => true)) }.should.raise(NIFTY::ArgumentError)
|
1373
1373
|
[1000, 'hoge'].each do |enable|
|
1374
|
-
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:
|
1374
|
+
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:session_stickiness_policy_enable => enable, :session_stickiness_policy_expiration_period => '3')) }.should.raise(NIFTY::ArgumentError)
|
1375
1375
|
end
|
1376
1376
|
[1000, 'hoge'].each do |period|
|
1377
|
-
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:
|
1377
|
+
lambda { @api.update_load_balancer_option(@basic_set_filter_params.merge(:session_stickiness_policy_expiration_period => period)) }.should.raise(NIFTY::ArgumentError)
|
1378
1378
|
end
|
1379
1379
|
end
|
1380
1380
|
|
@@ -15,7 +15,7 @@ context "instances" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
|
21
21
|
@describe_resources_response_body = <<-RESPONSE
|
@@ -16,7 +16,7 @@ context "Response classes" do
|
|
16
16
|
|
17
17
|
before do
|
18
18
|
@http_xml = <<-RESPONSE
|
19
|
-
<RebootInstancesResponse xmlns="http://cp.cloud.nifty.com/api/
|
19
|
+
<RebootInstancesResponse xmlns="http://cp.cloud.nifty.com/api/">
|
20
20
|
<return>true</return>
|
21
21
|
</RebootInstancesResponse>
|
22
22
|
RESPONSE
|
@@ -27,7 +27,7 @@ context "Response classes" do
|
|
27
27
|
|
28
28
|
specify "should show the response as a formatted string when calling #inspect" do
|
29
29
|
# sorting the response hash first since ruby 1.8.6 and ruby 1.9.1 sort the hash differently before the inspect
|
30
|
-
@response.sort.inspect.should.equal %{[[\"return\", \"true\"], [\"xmlns\", \"http://cp.cloud.nifty.com/api
|
30
|
+
@response.sort.inspect.should.equal %{[[\"return\", \"true\"], [\"xmlns\", \"http://cp.cloud.nifty.com/api/\"]]}
|
31
31
|
end
|
32
32
|
|
33
33
|
|
@@ -15,10 +15,10 @@ context "security_groups" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
|
21
|
-
@valid_ip_protocol = %w(TCP UDP ICMP SSH HTTP HTTPS SMTP POP3 IMAP)
|
21
|
+
@valid_ip_protocol = %w(TCP UDP ICMP SSH HTTP HTTPS SMTP POP3 IMAP ANY)
|
22
22
|
@valid_in_out = %w(IN In in Out Out out)
|
23
23
|
@valid_course_update = [1, 2, '1', '2']
|
24
24
|
@valid_boolean = [true, false, 'true', 'false']
|
data/test/test_Cloud_uploads.rb
CHANGED
@@ -15,7 +15,7 @@ context "instances" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
|
21
21
|
@describe_uploads_response_body = <<-RESPONSE
|
data/test/test_Cloud_volumes.rb
CHANGED
@@ -15,7 +15,7 @@ context "volumes" do
|
|
15
15
|
|
16
16
|
before do
|
17
17
|
@api = NIFTY::Cloud::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret",
|
18
|
-
:server => 'cp.cloud.nifty.com', :path => '/api/
|
18
|
+
:server => 'cp.cloud.nifty.com', :path => '/api/', :user_agent => 'NIFTY Cloud API Ruby SDK',
|
19
19
|
:signature_version => '2', :signature_method => 'HmacSHA256')
|
20
20
|
@valid_create_size = [
|
21
21
|
'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '15', '20',
|
@@ -36,7 +36,7 @@ context "volumes" do
|
|
36
36
|
<size>800</size>
|
37
37
|
<diskType>Disk40</diskType>
|
38
38
|
<snapshotId/>
|
39
|
-
<availabilityZone>
|
39
|
+
<availabilityZone>east-11</availabilityZone>
|
40
40
|
<accountingType>1</accountingType>
|
41
41
|
<nextMonthAccountingType>1</nextMonthAccountingType>
|
42
42
|
<status>in-use</status>
|
@@ -60,7 +60,7 @@ context "volumes" do
|
|
60
60
|
<volumeId>disk05</volumeId>
|
61
61
|
<size>800</size>
|
62
62
|
<snapshotId/>
|
63
|
-
<availabilityZone>
|
63
|
+
<availabilityZone>east-11</availabilityZone>
|
64
64
|
<status>creating</status>
|
65
65
|
<createTime>2008-05-07T11:51:50.000Z</createTime>
|
66
66
|
<accountingType>1</accountingType>
|
@@ -109,7 +109,7 @@ context "volumes" do
|
|
109
109
|
response.volumeSet.item[0]['size'].should.equal '800'
|
110
110
|
response.volumeSet.item[0].diskType.should.equal 'Disk40'
|
111
111
|
response.volumeSet.item[0].snapshotId.should.equal nil
|
112
|
-
response.volumeSet.item[0].availabilityZone.should.equal '
|
112
|
+
response.volumeSet.item[0].availabilityZone.should.equal 'east-11'
|
113
113
|
response.volumeSet.item[0].status.should.equal 'in-use'
|
114
114
|
response.volumeSet.item[0].createTime.should.equal '2008-05-07T11:51:50.000Z'
|
115
115
|
response.volumeSet.item[0].attachmentSet.item[0].volumeId.should.equal 'vol-4282672b'
|
@@ -142,7 +142,7 @@ context "volumes" do
|
|
142
142
|
response.volumeId.should.equal 'disk05'
|
143
143
|
response['size'].should.equal '800'
|
144
144
|
response.snapshotId.should.equal nil
|
145
|
-
response.availabilityZone.should.equal '
|
145
|
+
response.availabilityZone.should.equal 'east-11'
|
146
146
|
response.status.should.equal 'creating'
|
147
147
|
response.createTime.should.equal '2008-05-07T11:51:50.000Z'
|
148
148
|
end
|
metadata
CHANGED
@@ -1,146 +1,102 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: nifty-cloud-sdk
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.11.beta2
|
5
5
|
prerelease: 5
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 11
|
9
|
-
- beta
|
10
|
-
- 1
|
11
|
-
version: 1.11.beta1
|
12
6
|
platform: ruby
|
13
|
-
authors:
|
7
|
+
authors:
|
14
8
|
- NIFTY Corporation
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-09-16 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
23
15
|
name: xml-simple
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &198428060 !ruby/object:Gem::Requirement
|
26
17
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 15
|
31
|
-
segments:
|
32
|
-
- 1
|
33
|
-
- 0
|
34
|
-
- 12
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
35
21
|
version: 1.0.12
|
36
22
|
type: :runtime
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: mocha
|
40
23
|
prerelease: false
|
41
|
-
|
24
|
+
version_requirements: *198428060
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: mocha
|
27
|
+
requirement: &198427500 !ruby/object:Gem::Requirement
|
42
28
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
hash: 41
|
47
|
-
segments:
|
48
|
-
- 0
|
49
|
-
- 9
|
50
|
-
- 9
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
51
32
|
version: 0.9.9
|
52
33
|
type: :development
|
53
|
-
version_requirements: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: test-unit
|
56
34
|
prerelease: false
|
57
|
-
|
35
|
+
version_requirements: *198427500
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: test-unit
|
38
|
+
requirement: &198426960 !ruby/object:Gem::Requirement
|
58
39
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
hash: 15
|
63
|
-
segments:
|
64
|
-
- 2
|
65
|
-
- 1
|
66
|
-
- 2
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
67
43
|
version: 2.1.2
|
68
44
|
type: :development
|
69
|
-
version_requirements: *id003
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: test-spec
|
72
45
|
prerelease: false
|
73
|
-
|
46
|
+
version_requirements: *198426960
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: test-spec
|
49
|
+
requirement: &198426480 !ruby/object:Gem::Requirement
|
74
50
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
hash: 55
|
79
|
-
segments:
|
80
|
-
- 0
|
81
|
-
- 10
|
82
|
-
- 0
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
83
54
|
version: 0.10.0
|
84
55
|
type: :development
|
85
|
-
version_requirements: *id004
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: rcov
|
88
56
|
prerelease: false
|
89
|
-
|
57
|
+
version_requirements: *198426480
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rcov
|
60
|
+
requirement: &198426000 !ruby/object:Gem::Requirement
|
90
61
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
hash: 41
|
95
|
-
segments:
|
96
|
-
- 0
|
97
|
-
- 9
|
98
|
-
- 9
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
99
65
|
version: 0.9.9
|
100
66
|
type: :development
|
101
|
-
version_requirements: *id005
|
102
|
-
- !ruby/object:Gem::Dependency
|
103
|
-
name: perftools.rb
|
104
67
|
prerelease: false
|
105
|
-
|
68
|
+
version_requirements: *198426000
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: perftools.rb
|
71
|
+
requirement: &198425440 !ruby/object:Gem::Requirement
|
106
72
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
hash: 3
|
111
|
-
segments:
|
112
|
-
- 0
|
113
|
-
- 5
|
114
|
-
- 4
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
115
76
|
version: 0.5.4
|
116
77
|
type: :development
|
117
|
-
version_requirements: *id006
|
118
|
-
- !ruby/object:Gem::Dependency
|
119
|
-
name: yard
|
120
78
|
prerelease: false
|
121
|
-
|
79
|
+
version_requirements: *198425440
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: yard
|
82
|
+
requirement: &198424980 !ruby/object:Gem::Requirement
|
122
83
|
none: false
|
123
|
-
requirements:
|
124
|
-
- -
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
hash: 3
|
127
|
-
segments:
|
128
|
-
- 0
|
129
|
-
- 6
|
130
|
-
- 2
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
131
87
|
version: 0.6.2
|
132
88
|
type: :development
|
133
|
-
|
134
|
-
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *198424980
|
91
|
+
description: It is an operation library for Nifty Cloud APIs that the server making,
|
92
|
+
starting, stoping, and the server status confirming etc.
|
135
93
|
email:
|
136
94
|
executables: []
|
137
|
-
|
138
95
|
extensions: []
|
139
|
-
|
140
|
-
extra_rdoc_files:
|
96
|
+
extra_rdoc_files:
|
141
97
|
- LICENSE.txt
|
142
98
|
- README.rdoc
|
143
|
-
files:
|
99
|
+
files:
|
144
100
|
- Gemfile
|
145
101
|
- Rakefile
|
146
102
|
- nifty-cloud-sdk.gemspec
|
@@ -227,12 +183,10 @@ files:
|
|
227
183
|
- test/test_Cloud_resources.rb
|
228
184
|
- test/test_Cloud_security_groups.rb
|
229
185
|
- test/test_Cloud_keypairs.rb
|
230
|
-
has_rdoc: true
|
231
186
|
homepage: http://cloud.nifty.com/api/
|
232
187
|
licenses: []
|
233
|
-
|
234
188
|
post_install_message:
|
235
|
-
rdoc_options:
|
189
|
+
rdoc_options:
|
236
190
|
- --title
|
237
191
|
- NIFTY Cloud SDK documentation
|
238
192
|
- --line-numbers
|
@@ -240,36 +194,27 @@ rdoc_options:
|
|
240
194
|
- README.rdoc
|
241
195
|
- -c
|
242
196
|
- UTF-8
|
243
|
-
require_paths:
|
197
|
+
require_paths:
|
244
198
|
- lib
|
245
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
199
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
246
200
|
none: false
|
247
|
-
requirements:
|
248
|
-
- -
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
|
251
|
-
|
252
|
-
- 0
|
253
|
-
version: "0"
|
254
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
|
+
requirements:
|
202
|
+
- - ! '>='
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: '0'
|
205
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
206
|
none: false
|
256
|
-
requirements:
|
257
|
-
- -
|
258
|
-
- !ruby/object:Gem::Version
|
259
|
-
hash: 25
|
260
|
-
segments:
|
261
|
-
- 1
|
262
|
-
- 3
|
263
|
-
- 1
|
207
|
+
requirements:
|
208
|
+
- - ! '>'
|
209
|
+
- !ruby/object:Gem::Version
|
264
210
|
version: 1.3.1
|
265
211
|
requirements: []
|
266
|
-
|
267
212
|
rubyforge_project:
|
268
|
-
rubygems_version: 1.
|
213
|
+
rubygems_version: 1.8.13
|
269
214
|
signing_key:
|
270
215
|
specification_version: 3
|
271
216
|
summary: NIFTY Cloud SDK for Ruby
|
272
|
-
test_files:
|
217
|
+
test_files:
|
273
218
|
- test/test_Cloud.rb
|
274
219
|
- test/test_Cloud_uploads.rb
|
275
220
|
- test/test_Cloud_load_balancers.rb
|
@@ -283,3 +228,4 @@ test_files:
|
|
283
228
|
- test/test_Cloud_resources.rb
|
284
229
|
- test/test_Cloud_security_groups.rb
|
285
230
|
- test/test_Cloud_keypairs.rb
|
231
|
+
has_rdoc:
|