fog-openstack 0.1.15 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -1
  3. data/README.md +36 -5
  4. data/docs/common/connection_params.md +45 -0
  5. data/docs/common/resources.md +11 -0
  6. data/docs/compute.md +2 -46
  7. data/docs/getting_started.md +11 -10
  8. data/docs/network.md +2 -47
  9. data/docs/orchestration.md +2 -2
  10. data/docs/planning.md +2 -47
  11. data/docs/shared_file_system.md +82 -0
  12. data/docs/storage.md +5 -51
  13. data/docs/workflow.md +4 -2
  14. data/examples/metric/basics.rb +42 -0
  15. data/examples/shared_file_system/basics.rb +68 -0
  16. data/gemfiles/Gemfile-1.9 +1 -0
  17. data/lib/fog/identity/openstack/v3/requests/list_groups.rb +1 -1
  18. data/lib/fog/image/openstack/v2/models/image.rb +60 -15
  19. data/lib/fog/image/openstack/v2/models/images.rb +1 -4
  20. data/lib/fog/metric/openstack.rb +126 -0
  21. data/lib/fog/metric/openstack/models/metric.rb +18 -0
  22. data/lib/fog/metric/openstack/models/metrics.rb +31 -0
  23. data/lib/fog/metric/openstack/models/resource.rb +16 -0
  24. data/lib/fog/metric/openstack/models/resources.rb +24 -0
  25. data/lib/fog/metric/openstack/requests/get_metric.rb +62 -0
  26. data/lib/fog/metric/openstack/requests/get_metric_measures.rb +38 -0
  27. data/lib/fog/metric/openstack/requests/get_resource.rb +37 -0
  28. data/lib/fog/metric/openstack/requests/get_resource_metric_measures.rb +46 -0
  29. data/lib/fog/metric/openstack/requests/list_metrics.rb +104 -0
  30. data/lib/fog/metric/openstack/requests/list_resources.rb +70 -0
  31. data/lib/fog/network/openstack.rb +12 -9
  32. data/lib/fog/network/openstack/models/rbac_policy.rb +0 -1
  33. data/lib/fog/network/openstack/requests/create_floating_ip.rb +1 -1
  34. data/lib/fog/network/openstack/requests/create_network.rb +3 -3
  35. data/lib/fog/openstack.rb +25 -15
  36. data/lib/fog/openstack/version.rb +1 -1
  37. data/lib/fog/orchestration/openstack/models/stack.rb +5 -1
  38. data/lib/fog/shared_file_system/openstack.rb +278 -0
  39. data/lib/fog/shared_file_system/openstack/models/network.rb +42 -0
  40. data/lib/fog/shared_file_system/openstack/models/networks.rb +28 -0
  41. data/lib/fog/shared_file_system/openstack/models/share.rb +63 -0
  42. data/lib/fog/shared_file_system/openstack/models/shares.rb +28 -0
  43. data/lib/fog/shared_file_system/openstack/models/snapshot.rb +45 -0
  44. data/lib/fog/shared_file_system/openstack/models/snapshots.rb +28 -0
  45. data/lib/fog/shared_file_system/openstack/requests/create_share.rb +49 -0
  46. data/lib/fog/shared_file_system/openstack/requests/create_share_network.rb +41 -0
  47. data/lib/fog/shared_file_system/openstack/requests/create_snapshot.rb +46 -0
  48. data/lib/fog/shared_file_system/openstack/requests/delete_share.rb +29 -0
  49. data/lib/fog/shared_file_system/openstack/requests/delete_share_network.rb +28 -0
  50. data/lib/fog/shared_file_system/openstack/requests/delete_snapshot.rb +30 -0
  51. data/lib/fog/shared_file_system/openstack/requests/get_share.rb +26 -0
  52. data/lib/fog/shared_file_system/openstack/requests/get_share_network.rb +26 -0
  53. data/lib/fog/shared_file_system/openstack/requests/get_snapshot.rb +26 -0
  54. data/lib/fog/shared_file_system/openstack/requests/list_share_networks.rb +25 -0
  55. data/lib/fog/shared_file_system/openstack/requests/list_share_networks_detail.rb +25 -0
  56. data/lib/fog/shared_file_system/openstack/requests/list_shares.rb +25 -0
  57. data/lib/fog/shared_file_system/openstack/requests/list_shares_detail.rb +25 -0
  58. data/lib/fog/shared_file_system/openstack/requests/list_snapshots.rb +25 -0
  59. data/lib/fog/shared_file_system/openstack/requests/list_snapshots_detail.rb +25 -0
  60. data/lib/fog/shared_file_system/openstack/requests/update_share.rb +39 -0
  61. data/lib/fog/shared_file_system/openstack/requests/update_share_network.rb +31 -0
  62. data/lib/fog/shared_file_system/openstack/requests/update_snapshot.rb +31 -0
  63. metadata +43 -2
@@ -0,0 +1,26 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def get_share_network(id)
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => "share-networks/#{id}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def get_share_network(id)
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ share_net = data[:share_network_updated] || data[:share_networks].first
19
+ share_net['id'] = id
20
+ response.body = {'share_network' => share_net}
21
+ response
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def get_snapshot(id)
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => "snapshots/#{id}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def get_snapshot(id)
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ snapshot = data[:snapshot_updated] || data[:snapshots_detail].first
19
+ snapshot['id'] = id
20
+ response.body = snapshot
21
+ response
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def list_share_networks(options = {})
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => 'share_networks',
10
+ :query => options
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def list_share_networks(_options = {})
17
+ response = Excon::Response.new
18
+ response.status = 200
19
+ response.body = {'share_networks' => data[:share_networks]}
20
+ response
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def list_share_networks_detail(options = {})
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => 'share-networks/detail',
10
+ :query => options
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def list_share_networks_detail(_options = {})
17
+ response = Excon::Response.new
18
+ response.status = 200
19
+ response.body = {'share_networks' => data[:share_networks_detail]}
20
+ response
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def list_shares(options = {})
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => 'shares',
10
+ :query => options
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def list_shares(_options = {})
17
+ response = Excon::Response.new
18
+ response.status = 200
19
+ response.body = {'shares' => data[:shares]}
20
+ response
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def list_shares_detail(options = {})
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => 'shares/detail',
10
+ :query => options
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def list_shares_detail(_options = {})
17
+ response = Excon::Response.new
18
+ response.status = 200
19
+ response.body = {'shares' => data[:shares_detail]}
20
+ response
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def list_snapshots(options = {})
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => 'snapshots',
10
+ :query => options
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def list_snapshots(_options = {})
17
+ response = Excon::Response.new
18
+ response.status = 200
19
+ response.body = {'snapshots' => data[:snapshots]}
20
+ response
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def list_snapshots_detail(options = {})
6
+ request(
7
+ :expects => 200,
8
+ :method => 'GET',
9
+ :path => 'snapshots/detail',
10
+ :query => options
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def list_snapshots_detail(_options = {})
17
+ response = Excon::Response.new
18
+ response.status = 200
19
+ response.body = {'snapshots' => data[:snapshots_detail]}
20
+ response
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,39 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def update_share(id, options = {})
6
+ request(
7
+ :body => Fog::JSON.encode('share' => options),
8
+ :expects => 200,
9
+ :method => 'PUT',
10
+ :path => "shares/#{id}"
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def update_share(id, options = {})
17
+ # stringify keys
18
+ options = Hash[options.map { |k, v| [k.to_s, v] }]
19
+
20
+ update_data(id, options)
21
+
22
+ response = Excon::Response.new
23
+ response.status = 200
24
+ response.body = {'share' => data[:share_updated]}
25
+ response
26
+ end
27
+
28
+ private
29
+
30
+ def update_data(id, options)
31
+ data[:share_updated] = data[:shares_detailed].first.merge(options)
32
+ data[:share_updated]['id'] = id
33
+ data[:share_updated]['status'] = "PENDING"
34
+ data[:share_updated]['links']['self'] = "https://127.0.0.1:8786/v2/shares/#{id}"
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,31 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def update_share_network(id, options = {})
6
+ request(
7
+ :body => Fog::JSON.encode('share_network' => options),
8
+ :expects => 200,
9
+ :method => 'PUT',
10
+ :path => "share-networks/#{id}"
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def update_share_network(id, options = {})
17
+ # stringify keys
18
+ options = Hash[options.map { |k, v| [k.to_s, v] }]
19
+
20
+ data[:share_net_updated] = data[:share_networks_detail].first.merge(options)
21
+ data[:share_net_updated]['id'] = id
22
+
23
+ response = Excon::Response.new
24
+ response.status = 200
25
+ response.body = {'share_network' => data[:share_net_updated]}
26
+ response
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ module Fog
2
+ module SharedFileSystem
3
+ class OpenStack
4
+ class Real
5
+ def update_snapshot(id, options = {})
6
+ request(
7
+ :body => Fog::JSON.encode('snapshot' => options),
8
+ :expects => 200,
9
+ :method => 'PUT',
10
+ :path => "snapshots/#{id}"
11
+ )
12
+ end
13
+ end
14
+
15
+ class Mock
16
+ def update_snapshot(id, options = {})
17
+ # stringify keys
18
+ options = Hash[options.map { |k, v| [k.to_s, v] }]
19
+
20
+ data[:snapshot_updated] = data[:snapshots_detail].first.merge(options)
21
+ data[:snapshot_updated]['id'] = id
22
+
23
+ response = Excon::Response.new
24
+ response.status = 200
25
+ response.body = {'snapshot' => data[:snapshot_updated]}
26
+ response
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-10 00:00:00.000000000 Z
11
+ date: 2016-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -215,6 +215,8 @@ files:
215
215
  - Rakefile
216
216
  - bin/console
217
217
  - bin/setup
218
+ - docs/common/connection_params.md
219
+ - docs/common/resources.md
218
220
  - docs/compute.md
219
221
  - docs/getting_started.md
220
222
  - docs/introspection.md
@@ -223,6 +225,7 @@ files:
223
225
  - docs/nfv.md
224
226
  - docs/orchestration.md
225
227
  - docs/planning.md
228
+ - docs/shared_file_system.md
226
229
  - docs/storage.md
227
230
  - docs/workflow.md
228
231
  - examples/compute/basics.rb
@@ -230,10 +233,12 @@ files:
230
233
  - examples/identity/basics.rb
231
234
  - examples/image/upload-test-image.rb
232
235
  - examples/introspection/basics.rb
236
+ - examples/metric/basics.rb
233
237
  - examples/network/network_add_port.rb
234
238
  - examples/network/network_rbac.rb
235
239
  - examples/network/network_subnets_routers.rb
236
240
  - examples/planning/basics.rb
241
+ - examples/shared_file_system/basics.rb
237
242
  - examples/storage/set-account-quota.rb
238
243
  - examples/volume/backups.rb
239
244
  - examples/workflow/workflow-examples.rb
@@ -662,6 +667,17 @@ files:
662
667
  - lib/fog/metering/openstack/requests/list_events.rb
663
668
  - lib/fog/metering/openstack/requests/list_meters.rb
664
669
  - lib/fog/metering/openstack/requests/list_resources.rb
670
+ - lib/fog/metric/openstack.rb
671
+ - lib/fog/metric/openstack/models/metric.rb
672
+ - lib/fog/metric/openstack/models/metrics.rb
673
+ - lib/fog/metric/openstack/models/resource.rb
674
+ - lib/fog/metric/openstack/models/resources.rb
675
+ - lib/fog/metric/openstack/requests/get_metric.rb
676
+ - lib/fog/metric/openstack/requests/get_metric_measures.rb
677
+ - lib/fog/metric/openstack/requests/get_resource.rb
678
+ - lib/fog/metric/openstack/requests/get_resource_metric_measures.rb
679
+ - lib/fog/metric/openstack/requests/list_metrics.rb
680
+ - lib/fog/metric/openstack/requests/list_resources.rb
665
681
  - lib/fog/monitoring/openstack.rb
666
682
  - lib/fog/monitoring/openstack/models/alarm.rb
667
683
  - lib/fog/monitoring/openstack/models/alarm_count.rb
@@ -904,6 +920,31 @@ files:
904
920
  - lib/fog/planning/openstack/requests/list_roles.rb
905
921
  - lib/fog/planning/openstack/requests/patch_plan.rb
906
922
  - lib/fog/planning/openstack/requests/remove_role_from_plan.rb
923
+ - lib/fog/shared_file_system/openstack.rb
924
+ - lib/fog/shared_file_system/openstack/models/network.rb
925
+ - lib/fog/shared_file_system/openstack/models/networks.rb
926
+ - lib/fog/shared_file_system/openstack/models/share.rb
927
+ - lib/fog/shared_file_system/openstack/models/shares.rb
928
+ - lib/fog/shared_file_system/openstack/models/snapshot.rb
929
+ - lib/fog/shared_file_system/openstack/models/snapshots.rb
930
+ - lib/fog/shared_file_system/openstack/requests/create_share.rb
931
+ - lib/fog/shared_file_system/openstack/requests/create_share_network.rb
932
+ - lib/fog/shared_file_system/openstack/requests/create_snapshot.rb
933
+ - lib/fog/shared_file_system/openstack/requests/delete_share.rb
934
+ - lib/fog/shared_file_system/openstack/requests/delete_share_network.rb
935
+ - lib/fog/shared_file_system/openstack/requests/delete_snapshot.rb
936
+ - lib/fog/shared_file_system/openstack/requests/get_share.rb
937
+ - lib/fog/shared_file_system/openstack/requests/get_share_network.rb
938
+ - lib/fog/shared_file_system/openstack/requests/get_snapshot.rb
939
+ - lib/fog/shared_file_system/openstack/requests/list_share_networks.rb
940
+ - lib/fog/shared_file_system/openstack/requests/list_share_networks_detail.rb
941
+ - lib/fog/shared_file_system/openstack/requests/list_shares.rb
942
+ - lib/fog/shared_file_system/openstack/requests/list_shares_detail.rb
943
+ - lib/fog/shared_file_system/openstack/requests/list_snapshots.rb
944
+ - lib/fog/shared_file_system/openstack/requests/list_snapshots_detail.rb
945
+ - lib/fog/shared_file_system/openstack/requests/update_share.rb
946
+ - lib/fog/shared_file_system/openstack/requests/update_share_network.rb
947
+ - lib/fog/shared_file_system/openstack/requests/update_snapshot.rb
907
948
  - lib/fog/storage/openstack.rb
908
949
  - lib/fog/storage/openstack/models/directories.rb
909
950
  - lib/fog/storage/openstack/models/directory.rb