-
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
Transformation Mappings Read and Create #313
Conversation
raise BadRequestError, "Must specify mappings" unless data["mappings"] | ||
data["mappings"] = data["mappings"].each_with_object({}) do |(k, v), new_mappings| | ||
begin | ||
klass = collection_config.klass(k) |
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 collect_config
already map for example cluster
to EmsCluster
?
What about the GET - where do you do the translation?
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 ManageIQ/manageiq#16787 has the factory for transformation_mapping. Hope it satisfies your need. |
287e56e
to
b3ece58
Compare
@jntullo the create example should be something like
|
b3ece58
to
de8045c
Compare
@miq-bot add_label transformation |
@bzwei Cannot apply the following label because they are not recognized: transformation |
de8045c
to
4c3994d
Compare
@jntullo can you resolve the travis errors? |
4c3994d
to
3d832d6
Compare
af07c65
to
d3be166
Compare
expect(response.parsed_body).to include(expected) | ||
expect(response).to have_http_status(:bad_request) | ||
end | ||
end |
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.
can you add a test for when the source or destination href is bogus, i.e. /api/invalid_collection/:id, we should get a BadRequest on those. Might need a minor change to fetch_mapping_resource. Thanks.
Looks good @jntullo, just an additional test needed. |
d3be166
to
f324edc
Compare
Checked commit jntullo@f324edc with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Thanks @jntullo for updating this. LGTM!! 👍 |
gaprindashvili: depends on ManageIQ/manageiq#16787 and ManageIQ/manageiq#16947 and ManageIQ/manageiq#16988 |
Transformation Mappings Read and Create (cherry picked from commit 8772e52)
Gaprindashvili backport details:
|
Adds reads and creates of Transformation Mappings to the API:
Sample create:
Create will accept
transformation_mapping_items
as part of the request with href references to the source and destination.A call to
Will return all of the transformation mappings.
Will return a particular transformation mapping.
Transformation Mapping Items may be retrieved via:
which will return
Dependent upon:
ManageIQ/manageiq#16787
ManageIQ/manageiq#16947
and needs a factorycc: @bzwei @gmcculloug