-
Notifications
You must be signed in to change notification settings - Fork 143
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
Allow additional provider parameters to be specified on create #279
Conversation
75b01af
to
f61eab3
Compare
Is this ready to be un-wipped? |
@juliancheal will unwip when ManageIQ/manageiq#16802 is merged |
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.
So this allows writing azure_tenant_id
but does this also allow reading it back?
alias_attribute :azure_tenant_id, :uid_ems
So perhaps it'll get sent back under uid_ems
key on read (?)
BTW, why do we need the alias on write rather than telling users to put tenant in uid_ems
? Because that's just an implementation detail? If we want to hide it on write, let's also hide it on read IMHO.
In general, providers read/write has various asymmetries (#26), I'd like to reduce not increase them...
Good point @cben I'll check it's read as The field that the user would know from Azure documentation is |
@cben Why do you believe the user cannot read back the
|
|
||
expected = { | ||
"results" => [a_hash_including("uid_ems" => tenant.id.to_s, "name" => "sample azure provider")] | ||
} |
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.
@jntullo - does the results
hash mirror the database columns? Is that why the first hash key is uid_ems
and not azure_tenant_id
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.
@bronaghs yeah, it is all of the physical attributes
I meant via API, by GET /API/providers/1
…On Jan 15, 2018 21:42, "Bronagh Sorota" ***@***.***> wrote:
@cben <https://github.com/cben> Why do you believe the user cannot read
back the azure_tenant_id? Do you mean like this? :
ManageIQ::Providers::Azure::CloudManager.first.azure_tenant_id
|
@bronaghs I did some thinking on this and now that I see this is a similar issue in openstack (where |
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
f61eab3
to
ec756f2
Compare
ec756f2
to
4e4b2de
Compare
This update will allow providers to have more control over the parameters that are allowed when creating a new manager. Currently, only those columns for a provider are allowed. This will also be a good transition starting point to put more of the validation inside of the providers themselves, rather than store it all within the API controller.
4e4b2de
to
feeaa6c
Compare
Checked commit jntullo@feeaa6c with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
LGTM!! Thanks @jntullo for this enhancement. 👍 |
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 theAzure::CloudManager
to returnazure_tenant_id
, users will be allowed to specify that attribute for Azure Cloud Managers.@miq-bot add_label wip, enhancement
cc: @juliancheal @bronaghs
Dependent on ManageIQ/manageiq#16802
https://bugzilla.redhat.com/show_bug.cgi?id=1669600