fog-openstack 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CONTRIBUTORS.md +79 -0
- data/lib/fog/openstack/models/network/floating_ip.rb +24 -1
- data/lib/fog/openstack/network.rb +12 -2
- data/lib/fog/openstack/requests/network/associate_floating_ip.rb +10 -15
- data/lib/fog/openstack/requests/network/create_floating_ip.rb +1 -1
- data/lib/fog/openstack/requests/network/disassociate_floating_ip.rb +10 -15
- data/lib/fog/openstack/requests/network/get_floating_ip.rb +2 -12
- data/lib/fog/openstack/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4191e18e2e5e919b0eb167af4639b9d39454e1b8
|
4
|
+
data.tar.gz: 9514f40c05dacd2d2df860a23d83c2a84be900c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ba895b6f1e19022fe1b904470302e3a3a2a3e0e7b693fae7b17fe613924a6d330928c2a1fc37822504b4e92265406c9f928da4b7c9b7e17291714601287b94c
|
7
|
+
data.tar.gz: d1768d3a0d270ad6b7e7127ce32b6b3d1aadeb7db5171596016e3f7e892492c1638dc238f8ff5f9d8d559e61c6887e0e94c14c82c8b82823fb346cf9ce425003
|
data/.gitignore
CHANGED
data/CONTRIBUTORS.md
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
59 Wesley Beary <geemus@gmail.com>
|
2
|
+
44 Dan Prince <dprince@redhat.com>
|
3
|
+
37 Sergio Rubio <rubiojr@frameos.org>
|
4
|
+
29 Ladislav Smola <lsmola@redhat.com>
|
5
|
+
28 Nelvin Driz <nelvindriz@live.com>
|
6
|
+
27 Kyle Rames <kyle.rames@rackspace.com>
|
7
|
+
22 Darren Hague <d.hague@sap.com>
|
8
|
+
17 Ferran Rodenas <frodenas@gmail.com>
|
9
|
+
17 Philip Mark M. Deazeta <pdeazeta@morphlabs.com>
|
10
|
+
15 Brian D. Burns <iosctr@gmail.com>
|
11
|
+
14 Paul Thornthwaite <tokengeek@gmail.com>
|
12
|
+
14 Maurice Schreiber <maurice.schreiber@sap.com>
|
13
|
+
13 Eric Hodel <drbrain@segment7.net>
|
14
|
+
13 Hunter Nield <hunternield@gmail.com>
|
15
|
+
12 Nelvin Driz <nelvindriz@outlook.com>
|
16
|
+
11 Petr Blaho <pblaho@redhat.com>
|
17
|
+
11 Alvin Garcia <agarcia1337@gmail.com>
|
18
|
+
10 Sean Handley <sean.handley@gmail.com>
|
19
|
+
9 Philip Mark Deazeta <pmdeazeta@gmail.com>
|
20
|
+
9 Brandon Dunne <bdunne@redhat.com>
|
21
|
+
9 Bohuslav Kabrda <bkabrda@redhat.com>
|
22
|
+
9 Mike Moore <mike@blowmage.com>
|
23
|
+
8 Alfonso Juan Dillera <adillera@exist.com>
|
24
|
+
8 Evan Light <evan@tripledogdare.net>
|
25
|
+
8 Thomas Kadauke <thomas.kadauke@googlemail.com>
|
26
|
+
8 kanetann <kanetann@gmail.com>
|
27
|
+
7 Todd Willey <xtoddx@gmail.com>
|
28
|
+
7 Grzesiek Kolodziejczyk <gkolodziejczyk@gmail.com>
|
29
|
+
7 radekg <radek@gruchalski.com>
|
30
|
+
6 Tomokazu Hirai <tomokazu.hirai@kddi-web.com>
|
31
|
+
6 Ash Wilson <smashwilson@gmail.com>
|
32
|
+
5 TerryHowe <terrylhowe@gmail.com>
|
33
|
+
5 Greg Blomquist <gblomqui@redhat.com>
|
34
|
+
5 Alvin Garcia <agarcia@exist.com>
|
35
|
+
4 geemus <geemus@gmail.com>
|
36
|
+
4 Paul Thornthwaite <paul@brightbox.co.uk>
|
37
|
+
4 Lance Ivy <lance@cainlevy.net>
|
38
|
+
4 Stefan Majewsky <stefan.majewsky@sap.com>
|
39
|
+
4 Naoto TAKAHASHI <tnaoto@gmail.com>
|
40
|
+
4 Ohad Levy <ohadlevy@redhat.com>
|
41
|
+
4 Yauheni Kryudziuk <yauheni.kryudziuk@xing.com>
|
42
|
+
4 Julian Weber <jweber@avarteq.de>
|
43
|
+
4 Erik Mackdanz <erik@infochimps.com>
|
44
|
+
4 biomancer <biomancer@gmail.com>
|
45
|
+
4 Wesley Beary <geemus+github@gmail.com>
|
46
|
+
3 pyama86 <pyama@pepabo.com>
|
47
|
+
3 Nelvin Driz <iam@nelv.in>
|
48
|
+
3 Pedro Perez <pedro@bvox.net>
|
49
|
+
3 Bill Wei <bilwei@redhat.com>
|
50
|
+
3 Evan Petrie <ep873k@att.com>
|
51
|
+
3 Frederick Cheung <frederick.cheung@gmail.com>
|
52
|
+
3 Tzu-Mainn Chen <tzumainn@redhat.com>
|
53
|
+
3 Hongbin Lu <hongbin034@gmail.com>
|
54
|
+
3 Dan Prince <dan.prince@rackspace.com>
|
55
|
+
3 A.S. Lomoff <lomov.as@gmail.com>
|
56
|
+
3 Marjun Pagalan <mpagalan@gmail.com>
|
57
|
+
2 Coby Randquist <randquistcp@gmail.com>
|
58
|
+
2 zhitongLBN <z.liu@linkbynet.com>
|
59
|
+
2 Alfonso Juan Dillera <adillera@morphlabs.com>
|
60
|
+
2 Dmitry Gutov <dgutov@yandex.ru>
|
61
|
+
2 Adan Saenz <asaenz@momentumsi.com>
|
62
|
+
2 Dang Tung Lam <lamdt@vccloud.vn>
|
63
|
+
2 Tomas Varaneckas <tomas.varaneckas@gmail.com>
|
64
|
+
2 Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>
|
65
|
+
2 Daniel Lobato <elobatocs@gmail.com>
|
66
|
+
2 BK Box <bk@theboxes.org>
|
67
|
+
2 Alfonso Juan Dillera <aj.dillera@gmail.com>
|
68
|
+
2 Ben Bleything <ben@bleything.net>
|
69
|
+
2 mattray <matthewhray@gmail.com>
|
70
|
+
2 Matt Darby <matt.darby@rackspace.com>
|
71
|
+
2 Mark Maglana <mmaglana@gmail.com>
|
72
|
+
1 应俊 <yj2317916@gmail.com>
|
73
|
+
1 Aaron Huber <aaron.m.huber@intel.com>
|
74
|
+
1 Abhishek Chanda <abhishek.becs@gmail.com>
|
75
|
+
1 Andreas Pfau <andreas.pfau@sap.com>
|
76
|
+
1 Andrew Battye <andrew.battye@sap.com>
|
77
|
+
1 Andrew Donald Kennedy <andrew.kennedy@cloudsoftcorp.com>
|
78
|
+
1 Benjamin Müller <elchbenny@googlemail.com>
|
79
|
+
1 Brett Lentz <blentz@redhat.com>
|
@@ -21,7 +21,7 @@ module Fog
|
|
21
21
|
requires :floating_network_id
|
22
22
|
merge_attributes(service.create_floating_ip(self.floating_network_id,
|
23
23
|
|
24
|
-
|
24
|
+
self.attributes).body['floatingip'])
|
25
25
|
self
|
26
26
|
end
|
27
27
|
|
@@ -34,6 +34,29 @@ module Fog
|
|
34
34
|
service.delete_floating_ip(self.id)
|
35
35
|
true
|
36
36
|
end
|
37
|
+
|
38
|
+
def associate(port_id, fixed_ip_address = nil)
|
39
|
+
requires :id
|
40
|
+
options = if !fixed_ip_address.nil?
|
41
|
+
{ 'fixed_ip_address': fixed_ip_address }
|
42
|
+
else
|
43
|
+
{}
|
44
|
+
end
|
45
|
+
merge_attributes(service.associate_floating_ip(self.id,
|
46
|
+
port_id,
|
47
|
+
options).body['floatingip'])
|
48
|
+
end
|
49
|
+
|
50
|
+
def disassociate(fixed_ip_address = nil)
|
51
|
+
requires :id
|
52
|
+
options = if !fixed_ip_address.nil?
|
53
|
+
{ 'fixed_ip_address': fixed_ip_address }
|
54
|
+
else
|
55
|
+
{}
|
56
|
+
end
|
57
|
+
merge_attributes(service.disassociate_floating_ip(self.id,
|
58
|
+
options).body['floatingip'])
|
59
|
+
end
|
37
60
|
end
|
38
61
|
end
|
39
62
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require 'fog/openstack/core'
|
2
2
|
|
3
3
|
module Fog
|
4
4
|
module Network
|
@@ -174,7 +174,17 @@ module Fog
|
|
174
174
|
'tenant_id' => tenant_id,
|
175
175
|
}
|
176
176
|
},
|
177
|
-
:floating_ips => {
|
177
|
+
:floating_ips => {
|
178
|
+
'00000000-0000-0000-0000-000000000000' => {
|
179
|
+
'id' => '00000000-0000-0000-0000-000000000000',
|
180
|
+
'port_id' => nil,
|
181
|
+
'tenant_id' => tenant_id,
|
182
|
+
'floating_network_id' => network_id,
|
183
|
+
'router_id' => '00000000-0000-0000-0000-000000000000',
|
184
|
+
'floating_ip_address' => '66.66.66.66',
|
185
|
+
|
186
|
+
}
|
187
|
+
},
|
178
188
|
:routers => {},
|
179
189
|
:lb_pools => {},
|
180
190
|
:lb_members => {},
|
@@ -25,21 +25,16 @@ module Fog
|
|
25
25
|
|
26
26
|
class Mock
|
27
27
|
def associate_floating_ip(floating_ip_id, port_id, options = {})
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
self.data[:floating_ips][data['floating_ip_id']] = data
|
41
|
-
response.body = { 'floatingip' => data }
|
42
|
-
response
|
28
|
+
if data = self.data[:floating_ips][floating_ip_id]
|
29
|
+
response = Excon::Response.new
|
30
|
+
response.status = 201
|
31
|
+
data['port_id'] = port_id
|
32
|
+
data['fixed_ip_address'] = options[:fixed_ip_address]
|
33
|
+
response.body = { 'floatingip' => data }
|
34
|
+
response
|
35
|
+
else
|
36
|
+
raise Fog::Network::OpenStack::NotFound
|
37
|
+
end
|
43
38
|
end
|
44
39
|
end
|
45
40
|
end
|
@@ -28,7 +28,7 @@ module Fog
|
|
28
28
|
response = Excon::Response.new
|
29
29
|
response.status = 201
|
30
30
|
data = {
|
31
|
-
'id' =>
|
31
|
+
'id' => Fog::UUID.uuid,
|
32
32
|
'floating_network_id' => floating_network_id,
|
33
33
|
'port_id' => options[:port_id],
|
34
34
|
'tenant_id' => options[:tenant_id],
|
@@ -25,21 +25,16 @@ module Fog
|
|
25
25
|
|
26
26
|
class Mock
|
27
27
|
def disassociate_floating_ip(floating_ip_id, options = {})
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
self.data[:floating_ips][data['floating_ip_id']] = data
|
41
|
-
response.body = { 'floatingip' => data }
|
42
|
-
response
|
28
|
+
if data = self.data[:floating_ips][floating_ip_id]
|
29
|
+
response = Excon::Response.new
|
30
|
+
response.status = 201
|
31
|
+
data['port_id'] = nil
|
32
|
+
data['fixed_ip_address'] = nil
|
33
|
+
response.body = { 'floatingip' => data }
|
34
|
+
response
|
35
|
+
else
|
36
|
+
raise Fog::Network::OpenStack::NotFound
|
37
|
+
end
|
43
38
|
end
|
44
39
|
end
|
45
40
|
end
|
@@ -14,20 +14,10 @@ module Fog
|
|
14
14
|
class Mock
|
15
15
|
def get_floating_ip(floating_ip_id)
|
16
16
|
response = Excon::Response.new
|
17
|
+
|
17
18
|
if data = self.data[:floating_ips][floating_ip_id]
|
18
19
|
response.status = 200
|
19
|
-
response.body = {
|
20
|
-
"floatingip" => {
|
21
|
-
"id" => "00000000-0000-0000-0000-000000000000",
|
22
|
-
# changed
|
23
|
-
# "floating_ip_id" => floating_ip_id,
|
24
|
-
"port_id" => data["port_id"],
|
25
|
-
"tenant_id" => data["tenant_id"],
|
26
|
-
"fixed_ip_address" => data["fixed_ip_address"],
|
27
|
-
"router_id" => "00000000-0000-0000-0000-000000000000",
|
28
|
-
"floating_ip_address" => data["floating_ip_address"],
|
29
|
-
}
|
30
|
-
}
|
20
|
+
response.body = { 'floatingip' => data }
|
31
21
|
response
|
32
22
|
else
|
33
23
|
raise Fog::Network::OpenStack::NotFound
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- ".travis.yml"
|
165
165
|
- CODE_OF_CONDUCT.md
|
166
166
|
- CONTRIBUTING.md
|
167
|
+
- CONTRIBUTORS.md
|
167
168
|
- Gemfile
|
168
169
|
- LICENSE.md
|
169
170
|
- README.md
|