-
Notifications
You must be signed in to change notification settings - Fork 897
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
Add api_allowed_attributes to ExtManagementSystem and Provider #16802
Conversation
@jntullo unrecognized command 'enhancement', ignoring... Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone |
@miq-bot add_label enhancement, providers |
I like it, so if we don't do anything it's business as usual, but overriding this in the provider gives us more attributes. Yay! |
Do we need to update the API docs too? |
@juliancheal I'll update ManageIQ/manageiq-documentation#521 where I have the provider examples |
@jntullo great thanks, was just trying to find where to do it. |
ccdb43c
to
149f1ba
Compare
app/models/ext_management_system.rb
Outdated
@@ -27,6 +27,10 @@ def self.supported_types_and_descriptions_hash | |||
end | |||
end | |||
|
|||
def self.api_allowed_attributes | |||
%w() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see you've changed it to a method. You'll need to update the commit message, as it still mentions it being a constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliancheal updated ✨
149f1ba
to
ab56cc3
Compare
LGTM 👍 just need to fix the Rubocops 🍰 |
The addition of the api_allowed_attributes method will allow individual providers to have better control over the attributes that are allowed on a provider, including aliases that are more clear to the user.
ab56cc3
to
37a0b23
Compare
Checked commit jntullo@37a0b23 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@miq-bot add_label gaprindashvili/yes |
👍 |
@miq-bot assign @gtanzillo |
Adds the capability to create OpenStack providers. Because one of the parameters, keystone_v3_domain_id, is not currently exposed, it is added as an alias of azure_tenant_id which currently maps to uid_ems. Work is in progress to fix this. ManageIQ/manageiq#16802 ManageIQ/manageiq-api#279 ManageIQ/manageiq-providers-openstack#196
Adds the capability to create OpenStack providers. Because one of the parameters, keystone_v3_domain_id, is not currently exposed, it is added as an alias of azure_tenant_id which currently maps to uid_ems. Work is in progress to fix this. ManageIQ/manageiq#16802 ManageIQ/manageiq-api#279 ManageIQ/manageiq-providers-openstack#196
Adds the capability to create OpenStack providers. Because one of the parameters, keystone_v3_domain_id, is not currently exposed, it is added as an alias of azure_tenant_id which currently maps to uid_ems. Work is in progress to fix this. ManageIQ/manageiq#16802 ManageIQ/manageiq-api#279 ManageIQ/manageiq-providers-openstack#196
Ping @gtanzillo Is this good to be merged? |
@gtanzillo thanks Gregg!!! 🍰 And thanks @jntullo for working on this, now onto all the other PRs! |
@jntullo ManageIQ/manageiq-api#279 isn't marked as |
@juliancheal @bronaghs is this needed in g? Then I'll mark the api one as such |
Hi @jntullo - I thought this was owned by the API. Was there a BZ? Were the related PRs backported? |
Marking as |
Required for ManageIQ/manageiq-api#279
This update will allow individual providers to have more control over the parameters that are allowed when creating a new manager. This will also be a good transition starting point to move a lot of the validation inside of the providers themselves, rather than having it all within the API controller.
As an example, the Azure provider would like users to provide azure_tenant_id, which is not possible under the current API validation. By updating API_ALLOWED_ATTRIBUTES on the Azure::CloudManager to return azure_tenant_id, users will be allowed to specify that attribute for Azure Cloud Managers.
cc: @bronaghs @juliancheal - let me know your thoughts on this approach
@miq-bot enhancement, providers
https://bugzilla.redhat.com/show_bug.cgi?id=1669600