misty 1.4.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +87 -88
  3. data/lib/misty.rb +115 -1
  4. data/lib/misty/auth/catalog.rb +38 -0
  5. data/lib/misty/auth/catalog/v2.rb +15 -0
  6. data/lib/misty/auth/catalog/v3.rb +15 -0
  7. data/lib/misty/auth/token.rb +70 -0
  8. data/lib/misty/auth/token/v2.rb +63 -0
  9. data/lib/misty/auth/token/v3.rb +90 -0
  10. data/lib/misty/cloud.rb +74 -15
  11. data/lib/misty/config.rb +37 -43
  12. data/lib/misty/errors.rb +25 -5
  13. data/lib/misty/helper.rb +26 -0
  14. data/lib/misty/http/header.rb +3 -6
  15. data/lib/misty/http/method_builder.rb +2 -2
  16. data/lib/misty/http/request.rb +3 -3
  17. data/lib/misty/microversion.rb +12 -1
  18. data/lib/misty/misty.rb +7 -62
  19. data/lib/misty/openstack.rb +39 -0
  20. data/lib/misty/openstack/{aodh → api/aodh}/aodh_v2.rb +1 -1
  21. data/lib/misty/openstack/api/aodh/v2.rb +19 -0
  22. data/lib/misty/openstack/api/barbican/barbican_v1.rb +42 -0
  23. data/lib/misty/openstack/api/barbican/v1.rb +19 -0
  24. data/lib/misty/openstack/api/blazar/blazar_v1.rb +16 -0
  25. data/lib/misty/openstack/api/blazar/v1.rb +19 -0
  26. data/lib/misty/openstack/{ceilometer → api/ceilometer}/ceilometer_v2.rb +1 -1
  27. data/lib/misty/openstack/api/ceilometer/v2.rb +19 -0
  28. data/lib/misty/openstack/{cinder → api/cinder}/cinder_v1.rb +1 -1
  29. data/lib/misty/openstack/{cinder → api/cinder}/cinder_v2.rb +3 -3
  30. data/lib/misty/openstack/{cinder → api/cinder}/cinder_v3.rb +7 -4
  31. data/lib/misty/openstack/api/cinder/v1.rb +23 -0
  32. data/lib/misty/openstack/api/cinder/v2.rb +24 -0
  33. data/lib/misty/openstack/api/cinder/v3.rb +29 -0
  34. data/lib/misty/openstack/{designate → api/designate}/designate_v2.rb +2 -2
  35. data/lib/misty/openstack/api/designate/v2.rb +19 -0
  36. data/lib/misty/openstack/{freezer → api/freezer}/freezer_v1.rb +2 -2
  37. data/lib/misty/openstack/api/freezer/v1.rb +19 -0
  38. data/lib/misty/openstack/{glance → api/glance}/glance_v1.rb +1 -1
  39. data/lib/misty/openstack/{glance → api/glance}/glance_v2.rb +1 -1
  40. data/lib/misty/openstack/api/glance/v1.rb +19 -0
  41. data/lib/misty/openstack/api/glance/v2.rb +24 -0
  42. data/lib/misty/openstack/api/gnocchi/gnocchi_v1.rb +39 -0
  43. data/lib/misty/openstack/api/gnocchi/v1.rb +19 -0
  44. data/lib/misty/openstack/{heat → api/heat}/heat_v1.rb +1 -1
  45. data/lib/misty/openstack/api/heat/v1.rb +23 -0
  46. data/lib/misty/openstack/{ironic → api/ironic}/ironic_v1.rb +8 -2
  47. data/lib/misty/openstack/api/ironic/v1.rb +25 -0
  48. data/lib/misty/openstack/{karbor → api/karbor}/karbor_v1.rb +2 -2
  49. data/lib/misty/openstack/api/karbor/v1.rb +19 -0
  50. data/lib/misty/openstack/{keystone → api/keystone}/keystone_v2_0.rb +1 -1
  51. data/lib/misty/openstack/api/keystone/keystone_v2_0_ext.rb +14 -0
  52. data/lib/misty/openstack/{keystone → api/keystone}/keystone_v3.rb +35 -3
  53. data/lib/misty/openstack/{keystone → api/keystone}/keystone_v3_ext.rb +7 -9
  54. data/lib/misty/openstack/api/keystone/v2_0.rb +23 -0
  55. data/lib/misty/openstack/api/keystone/v3.rb +23 -0
  56. data/lib/misty/openstack/{magnum → api/magnum}/magnum_v1.rb +2 -2
  57. data/lib/misty/openstack/api/magnum/v1.rb +21 -0
  58. data/lib/misty/openstack/{manila → api/manila}/manila_v2.rb +7 -3
  59. data/lib/misty/openstack/api/manila/v2.rb +25 -0
  60. data/lib/misty/openstack/api/masakari/masakari_v1_0.rb +22 -0
  61. data/lib/misty/openstack/api/masakari/v1_0.rb +19 -0
  62. data/lib/misty/openstack/api/mistral/mistral_v2.rb +44 -0
  63. data/lib/misty/openstack/api/mistral/v2.rb +19 -0
  64. data/lib/misty/openstack/api/monasca/monasca_v2_0.rb +28 -0
  65. data/lib/misty/openstack/api/monasca/v2_0.rb +19 -0
  66. data/lib/misty/openstack/{murano → api/murano}/murano_v1.rb +1 -1
  67. data/lib/misty/openstack/api/murano/v1.rb +19 -0
  68. data/lib/misty/openstack/{neutron → api/neutron}/neutron_v2_0.rb +11 -12
  69. data/lib/misty/openstack/api/neutron/v2_0.rb +19 -0
  70. data/lib/misty/openstack/{nova → api/nova}/nova_v2_1.rb +1 -2
  71. data/lib/misty/openstack/api/nova/v2_1.rb +33 -0
  72. data/lib/misty/openstack/{octavia → api/octavia}/octavia_v2_0.rb +4 -3
  73. data/lib/misty/openstack/api/octavia/v2_0.rb +19 -0
  74. data/lib/misty/openstack/api/panko/panko_v2.rb +14 -0
  75. data/lib/misty/openstack/api/panko/v2.rb +19 -0
  76. data/lib/misty/openstack/api/placement/placement_v2_1.rb +50 -0
  77. data/lib/misty/openstack/api/placement/v2_1.rb +21 -0
  78. data/lib/misty/openstack/{sahara → api/sahara}/sahara_v1_1.rb +2 -2
  79. data/lib/misty/openstack/api/sahara/v1_1.rb +19 -0
  80. data/lib/misty/openstack/{searchlight → api/searchlight}/searchlight_v1.rb +2 -2
  81. data/lib/misty/openstack/api/searchlight/v1.rb +19 -0
  82. data/lib/misty/openstack/{senlin → api/senlin}/senlin_v1.rb +2 -2
  83. data/lib/misty/openstack/api/senlin/v1.rb +19 -0
  84. data/lib/misty/openstack/{swift → api/swift}/swift_v1.rb +2 -2
  85. data/lib/misty/openstack/api/swift/v1.rb +34 -0
  86. data/lib/misty/openstack/{tacker → api/tacker}/tacker_v1_0.rb +2 -2
  87. data/lib/misty/openstack/api/tacker/v1_0.rb +19 -0
  88. data/lib/misty/openstack/{trove → api/trove}/trove_v1_0.rb +23 -8
  89. data/lib/misty/openstack/api/trove/v1_0.rb +19 -0
  90. data/lib/misty/openstack/api/watcher/v1.rb +19 -0
  91. data/lib/misty/openstack/api/watcher/watcher_v1.rb +38 -0
  92. data/lib/misty/openstack/api/zaqar/v2.rb +19 -0
  93. data/lib/misty/openstack/{zaqar → api/zaqar}/zaqar_v2.rb +2 -2
  94. data/lib/misty/openstack/api/zun/v1.rb +19 -0
  95. data/lib/misty/openstack/api/zun/zun_v1.rb +55 -0
  96. data/lib/misty/openstack/service.rb +18 -15
  97. data/lib/misty/openstack/service_pack.rb +18 -0
  98. data/lib/misty/service.rb +4 -6
  99. data/lib/misty/services.rb +11 -10
  100. data/lib/misty/version.rb +1 -1
  101. data/test/integration/compute_test.rb +2 -2
  102. data/test/integration/{networking_test.rb → network_test.rb} +10 -10
  103. data/test/integration/orchestration_test.rb +4 -4
  104. data/test/integration/vcr/{networking_using_neutron_v2_0.yml → network_using_neutron_v2_0.yml} +0 -0
  105. data/test/unit/auth/catalog_test.rb +99 -0
  106. data/test/unit/{auth_test.rb → auth/token_test.rb} +79 -45
  107. data/test/unit/cloud/config_test.rb +79 -41
  108. data/test/unit/cloud/requests_test.rb +6 -6
  109. data/test/unit/cloud/services_test.rb +23 -23
  110. data/test/unit/cloud_test.rb +10 -10
  111. data/test/unit/http/method_builder_test.rb +13 -23
  112. data/test/unit/http/request_test.rb +1 -1
  113. data/test/unit/microversion_test.rb +13 -16
  114. data/test/unit/misty_test.rb +51 -49
  115. data/test/unit/openstack/APIs_test.rb +5 -9
  116. data/test/unit/openstack/extension_test.rb +6 -6
  117. data/test/unit/openstack/service_test.rb +2 -10
  118. data/test/unit/service_helper.rb +3 -8
  119. data/test/unit/services_test.rb +5 -5
  120. metadata +91 -66
  121. data/lib/misty/auth.rb +0 -91
  122. data/lib/misty/auth/auth_v2.rb +0 -65
  123. data/lib/misty/auth/auth_v3.rb +0 -89
  124. data/lib/misty/autoload.rb +0 -99
  125. data/lib/misty/client_pack.rb +0 -16
  126. data/lib/misty/openstack/aodh/v2.rb +0 -17
  127. data/lib/misty/openstack/ceilometer/v2.rb +0 -17
  128. data/lib/misty/openstack/cinder/v1.rb +0 -21
  129. data/lib/misty/openstack/cinder/v2.rb +0 -22
  130. data/lib/misty/openstack/cinder/v3.rb +0 -31
  131. data/lib/misty/openstack/designate/v2.rb +0 -17
  132. data/lib/misty/openstack/freezer/v1.rb +0 -17
  133. data/lib/misty/openstack/glance/v1.rb +0 -17
  134. data/lib/misty/openstack/glance/v2.rb +0 -17
  135. data/lib/misty/openstack/heat/v1.rb +0 -21
  136. data/lib/misty/openstack/ironic/v1.rb +0 -27
  137. data/lib/misty/openstack/karbor/v1.rb +0 -17
  138. data/lib/misty/openstack/keystone/keystone_v2_0_ext.rb +0 -18
  139. data/lib/misty/openstack/keystone/v2_0.rb +0 -21
  140. data/lib/misty/openstack/keystone/v3.rb +0 -21
  141. data/lib/misty/openstack/magnum/v1.rb +0 -23
  142. data/lib/misty/openstack/manila/v2.rb +0 -27
  143. data/lib/misty/openstack/murano/v1.rb +0 -17
  144. data/lib/misty/openstack/neutron/v2_0.rb +0 -17
  145. data/lib/misty/openstack/nova/v2_1.rb +0 -42
  146. data/lib/misty/openstack/octavia/v2_0.rb +0 -17
  147. data/lib/misty/openstack/sahara/v1_1.rb +0 -17
  148. data/lib/misty/openstack/searchlight/v1.rb +0 -17
  149. data/lib/misty/openstack/senlin/v1.rb +0 -17
  150. data/lib/misty/openstack/swift/v1.rb +0 -32
  151. data/lib/misty/openstack/tacker/v1_0.rb +0 -17
  152. data/lib/misty/openstack/trove/v1_0.rb +0 -17
  153. data/lib/misty/openstack/zaqar/v2.rb +0 -17
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/karbor/karbor_v1'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Karbor
7
- class V1
8
- include Misty::Openstack::KarborV1
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{data-protection data-protection-orchestration}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,18 +0,0 @@
1
- module Misty::Openstack::KeystoneV2_0_ext
2
- def tag
3
- 'Identity API Reference v3.8'
4
- end
5
-
6
- def api_ext
7
- {"/v2.0/users/{userId}/OS-KSADM/credentials"=>
8
- {:POST=>[:grant_credential_to_user],
9
- :GET=>[:list_credentials_ec2_extension]},
10
- "/v2.0/users/{userId}/OS-KSADM/credentials/OS-KSEC2:ec2Credentials"=>
11
- {:POST=>[:update_user_credentials],
12
- :DELETE=>[:delete_user_credentials],
13
- :GET=>[:get_user_credentials]},
14
- "/v2.0/users/{userId}/OS-KSADM/credentials/OS-KSEC2:ec2Credentials/{type}"=>
15
- {:GET=>[:list_credentials_by_type]},
16
- "/v2.0/OS-KSCRUD/users/{userId}"=>{:PATCH=>[:change_user_s_own_password]}}
17
- end
18
- end
@@ -1,21 +0,0 @@
1
- require 'misty/openstack/keystone/keystone_v2_0'
2
- require 'misty/openstack/keystone/keystone_v2_0_ext'
3
- require 'misty/client_pack'
4
- require 'misty/openstack/extension'
5
-
6
- module Misty
7
- module Openstack
8
- module Keystone
9
- class V2_0
10
- include Misty::Openstack::KeystoneV2_0
11
- include Misty::Openstack::KeystoneV2_0_ext
12
- include Misty::ClientPack
13
- include Misty::Openstack::Extension
14
-
15
- def service_names
16
- %w{identity}
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- require 'misty/openstack/keystone/keystone_v3'
2
- require 'misty/openstack/keystone/keystone_v3_ext'
3
- require 'misty/openstack/extension'
4
- require 'misty/client_pack'
5
-
6
- module Misty
7
- module Openstack
8
- module Keystone
9
- class V3
10
- include Misty::Openstack::KeystoneV3
11
- include Misty::Openstack::KeystoneV3_ext
12
- include Misty::ClientPack
13
- include Misty::Openstack::Extension
14
-
15
- def service_names
16
- %w{identity}
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,23 +0,0 @@
1
- require 'misty/openstack/magnum/magnum_v1'
2
- require 'misty/client_pack'
3
- require 'misty/openstack/microversion'
4
-
5
- module Misty
6
- module Openstack
7
- module Magnum
8
- class V1
9
- include Misty::Openstack::MagnumV1
10
- include Misty::ClientPack
11
- include Misty::HTTP::Microversion
12
-
13
- def microversion
14
- '1.4'
15
- end
16
-
17
- def service_names
18
- %w{container-infrastructure-management container-infrastructure}
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,27 +0,0 @@
1
- require 'misty/openstack/manila/manila_v2'
2
- require 'misty/client_pack'
3
- require 'misty/microversion'
4
-
5
- module Misty
6
- module Openstack
7
- module Manila
8
- class V2
9
- include Misty::Openstack::ManilaV2
10
- include Misty::ClientPack
11
- include Misty::Microversion
12
-
13
- def microversion
14
- '2.40'
15
- end
16
-
17
- def microversion_header(version)
18
- {'X-Openstack-Manila-API-Version' => "#{version}"}
19
- end
20
-
21
- def service_names
22
- %w{shared-file-systems shared}
23
- end
24
- end
25
- end
26
- end
27
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/murano/murano_v1'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Murano
7
- class V1
8
- include Misty::Openstack::MuranoV1
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{application-catalog}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/neutron/neutron_v2_0'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Neutron
7
- class V2_0
8
- include Misty::Openstack::NeutronV2_0
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{network networking}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,42 +0,0 @@
1
- require 'misty/openstack/nova/nova_v2_1'
2
- require 'misty/client_pack'
3
- require 'misty/microversion'
4
-
5
- module Misty
6
- module Openstack
7
- module Nova
8
- class V2_1
9
- include Misty::Openstack::NovaV2_1
10
- include Misty::ClientPack
11
- include Misty::Microversion
12
-
13
- # TODO: Verify
14
- # Overrides API because the definitions don't specify prefix
15
- def self.list_all_major_versions
16
- http_get('/', headers)
17
- end
18
-
19
- def self.show_details_of_specific_api_version(version)
20
- http_get("/#{version}", headers)
21
- end
22
-
23
- def microversion
24
- '2.60'
25
- end
26
-
27
- def microversion_header(version)
28
- # Use default 'OpenStack-API-Version' or older 'X-Openstack-Nova-API-Version'
29
- if @version >= '2.27'
30
- super
31
- else
32
- {'X-Openstack-Nova-API-Version' => "#{version}"}
33
- end
34
- end
35
-
36
- def service_names
37
- %w{compute}
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/octavia/octavia_v2_0'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Octavia
7
- class V2_0
8
- include Misty::Openstack::OctaviaV2_0
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{load-balancer}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/sahara/sahara_v1_1'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Sahara
7
- class V1_1
8
- include Misty::Openstack::SaharaV1_1
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{data-processing}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/searchlight/searchlight_v1'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Searchlight
7
- class V1
8
- include Misty::Openstack::SearchlightV1
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{search}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/senlin/senlin_v1'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Senlin
7
- class V1
8
- include Misty::Openstack::SenlinV1
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{clustering}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,32 +0,0 @@
1
- require 'misty/openstack/swift/swift_v1'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Swift
7
- class V1
8
- include Misty::Openstack::SwiftV1
9
- include Misty::ClientPack
10
-
11
- def prefix_path_to_ignore
12
- '/v1/{account}'
13
- end
14
-
15
- def service_names
16
- %w{object-storage object-store}
17
- end
18
-
19
- # Custom requests
20
- def requests_custom
21
- [ :bulk_delete ]
22
- end
23
-
24
- def bulk_delete(data)
25
- param = 'bulk-delete=1'
26
- @request_headers.add('Content-Type' => 'text/plain')
27
- create_update_or_delete_account_metadata(param, data)
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/tacker/tacker_v1_0'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Tacker
7
- class V1_0
8
- include Misty::Openstack::TackerV1_0
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{nfv-orchestration}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/trove/trove_v1_0'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Trove
7
- class V1_0
8
- include Misty::Openstack::TroveV1_0
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{database}
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- require 'misty/openstack/zaqar/zaqar_v2'
2
- require 'misty/client_pack'
3
-
4
- module Misty
5
- module Openstack
6
- module Zaqar
7
- class V2
8
- include Misty::Openstack::ZaqarV2
9
- include Misty::ClientPack
10
-
11
- def service_names
12
- %w{messaging}
13
- end
14
- end
15
- end
16
- end
17
- end