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
@@ -1,82 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | ipsec_site_connection requests', ['openstack']) do
2
- @ipsec_site_connection_format = {
3
- 'id' => String,
4
- 'name' => String,
5
- 'description' => String,
6
- 'status' => String,
7
- 'tenant_id' => String,
8
- 'admin_state_up' => Fog::Boolean,
9
- 'psk' => String,
10
- 'initiator' => String,
11
- 'auth_mode' => String,
12
- 'peer_cidrs' => Array,
13
- 'mtu' => Integer,
14
- 'peer_ep_group_id' => String,
15
- 'ikepolicy_id' => String,
16
- 'vpnservice_id' => String,
17
- 'dpd' => Hash,
18
- 'route_mode' => String,
19
- 'ipsecpolicy_id' => String,
20
- 'local_ep_group_id' => String,
21
- 'peer_address' => String,
22
- 'peer_id' => String
23
- }
24
-
25
- tests('success') do
26
- tests('#create_ipsec_site_connection').formats('ipsec_site_connection' => @ipsec_site_connection_format) do
27
- vpnservice_id = "vpn"
28
- ikepolicy_id = "ike"
29
- ipsecpolicy_id = "ipsec"
30
-
31
- attributes = {:name => 'test-ipsec-site-connection', :description => 'Test VPN IPSec Site Connection',
32
- :tenant_id => 'tenant_id',
33
- :peer_address => "172.24.4.226", :peer_id => "172.24.4.226", :peer_cidrs => [],
34
- :psk => "secret", :mtu => 1500, :dpd => {"action" => "hold", "interval" => 30, "timeout" => 120},
35
- :initiator => "bi-directional", :admin_state_up => true
36
- }
37
- Fog::Network[:openstack].create_ipsec_site_connection(vpnservice_id,
38
- ikepolicy_id,
39
- ipsecpolicy_id,
40
- attributes).body
41
- end
42
-
43
- tests('#list_ipsec_site_connections').formats('ipsec_site_connections' => [@ipsec_site_connection_format]) do
44
- Fog::Network[:openstack].list_ipsec_site_connections.body
45
- end
46
-
47
- tests('#get_ipsec_site_connection').formats('ipsec_site_connection' => @ipsec_site_connection_format) do
48
- ipsec_site_connection_id = Fog::Network[:openstack].ipsec_site_connections.all.first.id
49
- Fog::Network[:openstack].get_ipsec_site_connection(ipsec_site_connection_id).body
50
- end
51
-
52
- tests('#update_ipsec_site_connection').formats('ipsec_site_connection' => @ipsec_site_connection_format) do
53
- ipsec_site_connection_id = Fog::Network[:openstack].ipsec_site_connections.all.first.id
54
-
55
- attributes = {:name => 'rename-test-ipsec-site-connection', :description => 'Test VPN IPSec Site Connection',
56
- :tenant_id => 'tenant_id',
57
- :peer_address => "172.24.4.226", :peer_id => "172.24.4.226", :peer_cidrs => [],
58
- :psk => "secret", :mtu => 1500, :dpd => {"action" => "hold", "interval" => 30, "timeout" => 120},
59
- :initiator => "bi-directional", :admin_state_up => true}
60
- Fog::Network[:openstack].update_ipsec_site_connection(ipsec_site_connection_id, attributes).body
61
- end
62
-
63
- tests('#delete_ipsec_site_connection').succeeds do
64
- ipsec_site_connection_id = Fog::Network[:openstack].ipsec_site_connections.all.first.id
65
- Fog::Network[:openstack].delete_ipsec_site_connection(ipsec_site_connection_id)
66
- end
67
- end
68
-
69
- tests('failure') do
70
- tests('#get_ipsec_site_connection').raises(Fog::Network::OpenStack::NotFound) do
71
- Fog::Network[:openstack].get_ipsec_site_connection(0)
72
- end
73
-
74
- tests('#update_ipsec_site_connection').raises(Fog::Network::OpenStack::NotFound) do
75
- Fog::Network[:openstack].update_ipsec_site_connection(0, {})
76
- end
77
-
78
- tests('#delete_ipsec_site_connection').raises(Fog::Network::OpenStack::NotFound) do
79
- Fog::Network[:openstack].delete_ipsec_site_connection(0)
80
- end
81
- end
82
- end
@@ -1,93 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | lb_health_monitor requests', ['openstack']) do
2
-
3
- @lb_health_monitor_format = {
4
- 'id' => String,
5
- 'type' => String,
6
- 'delay' => Integer,
7
- 'timeout' => Integer,
8
- 'max_retries' => Integer,
9
- 'http_method' => String,
10
- 'url_path' => String,
11
- 'expected_codes' => String,
12
- 'status' => String,
13
- 'admin_state_up' => Fog::Boolean,
14
- 'tenant_id' => String,
15
- }
16
-
17
- tests('success') do
18
- before do
19
- @lb_pool = Fog::Network[:openstack].lb_pools.create(:subnet_id => 'subnet_id',
20
- :protocol => 'HTTP',
21
- :lb_method => 'ROUND_ROBIN')
22
- end
23
-
24
- after do
25
- @lb_pool.destroy
26
- end
27
-
28
- tests('#create_lb_health_monitor').formats({'health_monitor' => @lb_health_monitor_format}) do
29
- type = 'PING'
30
- delay = 1
31
- timeout = 5
32
- max_retries = 10
33
- attributes = {:http_method => 'GET', :url_path => '/', :expected_codes => '200, 201',
34
- :admin_state_up => true, :tenant_id => 'tenant_id'}
35
- Fog::Network[:openstack].create_lb_health_monitor(type, delay, timeout, max_retries, attributes).body
36
- end
37
-
38
- tests('#list_lb_health_monitors').formats({'health_monitors' => [@lb_health_monitor_format]}) do
39
- Fog::Network[:openstack].list_lb_health_monitors.body
40
- end
41
-
42
- tests('#get_lb_health_monitor').formats({'health_monitor' => @lb_health_monitor_format}) do
43
- lb_health_monitor_id = Fog::Network[:openstack].lb_health_monitors.all.first.id
44
- Fog::Network[:openstack].get_lb_health_monitor(lb_health_monitor_id).body
45
- end
46
-
47
- tests('#update_lb_health_monitor').formats({'health_monitor' => @lb_health_monitor_format}) do
48
- lb_health_monitor_id = Fog::Network[:openstack].lb_health_monitors.all.first.id
49
- attributes = {:delay => 5, :timeout => 10, :max_retries => 20,
50
- :http_method => 'POST', :url_path => '/varz', :expected_codes => '200',
51
- :admin_state_up => false}
52
- Fog::Network[:openstack].update_lb_health_monitor(lb_health_monitor_id, attributes).body
53
- end
54
-
55
- tests('#associate_lb_health_monitor').succeeds do
56
- lb_health_monitor_id = Fog::Network[:openstack].lb_health_monitors.all.first.id
57
- Fog::Network[:openstack].associate_lb_health_monitor(@lb_pool.id, lb_health_monitor_id)
58
- end
59
-
60
- tests('#disassociate_lb_health_monitor').succeeds do
61
- lb_health_monitor_id = Fog::Network[:openstack].lb_health_monitors.all.first.id
62
- Fog::Network[:openstack].disassociate_lb_health_monitor(@lb_pool.id, lb_health_monitor_id)
63
- end
64
-
65
- tests('#delete_lb_health_monitor').succeeds do
66
- lb_health_monitor_id = Fog::Network[:openstack].lb_health_monitors.all.first.id
67
- Fog::Network[:openstack].delete_lb_health_monitor(lb_health_monitor_id)
68
- end
69
- end
70
-
71
- tests('failure') do
72
- tests('#get_lb_health_monitor').raises(Fog::Network::OpenStack::NotFound) do
73
- Fog::Network[:openstack].get_lb_health_monitor(0)
74
- end
75
-
76
- tests('#update_lb_health_monitor').raises(Fog::Network::OpenStack::NotFound) do
77
- Fog::Network[:openstack].update_lb_health_monitor(0, {})
78
- end
79
-
80
- tests('#associate_lb_health_monitor').raises(Fog::Network::OpenStack::NotFound) do
81
- Fog::Network[:openstack].associate_lb_health_monitor(0, 0)
82
- end
83
-
84
- tests('#disassociate_lb_health_monitor').raises(Fog::Network::OpenStack::NotFound) do
85
- Fog::Network[:openstack].disassociate_lb_health_monitor(0, 0)
86
- end
87
-
88
- tests('#delete_lb_health_monitor').raises(Fog::Network::OpenStack::NotFound) do
89
- Fog::Network[:openstack].delete_lb_health_monitor(0)
90
- end
91
- end
92
-
93
- end
@@ -1,60 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | lb_member requests', ['openstack']) do
2
-
3
- @lb_member_format = {
4
- 'id' => String,
5
- 'pool_id' => String,
6
- 'address' => String,
7
- 'protocol_port' => Integer,
8
- 'weight' => Integer,
9
- 'status' => String,
10
- 'admin_state_up' => Fog::Boolean,
11
- 'tenant_id' => String,
12
- }
13
-
14
- tests('success') do
15
- tests('#create_lb_member').formats({'member' => @lb_member_format}) do
16
- pool_id = 'pool_id'
17
- address = '10.0.0.1'
18
- protocol_port = 80
19
- weight = 100
20
- attributes = {:admin_state_up => true, :tenant_id => 'tenant_id'}
21
- Fog::Network[:openstack].create_lb_member(pool_id, address, protocol_port, weight, attributes).body
22
- end
23
-
24
- tests('#list_lb_members').formats({'members' => [@lb_member_format]}) do
25
- Fog::Network[:openstack].list_lb_members.body
26
- end
27
-
28
- tests('#get_lb_member').formats({'member' => @lb_member_format}) do
29
- lb_member_id = Fog::Network[:openstack].lb_members.all.first.id
30
- Fog::Network[:openstack].get_lb_member(lb_member_id).body
31
- end
32
-
33
- tests('#update_lb_member').formats({'member' => @lb_member_format}) do
34
- lb_member_id = Fog::Network[:openstack].lb_members.all.first.id
35
- attributes = {:pool_id => 'new_pool_id', :weight => 50,
36
- :admin_state_up => false}
37
- Fog::Network[:openstack].update_lb_member(lb_member_id, attributes).body
38
- end
39
-
40
- tests('#delete_lb_member').succeeds do
41
- lb_member_id = Fog::Network[:openstack].lb_members.all.first.id
42
- Fog::Network[:openstack].delete_lb_member(lb_member_id)
43
- end
44
- end
45
-
46
- tests('failure') do
47
- tests('#get_lb_member').raises(Fog::Network::OpenStack::NotFound) do
48
- Fog::Network[:openstack].get_lb_member(0)
49
- end
50
-
51
- tests('#update_lb_member').raises(Fog::Network::OpenStack::NotFound) do
52
- Fog::Network[:openstack].update_lb_member(0, {})
53
- end
54
-
55
- tests('#delete_lb_member').raises(Fog::Network::OpenStack::NotFound) do
56
- Fog::Network[:openstack].delete_lb_member(0)
57
- end
58
- end
59
-
60
- end
@@ -1,80 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | lb_pool requests', ['openstack']) do
2
-
3
- @lb_pool_format = {
4
- 'id' => String,
5
- 'subnet_id' => String,
6
- 'protocol' => String,
7
- 'lb_method' => String,
8
- 'name' => String,
9
- 'description' => String,
10
- 'health_monitors' => Array,
11
- 'members' => Array,
12
- 'status' => String,
13
- 'admin_state_up' => Fog::Boolean,
14
- 'vip_id' => Fog::Nullable::String,
15
- 'tenant_id' => String,
16
- 'active_connections' => Fog::Nullable::Integer,
17
- 'bytes_in' => Fog::Nullable::Integer,
18
- 'bytes_out' => Fog::Nullable::Integer,
19
- 'total_connections' => Fog::Nullable::Integer
20
- }
21
-
22
- @lb_pool_stats_format = {
23
- 'active_connections' => Integer,
24
- 'bytes_in' => Integer,
25
- 'bytes_out' => Integer,
26
- 'total_connections' => Integer
27
- }
28
-
29
- tests('success') do
30
- tests('#create_lb_pool').formats({'pool' => @lb_pool_format}) do
31
- subnet_id = 'subnet_id'
32
- protocol = 'HTTP'
33
- lb_method = 'ROUND_ROBIN'
34
- attributes = {:name => 'test-pool', :description => 'Test Pool',
35
- :admin_state_up => true, :tenant_id => 'tenant_id'}
36
- Fog::Network[:openstack].create_lb_pool(subnet_id, protocol, lb_method, attributes).body
37
- end
38
-
39
- tests('#list_lb_pools').formats({'pools' => [@lb_pool_format]}) do
40
- Fog::Network[:openstack].list_lb_pools.body
41
- end
42
-
43
- tests('#get_lb_pool').formats({'pool' => @lb_pool_format}) do
44
- lb_pool_id = Fog::Network[:openstack].lb_pools.all.first.id
45
- Fog::Network[:openstack].get_lb_pool(lb_pool_id).body
46
- end
47
-
48
- tests('#get_lb_pool_stats').formats({'stats' => @lb_pool_stats_format}) do
49
- lb_pool_id = Fog::Network[:openstack].lb_pools.all.first.id
50
- Fog::Network[:openstack].get_lb_pool_stats(lb_pool_id).body
51
- end
52
-
53
- tests('#update_lb_pool').formats({'pool' => @lb_pool_format}) do
54
- lb_pool_id = Fog::Network[:openstack].lb_pools.all.first.id
55
- attributes = {:name => 'new-test-pool', :description => 'New Test Pool',
56
- :lb_method => 'LEAST_CONNECTIONS', :admin_state_up => false}
57
- Fog::Network[:openstack].update_lb_pool(lb_pool_id, attributes).body
58
- end
59
-
60
- tests('#delete_lb_pool').succeeds do
61
- lb_pool_id = Fog::Network[:openstack].lb_pools.all.first.id
62
- Fog::Network[:openstack].delete_lb_pool(lb_pool_id)
63
- end
64
- end
65
-
66
- tests('failure') do
67
- tests('#get_lb_pool').raises(Fog::Network::OpenStack::NotFound) do
68
- Fog::Network[:openstack].get_lb_pool(0)
69
- end
70
-
71
- tests('#update_lb_pool').raises(Fog::Network::OpenStack::NotFound) do
72
- Fog::Network[:openstack].update_lb_pool(0, {})
73
- end
74
-
75
- tests('#delete_lb_pool').raises(Fog::Network::OpenStack::NotFound) do
76
- Fog::Network[:openstack].delete_lb_pool(0)
77
- end
78
- end
79
-
80
- end
@@ -1,71 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | lb_vip requests', ['openstack']) do
2
-
3
- @lb_vip_format = {
4
- 'id' => String,
5
- 'subnet_id' => String,
6
- 'pool_id' => String,
7
- 'protocol' => String,
8
- 'protocol_port' => Integer,
9
- 'name' => String,
10
- 'description' => String,
11
- 'address' => String,
12
- 'port_id' => String,
13
- 'session_persistence' => Hash,
14
- 'connection_limit' => Integer,
15
- 'status' => String,
16
- 'admin_state_up' => Fog::Boolean,
17
- 'tenant_id' => String,
18
- }
19
-
20
- tests('success') do
21
- tests('#create_lb_vip').formats({'vip' => @lb_vip_format}) do
22
- subnet_id = 'subnet_id'
23
- pool_id = 'pool_id'
24
- protocol = 'HTTP'
25
- protocol_port = 80
26
- attributes = {:name => 'test-vip', :description => 'Test VIP',
27
- :address => '10.0.0.1', :connection_limit => 10,
28
- :session_persistence => { "cookie_name" => "COOKIE_NAME", "type" => "APP_COOKIE" },
29
- :admin_state_up => true, :tenant_id => 'tenant_id'}
30
- Fog::Network[:openstack].create_lb_vip(subnet_id, pool_id, protocol, protocol_port, attributes).body
31
- end
32
-
33
- tests('#list_lb_vips').formats({'vips' => [@lb_vip_format]}) do
34
- Fog::Network[:openstack].list_lb_vips.body
35
- end
36
-
37
- tests('#get_lb_vip').formats({'vip' => @lb_vip_format}) do
38
- lb_vip_id = Fog::Network[:openstack].lb_vips.all.first.id
39
- Fog::Network[:openstack].get_lb_vip(lb_vip_id).body
40
- end
41
-
42
- tests('#update_lb_vip').formats({'vip' => @lb_vip_format}) do
43
- lb_vip_id = Fog::Network[:openstack].lb_vips.all.first.id
44
- attributes = {:pool_id => 'new_pool_id', :name => 'new-test-vip',
45
- :description => 'New Test VIP', :connection_limit => 5,
46
- :session_persistence => { "type" => "HTTP_COOKIE" },
47
- :admin_state_up => false}
48
- Fog::Network[:openstack].update_lb_vip(lb_vip_id, attributes).body
49
- end
50
-
51
- tests('#delete_lb_vip').succeeds do
52
- lb_vip_id = Fog::Network[:openstack].lb_vips.all.first.id
53
- Fog::Network[:openstack].delete_lb_vip(lb_vip_id)
54
- end
55
- end
56
-
57
- tests('failure') do
58
- tests('#get_lb_vip').raises(Fog::Network::OpenStack::NotFound) do
59
- Fog::Network[:openstack].get_lb_vip(0)
60
- end
61
-
62
- tests('#update_lb_vip').raises(Fog::Network::OpenStack::NotFound) do
63
- Fog::Network[:openstack].update_lb_vip(0, {})
64
- end
65
-
66
- tests('#delete_lb_vip').raises(Fog::Network::OpenStack::NotFound) do
67
- Fog::Network[:openstack].delete_lb_vip(0)
68
- end
69
- end
70
-
71
- end
@@ -1,107 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | network requests', ['openstack']) do
2
-
3
- @network_format = {
4
- 'id' => String,
5
- 'name' => String,
6
- 'subnets' => Array,
7
- 'shared' => Fog::Boolean,
8
- 'status' => String,
9
- 'admin_state_up' => Fog::Boolean,
10
- 'tenant_id' => String,
11
- }
12
-
13
- @network_format_extensions = {
14
- 'router:external' => Fog::Boolean,
15
- 'provider:network_type' => String,
16
- 'provider:physical_network' => Fog::Nullable::String,
17
- 'provider:segmentation_id' => Integer
18
- }
19
-
20
- tests('success') do
21
- tests('#create_network').formats({'network' => @network_format}) do
22
- attributes = {
23
- :name => 'net_name',
24
- :shared => false,
25
- :admin_state_up => true,
26
- :tenant_id => 'tenant_id'
27
- }
28
- Fog::Network[:openstack].create_network(attributes).body
29
- end
30
- tests('#create_network+provider extensions').formats(
31
- {'network' => @network_format.merge(@network_format_extensions)}
32
- ) do
33
- attributes = {
34
- :name => 'net_name',
35
- :shared => false,
36
- :admin_state_up => true,
37
- :tenant_id => 'tenant_id',
38
- :router_external => true,
39
- # local, gre, vlan. Depends on the provider.
40
- # May rise an exception if the network_type isn't valid:
41
- # QuantumError: "Invalid input for operation: provider:physical_network"
42
- :provider_network_type => 'gre',
43
- :provider_segmentation_id => 22,
44
- }
45
- Fog::Network[:openstack].create_network(attributes).body
46
- end
47
-
48
- tests('#list_networks').formats({'networks' => [@network_format]}) do
49
- Fog::Network[:openstack].list_networks.body
50
- end
51
-
52
- tests('#get_network').formats({'network' => @network_format}) do
53
- network_id = Fog::Network[:openstack].networks.all.first.id
54
- Fog::Network[:openstack].get_network(network_id).body
55
- end
56
-
57
- tests('#update_network').formats({'network' => @network_format}) do
58
- network_id = Fog::Network[:openstack].networks.all.first.id
59
- attributes = {:name => 'net_name', :shared => false,
60
- :admin_state_up => true}
61
- Fog::Network[:openstack].update_network(network_id, attributes).body
62
- end
63
-
64
- tests('#delete_network').succeeds do
65
- network_id = Fog::Network[:openstack].networks.all.first.id
66
- Fog::Network[:openstack].delete_network(network_id)
67
- end
68
- end
69
-
70
- tests('failure') do
71
- tests('#create_network+provider extensions').raises(
72
- Excon::Errors::BadRequest
73
- ) do
74
- pending if Fog.mocking?
75
-
76
- attributes = {
77
- :name => 'net_name',
78
- :shared => false,
79
- :admin_state_up => true,
80
- :tenant_id => 'tenant_id',
81
- :router_external => true,
82
- # QuantumError: "Invalid input for operation: provider:physical_network"
83
- :provider_network_type => 'foobar',
84
- :provider_segmentation_id => 22,
85
- }
86
- Fog::Network[:openstack].create_network(attributes)
87
- end
88
-
89
- tests('#get_network').raises(Fog::Network::OpenStack::NotFound) do
90
- Fog::Network[:openstack].get_network(0)
91
- end
92
-
93
- tests('#update_network').raises(Fog::Network::OpenStack::NotFound) do
94
- Fog::Network[:openstack].update_network(0, {})
95
- end
96
-
97
- tests('#delete_network').raises(Fog::Network::OpenStack::NotFound) do
98
- Fog::Network[:openstack].delete_network(0)
99
- end
100
- end
101
-
102
- # Cleaning up the mess
103
- Fog::Network[:openstack].networks.each do |n|
104
- Fog::Network[:openstack].delete_network(n.id)
105
- end
106
-
107
- end