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,16 @@
1
+ module Misty::Openstack::GlanceV1
2
+ def v1
3
+ {"/v1/images"=>{:POST=>[:create_image], :GET=>[:list_images]},
4
+ "/v1/images/detail"=>{:GET=>[:list_images_with_details]},
5
+ "/v1/images/{image_id}"=>
6
+ {:PUT=>[:update_image],
7
+ :GET=>[:show_image_details_and_image_data],
8
+ :HEAD=>[:show_image_metadata],
9
+ :DELETE=>[:delete_image]},
10
+ "/v1/images/{image_id}/members/{member_id}"=>
11
+ {:PUT=>[:add_member_to_image], :DELETE=>[:remove_member]},
12
+ "/v1/images/{image_id}/members"=>
13
+ {:PUT=>[:replace_membership_list_for_an_image]},
14
+ "/v1/shared-images/{owner_id}"=>{:GET=>[:list_shared_images]}}
15
+ end
16
+ end
@@ -0,0 +1,29 @@
1
+ module Misty::Openstack::GlanceV2
2
+ def v2
3
+ {"/v2/images"=>{:POST=>[:create_an_image], :GET=>[:show_images]},
4
+ "/v2/images/{image_id}"=>
5
+ {:GET=>[:show_image_details],
6
+ :PATCH=>[:update_an_image],
7
+ :DELETE=>[:delete_an_image]},
8
+ "/v2/images/{image_id}/actions/deactivate"=>{:POST=>[:deactivate_image]},
9
+ "/v2/images/{image_id}/actions/reactivate"=>{:POST=>[:reactivate_image]},
10
+ "/v2/images/{image_id}/members"=>
11
+ {:POST=>[:create_image_member], :GET=>[:list_image_members]},
12
+ "/v2/images/{image_id}/members/{member_id}"=>
13
+ {:GET=>[:show_image_member_details],
14
+ :PUT=>[:update_image_member],
15
+ :DELETE=>[:delete_image_member]},
16
+ "/v2/images/{image_id}/tags/{tag}"=>
17
+ {:PUT=>[:add_image_tag], :DELETE=>[:delete_image_tag]},
18
+ "/v2/schemas/images"=>{:GET=>[:show_images_schema]},
19
+ "/v2/schemas/image"=>{:GET=>[:show_image_schema]},
20
+ "/v2/schemas/members"=>{:GET=>[:show_image_members_schema]},
21
+ "/v2/schemas/member"=>{:GET=>[:show_image_member_schema]},
22
+ "/v2/images/{image_id}/file"=>
23
+ {:PUT=>[:upload_binary_image_data], :GET=>[:download_binary_image_data]},
24
+ "/v2/tasks"=>{:POST=>[:create_task], :GET=>[:list_tasks]},
25
+ "/v2/tasks/{task_id}"=>{:GET=>[:show_task_details]},
26
+ "/v2/schemas/tasks"=>{:GET=>[:show_tasks_schema]},
27
+ "/v2/schemas/task"=>{:GET=>[:show_task_schema]}}
28
+ end
29
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/glance/glance_v1"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Glance
7
+ class V1 < Misty::HTTP::Client
8
+ extend Misty::Openstack::GlanceV1
9
+
10
+ def self.api
11
+ v1
12
+ end
13
+
14
+ def self.service_names
15
+ %w{image}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/glance/glance_v2"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Glance
7
+ class V2 < Misty::HTTP::Client
8
+ extend Misty::Openstack::GlanceV2
9
+
10
+ def self.api
11
+ v2
12
+ end
13
+
14
+ def self.service_names
15
+ %w{image}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,85 @@
1
+ module Misty::Openstack::HeatV1
2
+ def v1
3
+ {"/v1/{tenant_id}/build_info"=>{:GET=>[:show_build_information]},
4
+ "/"=>{:GET=>[:list_versions]},
5
+ "/v1/{tenant_id}/stacks"=>
6
+ {:POST=>[:create_stack, :adopt_stack], :GET=>[:list_stacks]},
7
+ "/v1/{tenant_id}/stacks/preview"=>{:POST=>[:preview_stack]},
8
+ "/v1/{tenant_id}/stacks/{stack_identity}"=>
9
+ {:GET=>[:find_stack], :DELETE=>[:find_stack_for_deletion]},
10
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}"=>
11
+ {:GET=>[:show_stack_details],
12
+ :PUT=>[:update_stack],
13
+ :PATCH=>[:update_stack_patch],
14
+ :DELETE=>[:delete_stack]},
15
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/preview"=>
16
+ {:PUT=>[:preview_stack_update], :PATCH=>[:preview_stack_update_patch]},
17
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/abandon"=>
18
+ {:DELETE=>[:abandon_stack]},
19
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/export"=>
20
+ {:GET=>[:export_stack]},
21
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/template"=>
22
+ {:GET=>[:get_stack_template]},
23
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/environment"=>
24
+ {:GET=>[:get_stack_environment]},
25
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/files"=>
26
+ {:GET=>[:get_stack_files]},
27
+ "/v1/{tenant_id}/stacks/{stack_identity}/resources"=>
28
+ {:GET=>[:find_stack_resources]},
29
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources"=>
30
+ {:GET=>[:list_stack_resources]},
31
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name}"=>
32
+ {:GET=>[:show_resource_data]},
33
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name}/metadata"=>
34
+ {:GET=>[:show_resource_metadata]},
35
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name}/signal"=>
36
+ {:POST=>[:send_a_signal_to_a_resource]},
37
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name_or_physical_id}"=>
38
+ {:PATCH=>[:mark_a_resource_as_unhealthy]},
39
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/outputs"=>
40
+ {:GET=>[:list_outputs]},
41
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/outputs/{output_key}"=>
42
+ {:GET=>[:show_output]},
43
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/snapshots"=>
44
+ {:POST=>[:snapshot_a_stack], :GET=>[:list_snapshots]},
45
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/snapshots/{snapshot_id}"=>
46
+ {:GET=>[:show_snapshot], :DELETE=>[:delete_a_snapshot]},
47
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/snapshots/{snapshot_id}/restore"=>
48
+ {:POST=>[:restore_snapshot]},
49
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/actions"=>
50
+ {:POST=>
51
+ [:suspend_stack,
52
+ :resume_stack,
53
+ :cancel_stack_update,
54
+ :check_stack_resources]},
55
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/events"=>
56
+ {:GET=>[:list_stack_events]},
57
+ "/v1/{tenant_id}/stacks/{stack_name}/events"=>{:GET=>[:find_stack_events]},
58
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name}/events"=>
59
+ {:GET=>[:list_resource_events]},
60
+ "/v1/{tenant_id}/stacks/{stack_name}/{stack_id}/resources/{resource_name}/events/{event_id}"=>
61
+ {:GET=>[:show_event_details]},
62
+ "/v1/{tenant_id}/template_versions"=>{:GET=>[:list_template_versions]},
63
+ "/v1/{tenant_id}/template_versions/{template_version}/functions"=>
64
+ {:GET=>[:list_template_functions]},
65
+ "/v1/{tenant_id}/validate"=>{:POST=>[:validate_template]},
66
+ "/v1/{tenant_id}/software_configs"=>
67
+ {:POST=>[:create_configuration], :GET=>[:list_configs]},
68
+ "/v1/{tenant_id}/software_configs/{config_id}"=>
69
+ {:GET=>[:show_configuration_details], :DELETE=>[:delete_config]},
70
+ "/v1/{tenant_id}/software_deployments"=>
71
+ {:POST=>[:create_deployment], :GET=>[:list_deployments]},
72
+ "/v1/{tenant_id}/software_deployments/{deployment_id}"=>
73
+ {:GET=>[:show_deployment_details],
74
+ :PUT=>[:update_deployment],
75
+ :DELETE=>[:delete_deployment]},
76
+ "/v1/{tenant_id}/software_deployments/metadata/{server_id}"=>
77
+ {:GET=>[:show_server_configuration_metadata]},
78
+ "/v1/{tenant_id}/resource_types"=>{:GET=>[:list_resource_types]},
79
+ "/v1/{tenant_id}/resource_types/{type_name}/template"=>
80
+ {:GET=>[:show_resource_type_template]},
81
+ "/v1/{tenant_id}/resource_types/{type_name}"=>
82
+ {:GET=>[:show_resource_type_schema]},
83
+ "/v1/{tenant_id}/services"=>{:GET=>[:show_orchestration_engine_status]}}
84
+ end
85
+ end
@@ -0,0 +1,24 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/heat/heat_v1"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Heat
7
+ class V1 < Misty::HTTP::Client
8
+ extend Misty::Openstack::HeatV1
9
+
10
+ def self.api
11
+ v1
12
+ end
13
+
14
+ def self.prefix_path_to_ignore
15
+ "/v1/{tenant_id}"
16
+ end
17
+
18
+ def self.service_names
19
+ %w{orchestration}
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,71 @@
1
+ module Misty::Openstack::IronicV1
2
+ def v1
3
+ {"/"=>{:GET=>[:list_api_versions]},
4
+ "/v1/"=>{:GET=>[:show_v1_api]},
5
+ "/v1/nodes"=>{:POST=>[:create_node], :GET=>[:list_nodes]},
6
+ "/v1/nodes/detail"=>{:GET=>[:list_nodes_detailed]},
7
+ "/v1/nodes/{node_ident}"=>
8
+ {:GET=>[:show_node_details],
9
+ :PATCH=>[:update_node],
10
+ :DELETE=>[:delete_node]},
11
+ "/v1/nodes/{node_ident}/validate"=>{:GET=>[:validate_node]},
12
+ "/v1/nodes/{node_ident}/maintenance"=>
13
+ {:PUT=>[:set_maintenance_flag], :DELETE=>[:clear_maintenance_flag]},
14
+ "/v1/nodes/{node_ident}/management/boot_device"=>
15
+ {:PUT=>[:set_boot_device], :GET=>[:get_boot_device]},
16
+ "/v1/nodes/{node_ident}/management/boot_device/supported"=>
17
+ {:GET=>[:get_supported_boot_devices]},
18
+ "/v1/nodes/{node_ident}/management/inject_nmi"=>
19
+ {:PUT=>[:inject_nmi_non_masking_interrupts]},
20
+ "/v1/nodes/{node_ident}/states"=>{:GET=>[:node_state_summary]},
21
+ "/v1/nodes/{node_ident}/states/power"=>{:PUT=>[:change_node_power_state]},
22
+ "/v1/nodes/{node_ident}/states/provision"=>
23
+ {:PUT=>[:change_node_provision_state]},
24
+ "/v1/nodes/{node_ident}/states/raid"=>{:PUT=>[:set_raid_config]},
25
+ "/v1/nodes/{node_ident}/states/console"=>
26
+ {:GET=>[:get_console], :PUT=>[:start_stop_console]},
27
+ "/v1/nodes/{node_ident}/vendor_passthru/methods"=>{:GET=>[:list_methods]},
28
+ "/v1/nodes/{node_ident}/vendor_passthru?method={method_name}"=>
29
+ {:GET=>[:call_a_method]},
30
+ "/v1/nodes/{node_ident}/vifs"=>
31
+ {:GET=>[:list_attached_vifs_of_a_node], :POST=>[:attach_a_vif_to_a_node]},
32
+ "/v1/nodes/{node_ident}/vifs/{node_vif_ident}"=>
33
+ {:DELETE=>[:detach_vif_from_a_node]},
34
+ "/v1/portgroups"=>{:GET=>[:list_portgroups], :POST=>[:create_portgroup]},
35
+ "/v1/portgroups/detail"=>{:GET=>[:list_detailed_portgroups]},
36
+ "/v1/portgroups/{portgroup_id}"=>
37
+ {:GET=>[:show_portgroup_details],
38
+ :PATCH=>[:update_a_portgroup],
39
+ :DELETE=>[:delete_portgroup]},
40
+ "/v1/nodes/{node_ident}/portgroups"=>{:GET=>[:list_portgroups_by_node]},
41
+ "/v1/nodes/{node_ident}/portgroups/detail"=>
42
+ {:GET=>[:list_detailed_portgroups_by_node]},
43
+ "/v1/ports"=>{:GET=>[:list_ports], :POST=>[:create_port]},
44
+ "/v1/ports/detail"=>{:GET=>[:list_detailed_ports]},
45
+ "/v1/ports/{port_id}"=>
46
+ {:GET=>[:show_port_details],
47
+ :PATCH=>[:update_a_port],
48
+ :DELETE=>[:delete_port]},
49
+ "/v1/nodes/{node_ident}/ports"=>{:GET=>[:list_ports_by_node]},
50
+ "/v1/nodes/{node_ident}/ports/detail"=>{:GET=>[:list_detailed_ports_by_node]},
51
+ "/v1/portgroups/{portgroup_ident}/ports"=>{:GET=>[:list_ports_by_portgroup]},
52
+ "/v1/portgroups/{portgroup_ident}/ports/detail"=>
53
+ {:GET=>[:list_detailed_ports_by_portgroup]},
54
+ "/v1/drivers"=>{:GET=>[:list_drivers]},
55
+ "/v1/drivers/{driver_name}"=>{:GET=>[:show_driver_details]},
56
+ "/v1/drivers/{driver_name}/properties"=>{:GET=>[:show_driver_properties]},
57
+ "/v1/drivers/{driver_name}/raid/logical_disk_properties"=>
58
+ {:GET=>[:show_driver_logical_disk_properties]},
59
+ "/v1/drivers/{driver_name}/vendor_passthru/methods"=>{:GET=>[:list_driver_method]},
60
+ "/v1/drivers/{driver_name}/vendor_passthru?method={method_name}"=>
61
+ {:GET=>[:call_a_driver_method]},
62
+ "/v1/chassis/detail"=>{:GET=>[:list_chassis_with_details]},
63
+ "/v1/chassis/{chassis_id}"=>
64
+ {:GET=>[:show_chassis_details],
65
+ :PATCH=>[:update_chassis],
66
+ :DELETE=>[:delete_chassis]},
67
+ "/v1/chassis"=>{:POST=>[:create_chassis], :GET=>[:list_chassis]},
68
+ "/v1/lookup"=>{:GET=>[:agent_lookup]},
69
+ "/v1/heartbeat/{node_ident}"=>{:POST=>[:agent_heartbeat]}}
70
+ end
71
+ end
@@ -0,0 +1,26 @@
1
+ require 'misty/http/client'
2
+ require 'misty/openstack/microversion'
3
+ require "misty/openstack/ironic/ironic_v1"
4
+
5
+ module Misty
6
+ module Openstack
7
+ module Ironic
8
+ class V1 < Misty::HTTP::Client
9
+ extend Misty::Openstack::IronicV1
10
+ include Misty::HTTP::Microversion
11
+
12
+ def self.api
13
+ v1
14
+ end
15
+
16
+ def self.service_names
17
+ %w{baremetal}
18
+ end
19
+
20
+ def microversion_header
21
+ { "X-Openstack-Ironic-API-Version" => "#{@version}" }
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,32 @@
1
+ module Misty::Openstack::KarborV1
2
+ def v1
3
+ {"/v1/{tenant_id}/protectables"=>{:GET=>[:list_protectable_types]},
4
+ "/v1/{tenant_id}/protectables/{protectable_type}"=>
5
+ {:GET=>[:show_protectable_type]},
6
+ "/v1/{tenant_id}/protectables/{protectable_type}/instances"=>
7
+ {:GET=>[:list_protectable_instances]},
8
+ "/v1/{tenant_id}/protectables/{protectable_type}/instances/{resource_id}"=>
9
+ {:GET=>[:show_protectable_instance]},
10
+ "/v1/{tenant_id}/providers"=>{:GET=>[:list_protection_providers]},
11
+ "/v1/{tenant_id}/providers/{provider_id}"=>
12
+ {:GET=>[:show_protection_provider]},
13
+ "/v1/{tenant_id}/plans"=>{:GET=>[:list_plans], :POST=>[:create_plan]},
14
+ "/v1/{tenant_id}/plans/{plan_id}"=>
15
+ {:GET=>[:show_plan], :PUT=>[:update_plan], :DELETE=>[:delete_plan]},
16
+ "/v1/{tenant_id}/triggers"=>
17
+ {:GET=>[:list_triggers], :POST=>[:create_trigger]},
18
+ "/v1/{tenant_id}/triggers/{trigger_id}"=>
19
+ {:GET=>[:show_trigger], :PUT=>[:update_trigger], :DELETE=>[:delete_trigger]},
20
+ "/v1/{tenant_id}/scheduled_operations"=>
21
+ {:GET=>[:list_scheduled_operations], :POST=>[:create_scheduled_operation]},
22
+ "/v1/{tenant_id}/scheduled_operations/{scheduled_operation_id}"=>
23
+ {:GET=>[:show_scheduled_operation], :DELETE=>[:delete_scheduled_operation]},
24
+ "/v1/{tenant_id}/providers/{provider_id}/checkpoints"=>
25
+ {:GET=>[:list_checkpoints], :POST=>[:create_checkpoint]},
26
+ "/v1/{tenant_id}/providers/{provider_id}/checkpoints/{checkpoint_id}"=>
27
+ {:GET=>[:show_checkpoint], :DELETE=>[:delete_checkpoint]},
28
+ "/v1/{tenant_id}/restores"=>
29
+ {:GET=>[:list_restores], :POST=>[:create_restore]},
30
+ "/v1/{tenant_id}/restores/{restore_id}"=>{:GET=>[:show_restore]}}
31
+ end
32
+ end
@@ -0,0 +1,20 @@
1
+ require 'misty/http/client'
2
+ require "misty/openstack/karbor/karbor_v1"
3
+
4
+ module Misty
5
+ module Openstack
6
+ module Karbor
7
+ class V1 < Misty::HTTP::Client
8
+ extend Misty::Openstack::KarborV1
9
+
10
+ def self.api
11
+ v1
12
+ end
13
+
14
+ def self.service_names
15
+ %w{data-protection data-protection-orchestration}
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,11 @@
1
+ module Misty::Openstack::KeystoneV2_0
2
+ def v2_0
3
+ {"/v2.0/extensions/{alias}"=>{:GET=>[:show_extension_details]},
4
+ "/v2.0/extensions"=>{:GET=>[:list_extensions]},
5
+ "/v2.0/tenants"=>{:GET=>[:list_tenants]},
6
+ "/v2.0/tokens"=>{:POST=>[:authenticate]},
7
+ "/v2.0"=>{:GET=>[:show_version_details]},
8
+ "/"=>{:GET=>[:list_versions]},
9
+ "/v2.0/tokens/revoked"=>{:GET=>[:list_revoked_tokens_v2]}}
10
+ end
11
+ end
@@ -0,0 +1,32 @@
1
+ module Misty::Openstack::KeystoneV2_0
2
+ def v2_0_ext
3
+ {"/v2.0/users/{user_id}/OS-KSADM/enabled"=>{:PUT=>[:enable_disable_user]},
4
+ "/v2.0/users/{user_id}/OS-KSADM/password"=>{:PUT=>[:set_user_password]},
5
+ "/v2.0/users/{user_id}/OS-KSADM/tenant"=>{:PUT=>[:update_user_tenant]},
6
+ "/v2.0/OS-KSADM/services"=>
7
+ {:POST=>[:create_service_admin_extension],
8
+ :GET=>[:list_services_admin_extension]},
9
+ "/v2.0/OS-KSADM/services/{service_id}"=>
10
+ {:GET=>[:shows_service_information_by_id],
11
+ :DELETE=>[:delete_service_admin_extension]},
12
+ "/v2.0/OS-KSADM/services/{serviceName}"=>
13
+ {:GET=>[:show_service_information_by_name]},
14
+ "/v2.0/OS-KSADM/roles"=>{:POST=>[:create_a_role], :GET=>[:list_all_roles]},
15
+ "/v2.0/OS-KSADM/roles/{role_id}"=>
16
+ {:GET=>[:show_a_role], :DELETE=>[:delete_a_role]},
17
+ "/v2.0/OS-KSADM/roles/{role_name}"=>{:GET=>[:show_role_information_by_name]},
18
+ "/v2.0/tenants/{tenant_id}/users/{user_id}/roles/OS-KSADM/{role_id}"=>
19
+ {:PUT=>[:grant_roles_to_user_on_tenant],
20
+ :DELETE=>[:revoke_role_from_user_on_tenant]},
21
+ "/v2.0/users/{userId}/OS-KSADM/credentials"=>
22
+ {:POST=>[:grant_credential_to_user],
23
+ :GET=>[:list_credentials_ec2_extension]},
24
+ "/v2.0/users/{userId}/OS-KSADM/credentials/OS-KSEC2:ec2Credentials"=>
25
+ {:POST=>[:update_user_credentials],
26
+ :DELETE=>[:delete_user_credentials],
27
+ :GET=>[:get_user_credentials]},
28
+ "/v2.0/users/{userId}/OS-KSADM/credentials/OS-KSEC2:ec2Credentials/{type}"=>
29
+ {:GET=>[:list_credentials_by_type]},
30
+ "/v2.0/OS-KSCRUD/users/{userId}"=>{:PATCH=>[:change_user_s_own_password]}}
31
+ end
32
+ end
@@ -0,0 +1,147 @@
1
+ module Misty::Openstack::KeystoneV3
2
+ def v3
3
+ {"/v3/auth/tokens"=>
4
+ {:POST=>
5
+ [:password_authentication_with_unscoped_authorization,
6
+ :password_authentication_with_scoped_authorization,
7
+ :password_authentication_with_explicit_unscoped_authorization,
8
+ :token_authentication_with_unscoped_authorization,
9
+ :token_authentication_with_scoped_authorization],
10
+ :GET=>[:validate_and_show_information_for_token],
11
+ :HEAD=>[:check_token],
12
+ :DELETE=>[:revoke_token]},
13
+ "/v3/auth/catalog"=>{:GET=>[:get_service_catalog]},
14
+ "/v3/auth/projects"=>{:GET=>[:get_available_project_scopes]},
15
+ "/v3/auth/domains"=>{:GET=>[:get_available_domain_scopes]},
16
+ "/v3/credentials"=>{:POST=>[:create_credential], :GET=>[:list_credentials]},
17
+ "/v3/credentials/{credential_id}"=>
18
+ {:GET=>[:show_credential_details],
19
+ :PATCH=>[:update_credential],
20
+ :DELETE=>[:delete_credential]},
21
+ "/v3/domains"=>{:GET=>[:list_domains], :POST=>[:create_domain]},
22
+ "/v3/domains/{domain_id}"=>
23
+ {:GET=>[:show_domain_details],
24
+ :PATCH=>[:update_domain],
25
+ :DELETE=>[:delete_domain]},
26
+ "/v3/domains/config/default"=>{:GET=>[:show_default_configuration_settings]},
27
+ "/v3/domains/config/{group}/default"=>
28
+ {:GET=>[:show_default_configuration_for_a_group]},
29
+ "/v3/domains/config/{group}/{option}/default"=>
30
+ {:GET=>[:show_default_option_for_a_group]},
31
+ "/v3/domains/{domain_id}/config/{group}/{option}"=>
32
+ {:GET=>[:show_domain_group_option_configuration],
33
+ :PATCH=>[:update_domain_group_option_configuration],
34
+ :DELETE=>[:delete_domain_group_option_configuration]},
35
+ "/v3/domains/{domain_id}/config/{group}"=>
36
+ {:GET=>[:show_domain_group_configuration],
37
+ :PATCH=>[:update_domain_group_configuration],
38
+ :DELETE=>[:delete_domain_group_configuration]},
39
+ "/v3/domains/{domain_id}/config"=>
40
+ {:PUT=>[:create_domain_configuration],
41
+ :GET=>[:show_domain_configuration],
42
+ :PATCH=>[:update_domain_configuration],
43
+ :DELETE=>[:delete_domain_configuration]},
44
+ "/v3/groups"=>{:GET=>[:list_groups], :POST=>[:create_group]},
45
+ "/v3/groups/{group_id}"=>
46
+ {:GET=>[:show_group_details],
47
+ :PATCH=>[:update_group],
48
+ :DELETE=>[:delete_group]},
49
+ "/v3/groups/{group_id}/users"=>{:GET=>[:list_users_in_group]},
50
+ "/v3/groups/{group_id}/users/{user_id}"=>
51
+ {:PUT=>[:add_user_to_group],
52
+ :HEAD=>[:check_whether_user_belongs_to_group],
53
+ :DELETE=>[:remove_user_from_group]},
54
+ "/v3/OS-INHERIT/domains/{domain_id}/users/{user_id}/roles/{role_id}/inherited_to_projects"=>
55
+ {:PUT=>[:assign_role_to_user_on_projects_owned_by_domain],
56
+ :HEAD=>[:check_if_user_has_an_inherited_project_role_on_domain],
57
+ :DELETE=>[:revoke_an_inherited_project_role_from_user_on_domain]},
58
+ "/v3/OS-INHERIT/domains/{domain_id}/groups/{group_id}/roles/{role_id}/inherited_to_projects"=>
59
+ {:PUT=>[:assign_role_to_group_on_projects_owned_by_a_domain],
60
+ :HEAD=>[:check_if_group_has_an_inherited_project_role_on_domain],
61
+ :DELETE=>[:revoke_an_inherited_project_role_from_group_on_domain]},
62
+ "/v3/OS-INHERIT/domains/{domain_id}/users/{user_id}/roles/inherited_to_projects"=>
63
+ {:GET=>[:list_user_s_inherited_project_roles_on_a_domain]},
64
+ "/v3/OS-INHERIT/domains/{domain_id}/groups/{group_id}/roles/inherited_to_projects"=>
65
+ {:GET=>[:list_group_s_inherited_project_roles_on_domain]},
66
+ "/v3/OS-INHERIT/projects/{project_id}/users/{user_id}/roles/{role_id}/inherited_to_projects"=>
67
+ {:PUT=>[:assign_role_to_user_on_projects_in_a_subtree],
68
+ :HEAD=>[:check_if_user_has_an_inherited_project_role_on_project],
69
+ :DELETE=>[:revoke_an_inherited_project_role_from_user_on_project]},
70
+ "/v3/OS-INHERIT/projects/{project_id}/groups/{group_id}/roles/{role_id}/inherited_to_projects"=>
71
+ {:PUT=>[:assign_role_to_group_on_projects_in_a_subtree],
72
+ :HEAD=>[:check_if_group_has_an_inherited_project_role_on_project],
73
+ :DELETE=>[:revoke_an_inherited_project_role_from_group_on_project]},
74
+ "/v3/role_assignments"=>{:GET=>[:list_role_assignments]},
75
+ "/v3/auth/tokens/OS-PKI/revoked"=>{:GET=>[:list_revoked_tokens]},
76
+ "/v3/policies"=>{:POST=>[:create_policy], :GET=>[:list_policies]},
77
+ "/v3/policies/{policy_id}"=>
78
+ {:GET=>[:show_policy_details],
79
+ :PATCH=>[:update_policy],
80
+ :DELETE=>[:delete_policy]},
81
+ "/v3/projects"=>{:GET=>[:list_projects], :POST=>[:create_project]},
82
+ "/v3/projects/{project_id}"=>
83
+ {:GET=>[:show_project_details],
84
+ :PATCH=>[:update_project],
85
+ :DELETE=>[:delete_project]},
86
+ "/v3/regions/{region_id}"=>
87
+ {:GET=>[:show_region_details],
88
+ :PATCH=>[:update_region],
89
+ :DELETE=>[:delete_region]},
90
+ "/v3/regions"=>{:GET=>[:list_regions], :POST=>[:create_region]},
91
+ "/v3/roles"=>{:GET=>[:list_roles], :POST=>[:create_role]},
92
+ "/v3/roles/{role_id}"=>
93
+ {:GET=>[:show_role_details],
94
+ :PATCH=>[:update_role],
95
+ :DELETE=>[:delete_role]},
96
+ "/v3/domains/{domain_id}/groups/{group_id}/roles"=>
97
+ {:GET=>[:list_role_assignments_for_group_on_domain]},
98
+ "/v3/domains/{domain_id}/groups/{group_id}/roles/{role_id}"=>
99
+ {:PUT=>[:assign_role_to_group_on_domain],
100
+ :HEAD=>[:check_whether_group_has_role_assignment_on_domain],
101
+ :DELETE=>[:unassign_role_from_group_on_domain]},
102
+ "/v3/domains/{domain_id}/users/{user_id}/roles"=>
103
+ {:GET=>[:list_role_assignments_for_user_on_domain]},
104
+ "/v3/domains/{domain_id}/users/{user_id}/roles/{role_id}"=>
105
+ {:PUT=>[:assign_role_to_user_on_domain],
106
+ :HEAD=>[:check_whether_user_has_role_assignment_on_domain],
107
+ :DELETE=>[:unassigns_role_from_user_on_domain]},
108
+ "/v3/projects/{project_id}/groups/{group_id}/roles"=>
109
+ {:GET=>[:list_role_assignments_for_group_on_project]},
110
+ "/v3/projects/{project_id}/groups/{group_id}/roles/{role_id}"=>
111
+ {:PUT=>[:assign_role_to_group_on_project],
112
+ :HEAD=>[:check_whether_group_has_role_assignment_on_project],
113
+ :DELETE=>[:unassign_role_from_group_on_project]},
114
+ "/v3/projects/{project_id}/users/{user_id}/roles"=>
115
+ {:GET=>[:list_role_assignments_for_user_on_project]},
116
+ "/v3/projects/{project_id}/users/{user_id}/roles/{role_id}"=>
117
+ {:PUT=>[:assign_role_to_user_on_project],
118
+ :HEAD=>[:check_whether_user_has_role_assignment_on_project],
119
+ :DELETE=>[:unassign_role_from_user_on_project]},
120
+ "/v3/roles/{prior_role_id}/implies"=>
121
+ {:GET=>[:list_implied_inference_roles_for_role]},
122
+ "/v3/roles/{prior_role_id}/implies/{implies_role_id}"=>
123
+ {:PUT=>[:create_role_inference_rule],
124
+ :GET=>[:get_role_inference_rule],
125
+ :HEAD=>[:confirm_role_inference_rule],
126
+ :DELETE=>[:delete_role_inference_rule]},
127
+ "/v3/role_inferences"=>{:GET=>[:list_all_role_inference_rules]},
128
+ "/v3/services"=>{:GET=>[:list_services], :POST=>[:create_service]},
129
+ "/v3/services/{service_id}"=>
130
+ {:GET=>[:show_service_details],
131
+ :PATCH=>[:update_service],
132
+ :DELETE=>[:delete_service]},
133
+ "/v3/endpoints"=>{:GET=>[:list_endpoints], :POST=>[:create_endpoint]},
134
+ "/v3/endpoints/{endpoint_id}"=>
135
+ {:GET=>[:show_endpoint_details],
136
+ :PATCH=>[:update_endpoint],
137
+ :DELETE=>[:delete_endpoint]},
138
+ "/v3/users"=>{:GET=>[:list_users], :POST=>[:create_user]},
139
+ "/v3/users/{user_id}"=>
140
+ {:GET=>[:show_user_details],
141
+ :PATCH=>[:update_user],
142
+ :DELETE=>[:delete_user]},
143
+ "/v3/users/{user_id}/groups"=>{:GET=>[:list_groups_to_which_a_user_belongs]},
144
+ "/v3/users/{user_id}/projects"=>{:GET=>[:list_projects_for_user]},
145
+ "/v3/users/{user_id}/password"=>{:POST=>[:change_password_for_user]}}
146
+ end
147
+ end