From d929a451f914603dda2da30a2df969603040ff31 Mon Sep 17 00:00:00 2001 From: Sandeep Reddy Date: Mon, 21 Oct 2024 18:19:23 +0530 Subject: [PATCH] add cloud and infra apis for resource pool --- ....rb => resource_pool_clouds_controller.rb} | 2 +- .../api/resource_pool_infras_controller.rb | 7 ++ config/api.yml | 73 +++++++++++++++---- 3 files changed, 67 insertions(+), 15 deletions(-) rename app/controllers/api/{resource_pools_controller.rb => resource_pool_clouds_controller.rb} (71%) create mode 100644 app/controllers/api/resource_pool_infras_controller.rb diff --git a/app/controllers/api/resource_pools_controller.rb b/app/controllers/api/resource_pool_clouds_controller.rb similarity index 71% rename from app/controllers/api/resource_pools_controller.rb rename to app/controllers/api/resource_pool_clouds_controller.rb index 6734bc4b5d..bf42fe2ce9 100644 --- a/app/controllers/api/resource_pools_controller.rb +++ b/app/controllers/api/resource_pool_clouds_controller.rb @@ -1,5 +1,5 @@ module Api - class ResourcePoolsController < BaseController + class ResourcePoolCloudsController < BaseController include Subcollections::Policies include Subcollections::PolicyProfiles include Subcollections::Tags diff --git a/app/controllers/api/resource_pool_infras_controller.rb b/app/controllers/api/resource_pool_infras_controller.rb new file mode 100644 index 0000000000..36a9a0a222 --- /dev/null +++ b/app/controllers/api/resource_pool_infras_controller.rb @@ -0,0 +1,7 @@ +module Api + class ResourcePoolInfrasController < BaseController + include Subcollections::Policies + include Subcollections::PolicyProfiles + include Subcollections::Tags + end +end diff --git a/config/api.yml b/config/api.yml index 4ff601c747..3db74f23ad 100644 --- a/config/api.yml +++ b/config/api.yml @@ -3325,13 +3325,58 @@ - :subcollection :verbs: *g :klass: ResourceAction - :resource_pools: - :description: Resource Pools - :identifier: resource_pool + + :resource_pool_clouds: + :description: Cloud Resource Pools + :identifier: resource_pool_cloud + :options: + - :collection + :verbs: *gp + :klass: ManageIQ::Providers::CloudManager::ResourcePool + :subcollections: + - :tags + - :policies + - :policy_profiles + :collection_actions: + :get: + - :name: read + :identifier: resource_pool_cloud_show_list + :post: + - :name: query + :identifier: resource_pool_cloud_show_list + :resource_actions: + :get: + - :name: read + :identifier: resource_pool_cloud_show + :post: + - :name: delete + :identifier: resource_pool_cloud_delete + :tags_subcollection_actions: + :post: + - :name: assign + :identifier: resource_pool_cloud_tag + - :name: unassign + :identifier: resource_pool_cloud_tag + :policies_subcollection_actions: + :post: + - :name: assign + :identifier: resource_pool_cloud_protect + - :name: unassign + :identifier: resource_pool_cloud_protect + :policy_profiles_subcollection_actions: + :post: + - :name: assign + :identifier: resource_pool_cloud_protect + - :name: unassign + :identifier: resource_pool_cloud_protect + + :resource_pool_infras: + :description: Infrastructure Resource Pools + :identifier: resource_pool_infra :options: - :collection :verbs: *gp - :klass: ResourcePool + :klass: ManageIQ::Providers::InfraManager::ResourcePool :subcollections: - :tags - :policies @@ -3339,35 +3384,35 @@ :collection_actions: :get: - :name: read - :identifier: resource_pool_show_list + :identifier: resource_pool_infra_show_list :post: - :name: query - :identifier: resource_pool_show_list + :identifier: resource_pool_infra_show_list :resource_actions: :get: - :name: read - :identifier: resource_pool_show + :identifier: resource_pool_infra_show :post: - :name: delete - :identifier: resource_pool_delete + :identifier: resource_pool_infra_delete :tags_subcollection_actions: :post: - :name: assign - :identifier: resource_pool_tag + :identifier: resource_pool_infra_tag - :name: unassign - :identifier: resource_pool_tag + :identifier: resource_pool_infra_tag :policies_subcollection_actions: :post: - :name: assign - :identifier: resource_pool_protect + :identifier: resource_pool_infra_protect - :name: unassign - :identifier: resource_pool_protect + :identifier: resource_pool_infra_protect :policy_profiles_subcollection_actions: :post: - :name: assign - :identifier: resource_pool_protect + :identifier: resource_pool_infra_protect - :name: unassign - :identifier: resource_pool_protect + :identifier: resource_pool_infra_protect :results: :description: Report Results :identifier: miq_report_reports