misty 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +222 -1
  3. data/lib/misty.rb +8 -0
  4. data/lib/misty/auth.rb +60 -0
  5. data/lib/misty/auth/auth_v2.rb +46 -0
  6. data/lib/misty/auth/auth_v3.rb +58 -0
  7. data/lib/misty/autoload.rb +82 -0
  8. data/lib/misty/cloud.rb +133 -0
  9. data/lib/misty/http/client.rb +115 -0
  10. data/lib/misty/http/direct.rb +26 -0
  11. data/lib/misty/http/method_builder.rb +96 -0
  12. data/lib/misty/http/request.rb +75 -0
  13. data/lib/misty/misty.rb +51 -0
  14. data/lib/misty/openstack/aodh/aodh_v2.rb +12 -0
  15. data/lib/misty/openstack/aodh/v2.rb +20 -0
  16. data/lib/misty/openstack/ceilometer/ceilometer_v2.rb +13 -0
  17. data/lib/misty/openstack/ceilometer/v2.rb +20 -0
  18. data/lib/misty/openstack/cinder/cinder_v1.rb +35 -0
  19. data/lib/misty/openstack/cinder/cinder_v3.rb +148 -0
  20. data/lib/misty/openstack/cinder/v1.rb +24 -0
  21. data/lib/misty/openstack/cinder/v3.rb +24 -0
  22. data/lib/misty/openstack/designate/designate_v2.rb +69 -0
  23. data/lib/misty/openstack/designate/v2.rb +20 -0
  24. data/lib/misty/openstack/glance/glance_v1.rb +16 -0
  25. data/lib/misty/openstack/glance/glance_v2.rb +29 -0
  26. data/lib/misty/openstack/glance/v1.rb +20 -0
  27. data/lib/misty/openstack/glance/v2.rb +20 -0
  28. data/lib/misty/openstack/heat/heat_v1.rb +85 -0
  29. data/lib/misty/openstack/heat/v1.rb +24 -0
  30. data/lib/misty/openstack/ironic/ironic_v1.rb +71 -0
  31. data/lib/misty/openstack/ironic/v1.rb +26 -0
  32. data/lib/misty/openstack/karbor/karbor_v1.rb +32 -0
  33. data/lib/misty/openstack/karbor/v1.rb +20 -0
  34. data/lib/misty/openstack/keystone/keystone_v2_0.rb +11 -0
  35. data/lib/misty/openstack/keystone/keystone_v2_0_ext.rb +32 -0
  36. data/lib/misty/openstack/keystone/keystone_v3.rb +147 -0
  37. data/lib/misty/openstack/keystone/keystone_v3_ext.rb +124 -0
  38. data/lib/misty/openstack/keystone/v2_0.rb +23 -0
  39. data/lib/misty/openstack/keystone/v3.rb +23 -0
  40. data/lib/misty/openstack/magnum/magnum_v1.rb +41 -0
  41. data/lib/misty/openstack/magnum/v1.rb +26 -0
  42. data/lib/misty/openstack/manila/manila_v2.rb +143 -0
  43. data/lib/misty/openstack/manila/v2.rb +26 -0
  44. data/lib/misty/openstack/microversion.rb +62 -0
  45. data/lib/misty/openstack/neutron/neutron_v2_0.rb +205 -0
  46. data/lib/misty/openstack/neutron/v2_0.rb +20 -0
  47. data/lib/misty/openstack/nova/nova_v2_1.rb +269 -0
  48. data/lib/misty/openstack/nova/v2_1.rb +40 -0
  49. data/lib/misty/openstack/sahara/sahara_v1_1.rb +77 -0
  50. data/lib/misty/openstack/sahara/v1_1.rb +20 -0
  51. data/lib/misty/openstack/searchlight/searchlight_v1.rb +15 -0
  52. data/lib/misty/openstack/searchlight/v1.rb +20 -0
  53. data/lib/misty/openstack/senlin/senlin_v1.rb +66 -0
  54. data/lib/misty/openstack/senlin/v1.rb +20 -0
  55. data/lib/misty/openstack/swift/swift_v1.rb +23 -0
  56. data/lib/misty/openstack/swift/v1.rb +20 -0
  57. data/lib/misty/openstack/trove/trove_v1_0.rb +51 -0
  58. data/lib/misty/openstack/trove/v1_0.rb +20 -0
  59. data/lib/misty/openstack/zaqar/v2.rb +20 -0
  60. data/lib/misty/openstack/zaqar/zaqar_v2.rb +46 -0
  61. data/lib/misty/version.rb +2 -2
  62. data/test/integration/compute_test.rb +35 -0
  63. data/test/integration/network_test.rb +34 -0
  64. data/test/integration/orchestration_test.rb +92 -0
  65. data/test/integration/test_helper.rb +19 -0
  66. data/test/integration/vcr/compute_using_nova_v2_1.yml +1107 -0
  67. data/test/integration/vcr/network_using_neutron_v2_0.yml +1029 -0
  68. data/test/integration/vcr/orchestration_using_heat_v1.yml +1457 -0
  69. data/test/unit/auth_helper.rb +52 -0
  70. data/test/unit/auth_test.rb +99 -0
  71. data/test/unit/cloud/requests_test.rb +113 -0
  72. data/test/unit/cloud/services_test.rb +171 -0
  73. data/test/unit/cloud_test.rb +145 -0
  74. data/test/unit/http/client_test.rb +74 -0
  75. data/test/unit/http/direct_test.rb +103 -0
  76. data/test/unit/http/method_builder_test.rb +133 -0
  77. data/test/unit/http/request_test.rb +123 -0
  78. data/test/unit/misty_test.rb +36 -0
  79. data/test/unit/openstack/APIs_test.rb +40 -0
  80. data/test/unit/openstack/microversion_test.rb +70 -0
  81. data/test/unit/service_helper.rb +25 -0
  82. data/test/unit/test_helper.rb +8 -0
  83. metadata +170 -5
@@ -0,0 +1,40 @@
1
+ require 'misty/http/client'
2
+ require 'misty/openstack/microversion'
3
+ require "misty/openstack/nova/nova_v2_1"
4
+
5
+ module Misty
6
+ module Openstack
7
+ module Nova
8
+ class V2_1 < Misty::HTTP::Client
9
+ extend Misty::Openstack::NovaV2_1
10
+ include Misty::HTTP::Microversion
11
+
12
+ def self.api
13
+ v2_1
14
+ end
15
+
16
+ # Overrides API because the definitions don't specify prefix
17
+ def self.list_all_major_versions
18
+ http_get("/", headers)
19
+ end
20
+
21
+ def self.show_details_of_specific_api_version(version)
22
+ http_get("/#{version}", headers)
23
+ end
24
+
25
+ def self.service_names
26
+ %w{compute}
27
+ end
28
+
29
+ def microversion_header
30
+ {
31
+ # Remove once depcrecated
32
+ "X-Openstack-Nova-API-Version" => "#{@version}",
33
+ # From version 2.27 the OpenStack-API-Version is used
34
+ "X-Openstack-API-Version" => "#{baseclass.downcase} #{@version}"
35
+ }
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,77 @@
1
+ module Misty::Openstack::SaharaV1_1
2
+ def v1_1
3
+ {"/v1.1/{project_id}/cluster-templates/{cluster_template_id}"=>
4
+ {:GET=>[:show_cluster_template_details],
5
+ :PUT=>[:update_cluster_templates],
6
+ :DELETE=>[:delete_cluster_template]},
7
+ "/v1.1/{project_id}/cluster-templates"=>
8
+ {:GET=>[:list_cluster_templates], :POST=>[:create_cluster_templates]},
9
+ "/v1.1/{project_id}/clusters"=>
10
+ {:GET=>[:list_available_clusters], :POST=>[:create_cluster]},
11
+ "/v1.1/{project_id}/clusters/multiple"=>{:POST=>[:create_multiple_clusters]},
12
+ "/v1.1/{project_id}/clusters/{cluster_id}"=>
13
+ {:GET=>[:show_details_of_a_cluster, :show_progress],
14
+ :DELETE=>[:delete_a_cluster],
15
+ :PUT=>[:scale_cluster],
16
+ :PATCH=>[:update_cluster]},
17
+ "/v1.1/{project_id}/data-sources/{data_source_id}"=>
18
+ {:GET=>[:show_data_source_details],
19
+ :DELETE=>[:delete_data_source],
20
+ :PUT=>[:update_data_source]},
21
+ "/v1.1/{project_id}/data-sources"=>
22
+ {:GET=>[:list_data_sources], :POST=>[:create_data_source]},
23
+ "/v1.1/{project_id}/images/{image_id}/tag"=>{:POST=>[:add_tags_to_image]},
24
+ "/v1.1/{project_id}/images/{image_id}"=>
25
+ {:GET=>[:show_image_details],
26
+ :POST=>[:register_image],
27
+ :DELETE=>[:unregister_image]},
28
+ "/v1.1/{project_id}/images/{image_id}/untag"=>
29
+ {:POST=>[:remove_tags_from_image]},
30
+ "/v1.1/{project_id}/images"=>{:GET=>[:list_images]},
31
+ "/v1.1/{project_id}/job-binaries"=>
32
+ {:GET=>[:list_job_binaries], :POST=>[:create_job_binary]},
33
+ "/v1.1/{project_id}/job-binaries/{job_binary_id}"=>
34
+ {:GET=>[:show_job_binary_details],
35
+ :DELETE=>[:delete_job_binary],
36
+ :PUT=>[:update_job_binary]},
37
+ "/v1.1/{project_id}/job-binaries/{job_binary_id}/data"=>
38
+ {:GET=>[:show_job_binary_data]},
39
+ "/v1.1/{project_id}/job-executions/{job_execution_id}/refresh-status"=>
40
+ {:GET=>[:refresh_job_execution_status]},
41
+ "/v1.1/{project_id}/job-executions"=>{:GET=>[:list_job_executions]},
42
+ "/v1.1/{project_id}/job-executions/{job_execution_id}"=>
43
+ {:GET=>[:show_job_execution_details],
44
+ :DELETE=>[:delete_job_execution],
45
+ :PATCH=>[:update_job_execution]},
46
+ "/v1.1/{project_id}/job-executions/{job_execution_id}/cancel"=>
47
+ {:GET=>[:cancel_job_execution]},
48
+ "/v1.1/{project_id}/job-types"=>{:GET=>[:list_job_types]},
49
+ "/v1.1/{project_id}/job-binary-internals/{name}"=>
50
+ {:PUT=>[:create_job_binary_internal]},
51
+ "/v1.1/{project_id}/job-binary-internals/{job_binary_internals_id}/data"=>
52
+ {:GET=>[:show_job_binary_internal_data]},
53
+ "/v1.1/{project_id}/job-binary-internals/{job_binary_internals_id}"=>
54
+ {:GET=>[:show_job_binary_internal_details],
55
+ :DELETE=>[:delete_job_binary_internal],
56
+ :PATCH=>[:update_job_binary_internal]},
57
+ "/v1.1/{project_id}/job-binary-internals"=>
58
+ {:GET=>[:list_job_binary_internals]},
59
+ "/v1.1/{project_id}/jobs/{job_id}/execute"=>{:POST=>[:run_job]},
60
+ "/v1.1/{project_id}/jobs"=>{:GET=>[:list_jobs], :POST=>[:create_job]},
61
+ "/v1.1/{project_id}/jobs/{job_id}"=>
62
+ {:GET=>[:show_job_details],
63
+ :DELETE=>[:remove_job],
64
+ :PATCH=>[:update_job_object]},
65
+ "/v1.1/{project_id}/node-group-templates"=>
66
+ {:GET=>[:list_node_group_templates], :POST=>[:create_node_group_template]},
67
+ "/v1.1/{project_id}/node-group-templates/{node_group_template_id}"=>
68
+ {:GET=>[:show_node_group_template_details],
69
+ :DELETE=>[:delete_node_group_template],
70
+ :PUT=>[:update_node_group_template]},
71
+ "/v1.1/{project_id}/plugins/{plugin_name}"=>
72
+ {:GET=>[:show_plugin_details], :PATCH=>[:update_plugin_details]},
73
+ "/v1.1/{project_id}/plugins"=>{:GET=>[:list_plugins]},
74
+ "/v1.1/{project_id}/plugins/{plugin_name}/{version}"=>
75
+ {:GET=>[:show_plugin_version_details]}}
76
+ end
77
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/sahara/sahara_v1_1"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Sahara
7
+ class V1_1 < Misty::HTTP::Client
8
+ extend Misty::Openstack::SaharaV1_1
9
+
10
+ def self.api
11
+ v1_1
12
+ end
13
+
14
+ def self.service_names
15
+ %w{data-processing}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,15 @@
1
+ module Misty::Openstack::SearchlightV1
2
+ def v1
3
+ {"/v1/search/plugins"=>{:GET=>[:list_plugins]},
4
+ "/v1/search/facets"=>{:GET=>[:list_facets]},
5
+ "/v1/search"=>
6
+ {:POST=>
7
+ [:create_a_general_search,
8
+ :create_a_type_restricted_search,
9
+ :create_an_administrative_search,
10
+ :create_a_free_text_search,
11
+ :create_a_phrase_search,
12
+ :create_a_compound_boolean_search,
13
+ :create_an_aggregated_search]}}
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/searchlight/searchlight_v1"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Searchlight
7
+ class V1 < Misty::HTTP::Client
8
+ extend Misty::Openstack::SearchlightV1
9
+
10
+ def self.api
11
+ v1
12
+ end
13
+
14
+ def self.service_names
15
+ %w{search}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,66 @@
1
+ module Misty::Openstack::SenlinV1
2
+ def v1
3
+ {"/"=>{:GET=>[:list_major_versions]},
4
+ "/{version}/"=>{:GET=>[:show_details_of_an_api_version]},
5
+ "/v1/build-info"=>{:GET=>[:shows_build_information]},
6
+ "/v1/profile-types"=>{:GET=>[:list_profile_types]},
7
+ "/v1/profile-types/{profile_type}"=>{:GET=>[:show_profile_type_details]},
8
+ "/v1/profile-types/{profile_type}/ops"=>
9
+ {:GET=>[:list_profile_type_operations]},
10
+ "/v1/profiles"=>{:GET=>[:list_profiles], :POST=>[:create_profile]},
11
+ "/v1/profiles/{profile_id}"=>
12
+ {:GET=>[:show_profile_details],
13
+ :PATCH=>[:update_profile],
14
+ :DELETE=>[:delete_profile]},
15
+ "/v1/profiles/validate"=>{:POST=>[:validate_profile]},
16
+ "/v1/policy-types"=>{:GET=>[:list_policy_types]},
17
+ "/v1/policy-types/{policy_type}"=>{:GET=>[:show_policy_type_details]},
18
+ "/v1/policies"=>{:GET=>[:list_policies], :POST=>[:create_policy]},
19
+ "/v1/policies/{policy_id}"=>
20
+ {:GET=>[:show_policy_details],
21
+ :PATCH=>[:update_policy],
22
+ :DELETE=>[:delete_policy]},
23
+ "/v1/policies/validate"=>{:POST=>[:validate_policy]},
24
+ "/v1/clusters"=>{:GET=>[:list_clusters], :POST=>[:create_cluster]},
25
+ "/v1/clusters/{cluster_id}"=>
26
+ {:GET=>[:show_cluster_details],
27
+ :PATCH=>[:update_cluster],
28
+ :DELETE=>[:delete_cluster]},
29
+ "/v1/clusters/{cluster_id}/actions"=>
30
+ {:POST=>
31
+ [:resize_a_cluster,
32
+ :scale_in_a_cluster,
33
+ :scale_out_a_cluster,
34
+ :add_nodes_to_a_cluster,
35
+ :remove_nodes_from_a_cluster,
36
+ :replace_nodes_in_a_cluster,
37
+ :attach_a_policy_to_a_cluster,
38
+ :detach_a_policy_from_a_cluster,
39
+ :update_a_policy_on_a_cluster,
40
+ :check_a_cluster_s_health_status,
41
+ :recover_a_cluster_to_a_healthy_status]},
42
+ "/v1/clusters/{cluster_id}/attrs/{path}"=>
43
+ {:GET=>[:collect_attributes_across_a_cluster]},
44
+ "/v1/clusters/{cluster_id}/ops"=>
45
+ {:POST=>[:perform_an_operation_on_a_cluster]},
46
+ "/v1/clusters/{cluster_id}/policies"=>{:GET=>[:list_all_cluster_policies]},
47
+ "/v1/clusters/{cluster_id}/policies/{policy_id}"=>
48
+ {:GET=>[:show_cluster_policy_details]},
49
+ "/v1/nodes"=>{:GET=>[:list_nodes], :POST=>[:create_node]},
50
+ "/v1/nodes/{node_id}"=>
51
+ {:GET=>[:show_node_details],
52
+ :PATCH=>[:update_node],
53
+ :DELETE=>[:delete_node]},
54
+ "/v1/nodes/{node_id}/actions"=>
55
+ {:POST=>[:check_a_node_s_health, :recover_a_node_to_healthy_status]},
56
+ "/v1/nodes/{node_id}/ops"=>{:POST=>[:perform_an_operation_on_a_node]},
57
+ "/v1/receivers"=>{:GET=>[:list_receivers], :POST=>[:create_receiver]},
58
+ "/v1/receivers/{receiver_id}"=>
59
+ {:GET=>[:show_receiver_details], :DELETE=>[:delete_receiver]},
60
+ "/v1/events"=>{:GET=>[:list_events]},
61
+ "/v1/events/{event_id}"=>{:GET=>[:shows_event_details]},
62
+ "/v1/webhooks/{webhook_id}/trigger"=>{:POST=>[:trigger_webhook_action]},
63
+ "/v1/actions"=>{:GET=>[:list_actions]},
64
+ "/v1/actions/{action_id}"=>{:GET=>[:show_action_details]}}
65
+ end
66
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/senlin/senlin_v1"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Senlin
7
+ class V1 < Misty::HTTP::Client
8
+ extend Misty::Openstack::SenlinV1
9
+
10
+ def self.api
11
+ v1
12
+ end
13
+
14
+ def self.service_names
15
+ %w{clustering}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ module Misty::Openstack::SwiftV1
2
+ def v1
3
+ {"/info"=>{:GET=>[:list_activated_capabilities]},
4
+ "/v1/{account}"=>
5
+ {:GET=>[:show_account_details_and_list_containers],
6
+ :POST=>[:create_update_or_delete_account_metadata],
7
+ :HEAD=>[:show_account_metadata]},
8
+ "/v1/{account}/{container}"=>
9
+ {:GET=>[:show_container_details_and_list_objects],
10
+ :PUT=>[:create_container],
11
+ :POST=>[:create_update_or_delete_container_metadata],
12
+ :HEAD=>[:show_container_metadata],
13
+ :DELETE=>[:delete_container]},
14
+ "/v1/{account}/{container}/{object}"=>
15
+ {:GET=>[:get_object_content_and_metadata],
16
+ :PUT=>[:create_or_replace_object],
17
+ :COPY=>[:copy_object],
18
+ :DELETE=>[:delete_object],
19
+ :HEAD=>[:show_object_metadata],
20
+ :POST=>[:create_or_update_object_metadata]},
21
+ "/v1/endpoints"=>{:GET=>[:list_endpoints]}}
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/swift/swift_v1"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Swift
7
+ class V1 < Misty::HTTP::Client
8
+ extend Misty::Openstack::SwiftV1
9
+
10
+ def self.api
11
+ v1
12
+ end
13
+
14
+ def self.service_names
15
+ %w{object-storage object-store}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,51 @@
1
+ module Misty::Openstack::TroveV1_0
2
+ def v1_0
3
+ {"/"=>{:GET=>[:list_versions]},
4
+ "/v1.0"=>{:GET=>[:show_version_details]},
5
+ "/v1.0/{accountId}/instances/{instanceId}"=>
6
+ {:DELETE=>[:delete_database_instance],
7
+ :GET=>[:show_database_instance_details],
8
+ :PUT=>[:attach_configuration_group, :detach_configuration_group],
9
+ :PATCH=>[:detach_replica]},
10
+ "/v1.0/{accountId}/instances"=>
11
+ {:POST=>[:create_database_instance], :GET=>[:list_database_instances]},
12
+ "/v1.0/{accountId}/instances/{instanceId}/configuration"=>
13
+ {:GET=>[:list_configuration_defaults]},
14
+ "/v1.0/{accountId}/instances/{instanceId}/action"=>
15
+ {:POST=>
16
+ [:restart_instance,
17
+ :resize_instance,
18
+ :resize_instance_volume,
19
+ :promote_instance_to_replica_source,
20
+ :delete_replication_base_instance]},
21
+ "/v1.0/{accountId}/instances/{instanceId}/databases/{databaseName}"=>
22
+ {:DELETE=>[:delete_database]},
23
+ "/v1.0/{accountId}/instances/{instanceId}/databases"=>
24
+ {:POST=>[:create_database], :GET=>[:list_instance_databases]},
25
+ "/v1.0/{accountId}/instances/{instanceId}/root"=>
26
+ {:POST=>[:enable_root_user],
27
+ :GET=>[:show_root_enabled_status_for_database_instance],
28
+ :DELETE=>[:disable_root_user]},
29
+ "/v1.0/{accountId}/instances/{instanceId}/users/{name}"=>
30
+ {:DELETE=>[:delete_user]},
31
+ "/v1.0/{accountId}/instances/{instanceId}/users"=>
32
+ {:POST=>[:create_user], :GET=>[:list_database_instance_users]},
33
+ "/v1.0/{accountId}/flavors/{flavorId}"=>{:GET=>[:show_flavor_details]},
34
+ "/v1.0/{accountId}/flavors"=>{:GET=>[:list_flavors]},
35
+ "/v1.0/{accountId}/datastores/versions/{datastore_version_id}/parameters/{parameter_name}"=>
36
+ {:GET=>[:show_configuration_parameter_details]},
37
+ "/v1.0/{accountId}/datastores/{datastore_name}/versions"=>
38
+ {:GET=>[:list_datastore_versions]},
39
+ "/v1.0/{accountId}/datastores/versions/{datastore_version_id}/parameters"=>
40
+ {:GET=>[:list_configuration_parameters]},
41
+ "/v1.0/{accountId}/configurations"=>
42
+ {:POST=>[:create_configuration_group], :GET=>[:list_configuration_groups]},
43
+ "/v1.0/{accountId}/configurations/{configId}/instances"=>
44
+ {:GET=>[:list_configuration_group_instances]},
45
+ "/v1.0/{accountId}/configurations/{configId}"=>
46
+ {:DELETE=>[:delete_configuration_group],
47
+ :PATCH=>[:patch_configuration_group],
48
+ :GET=>[:show_configuration_group_details],
49
+ :PUT=>[:update_configuration_group]}}
50
+ end
51
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/trove/trove_v1_0"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Trove
7
+ class V1_0 < Misty::HTTP::Client
8
+ extend Misty::Openstack::TroveV1_0
9
+
10
+ def self.api
11
+ v1_0
12
+ end
13
+
14
+ def self.service_names
15
+ %w{database}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/zaqar/zaqar_v2"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Zaqar
7
+ class V2 < Misty::HTTP::Client
8
+ extend Misty::Openstack::ZaqarV2
9
+
10
+ def self.api
11
+ v2
12
+ end
13
+
14
+ def self.service_names
15
+ %w{messaging}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,46 @@
1
+ module Misty::Openstack::ZaqarV2
2
+ def v2
3
+ {"/"=>{:GET=>[:list_major_versions]},
4
+ "/v2/queues"=>{:GET=>[:list_queues]},
5
+ "/v2/queues/{queue_name}"=>
6
+ {:PUT=>[:create_queue],
7
+ :PATCH=>[:update_queue],
8
+ :GET=>[:show_queue_details],
9
+ :DELETE=>[:delete_queue]},
10
+ "/v2/queues/{queue_name}/stats"=>{:GET=>[:get_queue_stats]},
11
+ "/v2/queues/{queue_name}/share"=>{:POST=>[:pre_signed_queue]},
12
+ "/v2/queues/{queue_name}/purge"=>{:POST=>[:purge_queue]},
13
+ "/v2/queues/{queue_name}/messages"=>
14
+ {:POST=>[:post_message], :GET=>[:list_messages]},
15
+ "/v2/queues/{queue_name}/messages?ids={ids}"=>
16
+ {:GET=>[:get_a_set_of_messages_by_id],
17
+ :DELETE=>[:delete_a_set_of_messages_by_id]},
18
+ "/v2/queues/{queue_name}/messages/{messageId}"=>
19
+ {:GET=>[:get_a_specific_message], :DELETE=>[:delete_a_specific_message]},
20
+ "/v2//queues/{queue_name}/claims"=>{:POST=>[:claim_messages]},
21
+ "/v2/queues/{queue_name}/claims/{claim_id}"=>
22
+ {:GET=>[:query_claim],
23
+ :PATCH=>[:update_renew_claim],
24
+ :DELETE=>[:delete_release_claim]},
25
+ "/v2/queues/{queue_name}/subscriptions"=>
26
+ {:GET=>[:list_subscriptions], :POST=>[:create_subscription]},
27
+ "/v2/queues/{queue_name}/subscriptions/{subscription_id}"=>
28
+ {:PATCH=>[:update_subscription],
29
+ :GET=>[:show_subscription_details],
30
+ :DELETE=>[:delete_subscription]},
31
+ "/v2/ping"=>{:GET=>[:ping]},
32
+ "/v2/health"=>{:GET=>[:health]},
33
+ "/v2/pools"=>{:GET=>[:list_pools]},
34
+ "/v2/pools/{pool_name}"=>
35
+ {:PUT=>[:create_pool],
36
+ :PATCH=>[:update_pool],
37
+ :GET=>[:show_pool_details],
38
+ :DELETE=>[:delete_pool]},
39
+ "/v2/flavors"=>{:GET=>[:list_flavors]},
40
+ "/v2/flavors/{flavor_name}"=>
41
+ {:PUT=>[:create_flavor],
42
+ :PATCH=>[:update_flavor],
43
+ :GET=>[:show_flavor_details],
44
+ :DELETE=>[:delete_flavor]}}
45
+ end
46
+ end