diff --git a/app/controllers/api/providers_controller.rb b/app/controllers/api/providers_controller.rb index a9f58a32fe..6d104a6e27 100644 --- a/app/controllers/api/providers_controller.rb +++ b/app/controllers/api/providers_controller.rb @@ -89,11 +89,16 @@ def options end supported_providers = ExtManagementSystem.supported_types_for_create.map do |klass| + if klass.supports_regions? + regions = klass.parent::Regions.all.sort_by { |r| r[:description] }.map { |r| r.slice(:name, :description) } + end + { - :title => klass.description, - :type => klass.to_s, - :kind => klass.to_s.demodulize.sub(/Manager$/, '').underscore - } + :title => klass.description, + :type => klass.to_s, + :kind => klass.to_s.demodulize.sub(/Manager$/, '').underscore, + :regions => regions + }.compact end render_options(:providers, "provider_settings" => providers_options, "supported_providers" => supported_providers)