fog-openstack 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -28
  3. data/docs/workflow.md +129 -0
  4. data/examples/workflow/workflow-examples.rb +387 -0
  5. data/gemfiles/Gemfile-1.9 +1 -0
  6. data/lib/fog/openstack.rb +5 -1
  7. data/lib/fog/openstack/baremetal.rb +14 -38
  8. data/lib/fog/openstack/compute.rb +4 -33
  9. data/lib/fog/openstack/core.rb +104 -50
  10. data/lib/fog/openstack/identity.rb +2 -1
  11. data/lib/fog/openstack/identity_v2.rb +0 -2
  12. data/lib/fog/openstack/identity_v3.rb +0 -2
  13. data/lib/fog/openstack/image_v1.rb +6 -6
  14. data/lib/fog/openstack/image_v2.rb +7 -6
  15. data/lib/fog/openstack/introspection.rb +10 -35
  16. data/lib/fog/openstack/metering.rb +16 -35
  17. data/lib/fog/openstack/monitoring.rb +5 -31
  18. data/lib/fog/openstack/network.rb +5 -34
  19. data/lib/fog/openstack/nfv.rb +10 -35
  20. data/lib/fog/openstack/orchestration.rb +5 -40
  21. data/lib/fog/openstack/planning.rb +11 -36
  22. data/lib/fog/openstack/requests/compute/get_limits.rb +8 -7
  23. data/lib/fog/openstack/requests/network/update_router.rb +1 -1
  24. data/lib/fog/openstack/requests/workflow_v2/create_action.rb +28 -0
  25. data/lib/fog/openstack/requests/workflow_v2/create_action_execution.rb +31 -0
  26. data/lib/fog/openstack/requests/workflow_v2/create_cron_trigger.rb +55 -0
  27. data/lib/fog/openstack/requests/workflow_v2/create_environment.rb +31 -0
  28. data/lib/fog/openstack/requests/workflow_v2/create_execution.rb +30 -0
  29. data/lib/fog/openstack/requests/workflow_v2/create_workbook.rb +28 -0
  30. data/lib/fog/openstack/requests/workflow_v2/create_workflow.rb +28 -0
  31. data/lib/fog/openstack/requests/workflow_v2/delete_action.rb +25 -0
  32. data/lib/fog/openstack/requests/workflow_v2/delete_action_execution.rb +25 -0
  33. data/lib/fog/openstack/requests/workflow_v2/delete_cron_trigger.rb +25 -0
  34. data/lib/fog/openstack/requests/workflow_v2/delete_environment.rb +25 -0
  35. data/lib/fog/openstack/requests/workflow_v2/delete_execution.rb +25 -0
  36. data/lib/fog/openstack/requests/workflow_v2/delete_workbook.rb +25 -0
  37. data/lib/fog/openstack/requests/workflow_v2/delete_workflow.rb +25 -0
  38. data/lib/fog/openstack/requests/workflow_v2/get_action.rb +27 -0
  39. data/lib/fog/openstack/requests/workflow_v2/get_action_execution.rb +26 -0
  40. data/lib/fog/openstack/requests/workflow_v2/get_cron_trigger.rb +28 -0
  41. data/lib/fog/openstack/requests/workflow_v2/get_environment.rb +28 -0
  42. data/lib/fog/openstack/requests/workflow_v2/get_execution.rb +26 -0
  43. data/lib/fog/openstack/requests/workflow_v2/get_task.rb +27 -0
  44. data/lib/fog/openstack/requests/workflow_v2/get_workbook.rb +28 -0
  45. data/lib/fog/openstack/requests/workflow_v2/get_workflow.rb +28 -0
  46. data/lib/fog/openstack/requests/workflow_v2/list_action_executions.rb +28 -0
  47. data/lib/fog/openstack/requests/workflow_v2/list_actions.rb +30 -0
  48. data/lib/fog/openstack/requests/workflow_v2/list_cron_triggers.rb +28 -0
  49. data/lib/fog/openstack/requests/workflow_v2/list_environments.rb +28 -0
  50. data/lib/fog/openstack/requests/workflow_v2/list_executions.rb +28 -0
  51. data/lib/fog/openstack/requests/workflow_v2/list_services.rb +28 -0
  52. data/lib/fog/openstack/requests/workflow_v2/list_tasks.rb +28 -0
  53. data/lib/fog/openstack/requests/workflow_v2/list_workbooks.rb +28 -0
  54. data/lib/fog/openstack/requests/workflow_v2/list_workflows.rb +30 -0
  55. data/lib/fog/openstack/requests/workflow_v2/rerun_task.rb +33 -0
  56. data/lib/fog/openstack/requests/workflow_v2/update_action.rb +28 -0
  57. data/lib/fog/openstack/requests/workflow_v2/update_action_execution.rb +33 -0
  58. data/lib/fog/openstack/requests/workflow_v2/update_environment.rb +31 -0
  59. data/lib/fog/openstack/requests/workflow_v2/update_execution.rb +33 -0
  60. data/lib/fog/openstack/requests/workflow_v2/update_workbook.rb +28 -0
  61. data/lib/fog/openstack/requests/workflow_v2/update_workflow.rb +28 -0
  62. data/lib/fog/openstack/requests/workflow_v2/validate_action.rb +28 -0
  63. data/lib/fog/openstack/requests/workflow_v2/validate_workbook.rb +28 -0
  64. data/lib/fog/openstack/requests/workflow_v2/validate_workflow.rb +28 -0
  65. data/lib/fog/openstack/storage.rb +4 -35
  66. data/lib/fog/openstack/version.rb +1 -1
  67. data/lib/fog/openstack/volume_v1.rb +7 -5
  68. data/lib/fog/openstack/volume_v2.rb +7 -5
  69. data/lib/fog/openstack/workflow.rb +12 -0
  70. data/lib/fog/openstack/workflow_v2.rb +160 -0
  71. metadata +48 -95
  72. data/lib/fog/openstack/common.rb +0 -44
  73. data/tests/openstack/models/compute/images_tests.rb +0 -13
  74. data/tests/openstack/models/compute/security_group_tests.rb +0 -54
  75. data/tests/openstack/models/compute/server_tests.rb +0 -220
  76. data/tests/openstack/models/compute/service_tests.rb +0 -17
  77. data/tests/openstack/models/image/image_tests.rb +0 -36
  78. data/tests/openstack/models/image/images_tests.rb +0 -19
  79. data/tests/openstack/models/network/floating_ip_tests.rb +0 -35
  80. data/tests/openstack/models/network/floating_ips_tests.rb +0 -19
  81. data/tests/openstack/models/network/ike_policies_tests.rb +0 -28
  82. data/tests/openstack/models/network/ike_policy_tests.rb +0 -36
  83. data/tests/openstack/models/network/ipsec_policies_tests.rb +0 -26
  84. data/tests/openstack/models/network/ipsec_policy_tests.rb +0 -36
  85. data/tests/openstack/models/network/ipsec_site_connection_tests.rb +0 -50
  86. data/tests/openstack/models/network/ipsec_site_connections_tests.rb +0 -32
  87. data/tests/openstack/models/network/lb_health_monitor_tests.rb +0 -52
  88. data/tests/openstack/models/network/lb_health_monitors_tests.rb +0 -21
  89. data/tests/openstack/models/network/lb_member_tests.rb +0 -28
  90. data/tests/openstack/models/network/lb_members_tests.rb +0 -21
  91. data/tests/openstack/models/network/lb_pool_tests.rb +0 -53
  92. data/tests/openstack/models/network/lb_pools_tests.rb +0 -20
  93. data/tests/openstack/models/network/lb_vip_tests.rb +0 -39
  94. data/tests/openstack/models/network/lb_vips_tests.rb +0 -21
  95. data/tests/openstack/models/network/network_tests.rb +0 -61
  96. data/tests/openstack/models/network/networks_tests.rb +0 -21
  97. data/tests/openstack/models/network/port_tests.rb +0 -28
  98. data/tests/openstack/models/network/ports_tests.rb +0 -25
  99. data/tests/openstack/models/network/router_tests.rb +0 -39
  100. data/tests/openstack/models/network/routers_tests.rb +0 -21
  101. data/tests/openstack/models/network/security_group_rule_tests.rb +0 -27
  102. data/tests/openstack/models/network/security_group_rules_tests.rb +0 -25
  103. data/tests/openstack/models/network/security_group_tests.rb +0 -17
  104. data/tests/openstack/models/network/security_groups_tests.rb +0 -16
  105. data/tests/openstack/models/network/subnet_tests.rb +0 -30
  106. data/tests/openstack/models/network/subnets_tests.rb +0 -27
  107. data/tests/openstack/models/network/vpn_service_tests.rb +0 -27
  108. data/tests/openstack/models/network/vpn_services_tests.rb +0 -22
  109. data/tests/openstack/models/nfv/vnf_tests.rb +0 -35
  110. data/tests/openstack/models/nfv/vnfd_tests.rb +0 -23
  111. data/tests/openstack/models/nfv/vnfds_tests.rb +0 -31
  112. data/tests/openstack/models/nfv/vnfs_tests.rb +0 -38
  113. data/tests/openstack/models/planning/.gitkeep +0 -0
  114. data/tests/openstack/models/planning/plan_tests.rb +0 -51
  115. data/tests/openstack/models/planning/plans_tests.rb +0 -18
  116. data/tests/openstack/models/planning/role_tests.rb +0 -14
  117. data/tests/openstack/models/storage/file_tests.rb +0 -251
  118. data/tests/openstack/requests/compute/address_tests.rb +0 -58
  119. data/tests/openstack/requests/compute/aggregate_tests.rb +0 -59
  120. data/tests/openstack/requests/compute/availability_zone_tests.rb +0 -18
  121. data/tests/openstack/requests/compute/flavor_tests.rb +0 -95
  122. data/tests/openstack/requests/compute/helper.rb +0 -41
  123. data/tests/openstack/requests/compute/image_tests.rb +0 -58
  124. data/tests/openstack/requests/compute/keypair_tests.rb +0 -30
  125. data/tests/openstack/requests/compute/limit_tests.rb +0 -59
  126. data/tests/openstack/requests/compute/quota_tests.rb +0 -60
  127. data/tests/openstack/requests/compute/security_group_tests.rb +0 -61
  128. data/tests/openstack/requests/compute/server_tests.rb +0 -289
  129. data/tests/openstack/requests/compute/service_tests.rb +0 -33
  130. data/tests/openstack/requests/compute/tenant_tests.rb +0 -19
  131. data/tests/openstack/requests/compute/volume_tests.rb +0 -38
  132. data/tests/openstack/requests/image/image_tests.rb +0 -135
  133. data/tests/openstack/requests/metering/event_tests.rb +0 -17
  134. data/tests/openstack/requests/metering/meter_tests.rb +0 -52
  135. data/tests/openstack/requests/metering/resource_tests.rb +0 -19
  136. data/tests/openstack/requests/network/ike_policy_tests.rb +0 -65
  137. data/tests/openstack/requests/network/ipsec_policy_tests.rb +0 -65
  138. data/tests/openstack/requests/network/ipsec_site_connection_tests.rb +0 -82
  139. data/tests/openstack/requests/network/lb_health_monitor_tests.rb +0 -93
  140. data/tests/openstack/requests/network/lb_member_tests.rb +0 -60
  141. data/tests/openstack/requests/network/lb_pool_tests.rb +0 -80
  142. data/tests/openstack/requests/network/lb_vip_tests.rb +0 -71
  143. data/tests/openstack/requests/network/network_tests.rb +0 -107
  144. data/tests/openstack/requests/network/port_tests.rb +0 -66
  145. data/tests/openstack/requests/network/quota_tests.rb +0 -65
  146. data/tests/openstack/requests/network/router_tests.rb +0 -73
  147. data/tests/openstack/requests/network/security_group_rule_tests.rb +0 -58
  148. data/tests/openstack/requests/network/security_group_tests.rb +0 -43
  149. data/tests/openstack/requests/network/subnet_tests.rb +0 -66
  150. data/tests/openstack/requests/network/vpn_service_tests.rb +0 -61
  151. data/tests/openstack/requests/nfv/vnf_tests.rb +0 -70
  152. data/tests/openstack/requests/nfv/vnfd_tests.rb +0 -44
  153. data/tests/openstack/requests/orchestration/stack_tests.rb +0 -64
  154. data/tests/openstack/requests/planning/.gitkeep +0 -0
  155. data/tests/openstack/requests/planning/plan_tests.rb +0 -65
  156. data/tests/openstack/requests/planning/role_tests.rb +0 -16
  157. data/tests/openstack/requests/storage/container_tests.rb +0 -64
  158. data/tests/openstack/requests/storage/large_object_tests.rb +0 -372
  159. data/tests/openstack/requests/storage/object_tests.rb +0 -208
  160. data/tests/openstack/requests/volume/availability_zone_tests.rb +0 -13
  161. data/tests/openstack/requests/volume/quota_tests.rb +0 -50
  162. data/tests/openstack/requests/volume/volume_type_tests.rb +0 -32
@@ -0,0 +1,12 @@
1
+ module Fog
2
+ module Workflow
3
+ class OpenStack < Fog::Service
4
+ # Fog::Workflow::OpenStack.new() will return a Fog::Workflow::OpenStack::V2
5
+ # Will choose the latest available once Mistral V3 is released.
6
+ def self.new(args = {})
7
+ @openstack_auth_uri = URI.parse(args[:openstack_auth_url]) if args[:openstack_auth_url]
8
+ Fog::Workflow::OpenStack::V2.new(args)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,160 @@
1
+ require 'fog/openstack/workflow'
2
+
3
+ module Fog
4
+ module Workflow
5
+ class OpenStack
6
+ class V2 < Fog::Service
7
+ SUPPORTED_VERSIONS = /v2/
8
+
9
+ requires :openstack_auth_url
10
+ recognizes :openstack_username, :openstack_api_key,
11
+ :openstack_project_name, :openstack_domain_id
12
+
13
+ ## REQUESTS
14
+ #
15
+ request_path 'fog/openstack/requests/workflow_v2'
16
+
17
+ # Workflow requests
18
+ request :create_execution
19
+ request :get_execution
20
+ request :list_executions
21
+ request :update_execution
22
+ request :delete_execution
23
+
24
+ request :create_action_execution
25
+ request :get_action_execution
26
+ request :list_action_executions
27
+ request :update_action_execution
28
+ request :delete_action_execution
29
+
30
+ request :create_workbook
31
+ request :get_workbook
32
+ request :list_workbooks
33
+ request :update_workbook
34
+ request :validate_workbook
35
+ request :delete_workbook
36
+
37
+ request :create_workflow
38
+ request :get_workflow
39
+ request :list_workflows
40
+ request :update_workflow
41
+ request :validate_workflow
42
+ request :delete_workflow
43
+
44
+ request :create_action
45
+ request :get_action
46
+ request :list_actions
47
+ request :update_action
48
+ request :validate_action
49
+ request :delete_action
50
+
51
+ request :get_task
52
+ request :list_tasks
53
+ request :rerun_task
54
+
55
+ request :create_cron_trigger
56
+ request :get_cron_trigger
57
+ request :list_cron_triggers
58
+ request :delete_cron_trigger
59
+
60
+ request :create_environment
61
+ request :get_environment
62
+ request :list_environments
63
+ request :update_environment
64
+ request :delete_environment
65
+
66
+ request :list_services
67
+
68
+ class Mock
69
+ def self.data
70
+ @data ||= Hash.new do |hash, key|
71
+ hash[key] = {
72
+ :workflows => {}
73
+ }
74
+ end
75
+ end
76
+
77
+ def self.reset
78
+ @data = nil
79
+ end
80
+
81
+ include Fog::OpenStack::Core
82
+
83
+ def initialize(options = {})
84
+ @auth_token = Fog::Mock.random_base64(64)
85
+ @auth_token_expiration = (Time.now.utc + 86_400).iso8601
86
+
87
+ initialize_identity options
88
+ end
89
+
90
+ def data
91
+ self.class.data[@openstack_username]
92
+ end
93
+
94
+ def reset_data
95
+ self.class.data.delete(@openstack_username)
96
+ end
97
+ end
98
+
99
+ class Real
100
+ include Fog::OpenStack::Core
101
+
102
+ def initialize(options = {})
103
+ initialize_identity options
104
+
105
+ @openstack_service_type = options[:openstack_service_type] || ['workflowv2']
106
+ @openstack_service_name = options[:openstack_service_name]
107
+
108
+ @connection_options = options[:connection_options] || {}
109
+
110
+ authenticate
111
+
112
+ unless @path.match(SUPPORTED_VERSIONS)
113
+ @path = "/" + Fog::OpenStack.get_supported_version(
114
+ SUPPORTED_VERSIONS,
115
+ @openstack_management_uri,
116
+ @auth_token,
117
+ @connection_options
118
+ )
119
+ end
120
+
121
+ @persistent = options[:persistent] || false
122
+ @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
123
+ end
124
+
125
+ def request(params)
126
+ response = @connection.request(
127
+ params.merge(
128
+ :headers => {
129
+ 'Content-Type' => 'application/json',
130
+ 'X-Auth-Token' => @auth_token
131
+ }.merge!(params[:headers] || {}),
132
+ :path => "#{@path}/#{params[:path]}"
133
+ )
134
+ )
135
+ rescue Excon::Errors::Unauthorized => error
136
+ if error.response.body != "Bad username or password" # token expiration
137
+ @openstack_must_reauthenticate = true
138
+ authenticate
139
+ retry
140
+ else # bad credentials
141
+ raise error
142
+ end
143
+ rescue Excon::Errors::HTTPStatusError => error
144
+ raise case error
145
+ when Excon::Errors::NotFound
146
+ Fog::Workflow::OpenStack::NotFound.slurp(error)
147
+ else
148
+ error
149
+ end
150
+ else
151
+ unless response.body.empty?
152
+ response.body = Fog::JSON.decode(response.body)
153
+ end
154
+ response
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
160
+ 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.7
4
+ version: 0.1.8
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-06-27 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -223,6 +223,7 @@ files:
223
223
  - docs/orchestration.md
224
224
  - docs/planning.md
225
225
  - docs/storage.md
226
+ - docs/workflow.md
226
227
  - examples/compute/basics.rb
227
228
  - examples/compute/block_device_mapping_v2.rb
228
229
  - examples/identity/basics.rb
@@ -233,11 +234,11 @@ files:
233
234
  - examples/network/network_subnets_routers.rb
234
235
  - examples/planning/basics.rb
235
236
  - examples/storage/set-account-quota.rb
237
+ - examples/workflow/workflow-examples.rb
236
238
  - fog-openstack.gemspec
237
239
  - gemfiles/Gemfile-1.9
238
240
  - lib/fog/openstack.rb
239
241
  - lib/fog/openstack/baremetal.rb
240
- - lib/fog/openstack/common.rb
241
242
  - lib/fog/openstack/compute.rb
242
243
  - lib/fog/openstack/core.rb
243
244
  - lib/fog/openstack/errors.rb
@@ -1026,11 +1027,54 @@ files:
1026
1027
  - lib/fog/openstack/requests/volume_v2/update_snapshot_metadata.rb
1027
1028
  - lib/fog/openstack/requests/volume_v2/update_volume.rb
1028
1029
  - lib/fog/openstack/requests/volume_v2/update_volume_type.rb
1030
+ - lib/fog/openstack/requests/workflow_v2/create_action.rb
1031
+ - lib/fog/openstack/requests/workflow_v2/create_action_execution.rb
1032
+ - lib/fog/openstack/requests/workflow_v2/create_cron_trigger.rb
1033
+ - lib/fog/openstack/requests/workflow_v2/create_environment.rb
1034
+ - lib/fog/openstack/requests/workflow_v2/create_execution.rb
1035
+ - lib/fog/openstack/requests/workflow_v2/create_workbook.rb
1036
+ - lib/fog/openstack/requests/workflow_v2/create_workflow.rb
1037
+ - lib/fog/openstack/requests/workflow_v2/delete_action.rb
1038
+ - lib/fog/openstack/requests/workflow_v2/delete_action_execution.rb
1039
+ - lib/fog/openstack/requests/workflow_v2/delete_cron_trigger.rb
1040
+ - lib/fog/openstack/requests/workflow_v2/delete_environment.rb
1041
+ - lib/fog/openstack/requests/workflow_v2/delete_execution.rb
1042
+ - lib/fog/openstack/requests/workflow_v2/delete_workbook.rb
1043
+ - lib/fog/openstack/requests/workflow_v2/delete_workflow.rb
1044
+ - lib/fog/openstack/requests/workflow_v2/get_action.rb
1045
+ - lib/fog/openstack/requests/workflow_v2/get_action_execution.rb
1046
+ - lib/fog/openstack/requests/workflow_v2/get_cron_trigger.rb
1047
+ - lib/fog/openstack/requests/workflow_v2/get_environment.rb
1048
+ - lib/fog/openstack/requests/workflow_v2/get_execution.rb
1049
+ - lib/fog/openstack/requests/workflow_v2/get_task.rb
1050
+ - lib/fog/openstack/requests/workflow_v2/get_workbook.rb
1051
+ - lib/fog/openstack/requests/workflow_v2/get_workflow.rb
1052
+ - lib/fog/openstack/requests/workflow_v2/list_action_executions.rb
1053
+ - lib/fog/openstack/requests/workflow_v2/list_actions.rb
1054
+ - lib/fog/openstack/requests/workflow_v2/list_cron_triggers.rb
1055
+ - lib/fog/openstack/requests/workflow_v2/list_environments.rb
1056
+ - lib/fog/openstack/requests/workflow_v2/list_executions.rb
1057
+ - lib/fog/openstack/requests/workflow_v2/list_services.rb
1058
+ - lib/fog/openstack/requests/workflow_v2/list_tasks.rb
1059
+ - lib/fog/openstack/requests/workflow_v2/list_workbooks.rb
1060
+ - lib/fog/openstack/requests/workflow_v2/list_workflows.rb
1061
+ - lib/fog/openstack/requests/workflow_v2/rerun_task.rb
1062
+ - lib/fog/openstack/requests/workflow_v2/update_action.rb
1063
+ - lib/fog/openstack/requests/workflow_v2/update_action_execution.rb
1064
+ - lib/fog/openstack/requests/workflow_v2/update_environment.rb
1065
+ - lib/fog/openstack/requests/workflow_v2/update_execution.rb
1066
+ - lib/fog/openstack/requests/workflow_v2/update_workbook.rb
1067
+ - lib/fog/openstack/requests/workflow_v2/update_workflow.rb
1068
+ - lib/fog/openstack/requests/workflow_v2/validate_action.rb
1069
+ - lib/fog/openstack/requests/workflow_v2/validate_workbook.rb
1070
+ - lib/fog/openstack/requests/workflow_v2/validate_workflow.rb
1029
1071
  - lib/fog/openstack/storage.rb
1030
1072
  - lib/fog/openstack/version.rb
1031
1073
  - lib/fog/openstack/volume.rb
1032
1074
  - lib/fog/openstack/volume_v1.rb
1033
1075
  - lib/fog/openstack/volume_v2.rb
1076
+ - lib/fog/openstack/workflow.rb
1077
+ - lib/fog/openstack/workflow_v2.rb
1034
1078
  - supported.md
1035
1079
  - tests/fixtures/introspection.yaml
1036
1080
  - tests/helper.rb
@@ -1045,96 +1089,6 @@ files:
1045
1089
  - tests/helpers/responds_to_helper.rb
1046
1090
  - tests/helpers/schema_validator_tests.rb
1047
1091
  - tests/helpers/succeeds_helper.rb
1048
- - tests/openstack/models/compute/images_tests.rb
1049
- - tests/openstack/models/compute/security_group_tests.rb
1050
- - tests/openstack/models/compute/server_tests.rb
1051
- - tests/openstack/models/compute/service_tests.rb
1052
- - tests/openstack/models/image/image_tests.rb
1053
- - tests/openstack/models/image/images_tests.rb
1054
- - tests/openstack/models/network/floating_ip_tests.rb
1055
- - tests/openstack/models/network/floating_ips_tests.rb
1056
- - tests/openstack/models/network/ike_policies_tests.rb
1057
- - tests/openstack/models/network/ike_policy_tests.rb
1058
- - tests/openstack/models/network/ipsec_policies_tests.rb
1059
- - tests/openstack/models/network/ipsec_policy_tests.rb
1060
- - tests/openstack/models/network/ipsec_site_connection_tests.rb
1061
- - tests/openstack/models/network/ipsec_site_connections_tests.rb
1062
- - tests/openstack/models/network/lb_health_monitor_tests.rb
1063
- - tests/openstack/models/network/lb_health_monitors_tests.rb
1064
- - tests/openstack/models/network/lb_member_tests.rb
1065
- - tests/openstack/models/network/lb_members_tests.rb
1066
- - tests/openstack/models/network/lb_pool_tests.rb
1067
- - tests/openstack/models/network/lb_pools_tests.rb
1068
- - tests/openstack/models/network/lb_vip_tests.rb
1069
- - tests/openstack/models/network/lb_vips_tests.rb
1070
- - tests/openstack/models/network/network_tests.rb
1071
- - tests/openstack/models/network/networks_tests.rb
1072
- - tests/openstack/models/network/port_tests.rb
1073
- - tests/openstack/models/network/ports_tests.rb
1074
- - tests/openstack/models/network/router_tests.rb
1075
- - tests/openstack/models/network/routers_tests.rb
1076
- - tests/openstack/models/network/security_group_rule_tests.rb
1077
- - tests/openstack/models/network/security_group_rules_tests.rb
1078
- - tests/openstack/models/network/security_group_tests.rb
1079
- - tests/openstack/models/network/security_groups_tests.rb
1080
- - tests/openstack/models/network/subnet_tests.rb
1081
- - tests/openstack/models/network/subnets_tests.rb
1082
- - tests/openstack/models/network/vpn_service_tests.rb
1083
- - tests/openstack/models/network/vpn_services_tests.rb
1084
- - tests/openstack/models/nfv/vnf_tests.rb
1085
- - tests/openstack/models/nfv/vnfd_tests.rb
1086
- - tests/openstack/models/nfv/vnfds_tests.rb
1087
- - tests/openstack/models/nfv/vnfs_tests.rb
1088
- - tests/openstack/models/planning/.gitkeep
1089
- - tests/openstack/models/planning/plan_tests.rb
1090
- - tests/openstack/models/planning/plans_tests.rb
1091
- - tests/openstack/models/planning/role_tests.rb
1092
- - tests/openstack/models/storage/file_tests.rb
1093
- - tests/openstack/requests/compute/address_tests.rb
1094
- - tests/openstack/requests/compute/aggregate_tests.rb
1095
- - tests/openstack/requests/compute/availability_zone_tests.rb
1096
- - tests/openstack/requests/compute/flavor_tests.rb
1097
- - tests/openstack/requests/compute/helper.rb
1098
- - tests/openstack/requests/compute/image_tests.rb
1099
- - tests/openstack/requests/compute/keypair_tests.rb
1100
- - tests/openstack/requests/compute/limit_tests.rb
1101
- - tests/openstack/requests/compute/quota_tests.rb
1102
- - tests/openstack/requests/compute/security_group_tests.rb
1103
- - tests/openstack/requests/compute/server_tests.rb
1104
- - tests/openstack/requests/compute/service_tests.rb
1105
- - tests/openstack/requests/compute/tenant_tests.rb
1106
- - tests/openstack/requests/compute/volume_tests.rb
1107
- - tests/openstack/requests/image/image_tests.rb
1108
- - tests/openstack/requests/metering/event_tests.rb
1109
- - tests/openstack/requests/metering/meter_tests.rb
1110
- - tests/openstack/requests/metering/resource_tests.rb
1111
- - tests/openstack/requests/network/ike_policy_tests.rb
1112
- - tests/openstack/requests/network/ipsec_policy_tests.rb
1113
- - tests/openstack/requests/network/ipsec_site_connection_tests.rb
1114
- - tests/openstack/requests/network/lb_health_monitor_tests.rb
1115
- - tests/openstack/requests/network/lb_member_tests.rb
1116
- - tests/openstack/requests/network/lb_pool_tests.rb
1117
- - tests/openstack/requests/network/lb_vip_tests.rb
1118
- - tests/openstack/requests/network/network_tests.rb
1119
- - tests/openstack/requests/network/port_tests.rb
1120
- - tests/openstack/requests/network/quota_tests.rb
1121
- - tests/openstack/requests/network/router_tests.rb
1122
- - tests/openstack/requests/network/security_group_rule_tests.rb
1123
- - tests/openstack/requests/network/security_group_tests.rb
1124
- - tests/openstack/requests/network/subnet_tests.rb
1125
- - tests/openstack/requests/network/vpn_service_tests.rb
1126
- - tests/openstack/requests/nfv/vnf_tests.rb
1127
- - tests/openstack/requests/nfv/vnfd_tests.rb
1128
- - tests/openstack/requests/orchestration/stack_tests.rb
1129
- - tests/openstack/requests/planning/.gitkeep
1130
- - tests/openstack/requests/planning/plan_tests.rb
1131
- - tests/openstack/requests/planning/role_tests.rb
1132
- - tests/openstack/requests/storage/container_tests.rb
1133
- - tests/openstack/requests/storage/large_object_tests.rb
1134
- - tests/openstack/requests/storage/object_tests.rb
1135
- - tests/openstack/requests/volume/availability_zone_tests.rb
1136
- - tests/openstack/requests/volume/quota_tests.rb
1137
- - tests/openstack/requests/volume/volume_type_tests.rb
1138
1092
  homepage: https://github.com/fog/fog-openstack
1139
1093
  licenses:
1140
1094
  - MIT
@@ -1155,9 +1109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1155
1109
  version: '0'
1156
1110
  requirements: []
1157
1111
  rubyforge_project:
1158
- rubygems_version: 2.4.8
1112
+ rubygems_version: 2.5.1
1159
1113
  signing_key:
1160
1114
  specification_version: 4
1161
1115
  summary: OpenStack fog provider gem
1162
1116
  test_files: []
1163
- has_rdoc:
@@ -1,44 +0,0 @@
1
- module Fog
2
- module OpenStack
3
- module Common
4
- attr_reader :unscoped_token
5
-
6
- include Fog::OpenStack::Core
7
-
8
- def request(params)
9
- retried = false
10
- begin
11
- std_headers = {
12
- 'Content-Type' => 'application/json',
13
- 'Accept' => 'application/json',
14
- 'X-Auth-Token' => @auth_token
15
- }
16
- param_headers = params.fetch(:headers, {})
17
-
18
- response = @connection.request(params.merge({
19
- :headers => std_headers.merge(param_headers),
20
- :path => "#{@path}/#{params[:path]}"
21
- }))
22
- rescue Excon::Errors::Unauthorized => error
23
- raise if retried
24
- retried = true
25
-
26
- @openstack_must_reauthenticate = true
27
- authenticate
28
- retry
29
- rescue Excon::Errors::HTTPStatusError => error
30
- raise case error
31
- when Excon::Errors::NotFound
32
- self.class.not_found_class.slurp(error)
33
- else
34
- error
35
- end
36
- end
37
- unless response.body.empty?
38
- response.body = Fog::JSON.decode(response.body) unless params[:raw_body]
39
- end
40
- response
41
- end
42
- end
43
- end
44
- end
@@ -1,13 +0,0 @@
1
- Shindo.tests("Fog::Compute[:openstack] | images collection", ['openstack']) do
2
-
3
- tests('success') do
4
-
5
- tests('#all').succeeds do
6
- fog = Fog::Compute[:openstack]
7
- test 'not nil' do
8
- fog.images.all.is_a? Array
9
- end
10
- end
11
-
12
- end
13
- end
@@ -1,54 +0,0 @@
1
- Shindo.tests("Fog::Compute[:openstack] | security_group", ['openstack']) do
2
- tests('success') do
3
- begin
4
- fog = Fog::Compute[:openstack]
5
-
6
- security_group = fog.security_groups.create(
7
- :name => 'my_group',
8
- :description => 'my group'
9
- )
10
-
11
- tests('#create').succeeds do
12
- security_group = fog.security_groups.create(
13
- :name => 'my_group',
14
- :description => 'my group'
15
- )
16
-
17
- returns('my_group') { security_group.name }
18
- returns('my group') { security_group.description }
19
- returns([]) { security_group.security_group_rules }
20
- returns(true, "Tenant Id is not nil") { security_group.tenant_id != nil }
21
- end
22
-
23
- tests('#rules').succeeds do
24
- tests("#create").succeeds do
25
- rules_count = security_group.security_group_rules.count
26
- rule = security_group.security_group_rules.create(
27
- :parent_group_id => security_group.id,
28
- :ip_protocol => 'tcp',
29
- :from_port => 1234,
30
- :to_port => 1234,
31
- :ip_range => { "cidr" => "0.0.0.0/0" }
32
- )
33
- returns(true, "added security group rule") { security_group.security_group_rules.count == (rules_count + 1) }
34
- security_group_rule = security_group.security_group_rules.find { |r| r.id == rule.id }
35
- returns(true, "security group rule has rule attributes") { security_group_rule.attributes == rule.attributes }
36
- end
37
-
38
- tests("#destroy").succeeds do
39
- rule = security_group.security_group_rules.create(
40
- :parent_group_id => security_group.id,
41
- :ip_protocol => 'tcp',
42
- :from_port => 1234,
43
- :to_port => 1234,
44
- :ip_range => { "cidr" => "0.0.0.0/0" }
45
- )
46
- rule.destroy
47
- returns(true, "successfully destroyed rule") { rule.reload == nil }
48
- end
49
- end
50
- ensure
51
- security_group.destroy if security_group
52
- end
53
- end
54
- end