Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a list of supported providers in OPTIONS /api/providers #579

Merged
merged 1 commit into from
Apr 24, 2019

Conversation

skateman
Copy link
Member

@Hyperkid123 is working on the new API-driven forms for adding a provider and for that he needs a way to ask for the list of supported providers with their names and classes. Since ManageIQ/manageiq#18568 we can ask for the list of the provider classes that are available for adding via the UI.

$ curl -u admin:smartvm -XOPTIONS "http://localhost:3000/api/providers" | jq

{
 ...
  "data": {
    "provider_settings": {
       ...
    },
    "supported_providers": [
      {
        "title": "Ansible Tower Automation",
        "type": "ManageIQ::Providers::AnsibleTower::AutomationManager",
        "kind": "automation"
      },
      {
        "title": "Kubernetes",
        "type": "ManageIQ::Providers::Kubernetes::ContainerManager",
        "kind": "container"
      },
      {
        "title": "OpenShift",
        "type": "ManageIQ::Providers::Openshift::ContainerManager",
        "kind": "container"
      },
      {
        "title": "Lenovo XClarity",
        "type": "ManageIQ::Providers::Lenovo::PhysicalInfraManager",
        "kind": "physical_infra"
      },
      {
        "title": "Redfish",
        "type": "ManageIQ::Providers::Redfish::PhysicalInfraManager",
        "kind": "physical_infra"
      },
      {
        "title": "OpenStack Platform Director",
        "type": "ManageIQ::Providers::Openstack::InfraManager",
        "kind": "infra"
      },
      {
        "title": "Red Hat Virtualization",
        "type": "ManageIQ::Providers::Redhat::InfraManager",
        "kind": "infra"
      },
      {
        "title": "Microsoft System Center VMM",
        "type": "ManageIQ::Providers::Microsoft::InfraManager",
        "kind": "infra"
      },
      {
        "title": "VMware vCenter",
        "type": "ManageIQ::Providers::Vmware::InfraManager",
        "kind": "infra"
      },
      {
        "title": "Foreman Configuration",
        "type": "ManageIQ::Providers::Foreman::ConfigurationManager",
        "kind": "configuration"
      },
      {
        "title": "Amazon EC2",
        "type": "ManageIQ::Providers::Amazon::CloudManager",
        "kind": "cloud"
      },
      {
        "title": "Azure",
        "type": "ManageIQ::Providers::Azure::CloudManager",
        "kind": "cloud"
      },
      {
        "title": "Google Compute Engine",
        "type": "ManageIQ::Providers::Google::CloudManager",
        "kind": "cloud"
      },
      {
        "title": "OpenStack",
        "type": "ManageIQ::Providers::Openstack::CloudManager",
        "kind": "cloud"
      },
      {
        "title": "VMware vCloud",
        "type": "ManageIQ::Providers::Vmware::CloudManager",
        "kind": "cloud"
      }
    ]
  }
}

Originally I wanted to group these fields by the kind of the provider, but IMO this can be done on the client much easier. Maybe the kind and type keys should be changed to something else, I wasn't sure about the class as it might be a reserved word in other worlds.

@miq-bot add_reviewer @abellotti
@miq-bot add_reviewer @djberg96
cc @Hyperkid123, @agrare, @martinpovolny

@miq-bot miq-bot requested review from abellotti and djberg96 April 24, 2019 12:08
@skateman skateman force-pushed the supported-providers branch from 46cea69 to 16845cd Compare April 24, 2019 12:27
@miq-bot
Copy link
Member

miq-bot commented Apr 24, 2019

Checked commit skateman@16845cd with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

Copy link
Member

@Fryguy Fryguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Getting closer and closer to pure pluggability!

@Fryguy
Copy link
Member

Fryguy commented Apr 24, 2019

cc @agrare @gtanzillo

@agrare
Copy link
Member

agrare commented Apr 24, 2019

Love it @skateman !

Copy link
Contributor

@djberg96 djberg96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@abellotti
Copy link
Member

looks good, also adding the new element so not breaking compatibility, so 👍 from me.

@abellotti abellotti added this to the Sprint 110 Ending Apr 29, 2019 milestone Apr 24, 2019
@abellotti abellotti merged commit c214ff2 into ManageIQ:master Apr 24, 2019
@skateman skateman deleted the supported-providers branch April 24, 2019 15:16
@agrare
Copy link
Member

agrare commented Apr 24, 2019

🎉

@skateman
Copy link
Member Author

@miq-bot add_label changelog/yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants