fog-openstack 0.1.20 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/fog/dns/openstack/v2.rb +137 -1
  4. data/lib/fog/dns/openstack/v2/models/pool.rb +21 -0
  5. data/lib/fog/dns/openstack/v2/models/pools.rb +25 -0
  6. data/lib/fog/dns/openstack/v2/models/zone_transfer_accept.rb +29 -0
  7. data/lib/fog/dns/openstack/v2/models/zone_transfer_accepts.rb +25 -0
  8. data/lib/fog/dns/openstack/v2/models/zone_transfer_request.rb +50 -0
  9. data/lib/fog/dns/openstack/v2/models/zone_transfer_requests.rb +30 -0
  10. data/lib/fog/dns/openstack/v2/requests/create_zone_transfer_accept.rb +32 -0
  11. data/lib/fog/dns/openstack/v2/requests/create_zone_transfer_request.rb +34 -0
  12. data/lib/fog/dns/openstack/v2/requests/delete_zone_transfer_request.rb +26 -0
  13. data/lib/fog/dns/openstack/v2/requests/get_pool.rb +30 -0
  14. data/lib/fog/dns/openstack/v2/requests/get_zone_transfer_accept.rb +28 -0
  15. data/lib/fog/dns/openstack/v2/requests/get_zone_transfer_request.rb +29 -0
  16. data/lib/fog/dns/openstack/v2/requests/list_pools.rb +30 -0
  17. data/lib/fog/dns/openstack/v2/requests/list_zone_transfer_accepts.rb +27 -0
  18. data/lib/fog/dns/openstack/v2/requests/list_zone_transfer_requests.rb +27 -0
  19. data/lib/fog/dns/openstack/v2/requests/update_zone_transfer_request.rb +36 -0
  20. data/lib/fog/identity/openstack/v3/requests/list_user_projects.rb +3 -2
  21. data/lib/fog/key_manager/openstack.rb +48 -0
  22. data/lib/fog/key_manager/openstack/models/acl.rb +23 -0
  23. data/lib/fog/key_manager/openstack/requests/delete_container_acl.rb +24 -0
  24. data/lib/fog/key_manager/openstack/requests/delete_secret_acl.rb +24 -0
  25. data/lib/fog/key_manager/openstack/requests/get_container_acl.rb +31 -0
  26. data/lib/fog/key_manager/openstack/requests/get_secret_acl.rb +31 -0
  27. data/lib/fog/key_manager/openstack/requests/replace_container_acl.rb +27 -0
  28. data/lib/fog/key_manager/openstack/requests/replace_secret_acl.rb +27 -0
  29. data/lib/fog/key_manager/openstack/requests/update_container_acl.rb +26 -0
  30. data/lib/fog/key_manager/openstack/requests/update_secret_acl.rb +26 -0
  31. data/lib/fog/metric/openstack/requests/list_resources.rb +3 -3
  32. data/lib/fog/network/openstack.rb +77 -2
  33. data/lib/fog/network/openstack/models/network_ip_availabilities.rb +24 -0
  34. data/lib/fog/network/openstack/models/network_ip_availability.rb +17 -0
  35. data/lib/fog/network/openstack/requests/create_lbaas_l7policy.rb +50 -0
  36. data/lib/fog/network/openstack/requests/create_lbaas_l7rule.rb +50 -0
  37. data/lib/fog/network/openstack/requests/delete_lbaas_l7policy.rb +28 -0
  38. data/lib/fog/network/openstack/requests/delete_lbaas_l7rule.rb +28 -0
  39. data/lib/fog/network/openstack/requests/get_lbaas_l7policy.rb +28 -0
  40. data/lib/fog/network/openstack/requests/get_lbaas_l7rule.rb +28 -0
  41. data/lib/fog/network/openstack/requests/get_network_ip_availability.rb +28 -0
  42. data/lib/fog/network/openstack/requests/list_lbaas_l7policies.rb +25 -0
  43. data/lib/fog/network/openstack/requests/list_lbaas_l7rules.rb +25 -0
  44. data/lib/fog/network/openstack/requests/list_network_ip_availabilities.rb +28 -0
  45. data/lib/fog/network/openstack/requests/update_lbaas_l7policy.rb +43 -0
  46. data/lib/fog/network/openstack/requests/update_lbaas_l7rule.rb +42 -0
  47. data/lib/fog/network/openstack/requests/update_lbaas_listener.rb +3 -4
  48. data/lib/fog/openstack/version.rb +1 -1
  49. data/lib/fog/shared_file_system/openstack.rb +20 -0
  50. data/lib/fog/shared_file_system/openstack/models/share.rb +4 -0
  51. data/lib/fog/shared_file_system/openstack/models/share_export_location.rb +16 -0
  52. data/lib/fog/shared_file_system/openstack/models/share_export_locations.rb +31 -0
  53. data/lib/fog/shared_file_system/openstack/requests/get_share_export_location.rb +29 -0
  54. data/lib/fog/shared_file_system/openstack/requests/list_share_export_locations.rb +27 -0
  55. data/lib/fog/shared_file_system/openstack/requests/list_share_networks.rb +1 -1
  56. data/lib/fog/volume/openstack/requests/update_metadata.rb +1 -1
  57. metadata +81 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50563e6b22ba89f6fa72a25141b465c03a062362
4
- data.tar.gz: 1fe391d2160e4030614e710cf97763ed44caf90b
3
+ metadata.gz: 3735199d42be3dc72bc5c40e6de63e9c89cb6960
4
+ data.tar.gz: 1ce08c5e313b9bf9425743a3c05b999e999be03b
5
5
  SHA512:
6
- metadata.gz: f31a8b75f9508e32dfeffffa991e8ef74389454acabe7b0bca5f1bc9117d33dc310c089b16cef778b909461d24cc44eefd1fb67ad82c1fbc294f9507b2a47697
7
- data.tar.gz: f5e1ccdc99e2be0ac021c0cc40202b3e6fbf30641328abae2b6879c95c63c72d06ba6f087eaba7fe7a1ef06d999ae166e31fc070cc80582fdd4b0aec9a476f15
6
+ metadata.gz: 0ecd430174ea0955ccd201adb58e32358c0c7b27658482f81436349fac8bb472d63666df5d730c129a2f4ef69154951b259d55021e580b9e81f880752cc0e6d5
7
+ data.tar.gz: 7c3da3efae0ecd4dfb1e38629b6d4e5b13c457a3a105c154448ea47cd79179456a30457c40c461f576ab642dc34a833fc03fe4a1bf632d8b5fa81ead445eeec4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fog::Openstack
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/fog-openstack.svg)](http://badge.fury.io/rb/fog-openstack) [![Build Status](https://travis-ci.org/fog/fog-openstack.svg?branch=master)](https://travis-ci.org/fog/fog-openstack) [![Dependency Status](https://gemnasium.com/fog/fog-openstack.svg)](https://gemnasium.com/fog/fog-openstack) [![Coverage Status](https://coveralls.io/repos/github/fog/fog-openstack/badge.svg?branch=master)](https://coveralls.io/github/fog/fog-openstack?branch=master) [![Code Climate](https://codeclimate.com/github/fog/fog-openstack.png)](https://codeclimate.com/github/fog/fog-openstack) [![Join the chat at https://gitter.im/fog/fog-openstack](https://badges.gitter.im/fog/fog-openstack.svg)](https://gitter.im/fog/fog-openstack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3
+ [![Gem Version](https://badge.fury.io/rb/fog-openstack.svg)](http://badge.fury.io/rb/fog-openstack) [![Build Status](https://travis-ci.org/fog/fog-openstack.svg?branch=master)](https://travis-ci.org/fog/fog-openstack) [![Dependency Status](https://gemnasium.com/fog/fog-openstack.svg)](https://gemnasium.com/fog/fog-openstack) [![Coverage Status](https://coveralls.io/repos/github/fog/fog-openstack/badge.svg?branch=master)](https://coveralls.io/github/fog/fog-openstack?branch=master) [![Code Climate](https://codeclimate.com/github/fog/fog-openstack.svg)](https://codeclimate.com/github/fog/fog-openstack) [![Join the chat at https://gitter.im/fog/fog-openstack](https://badges.gitter.im/fog/fog-openstack.svg)](https://gitter.im/fog/fog-openstack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
4
 
5
5
  This is the plugin Gem to talk to [OpenStack](http://openstack.org) clouds via fog.
6
6
 
@@ -23,6 +23,12 @@ module Fog
23
23
  collection :zones
24
24
  model :recordset
25
25
  collection :recordsets
26
+ model :pool
27
+ collection :pools
28
+ model :zone_transfer_request
29
+ collection :zone_transfer_requests
30
+ model :zone_transfer_accept
31
+ collection :zone_transfer_accepts
26
32
 
27
33
  request_path 'fog/dns/openstack/v2/requests'
28
34
 
@@ -38,9 +44,23 @@ module Fog
38
44
  request :update_recordset
39
45
  request :delete_recordset
40
46
 
47
+ request :list_pools
48
+ request :get_pool
49
+
41
50
  request :get_quota
42
51
  request :update_quota
43
52
 
53
+ request :create_zone_transfer_request
54
+ request :get_zone_transfer_request
55
+ request :list_zone_transfer_requests
56
+ request :update_zone_transfer_request
57
+ request :delete_zone_transfer_request
58
+
59
+ request :create_zone_transfer_accept
60
+ request :get_zone_transfer_accept
61
+ request :list_zone_transfer_accepts
62
+
63
+
44
64
  def self.setup_headers(options)
45
65
  # user needs to have admin privileges to ask for all projects
46
66
  all_projects = options.delete(:all_projects) || false
@@ -80,6 +100,52 @@ module Fog
80
100
  "self" => "https://127.0.0.1:9001/v2/zones/a86dba58-0043-4cc6-a1bb-69d5e86f3ca3"
81
101
  }
82
102
  }],
103
+ :pools => {
104
+ "metadata" => {
105
+ "total_count" => 2
106
+ },
107
+ "links" => {
108
+ "self" => "http://127.0.0.1:9001/v2/pools"
109
+ },
110
+ "pools" => [
111
+ {
112
+ "description" => '',
113
+ "id" => "794ccc2c-d751-44fe-b57f-8894c9f5c842",
114
+ "project_id" => '',
115
+ "created_at" => "2015-02-18T22:18:58.000000",
116
+ "attributes" => '',
117
+ "ns_records" => [
118
+ {
119
+ "hostname" => "ns1.example.org.",
120
+ "priority" => 1
121
+ }
122
+ ],
123
+ "links" => {
124
+ "self" => "http://127.0.0.1:9001/v2/pools/794ccc2c-d751-44fe-b57f-8894c9f5c842"
125
+ },
126
+ "name" => "default",
127
+ "updated_at" => "2015-02-19T15:59:44.000000"
128
+ },
129
+ {
130
+ "description" => '',
131
+ "id" => "d1716333-8c16-490f-85ee-29af36907605",
132
+ "project_id" => "noauth-project",
133
+ "created_at" => "2015-02-23T21:56:33.000000",
134
+ "attributes" => '',
135
+ "ns_records" => [
136
+ {
137
+ "hostname" => "ns2.example.org.",
138
+ "priority" => 1
139
+ }
140
+ ],
141
+ "links" => {
142
+ "self" => "http://127.0.0.1:9001/v2/pools/d1716333-8c16-490f-85ee-29af36907605"
143
+ },
144
+ "name" => "example_pool",
145
+ "updated_at" => ''
146
+ }
147
+ ]
148
+ },
83
149
  :quota => {
84
150
  "api_export_size" => 1000,
85
151
  "recordset_records" => 20,
@@ -116,7 +182,77 @@ module Fog
116
182
  "metadata" => {
117
183
  "total_count" => 2
118
184
  }
119
- }
185
+ },
186
+ :zone_transfer_requests => {
187
+ "transfer_requests" => [
188
+ {
189
+ "created_at" => "2014-07-17T20:34:40.882579",
190
+ "description" => "This was created by the requesting project",
191
+ "id" => "f2ad17b5-807a-423f-a991-e06236c247be",
192
+ "key" => "9Z2R50Y0",
193
+ "project_id" => "1",
194
+ "status" => "ACTIVE",
195
+ "target_project_id" => "123456",
196
+ "updated_at" => nil,
197
+ "zone_id" => "6b78734a-aef1-45cd-9708-8eb3c2d26ff8",
198
+ "zone_name" => "qa.dev.example.com.",
199
+ "links" => {
200
+ "self" => "http://127.0.0.1:9001/v2/zones/tasks/transfer_requests/f2ad17b5-807a-423f-a991-e06236c247be"
201
+ }
202
+ },
203
+ {
204
+ "description" => "This is scoped to the requesting project",
205
+ "id" => "efd2d720-b0c4-43d4-99f7-d9b53e08860d",
206
+ "zone_id" => "2c4d5e37-f823-4bee-9859-031cb44f80e7",
207
+ "zone_name" => "subdomain.example.com.",
208
+ "status" => "ACTIVE",
209
+ "links" => {
210
+ "self" => "http://127.0.0.1:9001/v2/zones/tasks/transfer_requests/efd2d720-b0c4-43d4-99f7-d9b53e08860d"
211
+ }
212
+ }
213
+ ],
214
+ "links" => {
215
+ "self" => "http://127.0.0.1:9001/v2/zones/tasks/transfer_requests"
216
+ }
217
+ },
218
+ :zone_transfer_accepts => {
219
+ "metadata" => {
220
+ "total_count" => 2
221
+ },
222
+ "links" => {
223
+ "self" => "http://127.0.0.1:9001/v2/zones/tasks/transfer_accepts"
224
+ },
225
+ "transfer_accepts" => [
226
+ {
227
+ "status" => "COMPLETE",
228
+ "zone_id" => "8db93d1a-59e3-4143-a393-5821abea0a46",
229
+ "links" => {
230
+ "self" => "http://127.0.0.1:9001/v2/zones/tasks/transfer_accepts/afb4222b-18b3-44b3-9f54-e0dfdba1be44",
231
+ "zone" => "http://127.0.0.1:9001/v2/zones/8db93d1a-59e3-4143-a393-5821abea0a46"
232
+ },
233
+ "created_at" => "2016-06-01 05:35:35",
234
+ "updated_at" => "2016-06-01 05:35:35",
235
+ "key" => nil,
236
+ "project_id" => "85604ecfb5334b50bd40ca53fc1d710f",
237
+ "id" => "afb4222b-18b3-44b3-9f54-e0dfdba1be44",
238
+ "zone_transfer_request_id" => "d223f7ef-77a6-459e-abd3-b4dbc97338e7"
239
+ },
240
+ {
241
+ "status" => "COMPLETE",
242
+ "zone_id" => "925bfc45-8901-4aca-aa12-18afaf0879e2",
243
+ "links" => {
244
+ "self" => "http://127.0.0.1:9001/v2/zones/tasks/transfer_accepts/ecbc7091-c498-4ec4-9893-68b06297fe50",
245
+ "zone" => "http://127.0.0.1:9001/v2/zones/925bfc45-8901-4aca-aa12-18afaf0879e2"
246
+ },
247
+ "created_at" => "2016-06-01 10:06:36",
248
+ "updated_at" => "2016-06-01 10:06:37",
249
+ "key" => nil,
250
+ "project_id" => "85604ecfb5334b50bd40ca53fc1d710f",
251
+ "id" => "ecbc7091-c498-4ec4-9893-68b06297fe50",
252
+ "zone_transfer_request_id" => "94cf9bd3-4137-430b-bf75-4e690430258c"
253
+ }
254
+ ]
255
+ }
120
256
  }
121
257
  end
122
258
  end
@@ -0,0 +1,21 @@
1
+ require 'fog/openstack/models/model'
2
+
3
+ module Fog
4
+ module DNS
5
+ class OpenStack
6
+ class V2
7
+ class Pool < Fog::OpenStack::Model
8
+ identity :id
9
+
10
+ attribute :name
11
+ attribute :description
12
+ attribute :ns_records
13
+ attribute :project_id
14
+ attribute :links
15
+ attribute :created_at
16
+ attribute :updated_at
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ require 'fog/openstack/models/collection'
2
+ require 'fog/dns/openstack/v2/models/pool'
3
+
4
+ module Fog
5
+ module DNS
6
+ class OpenStack
7
+ class V2
8
+ class Pools < Fog::OpenStack::Collection
9
+ model Fog::DNS::OpenStack::V2::Pool
10
+
11
+ def all(options = {})
12
+ load_response(service.list_pools(options), 'pools')
13
+ end
14
+
15
+ def find_by_id(id, options = {})
16
+ pool_hash = service.get_pool(id, options).body
17
+ new(pool_hash.merge(:service => service))
18
+ end
19
+
20
+ alias get find_by_id
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,29 @@
1
+ require 'fog/openstack/models/model'
2
+
3
+ module Fog
4
+ module DNS
5
+ class OpenStack
6
+ class V2
7
+ class ZoneTransferAccept < Fog::OpenStack::Model
8
+ identity :id
9
+
10
+ attribute :status
11
+ attribute :project_id
12
+ attribute :zone_id
13
+ attribute :key
14
+ attribute :created_at
15
+ attribute :updated_at
16
+ attribute :zone_transfer_request_id
17
+ attribute :links
18
+
19
+ def save
20
+ unless persisted?
21
+ merge_attributes(service.create_zone_transfer_accept(key, zone_transfer_request_id))
22
+ end
23
+ true
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,25 @@
1
+ require 'fog/openstack/models/collection'
2
+ require 'fog/dns/openstack/v2/models/zone_transfer_accept'
3
+
4
+ module Fog
5
+ module DNS
6
+ class OpenStack
7
+ class V2
8
+ class ZoneTransferAccepts < Fog::OpenStack::Collection
9
+ model Fog::DNS::OpenStack::V2::ZoneTransferAccept
10
+
11
+ def all(options = {})
12
+ load_response(service.list_zone_transfer_accepts(options), 'transfer_accepts')
13
+ end
14
+
15
+ def find_by_id(id)
16
+ zone_transfer_accept_hash = service.get_zone_transfer_accept(id).body
17
+ new(zone_transfer_accept_hash.merge(:service => service))
18
+ end
19
+
20
+ alias get find_by_id
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,50 @@
1
+ require 'fog/openstack/models/model'
2
+
3
+ module Fog
4
+ module DNS
5
+ class OpenStack
6
+ class V2
7
+ class ZoneTransferRequest < Fog::OpenStack::Model
8
+ identity :id
9
+ attribute :project_id
10
+ attribute :description
11
+ attribute :status
12
+ attribute :zone_id
13
+ attribute :zone_name
14
+ attribute :key
15
+ attribute :target_project_id
16
+ attribute :created_at
17
+ attribute :updated_at
18
+ attribute :version
19
+
20
+ def save
21
+ if persisted?
22
+ update(description: description, target_project_id: target_project_id)
23
+ else
24
+ merge_attributes(ervice.create_zone_transfer_request(zone_id, {
25
+ :target_project_id => target_project_id,
26
+ :description => description,
27
+ :project_id => project_id
28
+ }))
29
+ end
30
+ true
31
+ end
32
+
33
+ def update(options = nil)
34
+ requires :id
35
+ merge_attributes(ervice.update_zone_transfer_request(id,options[:description],{
36
+ :target_project_id => options[:target_project_id]
37
+ }))
38
+ self
39
+ end
40
+
41
+ def destroy(options = {})
42
+ requires :id
43
+ service.delete_zone_transfer_request(id)
44
+ true
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,30 @@
1
+ require 'fog/openstack/models/collection'
2
+ require 'fog/dns/openstack/v2/models/zone_transfer_request'
3
+
4
+ module Fog
5
+ module DNS
6
+ class OpenStack
7
+ class V2
8
+ class ZoneTransferRequests < Fog::OpenStack::Collection
9
+ model Fog::DNS::OpenStack::V2::ZoneTransferRequest
10
+
11
+ def all(options = {})
12
+ load_response(service.list_zone_transfer_requests(options), 'transfer_requests')
13
+ end
14
+
15
+ def find_by_id(id)
16
+ zone_transfer_request_hash = service.get_zone_transfer_request(id).body
17
+ new(zone_transfer_request_hash.merge(:service => service))
18
+ end
19
+
20
+ alias get find_by_id
21
+
22
+ def destroy(id)
23
+ zone = find_by_id(id)
24
+ zone.destroy
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ module Fog
2
+ module DNS
3
+ class OpenStack
4
+ class V2
5
+ class Real
6
+ def create_zone_transfer_accept(key, zone_transfer_request_id)
7
+ data = {
8
+ :key => key,
9
+ :zone_transfer_request_id => zone_transfer_request_id
10
+ }
11
+
12
+ request(
13
+ :body => Fog::JSON.encode(data),
14
+ :expects => 200,
15
+ :method => 'POST',
16
+ :path => "zones/tasks/transfer_accepts"
17
+ )
18
+ end
19
+ end
20
+
21
+ class Mock
22
+ def create_zone_transfer_accept(key, zone_transfer_request_id)
23
+ response = Excon::Response.new
24
+ response.status = 200
25
+ response.body = data[:zone_transfer_accepts]["transfer_accepts"].first
26
+ response
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
1
+
2
+ module Fog
3
+ module DNS
4
+ class OpenStack
5
+ class V2
6
+ class Real
7
+ def create_zone_transfer_request(zone_id, options = {})
8
+ vanilla_options = [:target_project_id, :description, :project_id]
9
+ data = vanilla_options.inject({}) do |result,option|
10
+ result[option] = options[option] if options[option]
11
+ result
12
+ end
13
+
14
+ request(
15
+ :body => Fog::JSON.encode(data),
16
+ :expects => 201,
17
+ :method => 'POST',
18
+ :path => "zones/#{zone_id}/tasks/transfer_requests"
19
+ )
20
+ end
21
+ end
22
+
23
+ class Mock
24
+ def create_zone_transfer_request(zone_id, options = {})
25
+ response = Excon::Response.new
26
+ response.status = 201
27
+ response.body = data[:zone_transfer_requests]["transfer_requests"].first
28
+ response
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,26 @@
1
+
2
+ module Fog
3
+ module DNS
4
+ class OpenStack
5
+ class V2
6
+ class Real
7
+ def delete_zone_transfer_request(zone_transfer_request_id)
8
+ request(
9
+ :expects => 204,
10
+ :method => 'DELETE',
11
+ :path => "zones/tasks/transfer_requests/#{zone_transfer_request_id}"
12
+ )
13
+ end
14
+ end
15
+
16
+ class Mock
17
+ def delete_zone_transfer_request(zone_transfer_request_id)
18
+ response = Excon::Response.new
19
+ response.status = 204
20
+ response
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end