misty 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/misty/auth.rb +5 -13
- data/lib/misty/auth/auth_v2.rb +13 -11
- data/lib/misty/auth/auth_v3.rb +11 -9
- data/lib/misty/auth/errors.rb +12 -0
- data/lib/misty/auth/name.rb +4 -4
- data/lib/misty/client.rb +105 -0
- data/lib/misty/client_pack.rb +16 -0
- data/lib/misty/http/method_builder.rb +36 -20
- data/lib/misty/misty.rb +14 -0
- data/lib/misty/openstack/aodh/aodh_v2.rb +1 -1
- data/lib/misty/openstack/aodh/v2.rb +5 -8
- data/lib/misty/openstack/ceilometer/ceilometer_v2.rb +1 -1
- data/lib/misty/openstack/ceilometer/v2.rb +5 -8
- data/lib/misty/openstack/cinder/cinder_v1.rb +1 -1
- data/lib/misty/openstack/cinder/cinder_v2.rb +1 -1
- data/lib/misty/openstack/cinder/cinder_v3.rb +1 -1
- data/lib/misty/openstack/cinder/v1.rb +6 -9
- data/lib/misty/openstack/cinder/v2.rb +6 -9
- data/lib/misty/openstack/cinder/v3.rb +7 -10
- data/lib/misty/openstack/designate/designate_v2.rb +1 -1
- data/lib/misty/openstack/designate/v2.rb +5 -8
- data/lib/misty/openstack/extension.rb +33 -0
- data/lib/misty/openstack/freezer/freezer_v1.rb +1 -1
- data/lib/misty/openstack/freezer/v1.rb +5 -8
- data/lib/misty/openstack/glance/glance_v1.rb +1 -1
- data/lib/misty/openstack/glance/glance_v2.rb +1 -1
- data/lib/misty/openstack/glance/v1.rb +5 -8
- data/lib/misty/openstack/glance/v2.rb +5 -8
- data/lib/misty/openstack/heat/heat_v1.rb +1 -1
- data/lib/misty/openstack/heat/v1.rb +6 -9
- data/lib/misty/openstack/ironic/ironic_v1.rb +1 -1
- data/lib/misty/openstack/ironic/v1.rb +6 -9
- data/lib/misty/openstack/karbor/karbor_v1.rb +1 -1
- data/lib/misty/openstack/karbor/v1.rb +5 -8
- data/lib/misty/openstack/keystone/keystone_v2_0.rb +1 -1
- data/lib/misty/openstack/keystone/keystone_v2_0_ext.rb +2 -2
- data/lib/misty/openstack/keystone/keystone_v3.rb +1 -1
- data/lib/misty/openstack/keystone/keystone_v3_ext.rb +2 -2
- data/lib/misty/openstack/keystone/v2_0.rb +8 -10
- data/lib/misty/openstack/keystone/v3.rb +8 -10
- data/lib/misty/openstack/magnum/magnum_v1.rb +1 -1
- data/lib/misty/openstack/magnum/v1.rb +6 -9
- data/lib/misty/openstack/manila/manila_v2.rb +1 -1
- data/lib/misty/openstack/manila/v2.rb +6 -9
- data/lib/misty/openstack/murano/murano_v1.rb +1 -1
- data/lib/misty/openstack/murano/v1.rb +5 -8
- data/lib/misty/openstack/neutron/neutron_v2_0.rb +1 -1
- data/lib/misty/openstack/neutron/v2_0.rb +5 -8
- data/lib/misty/openstack/nova/nova_v2_1.rb +1 -1
- data/lib/misty/openstack/nova/v2_1.rb +7 -9
- data/lib/misty/openstack/octavia/octavia_v2_0.rb +1 -1
- data/lib/misty/openstack/octavia/v2_0.rb +5 -8
- data/lib/misty/openstack/sahara/sahara_v1_1.rb +1 -1
- data/lib/misty/openstack/sahara/v1_1.rb +5 -8
- data/lib/misty/openstack/searchlight/searchlight_v1.rb +1 -1
- data/lib/misty/openstack/searchlight/v1.rb +5 -8
- data/lib/misty/openstack/senlin/senlin_v1.rb +1 -1
- data/lib/misty/openstack/senlin/v1.rb +5 -8
- data/lib/misty/openstack/swift/swift_v1.rb +1 -1
- data/lib/misty/openstack/swift/v1.rb +17 -9
- data/lib/misty/openstack/tacker/tacker_v1_0.rb +1 -1
- data/lib/misty/openstack/tacker/v1_0.rb +5 -8
- data/lib/misty/openstack/trove/trove_v1_0.rb +1 -1
- data/lib/misty/openstack/trove/v1_0.rb +5 -8
- data/lib/misty/openstack/zaqar/v2.rb +5 -8
- data/lib/misty/openstack/zaqar/zaqar_v2.rb +1 -1
- data/lib/misty/version.rb +1 -1
- data/test/unit/{http/client_test.rb → client_test.rb} +20 -8
- data/test/unit/cloud/requests_test.rb +77 -5
- data/test/unit/cloud/services_test.rb +20 -5
- data/test/unit/http/header_test.rb +0 -1
- data/test/unit/http/method_builder_test.rb +4 -4
- data/test/unit/http/request_test.rb +29 -20
- data/test/unit/microversion_test.rb +1 -1
- data/test/unit/misty_test.rb +18 -0
- data/test/unit/openstack/APIs_test.rb +18 -13
- data/test/unit/openstack/extension_test.rb +68 -0
- data/test/unit/service_helper.rb +1 -1
- metadata +8 -4
- data/lib/misty/http/client.rb +0 -108
@@ -1,17 +1,14 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/ceilometer/ceilometer_v2'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Ceilometer
|
7
|
-
class V2
|
8
|
-
|
7
|
+
class V2
|
8
|
+
include Misty::Openstack::CeilometerV2
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v2
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.service_names
|
11
|
+
def service_names
|
15
12
|
%w{metering}
|
16
13
|
end
|
17
14
|
end
|
@@ -1,21 +1,18 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/cinder/cinder_v1'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Cinder
|
7
|
-
class V1
|
8
|
-
|
7
|
+
class V1
|
8
|
+
include Misty::Openstack::CinderV1
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v1
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.prefix_path_to_ignore
|
11
|
+
def prefix_path_to_ignore
|
15
12
|
'/v1/{admin_tenant_id}/'
|
16
13
|
end
|
17
14
|
|
18
|
-
def
|
15
|
+
def service_names
|
19
16
|
%w{block-storage, block-store, volume}
|
20
17
|
end
|
21
18
|
end
|
@@ -1,21 +1,18 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/cinder/cinder_v2'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Cinder
|
7
|
-
class V2
|
8
|
-
|
7
|
+
class V2
|
8
|
+
include Misty::Openstack::CinderV2
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v2
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.prefix_path_to_ignore
|
11
|
+
def prefix_path_to_ignore
|
15
12
|
'/v2/{tenant_id}'
|
16
13
|
end
|
17
14
|
|
18
|
-
def
|
15
|
+
def service_names
|
19
16
|
%w{block-storage, block-store, volume}
|
20
17
|
end
|
21
18
|
end
|
@@ -1,23 +1,20 @@
|
|
1
|
-
require 'misty/http/client'
|
2
|
-
require 'misty/microversion'
|
3
1
|
require 'misty/openstack/cinder/cinder_v3'
|
2
|
+
require 'misty/client_pack'
|
3
|
+
require 'misty/microversion'
|
4
4
|
|
5
5
|
module Misty
|
6
6
|
module Openstack
|
7
7
|
module Cinder
|
8
|
-
class V3
|
9
|
-
|
8
|
+
class V3
|
9
|
+
include Misty::Openstack::CinderV3
|
10
|
+
include Misty::ClientPack
|
10
11
|
include Misty::Microversion
|
11
12
|
|
12
|
-
def
|
13
|
-
v3
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.prefix_path_to_ignore
|
13
|
+
def prefix_path_to_ignore
|
17
14
|
'/v3/{tenant_id}'
|
18
15
|
end
|
19
16
|
|
20
|
-
def
|
17
|
+
def service_names
|
21
18
|
%w{block-storage, block-store, volume}
|
22
19
|
end
|
23
20
|
end
|
@@ -1,17 +1,14 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/designate/designate_v2'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Designate
|
7
|
-
class V2
|
8
|
-
|
7
|
+
class V2
|
8
|
+
include Misty::Openstack::DesignateV2
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v2
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.service_names
|
11
|
+
def service_names
|
15
12
|
%w{dns}
|
16
13
|
end
|
17
14
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Misty
|
2
|
+
module Openstack
|
3
|
+
module Extension
|
4
|
+
def api
|
5
|
+
@api_fusion ||= begin
|
6
|
+
list = super
|
7
|
+
api_ext.each do |key, value|
|
8
|
+
if list.include?(key)
|
9
|
+
target = list[key]
|
10
|
+
value.each do |verb, methods|
|
11
|
+
if target.has_key?(verb)
|
12
|
+
# Add methods to existing Verb
|
13
|
+
methods.each do |method|
|
14
|
+
raise RuntimeError, "#{key} => #{verb} already includes: #{method}" if target[verb].include?(method)
|
15
|
+
target[verb] << method
|
16
|
+
end
|
17
|
+
else
|
18
|
+
# Add Verb
|
19
|
+
target.merge!(verb => methods)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
else
|
23
|
+
# Add Resource
|
24
|
+
list.merge!(key => value)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
list
|
28
|
+
end
|
29
|
+
@api_fusion
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -1,17 +1,14 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/freezer/freezer_v1'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Freezer
|
7
|
-
class V1
|
8
|
-
|
7
|
+
class V1
|
8
|
+
include Misty::Openstack::FreezerV1
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v1
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.service_names
|
11
|
+
def service_names
|
15
12
|
%w{backup}
|
16
13
|
end
|
17
14
|
end
|
@@ -1,17 +1,14 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/glance/glance_v1'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Glance
|
7
|
-
class V1
|
8
|
-
|
7
|
+
class V1
|
8
|
+
include Misty::Openstack::GlanceV1
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v1
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.service_names
|
11
|
+
def service_names
|
15
12
|
%w{image}
|
16
13
|
end
|
17
14
|
end
|
@@ -1,17 +1,14 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/glance/glance_v2'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Glance
|
7
|
-
class V2
|
8
|
-
|
7
|
+
class V2
|
8
|
+
include Misty::Openstack::GlanceV2
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v2
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.service_names
|
11
|
+
def service_names
|
15
12
|
%w{image}
|
16
13
|
end
|
17
14
|
end
|
@@ -1,21 +1,18 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/heat/heat_v1'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Heat
|
7
|
-
class V1
|
8
|
-
|
7
|
+
class V1
|
8
|
+
include Misty::Openstack::HeatV1
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v1
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.prefix_path_to_ignore
|
11
|
+
def prefix_path_to_ignore
|
15
12
|
'/v1/{tenant_id}'
|
16
13
|
end
|
17
14
|
|
18
|
-
def
|
15
|
+
def service_names
|
19
16
|
%w{orchestration}
|
20
17
|
end
|
21
18
|
end
|
@@ -1,19 +1,16 @@
|
|
1
|
-
require 'misty/http/client'
|
2
|
-
require 'misty/microversion'
|
3
1
|
require 'misty/openstack/ironic/ironic_v1'
|
2
|
+
require 'misty/client_pack'
|
3
|
+
require 'misty/microversion'
|
4
4
|
|
5
5
|
module Misty
|
6
6
|
module Openstack
|
7
7
|
module Ironic
|
8
|
-
class V1
|
9
|
-
|
8
|
+
class V1
|
9
|
+
include Misty::Openstack::IronicV1
|
10
|
+
include Misty::ClientPack
|
10
11
|
include Misty::Microversion
|
11
12
|
|
12
|
-
def
|
13
|
-
v1
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.service_names
|
13
|
+
def service_names
|
17
14
|
%w{baremetal}
|
18
15
|
end
|
19
16
|
end
|
@@ -1,17 +1,14 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/karbor/karbor_v1'
|
2
|
+
require 'misty/client_pack'
|
3
3
|
|
4
4
|
module Misty
|
5
5
|
module Openstack
|
6
6
|
module Karbor
|
7
|
-
class V1
|
8
|
-
|
7
|
+
class V1
|
8
|
+
include Misty::Openstack::KarborV1
|
9
|
+
include Misty::ClientPack
|
9
10
|
|
10
|
-
def
|
11
|
-
v1
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.service_names
|
11
|
+
def service_names
|
15
12
|
%w{data-protection data-protection-orchestration}
|
16
13
|
end
|
17
14
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Misty::Openstack::
|
2
|
-
def
|
1
|
+
module Misty::Openstack::KeystoneV2_0_ext
|
2
|
+
def api_ext
|
3
3
|
{"/v2.0/users/{user_id}/OS-KSADM/enabled"=>{:PUT=>[:enable_disable_user]},
|
4
4
|
"/v2.0/users/{user_id}/OS-KSADM/password"=>{:PUT=>[:set_user_password]},
|
5
5
|
"/v2.0/users/{user_id}/OS-KSADM/tenant"=>{:PUT=>[:update_user_tenant]},
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Misty::Openstack::
|
2
|
-
def
|
1
|
+
module Misty::Openstack::KeystoneV3_ext
|
2
|
+
def api_ext
|
3
3
|
{"/v3/policies/{policy_id}/OS-ENDPOINT-POLICY/endpoints/{endpoint_id}"=>
|
4
4
|
{:PUT=>[:associate_policy_and_endpoint],
|
5
5
|
:GET=>[:verify_a_policy_and_endpoint_association],
|
@@ -1,20 +1,18 @@
|
|
1
|
-
require 'misty/http/client'
|
2
1
|
require 'misty/openstack/keystone/keystone_v2_0'
|
3
2
|
require 'misty/openstack/keystone/keystone_v2_0_ext'
|
3
|
+
require 'misty/client_pack'
|
4
|
+
require 'misty/openstack/extension'
|
4
5
|
|
5
6
|
module Misty
|
6
7
|
module Openstack
|
7
8
|
module Keystone
|
8
|
-
class V2_0
|
9
|
-
|
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
|
10
14
|
|
11
|
-
def
|
12
|
-
api = v2_0
|
13
|
-
api.merge!(v2_0_ext)
|
14
|
-
api
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.service_names
|
15
|
+
def service_names
|
18
16
|
%w{identity}
|
19
17
|
end
|
20
18
|
end
|