misty 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,56 @@
1
+ module Misty::Openstack::OctaviaV2_0
2
+ def v2_0
3
+ {"/v2.0/lbaas/loadbalancers"=>
4
+ {:GET=>[:list_load_balancers], :POST=>[:create_a_load_balancer]},
5
+ "/v2.0/lbaas/loadbalancers/{loadbalancer_id}"=>
6
+ {:GET=>[:show_load_balancer_details],
7
+ :PUT=>[:update_a_load_balancer],
8
+ :DELETE=>[:remove_a_load_balancer]},
9
+ "/v2.0/lbaas/loadbalancers/{loadbalancer_id}/stats"=>
10
+ {:GET=>[:get_load_balancer_statistics]},
11
+ "/v2.0/lbaas/loadbalancers/{loadbalancer_id}/status"=>
12
+ {:GET=>[:get_the_load_balancer_status_tree]},
13
+ "/v2.0/lbaas/listeners"=>{:GET=>[:list_listeners], :POST=>[:create_listener]},
14
+ "/v2.0/lbaas/listeners/{listener_id}"=>
15
+ {:GET=>[:show_listener_details],
16
+ :PUT=>[:update_a_listener],
17
+ :DELETE=>[:remove_a_listener]},
18
+ "/v2.0/lbaas/listeners/{listener_id}/stats"=>
19
+ {:GET=>[:get_listener_statistics]},
20
+ "/v2.0/lbaas/pools"=>{:GET=>[:list_pools], :POST=>[:create_pool]},
21
+ "/v2.0/lbaas/pools/{pool_id}"=>
22
+ {:GET=>[:show_pool_details],
23
+ :PUT=>[:update_a_pool],
24
+ :DELETE=>[:remove_a_pool]},
25
+ "/v2.0/lbaas/pools/{pool_id}/members"=>
26
+ {:GET=>[:list_members], :POST=>[:create_member]},
27
+ "/v2.0/lbaas/pools/{pool_id}/members/{member-id}"=>
28
+ {:GET=>[:show_member_details]},
29
+ "/v2.0/lbaas/pools/{pool_id}/members/{member_id}"=>
30
+ {:PUT=>[:update_a_member], :DELETE=>[:remove_a_member]},
31
+ "/v2.0/lbaas/healthmonitors"=>
32
+ {:GET=>[:list_health_monitors], :POST=>[:create_health_monitor]},
33
+ "/v2.0/lbaas/healthmonitors/{healthmonitor_id}"=>
34
+ {:GET=>[:show_health_monitor_details],
35
+ :PUT=>[:update_a_health_monitor],
36
+ :DELETE=>[:remove_a_health_monitor]},
37
+ "/v2.0/lbaas/l7policies"=>
38
+ {:GET=>[:list_l7_policies], :POST=>[:create_an_l7_policy]},
39
+ "/v2.0/lbaas/l7policies/{l7policy_id}"=>
40
+ {:GET=>[:show_l7_policy_details],
41
+ :PUT=>[:update_a_l7_policy],
42
+ :DELETE=>[:remove_a_l7_policy]},
43
+ "/v2.0/lbaas/l7policies/{l7policy_id}/rules"=>
44
+ {:GET=>[:list_l7_rules], :POST=>[:create_an_l7_rule]},
45
+ "/v2.0/lbaas/l7policies/{l7policy_id}/rules/{l7rule_id}"=>
46
+ {:GET=>[:show_l7_rule_details],
47
+ :PUT=>[:update_a_l7_rule],
48
+ :DELETE=>[:remove_a_l7_rule]},
49
+ "/v2.0/lbaas/quotas"=>{:GET=>[:list_quota]},
50
+ "/v2.0/lbaas/quotas/defaults"=>{:GET=>[:show_quota_defaults]},
51
+ "/v2.0/lbaas/quotas/{project_id}"=>
52
+ {:GET=>[:show_project_quota],
53
+ :PUT=>[:update_a_quota],
54
+ :DELETE=>[:remove_a_quota]}}
55
+ end
56
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/octavia/octavia_v2_0"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Octavia
7
+ class V2_0 < Misty::HTTP::Client
8
+ extend Misty::Openstack::OctaviaV2_0
9
+
10
+ def self.api
11
+ v2_0
12
+ end
13
+
14
+ def self.service_names
15
+ %w{load-balancer}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -47,6 +47,8 @@ module Misty::Openstack::SenlinV1
47
47
  "/v1/clusters/{cluster_id}/policies/{policy_id}"=>
48
48
  {:GET=>[:show_cluster_policy_details]},
49
49
  "/v1/nodes"=>{:GET=>[:list_nodes], :POST=>[:create_node]},
50
+ "/v1/nodes/adopt"=>{:POST=>[:adopt_node]},
51
+ "/v1/nodes/adopt-preview"=>{:POST=>[:adopt_node_preview]},
50
52
  "/v1/nodes/{node_id}"=>
51
53
  {:GET=>[:show_node_details],
52
54
  :PATCH=>[:update_node],
@@ -56,11 +58,14 @@ module Misty::Openstack::SenlinV1
56
58
  "/v1/nodes/{node_id}/ops"=>{:POST=>[:perform_an_operation_on_a_node]},
57
59
  "/v1/receivers"=>{:GET=>[:list_receivers], :POST=>[:create_receiver]},
58
60
  "/v1/receivers/{receiver_id}"=>
59
- {:GET=>[:show_receiver_details], :DELETE=>[:delete_receiver]},
61
+ {:GET=>[:show_receiver_details],
62
+ :PATCH=>[:update_receiver],
63
+ :DELETE=>[:delete_receiver]},
60
64
  "/v1/events"=>{:GET=>[:list_events]},
61
65
  "/v1/events/{event_id}"=>{:GET=>[:shows_event_details]},
62
66
  "/v1/webhooks/{webhook_id}/trigger"=>{:POST=>[:trigger_webhook_action]},
63
67
  "/v1/actions"=>{:GET=>[:list_actions]},
64
- "/v1/actions/{action_id}"=>{:GET=>[:show_action_details]}}
68
+ "/v1/actions/{action_id}"=>{:GET=>[:show_action_details]},
69
+ "/v1/services"=>{:GET=>[:list_services]}}
65
70
  end
66
71
  end
@@ -0,0 +1,35 @@
1
+ module Misty::Openstack::TackerV1_0
2
+ def v1_0
3
+ {"/"=>{:GET=>[:list_versions]},
4
+ "/v1.0/extensions"=>{:GET=>[:list_extensions]},
5
+ "/v1.0/extensions/{alias}"=>{:GET=>[:show_extension]},
6
+ "/v1.0/vnfds"=>{:POST=>[:create_vnfd], :GET=>[:list_vnfds]},
7
+ "/v1.0/vnfds/{vnfd_id}"=>
8
+ {:GET=>[:show_vnfd], :PUT=>[:update_vnfd], :DELETE=>[:delete_vnfd]},
9
+ "/v1.0/vnfs"=>{:POST=>[:create_vnf], :GET=>[:list_vnfs]},
10
+ "/v1.0/vnfs/{vnf_id}"=>
11
+ {:GET=>[:show_vnf], :PUT=>[:update_vnf], :DELETE=>[:delete_vnf]},
12
+ "/v1.0/vnfs/{vnf_id}/resources"=>{:GET=>[:list_vnf_resources]},
13
+ "/v1.0/vnfs/{vnf_id}/actions"=>{:POST=>[:trigger_vnf_scaling]},
14
+ "/v1.0/vims"=>{:POST=>[:register_vim], :GET=>[:list_vims]},
15
+ "/v1.0/vims/{vim_id}"=>
16
+ {:GET=>[:show_vim], :PUT=>[:update_vim], :DELETE=>[:delete_vim]},
17
+ "/v1.0/events"=>{:GET=>[:list_events]},
18
+ "/v1.0/events/{event_id}"=>{:GET=>[:show_event]},
19
+ "/v1.0/vnffgds"=>{:POST=>[:create_vnffgd], :GET=>[:list_vnffgds]},
20
+ "/v1.0/vnffgds/{vnffgd_id}"=>
21
+ {:GET=>[:show_vnffgd], :DELETE=>[:delete_vnffgd]},
22
+ "/v1.0/vnffgs"=>{:POST=>[:create_vnffg], :GET=>[:list_vnffgs]},
23
+ "/v1.0/vnffgs/{vnffg_id}"=>{:GET=>[:show_vnffg], :DELETE=>[:delete_vnffg]},
24
+ "/v1.0/nfps"=>{:GET=>[:list_nfps]},
25
+ "/v1.0/nfps/{nfp_id}"=>{:GET=>[:show_nfp]},
26
+ "/v1.0/sfcs"=>{:GET=>[:list_sfcs]},
27
+ "/v1.0/sfcs/{sfc_id}"=>{:GET=>[:show_sfc]},
28
+ "/v1.0/classifiers"=>{:GET=>[:list_classifiers]},
29
+ "/v1.0/classifiers/{sfc_id}"=>{:GET=>[:show_classifier]},
30
+ "/v1.0/nsds"=>{:POST=>[:create_nsd], :GET=>[:list_nsds]},
31
+ "/v1.0/nsds/{nsd_id}"=>{:GET=>[:show_nsd], :DELETE=>[:delete_nsd]},
32
+ "/v1.0/nss"=>{:POST=>[:create_ns], :GET=>[:list_nss]},
33
+ "/v1.0/nss/{ns_id}"=>{:GET=>[:show_ns]}}
34
+ end
35
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/tacker/tacker_v1_0"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Tacker
7
+ class V1_0 < Misty::HTTP::Client
8
+ extend Misty::Openstack::TackerV1_0
9
+
10
+ def self.api
11
+ v1_0
12
+ end
13
+
14
+ def self.service_names
15
+ %w{nfv-orchestration}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -46,6 +46,14 @@ module Misty
46
46
  end
47
47
  end
48
48
 
49
+ def names
50
+ service_names = []
51
+ @services.each do |service|
52
+ service_names << service.name
53
+ end
54
+ service_names
55
+ end
56
+
49
57
  def to_s
50
58
  list = ""
51
59
  @services.each do |service|
@@ -1,3 +1,3 @@
1
1
  module Misty
2
- VERSION = "0.6.2"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -69,6 +69,14 @@ describe "Misty::Cloud" do
69
69
  end.must_raise NoMethodError
70
70
  end
71
71
 
72
+ it "#backup" do
73
+ stub_request(:post, "http://localhost:5000/v3/auth/tokens").
74
+ with(:body => JSON.dump(auth_body), :headers => auth_headers).
75
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3("backup", "freezer")), :headers => token_header)
76
+
77
+ cloud.backup.must_be_kind_of Misty::Openstack::Freezer::V1
78
+ end
79
+
72
80
  it "#baremetal" do
73
81
  stub_request(:post, "http://localhost:5000/v3/auth/tokens").
74
82
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
@@ -125,12 +133,28 @@ describe "Misty::Cloud" do
125
133
  cloud.image.must_be_kind_of Misty::Openstack::Glance::V2
126
134
  end
127
135
 
128
- it "#network" do
136
+ it "#load_balancer" do
137
+ stub_request(:post, "http://localhost:5000/v3/auth/tokens").
138
+ with(:body => JSON.dump(auth_body), :headers => auth_headers).
139
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3("load-balancer", "octavia")), :headers => token_header)
140
+
141
+ cloud.load_balancer.must_be_kind_of Misty::Openstack::Octavia::V2_0
142
+ end
143
+
144
+ it "#networking" do
129
145
  stub_request(:post, "http://localhost:5000/v3/auth/tokens").
130
146
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
131
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("network", "neutron")), :headers => token_header)
147
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3("networking", "neutron")), :headers => token_header)
132
148
 
133
- cloud.network.must_be_kind_of Misty::Openstack::Neutron::V2_0
149
+ cloud.networking.must_be_kind_of Misty::Openstack::Neutron::V2_0
150
+ end
151
+
152
+ it "#nfv_orchestration" do
153
+ stub_request(:post, "http://localhost:5000/v3/auth/tokens").
154
+ with(:body => JSON.dump(auth_body), :headers => auth_headers).
155
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3("nfv-orchestration", "tacker")), :headers => token_header)
156
+
157
+ cloud.nfv_orchestration.must_be_kind_of Misty::Openstack::Tacker::V1_0
134
158
  end
135
159
 
136
160
  it "#objectStorage" do
@@ -168,4 +192,23 @@ describe "Misty::Cloud" do
168
192
 
169
193
  cloud.shared_file_systems.must_be_kind_of Misty::Openstack::Manila::V2
170
194
  end
195
+
196
+ describe "prefixed service name" do
197
+ it "#network match networking" do
198
+ stub_request(:post, "http://localhost:5000/v3/auth/tokens").
199
+ with(:body => JSON.dump(auth_body), :headers => auth_headers).
200
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3("networking", "neutron")), :headers => token_header)
201
+
202
+ cloud.network.must_be_kind_of Misty::Openstack::Neutron::V2_0
203
+ end
204
+
205
+ it "#data is ambiguous" do
206
+ stub_request(:post, "http://localhost:5000/v3/auth/tokens").
207
+ with(:body => JSON.dump(auth_body), :headers => auth_headers)
208
+
209
+ proc do
210
+ cloud.data
211
+ end.must_raise NoMethodError
212
+ end
213
+ end
171
214
  end
@@ -82,8 +82,8 @@ describe Misty do
82
82
  validate(service)
83
83
  end
84
84
 
85
- it "has network service" do
86
- service = Misty::services.find { |s| s.name == :network}
85
+ it "has networking service" do
86
+ service = Misty::services.find { |s| s.name == :networking}
87
87
  validate(service)
88
88
  end
89
89
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: misty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilles Dubreuil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -144,11 +144,15 @@ files:
144
144
  - lib/misty/openstack/ceilometer/ceilometer_v2.rb
145
145
  - lib/misty/openstack/ceilometer/v2.rb
146
146
  - lib/misty/openstack/cinder/cinder_v1.rb
147
+ - lib/misty/openstack/cinder/cinder_v2.rb
147
148
  - lib/misty/openstack/cinder/cinder_v3.rb
148
149
  - lib/misty/openstack/cinder/v1.rb
150
+ - lib/misty/openstack/cinder/v2.rb
149
151
  - lib/misty/openstack/cinder/v3.rb
150
152
  - lib/misty/openstack/designate/designate_v2.rb
151
153
  - lib/misty/openstack/designate/v2.rb
154
+ - lib/misty/openstack/freezer/freezer_v1.rb
155
+ - lib/misty/openstack/freezer/v1.rb
152
156
  - lib/misty/openstack/glance/glance_v1.rb
153
157
  - lib/misty/openstack/glance/glance_v2.rb
154
158
  - lib/misty/openstack/glance/v1.rb
@@ -170,10 +174,14 @@ files:
170
174
  - lib/misty/openstack/manila/manila_v2.rb
171
175
  - lib/misty/openstack/manila/v2.rb
172
176
  - lib/misty/openstack/microversion.rb
177
+ - lib/misty/openstack/murano/murano_v1.rb
178
+ - lib/misty/openstack/murano/v1.rb
173
179
  - lib/misty/openstack/neutron/neutron_v2_0.rb
174
180
  - lib/misty/openstack/neutron/v2_0.rb
175
181
  - lib/misty/openstack/nova/nova_v2_1.rb
176
182
  - lib/misty/openstack/nova/v2_1.rb
183
+ - lib/misty/openstack/octavia/octavia_v2_0.rb
184
+ - lib/misty/openstack/octavia/v2_0.rb
177
185
  - lib/misty/openstack/sahara/sahara_v1_1.rb
178
186
  - lib/misty/openstack/sahara/v1_1.rb
179
187
  - lib/misty/openstack/searchlight/searchlight_v1.rb
@@ -182,6 +190,8 @@ files:
182
190
  - lib/misty/openstack/senlin/v1.rb
183
191
  - lib/misty/openstack/swift/swift_v1.rb
184
192
  - lib/misty/openstack/swift/v1.rb
193
+ - lib/misty/openstack/tacker/tacker_v1_0.rb
194
+ - lib/misty/openstack/tacker/v1_0.rb
185
195
  - lib/misty/openstack/trove/trove_v1_0.rb
186
196
  - lib/misty/openstack/trove/v1_0.rb
187
197
  - lib/misty/openstack/zaqar/v2.rb