vagrant-hp 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92889ca25d3c6e6a85da3f7155befd64f46f87e9
4
- data.tar.gz: 1c4ac01044bd006e42ef4f53234ca4969bdb8da0
3
+ metadata.gz: 4ad0323fa8a3a19b68e1b86c519f0af665f8268c
4
+ data.tar.gz: d0a7eb5ac2238cee94d1821efe4baae220f1c6bb
5
5
  SHA512:
6
- metadata.gz: ebe24d2a73dd13e5ae2ab485f0dcb2e69d3d3959eb14a2a3ae28d734b0ce4c75b5feaf0c7ce6d44dbc3b73650989581a6c87dd7bc0270cd465bf2fa74755ff47
7
- data.tar.gz: 48c30fdc1ffd725857e6154df1fdb35e22c577218326a4121639949dd66ed39e063c0292bbebbadbfb5aac990df086222d4d048e062489d75cf01d94e14c765b
6
+ metadata.gz: 24d730dc8d0c85e69fa139c02fc7e187608e638e3595e920703f8e54f655aed762833491dd96fdb431f898818c7770f49b73cbf0d1ded1ccfcaf1cc03235d5dc
7
+ data.tar.gz: ebdbcf8734ec945ba15bc7628ecda99c253064d3b61dcfc2e84cbd01a4b31de17e96b46e5e91be855b5493e18e2fce4cffc30d415c764ad15f1cc159fc5e0f1e
@@ -2,3 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+ - 2.1.0
@@ -1,6 +1,10 @@
1
+ # 0.1.4
2
+ * Network(s) Support (Manish Sethi)
3
+
1
4
  # 0.1.3 (Jan 17 2014)
2
5
  * Upgraded to fog 1.19.0
3
6
  * Upgraded to HP-Compute-v13.5
7
+ * Floating-ip improvements
4
8
 
5
9
  # 0.1.2 (Oct 26 2013)
6
10
  * Upgraded to fog 1.15.0
data/README.md CHANGED
@@ -64,6 +64,8 @@ Vagrant.configure("2") do |config|
64
64
  rs.availability_zone = "az1"
65
65
  # Security Groups defaults to ["default"]
66
66
  # rs.security_groups = ["group1", "group2"]
67
+ rs.floating_ip ="33.33.33.10" # Optional
68
+ rs.network = ["830744ee-38a8-4618-a1eb-7c06fcsdf78", "Test_Network"] # Optional
67
69
  end
68
70
  end
69
71
  ```
@@ -129,6 +131,8 @@ Vagrant.configure("2") do |config|
129
131
  rs.availability_zone = "az1"
130
132
  # Security Groups defaults to ["default"]
131
133
  # rs.security_groups = ["group1", "group2"]
134
+ rs.floating_ip ="33.33.33.10" # Optional
135
+ rs.network = ["830744ee-38a8-4618-a1eb-7c06fcsdf78", "Test_Network"] # Optional
132
136
  end
133
137
 
134
138
  end
@@ -30,8 +30,8 @@ module VagrantPlugins
30
30
  b2.use MessageNotCreated
31
31
  next
32
32
  end
33
- b2.use SyncFolders
34
33
  b2.use Provision
34
+ b2.use SyncFolders
35
35
  end
36
36
  end
37
37
  end
@@ -28,14 +28,24 @@ module VagrantPlugins
28
28
 
29
29
  @logger.info('Connecting to HP...')
30
30
  env[:hp_compute] = Fog::Compute.new(
31
- provider: 'HP',
32
- version: 'v2',
33
- hp_access_key: access_key,
34
- hp_secret_key: secret_key,
35
- hp_tenant_id: tenant_id,
36
- hp_avl_zone: availability_zone,
31
+ provider: 'HP',
32
+ version: :v2,
33
+ hp_access_key: access_key,
34
+ hp_secret_key: secret_key,
35
+ hp_tenant_id: tenant_id,
36
+ hp_avl_zone: availability_zone,
37
37
  )
38
38
 
39
+ # If network is provided
40
+ if config.network
41
+ env[:hp_network] = Fog::HP::Network.new(
42
+ hp_access_key: access_key,
43
+ hp_secret_key: secret_key,
44
+ hp_tenant_id: tenant_id,
45
+ hp_avl_zone: availability_zone
46
+ )
47
+ end
48
+
39
49
  @app.call(env)
40
50
  end
41
51
 
@@ -20,7 +20,7 @@ module VagrantPlugins
20
20
 
21
21
  def call(env)
22
22
  # Get the configs
23
- config = env[:machine].provider_config
23
+ config = env[:machine].provider_config
24
24
 
25
25
  # Find the flavor
26
26
  env[:ui].info(I18n.t('vagrant_hp.finding_flavor'))
@@ -32,6 +32,13 @@ module VagrantPlugins
32
32
  image = find_match(env[:hp_compute].images, config.image)
33
33
  raise Errors::NoMatchingImage unless image
34
34
 
35
+ # Find the floating-ip
36
+ if config.floating_ip
37
+ env[:ui].info(I18n.t('vagrant_hp.finding_floating_ip'))
38
+ fip = env[:hp_compute].addresses.find { |fip| fip.ip.eql? config.floating_ip }
39
+ raise Errors::NoMatchingFloatingIp unless fip
40
+ end
41
+
35
42
  # Figure out the name for the server
36
43
  server_name = config.server_name || env[:machine].name if \
37
44
  env[:machine].name != 'default' || get_server_name
@@ -55,6 +62,17 @@ module VagrantPlugins
55
62
  security_groups: config.security_groups
56
63
  }
57
64
 
65
+ # Find network if provided in Vagrantfile
66
+ if config.network
67
+ networks = Array.new
68
+ env[:ui].info(I18n.t('vagrant_hp.finding_network'))
69
+ config.network.each do |net|
70
+ network = find_match(env[:hp_network].networks, net)
71
+ networks.push(network.id) if network
72
+ end
73
+ options[:networks] = networks
74
+ end
75
+
58
76
  # Create the server
59
77
  server = env[:hp_compute].servers.create(options)
60
78
 
@@ -74,6 +92,7 @@ module VagrantPlugins
74
92
  # Wait for the server to be ready
75
93
  begin
76
94
  server.wait_for(30) { ready? }
95
+
77
96
  rescue RuntimeError, Fog::Errors::TimeoutError => e
78
97
  # If we don't have an error about a state transition, then
79
98
  # we just move on.
@@ -82,9 +101,13 @@ module VagrantPlugins
82
101
  end
83
102
  end
84
103
  env[:ui].clear_line
85
- env[:ui].info(I18n.t('vagrant_hp.associate_floating_ip_to_server'))
86
- ip = env[:hp_compute].addresses.create
87
- ip.server = server
104
+ if not config.floating_ip
105
+ env[:ui].clear_line
106
+ env[:ui].info(I18n.t('vagrant_hp.new_floating_ip_to_server'))
107
+ fip = env[:hp_compute].addresses.create
108
+ end
109
+ fip.server = server
110
+
88
111
  unless env[:interrupted]
89
112
  # Clear the line one more time so the progress is removed
90
113
  env[:ui].clear_line
@@ -119,9 +142,11 @@ module VagrantPlugins
119
142
  collection.each do |single|
120
143
  return single if single.id == name
121
144
  return single if single.name == name
122
- end
123
- nil
145
+ return single if name.is_a?(Regexp) && name =~ single.name
146
+ end
147
+ nil
124
148
  end
149
+
125
150
  end
126
151
  end
127
152
  end
@@ -17,9 +17,12 @@ module VagrantPlugins
17
17
 
18
18
  def call(env)
19
19
  if env[:machine].id
20
- @logger.info(I18n.t('vagrant_hp.deleting_floating_ip'))
21
- ip = env[:hp_compute].addresses.find { |ip| ip.instance_id==env[:machine].id }
22
- ip.destroy
20
+ config = env[:machine].provider_config
21
+ if not config.floating_ip
22
+ @logger.info(I18n.t('vagrant_hp.deleting_floating_ip'))
23
+ ip = env[:hp_compute].addresses.find { |ip| ip.instance_id==env[:machine].id }
24
+ ip.destroy
25
+ end
23
26
  @logger.info(I18n.t('vagrant_hp.deleting_server'))
24
27
  server = env[:hp_compute].servers.get(env[:machine].id)
25
28
  server.destroy
@@ -30,6 +30,10 @@ module VagrantPlugins
30
30
 
31
31
  attr_accessor :security_groups
32
32
 
33
+ attr_accessor :floating_ip
34
+
35
+ attr_accessor :network
36
+
33
37
  def initialize(region_specific = false)
34
38
  @access_key = UNSET_VALUE
35
39
  @secret_key = UNSET_VALUE
@@ -42,6 +46,9 @@ module VagrantPlugins
42
46
  @ssh_private_key_path = UNSET_VALUE
43
47
  @ssh_username = UNSET_VALUE
44
48
  @flavor = UNSET_VALUE
49
+ @network = UNSET_VALUE
50
+ @config = UNSET_VALUE
51
+
45
52
 
46
53
  @__compiled_region_configs = {}
47
54
  @__finalized = false
@@ -108,6 +115,9 @@ module VagrantPlugins
108
115
  @ssh_private_key_path = nil if @ssh_private_key_path == UNSET_VALUE
109
116
  @ssh_username = nil if @ssh_username == UNSET_VALUE
110
117
 
118
+ # The network values.
119
+ @network = [] if @network == UNSET_VALUE
120
+
111
121
  # Mark that we finalized
112
122
  @__finalized = true
113
123
  end
@@ -19,6 +19,10 @@ module VagrantPlugins
19
19
  class RsyncError < VagrantHPError
20
20
  error_key(:rsync_error)
21
21
  end
22
+
23
+ class NoMatchingFloatingIp < VagrantHPError
24
+ error_key(:floating_ip_error)
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module VagrantPlugins
7
7
  module HP
8
- VERSION = '0.1.3'
8
+ VERSION = '0.1.4'
9
9
  end
10
10
  end
@@ -28,6 +28,8 @@ en:
28
28
  Waiting for SSH to become available...
29
29
  associate_floating_ip_to_server: |-
30
30
  Associating floating-ip to server...
31
+ new_floating_ip_to_server: |-
32
+ Requesting a new floating-ip...
31
33
  warn_networks: |-
32
34
  Warning! The HP provider doesn't support any of the Vagrant
33
35
  high-level network configurations (`config.vm.network`). They
@@ -38,6 +40,10 @@ en:
38
40
  Finding flavor for server...
39
41
  finding_image: |-
40
42
  Finding image for server...
43
+ finding_floating_ip: |-
44
+ Finding floating-ip...
45
+ finding_network: |-
46
+ Finding network...
41
47
  deleting_floating_ip: |-
42
48
  "Attempting to delete floating-ip..."
43
49
 
@@ -73,6 +79,9 @@ en:
73
79
  Guest path: %{guestpath}
74
80
  Error: %{stderr}
75
81
 
82
+ floating_ip_error: |-
83
+ Floating-Ip not found.
84
+
76
85
  states:
77
86
  short_active: |-
78
87
  active
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-hp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohit Sethi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.19.0
20
20
  type: :runtime
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.19.0
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: '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: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.14.7
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.14.7
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-expectations
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.14.4
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.14.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-mocks
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.14.4
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.14.4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubygems-bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: Enables Vagrant to manage machines on HP Cloud.
@@ -114,49 +114,43 @@ executables: []
114
114
  extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
- - locales/en.yml
118
- - test_key.pem
117
+ - ".coveragerc"
118
+ - ".gitignore"
119
+ - ".rubocop.yml"
120
+ - ".travis.yml"
121
+ - CHANGELOG.md
122
+ - Gemfile
119
123
  - LICENSE
120
- - spec/vagrant-hp/config_spec.rb
121
- - dummy_hp.box
122
124
  - README.md
123
- - Gemfile
124
- - vagrant-hp.gemspec
125
- - test_address.rb
126
125
  - Rakefile
127
- - CHANGELOG.md_
126
+ - dummy_hp.box
127
+ - example_box/README.md
128
+ - example_box/Vagrantfile
129
+ - example_box/metadata.json
128
130
  - lib/vagrant-hp.rb
129
- - lib/vagrant-hp/provider.rb
130
- - lib/vagrant-hp/util/timer.rb
131
- - lib/vagrant-hp/plugin.rb
132
131
  - lib/vagrant-hp/action.rb
133
- - lib/vagrant-hp/errors.rb
134
- - lib/vagrant-hp/version.rb
135
- - lib/vagrant-hp/config.rb
132
+ - lib/vagrant-hp/action/connect_hp.rb
133
+ - lib/vagrant-hp/action/create_server.rb
134
+ - lib/vagrant-hp/action/delete_server.rb
136
135
  - lib/vagrant-hp/action/halt_server.rb
136
+ - lib/vagrant-hp/action/is_created.rb
137
+ - lib/vagrant-hp/action/is_running.rb
138
+ - lib/vagrant-hp/action/message_already_created.rb
139
+ - lib/vagrant-hp/action/message_not_created.rb
140
+ - lib/vagrant-hp/action/read_ssh_info.rb
137
141
  - lib/vagrant-hp/action/read_state.rb
138
- - lib/vagrant-hp/action/delete_server.rb
139
142
  - lib/vagrant-hp/action/sync_folders.rb
140
- - lib/vagrant-hp/action/read_ssh_info.rb
141
- - lib/vagrant-hp/action/message_already_created.rb
142
- - lib/vagrant-hp/action/create_server.rb
143
143
  - lib/vagrant-hp/action/timed_provision.rb
144
- - lib/vagrant-hp/action/message_not_created.rb
145
- - lib/vagrant-hp/action/test.rb
146
144
  - lib/vagrant-hp/action/warn_networks.rb
147
- - lib/vagrant-hp/action/is_created.rb
148
- - lib/vagrant-hp/action/connect_hp.rb
149
- - lib/vagrant-hp/action/is_running.rb
150
- - test.rb
151
- - example_box/README.md
152
- - example_box/metadata.json
153
- - example_box/Vagrantfile
154
- - CHANGELOG.md
155
- - Vagrantfile
156
- - .rubocop.yml
157
- - .coveragerc
158
- - .travis.yml
159
- - .gitignore
145
+ - lib/vagrant-hp/config.rb
146
+ - lib/vagrant-hp/errors.rb
147
+ - lib/vagrant-hp/plugin.rb
148
+ - lib/vagrant-hp/provider.rb
149
+ - lib/vagrant-hp/util/timer.rb
150
+ - lib/vagrant-hp/version.rb
151
+ - locales/en.yml
152
+ - spec/vagrant-hp/config_spec.rb
153
+ - vagrant-hp.gemspec
160
154
  homepage: http://github.com/mohitsethi/vagrant-hp
161
155
  licenses: []
162
156
  metadata: {}
@@ -166,17 +160,17 @@ require_paths:
166
160
  - lib
167
161
  required_ruby_version: !ruby/object:Gem::Requirement
168
162
  requirements:
169
- - - '>='
163
+ - - ">="
170
164
  - !ruby/object:Gem::Version
171
165
  version: '0'
172
166
  required_rubygems_version: !ruby/object:Gem::Requirement
173
167
  requirements:
174
- - - '>='
168
+ - - ">="
175
169
  - !ruby/object:Gem::Version
176
170
  version: 1.3.6
177
171
  requirements: []
178
172
  rubyforge_project: vagrant-hp
179
- rubygems_version: 2.1.11
173
+ rubygems_version: 2.2.2
180
174
  signing_key:
181
175
  specification_version: 4
182
176
  summary: Enables Vagrant to manage machines on HP Cloud.
@@ -1,13 +0,0 @@
1
- # 0.1.3 (Jan 17 2014)
2
- * Upgraded to fog 1.19.0
3
- * Upgraded to HP-Compute-v13.5
4
-
5
- # 0.1.2 (Oct 26 2013)
6
- * Upgraded to fog 1.15.0
7
-
8
- # 0.1.1 (May 22, 2013)
9
- * Added support to specify security groups.
10
-
11
- # 0.1.0 (March 31, 2013)
12
- * Vagrant-Hp
13
- * Initial release.
@@ -1,28 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
- VAGRANTFILE_API_VERSION = "2"
6
-
7
- Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
- # Every Vagrant virtual environment requires a box to build off of.
9
- config.vm.box = "dummy"
10
- config.vm.provider :hp do |rs|
11
- rs.access_key = "Y5SKH1MU6HZ2PEM9ZNZL"
12
- rs.secret_key = "YA2BJr98R3hDK7IwpIkHXlDCDo9GG+GIuqhflPqQ"
13
- rs.flavor = "standard.xsmall"
14
- rs.tenant_id = "87309806546461"
15
- rs.server_name = "test_server"
16
- #rs.image = "Ubuntu Precise 12.04 LTS Server 64-bit 20121026 (b)"
17
- rs.image = "CentOS 6.3 Server 64-bit 20130116 (b)"
18
- rs.keypair_name = "test_hp"
19
- #rs.keypair_name = "ms"
20
- rs.ssh_private_key_path = "./test_key.pem"
21
- #rs.ssh_private_key_path = "~anne/.ssh/id_rsa"
22
- rs.ssh_username = "root"
23
- #rs.availability_zone = "az1"
24
- # Security Groups defaults to ["default"]
25
- # rs.security_groups = ["group1", "group2"]
26
- end
27
-
28
- end
@@ -1,22 +0,0 @@
1
- require 'rubygems'
2
- require 'fog'
3
-
4
- hp_access_key = "Y5SKH1MU6HZ2PEM9ZNZL"
5
- hp_secret_key = "YA2BJr98R3hDK7IwpIkHXlDCDo9GG+GIuqhflPqQ"
6
- hp_tenant_id = "87309806546461"
7
-
8
-
9
- connection = Fog::Compute.new(
10
- provider: :hp,
11
- version: 'v2',
12
- hp_access_key: hp_access_key,
13
- hp_secret_key: hp_secret_key,
14
- hp_tenant_id: hp_tenant_id,
15
- hp_avl_zone: 'az-1.region-a.geo-1'
16
- )
17
-
18
- puts "++++++++++++++++++++++++++"
19
- puts "hp_avl_zone: #{connection.inspect}"
20
- puts "++++++++++++++++++++++++++"
21
- puts "key_pairs: #{connection.key_pairs}"
22
- puts "++++++++++++++++++++++++++"
data/test.rb DELETED
@@ -1,49 +0,0 @@
1
- require 'rubygems'
2
- require 'fog'
3
-
4
- hp_access_key = "Y5SKH1MU6HZ2PEM9ZNZL"
5
- hp_secret_key = "YA2BJr98R3hDK7IwpIkHXlDCDo9GG+GIuqhflPqQ"
6
- hp_tenant_id = "87309806546461"
7
- hp_avl_zone = "US West"
8
-
9
-
10
- conn = Fog::Compute.new(
11
- :provider => "HP",
12
- :version => :v2,
13
- :hp_access_key => hp_access_key,
14
- :hp_secret_key => hp_secret_key,
15
- #:hp_auth_uri => "<IDENTITY_ENDPOINT_URL>",
16
- :hp_tenant_id => hp_tenant_id,
17
- #:hp_avl_zone => "<your_AVAILABILITY_ZONE>",
18
- #:hp_avl_zone => 'az-1.region-a.geo-1'
19
- :hp_avl_zone => 'region-a.geo-1'
20
- )
21
-
22
- puts "+++++++++++++++++++++++"
23
- #puts "conn: #{conn.inspect}"
24
- puts "+++++++++++++++++++++++"
25
- #puts "keypairs: #{conn.key_pairs.inspect}"
26
- puts "+++++++++++++++++++++++"
27
-
28
-
29
- puts "Floating_ips:"
30
- #puts "#{conn.methods}"
31
- #puts "#{conn.list_addresses.inspect}"
32
- puts "#{conn.addresses.inspect}"
33
- puts "+++++++++++++++++++++++"
34
- #puts "allocate_address: #{conn.allocate_address.inspect}"
35
- #puts "allocate_address: #{conn.allocate_address.inspect}"
36
- puts "Allocating new address"
37
- ip = conn.addresses.create
38
- #ip = conn.allocate_address
39
- puts "methods: #{ip.methods}"
40
-
41
- server = conn.servers.get('1b6e1de8-a167-42ca-84e3-da612d733115')
42
- puts "server: #{server.inspect}"
43
- puts "+++++++++++++++++++++++"
44
- puts "allocate_address"
45
- puts "server.id: #{server.id}"
46
- puts "ip.ip: #{ip.ip}"
47
- conn.associate_address("#{server.id}", "#{ip.ip}")
48
- #ip.server = server
49
-
@@ -1,38 +0,0 @@
1
- require 'rubygems'
2
- require 'fog'
3
-
4
- hp_access_key = "Y5SKH1MU6HZ2PEM9ZNZL"
5
- hp_secret_key = "YA2BJr98R3hDK7IwpIkHXlDCDo9GG+GIuqhflPqQ"
6
- hp_tenant_id = "87309806546461"
7
- hp_avl_zone = "US West"
8
-
9
-
10
- conn = Fog::Compute.new(
11
- :provider => "HP",
12
- :version => :v2,
13
- :hp_access_key => hp_access_key,
14
- :hp_secret_key => hp_secret_key,
15
- #:hp_auth_uri => "<IDENTITY_ENDPOINT_URL>",
16
- :hp_tenant_id => hp_tenant_id,
17
- #:hp_avl_zone => "<your_AVAILABILITY_ZONE>",
18
- #:hp_avl_zone => 'az-1.region-a.geo-1'
19
- :hp_avl_zone => 'region-a.geo-1'
20
- )
21
-
22
- puts "+++++++++++++++++++++++"
23
- #puts "conn: #{conn.inspect}"
24
- puts "+++++++++++++++++++++++"
25
- #puts "keypairs: #{conn.key_pairs.inspect}"
26
- puts "+++++++++++++++++++++++"
27
-
28
-
29
- puts "Floating_ips: #{conn.addresses.inspect}"
30
- conn.addresses.each do |addr|
31
- addr.destroy
32
- puts "#{addr.inspect} destroyed"
33
- end
34
- #puts "#{conn.methods}"
35
- #puts "#{conn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