-
Notifications
You must be signed in to change notification settings - Fork 141
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
Expose DDF schema for a provider when asking using OPTIONS + type #645
Conversation
883c633
to
de283d8
Compare
@skateman is there way to get {
"authentication": {
"default": {
"name": "foo",
"password": "bar"
},
"remote": {
"name": "foo",
"password": "bar"
}
}
} |
@Hyperkid123 I'm just exposing the stuff @agrare is defining in ManageIQ/manageiq-providers-amazon#551, if I'd do what you want here, we would end up with the same if-else-case 🍝 we have in ems_common. |
ManageIQ/manageiq#19120 has been merged. |
@Fryguy we don't depend on the validation backend here, this PR could go in right now without any backend modifications...but thanks, I'll take a look at it. |
de283d8
to
8fb1bd1
Compare
8fb1bd1
to
2c98c6f
Compare
Checked commit skateman@2c98c6f with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Extracted the
providers_options
into a separate method and only returning when thetype
isn't set for the/api/providers
. If thetype
param is set in a request, the API will try to append the data-driven-form schema if specified under thedata.provider_form_schema
key. This schema can be used by the UI to render the right form that contains all the required info for adding a provider of the given type.If the
type
argument cannot be safely constantized into a subclass ofExtManagementSystem
or the provider has no DDF specified it will raise anBadRequestError
. The request without thetype
parameter behaves like the OPTIONS request before this change.Example of the DDF schema in the amazon provider: ManageIQ/manageiq-providers-amazon#551
Parent issue: ManageIQ/manageiq#18818
@miq-bot add_reviewer @lpichler
@miq-bot add_reviewer @abellotti
@miq-bot add_label enhancement, ivanchuk/no, hammer/no
cc @Hyperkid123, @martinpovolny, @agrare