nifty-cloud-sdk 1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/CHANGELOG +112 -0
  2. data/Gemfile +4 -0
  3. data/INSTALL +30 -0
  4. data/LICENSE.txt +58 -0
  5. data/README.rdoc +375 -0
  6. data/Rakefile +61 -0
  7. data/lib/NIFTY.rb +405 -0
  8. data/lib/NIFTY/Cloud.rb +24 -0
  9. data/lib/NIFTY/Cloud/availability_zones.rb +23 -0
  10. data/lib/NIFTY/Cloud/certificates.rb +283 -0
  11. data/lib/NIFTY/Cloud/images.rb +134 -0
  12. data/lib/NIFTY/Cloud/instances.rb +372 -0
  13. data/lib/NIFTY/Cloud/keypairs.rb +76 -0
  14. data/lib/NIFTY/Cloud/load_balancers.rb +433 -0
  15. data/lib/NIFTY/Cloud/security_groups.rb +357 -0
  16. data/lib/NIFTY/Cloud/volumes.rb +140 -0
  17. data/lib/NIFTY/config.rb +41 -0
  18. data/lib/NIFTY/exceptions.rb +32 -0
  19. data/lib/NIFTY/responses.rb +19 -0
  20. data/lib/NIFTY/version.rb +3 -0
  21. data/nifty-cloud-sdk.gemspec +28 -0
  22. data/sample/availability_zones/describe-availability-zones.rb +37 -0
  23. data/sample/certificate/create-ssl-certificate.rb +41 -0
  24. data/sample/certificate/delete-ssl-certificate.rb +28 -0
  25. data/sample/certificate/describe-ssl-certificate-attribute.rb +58 -0
  26. data/sample/certificate/describe-ssl-certificates.rb +49 -0
  27. data/sample/certificate/download-ssl-certificate.rb +31 -0
  28. data/sample/certificate/modify-ssl-certificate-attribute.rb +29 -0
  29. data/sample/certificate/register-corporate-info-for-certificate.rb +57 -0
  30. data/sample/certificate/upload-ssl-certificate.rb +32 -0
  31. data/sample/images/create-image.rb +33 -0
  32. data/sample/images/delete-image.rb +26 -0
  33. data/sample/images/describe-images.rb +70 -0
  34. data/sample/images/modify-image-attribute.rb +33 -0
  35. data/sample/instances/cancel_copy_instances.rb +26 -0
  36. data/sample/instances/copy-instances.rb +41 -0
  37. data/sample/instances/describe-instance-attribute.rb +78 -0
  38. data/sample/instances/describe-instances.rb +100 -0
  39. data/sample/instances/modify-instance-attribute.rb +30 -0
  40. data/sample/instances/reboot-instances.rb +29 -0
  41. data/sample/instances/run-instances.rb +104 -0
  42. data/sample/instances/start-instances.rb +36 -0
  43. data/sample/instances/stop-instances.rb +35 -0
  44. data/sample/instances/terminate-instances.rb +34 -0
  45. data/sample/keypairs/create-key-pair.rb +31 -0
  46. data/sample/keypairs/delete-key-pair.rb +28 -0
  47. data/sample/keypairs/describe-key-pairs.rb +31 -0
  48. data/sample/load_balancers/configure-health-check.rb +41 -0
  49. data/sample/load_balancers/create-load-balancer.rb +35 -0
  50. data/sample/load_balancers/delete-load-balancer.rb +28 -0
  51. data/sample/load_balancers/deregister-instances-from-load-balancer.rb +35 -0
  52. data/sample/load_balancers/describe-instance-health.rb +36 -0
  53. data/sample/load_balancers/describe-load-balancers.rb +89 -0
  54. data/sample/load_balancers/register-instances-with-load-balancer.rb +33 -0
  55. data/sample/load_balancers/register-port-with-load-balancer.rb +37 -0
  56. data/sample/load_balancers/set-filter-for-load-balancer.rb +38 -0
  57. data/sample/load_balancers/update-load-balancer.rb +33 -0
  58. data/sample/security_groups/authorize-security-group-ingress.rb +36 -0
  59. data/sample/security_groups/create-security-group.rb +29 -0
  60. data/sample/security_groups/delete-security-group.rb +28 -0
  61. data/sample/security_groups/deregister-instances-from-security-group.rb +31 -0
  62. data/sample/security_groups/describe-security-activities.rb +33 -0
  63. data/sample/security_groups/describe-security-groups.rb +59 -0
  64. data/sample/security_groups/register-instances-with-security-group.rb +31 -0
  65. data/sample/security_groups/revoke-security-group-ingress.rb +36 -0
  66. data/sample/security_groups/update-security-group.rb +30 -0
  67. data/sample/volumes/attach-volumes.rb +34 -0
  68. data/sample/volumes/create-volume.rb +38 -0
  69. data/sample/volumes/delete-volume.rb +28 -0
  70. data/sample/volumes/describe-volumes.rb +44 -0
  71. data/sample/volumes/detach-volume.rb +35 -0
  72. data/test/test_Cloud.rb +186 -0
  73. data/test/test_Cloud_availability_zones.rb +50 -0
  74. data/test/test_Cloud_certificates.rb +627 -0
  75. data/test/test_Cloud_images.rb +284 -0
  76. data/test/test_Cloud_instances.rb +941 -0
  77. data/test/test_Cloud_keypairs.rb +177 -0
  78. data/test/test_Cloud_load_balancers.rb +1183 -0
  79. data/test/test_Cloud_responses.rb +43 -0
  80. data/test/test_Cloud_security_groups.rb +699 -0
  81. data/test/test_Cloud_volumes.rb +325 -0
  82. data/test/test_helper.rb +23 -0
  83. metadata +275 -0
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => "loadBalancerName",
24
+ #:load_balancer_port => 0,
25
+ #:instance_port => 0
26
+ }
27
+
28
+ pp response = ncs4r.delete_load_balancer(options)
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => "loadBalancerName",
24
+ #:load_balancer_port => 0,
25
+ #:instance_port => 0,
26
+ #:instances => ["instanceId"]
27
+ }
28
+
29
+ pp response = ncs4r.deregister_instances_from_load_balancer(options)
30
+
31
+ if instances = response.DeregisterInstancesFromLoadBalancerResult.Instances
32
+ instances.member.each do |instance|
33
+ p instance.InstanceId
34
+ end
35
+ end
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => "LoadBalancerName",
24
+ #:load_balancer_port => 80,
25
+ #:instance_port => 80,
26
+ #:instances => ["InstanceId"]
27
+ }
28
+
29
+ pp response = ncs4r.describe_instance_health(options)
30
+
31
+ response.DescribeInstanceHealthResult.InstanceStates.member.each do |instance|
32
+ p instance.InstanceId
33
+ p instance.State
34
+ p instance.ReasonCode
35
+ p instance.Description
36
+ end
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => ["loadBalancerName"],
24
+ #:load_balancer_port => [0],
25
+ #:instance_port => [0]
26
+ }
27
+
28
+ pp response = ncs4r.describe_load_balancers(options)
29
+
30
+ if descriptions = response.DescribeLoadBalancersResult.LoadBalancerDescriptions
31
+ descriptions.member.each do |description|
32
+ p description.LoadBalancerName
33
+ p description.DNSName
34
+ p description.NetworkVolume
35
+ if listener_descriptions = description.ListenerDescriptions
36
+ listener_descriptions.member.each do |listener_description|
37
+ listener = listener_description.Listener
38
+ p listener.Protocol
39
+ p listener.LoadBalancerPort
40
+ p listener.InstancePort
41
+ p listener.BalancingType
42
+ end
43
+ end
44
+ if policy_names = descriptions.PolicyNames
45
+ policy_names.member.each do |policy_name|
46
+ if policies = policy_name.Policies
47
+ if app_cookie_stickiness_policies = policies.AppCookieStickinessPolicies
48
+ app_cookie_stickiness_policies.member.each do |policy|
49
+ p policy.PolicyName
50
+ p policy.CookieName
51
+ end
52
+ end
53
+ if lb_cookie_stickiness_policies = policies.LBCookieStickinessPolicies
54
+ lb_cookie_stickiness_policies.member.each do |policy|
55
+ p policy.PolicyName
56
+ p policy.CookieExpirationPeriod
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ if zones = description.AvailabilityZones
63
+ zones.member.each do |zone|
64
+ p zone
65
+ end
66
+ end
67
+ if instances = description.Instances
68
+ instances.member.each do |instance|
69
+ p instance.InstanceId
70
+ end
71
+ end
72
+ if health = description.HealthCheck
73
+ p health.Target
74
+ p health.Interval
75
+ p health.Timeout
76
+ p health.UnhealthyThreshold
77
+ p health.HealthyThreshold
78
+ end
79
+ if filter = description.Filter
80
+ p filter.FilterType
81
+ if ip_addresses = filter.IPAddresses
82
+ ip_addresses.member.each do |ip_address|
83
+ p ip_address
84
+ end
85
+ end
86
+ end
87
+ p description.CreatedTime
88
+ end
89
+ end
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => "loadBalancerName",
24
+ #:load_balancer_port => 0,
25
+ #:instance_port => 0,
26
+ #:instances => ["instanceId"]
27
+ }
28
+
29
+ pp response = ncs4r.register_instances_with_load_balancer(options)
30
+
31
+ response.RegisterInstancesWithLoadBalancerResult.Instances.member.each do |instance|
32
+ p instance.InstanceId
33
+ end
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => "loadBalancerName",
24
+ #:listeners => [{:protocol => "protocol",
25
+ # :load_balancer_port => 0,
26
+ # :instance_port => 0,
27
+ # :balancing_type => "balancingType"}]
28
+ }
29
+
30
+ pp response = ncs4r.register_port_with_load_balancer(options)
31
+
32
+ response.RegisterPortWithLoadBalancerResult.Listeners.member.each do |listener|
33
+ p listener.Protocol
34
+ p listener.LoadBalancerPort
35
+ p listener.InstancePort
36
+ p listener.BalancingType
37
+ end
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => "loadBalancerName",
24
+ #:load_balancer_port => 0,
25
+ #:instance_port => 0,
26
+ #:ip_addresses => [{:ip_address => "ipAddress",
27
+ # :add_on_filter => false}],
28
+ #:filter_type => "filterType"
29
+ }
30
+
31
+ pp response = ncs4r.set_filter_for_load_balancer(options)
32
+
33
+ if filter = response.SetFilterForLoadBalancerResult.Filter
34
+ p filter.FilterType
35
+ filter.IPAddresses.member.each do |ipaddr|
36
+ p ipaddr.IPAddress
37
+ end
38
+ end
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:load_balancer_name => "loadBalancerName",
24
+ #:listener_update => [{:load_balancer_port => 0,
25
+ # :instance_port => 0,
26
+ # :listener_protocol => "protocol",
27
+ # :listener_load_balancer_port => 0,
28
+ # :listener_instance_port => 0,
29
+ # :listener_balancing_type => "balancingType"}],
30
+ #:network_update => 0
31
+ }
32
+
33
+ pp response = ncs4r.update_load_balancer(options)
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:user_id => "userId",
24
+ #:group_name => "group01",
25
+ #:ip_permissions => [{:ip_protocl => "ipProtocol",
26
+ # :from_port => 0,
27
+ # :to_port => 0,
28
+ # :in_out => "inOut",
29
+ # :user_id => "userId",
30
+ # :group_name => "groupName",
31
+ # :cidr_ip => "*.*.*.*"}]
32
+ }
33
+
34
+ pp response = ncs4r.authorize_security_group_ingress(options)
35
+
36
+ p response.return
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:group_name => "groupName",
24
+ #:group_description => "groupDescription"
25
+ }
26
+
27
+ pp response = ncs4r.create_security_group(options)
28
+
29
+ p response.return
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:group_name => "groupName"
24
+ }
25
+
26
+ pp response = ncs4r.delete_security_group(options)
27
+
28
+ p response.return
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # ニフティクラウドSDK for Ruby
4
+ #
5
+ # Ruby Gem Name:: nifty-cloud-sdk
6
+ # Author:: NIFTY Corporation
7
+ # Copyright:: Copyright 2011 NIFTY Corporation All Rights Reserved.
8
+ # License:: Distributes under the same terms as Ruby
9
+ # Home:: http://cloud.nifty.com/api/
10
+ #++
11
+
12
+ require 'rubygems'
13
+ require File.dirname(__FILE__) + "/../../lib/NIFTY"
14
+ require 'pp'
15
+
16
+ ACCESS_KEY = ENV["NIFTY_CLOUD_ACCESS_KEY"] || "<Your Access Key ID>"
17
+ SECRET_KEY = ENV["NIFTY_CLOUD_SECRET_KEY"] || "<Your Secret Access Key>"
18
+
19
+
20
+ ncs4r = NIFTY::Cloud::Base.new(:access_key => ACCESS_KEY, :secret_key => SECRET_KEY)
21
+
22
+ options = {
23
+ #:group_name => "groupName",
24
+ #:instance_id => ["instanceId"]
25
+ }
26
+
27
+ pp response = ncs4r.deregister_instances_from_security_group(options)
28
+
29
+ response.instancesSet.item.each do |instance|
30
+ p instance.instanceId
31
+ end