-
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
TransformationMapping: API for adding mapping item #546
TransformationMapping: API for adding mapping item #546
Conversation
👍 |
@abellotti Can we merge? |
@miq-bot add_reviewer @abellotti |
rescue StandardError => err | ||
raise BadRequestError, "Failed to update Transformation Mapping - #{err}" | ||
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.
A little syntactic sugar you can use here is the Object#tap
method. So you can write that like this:
resource_search(id, type, collection_class(type)).tap do |mapping|
mapping.transformation_mapping_items.append(create_mapping_items([data]))
mapping.save!
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.
All right, fixed.
add_mapping_item action: to add new transformation mapping items (clusters, lans, storages) to the transformation_mapping_items array.
33d3972
to
999d5ec
Compare
Checked commits mzazrivec/manageiq-api@aab74eb~...999d5ec with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@mzazrivec Cannot apply the following label because they are not recognized: transformation enhancement |
@miq-bot add_label transformation, enhancement |
@bdunne @abellotti Look ok? |
Thanks @mzazrivec for the API Enhancement. LGTM!!! 👍 |
@miq-bot add_label hammer/yes |
…ping_item TransformationMapping: API for adding mapping item (cherry picked from commit 200ca55) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693718
Hammer backport details:
|
This change implements new action (
add_mapping_item
) for transformation mapping: it adds new transformation mapping item to previously created transformation mapping.Requested in https://trello.com/c/P5W747wT/217-spike-add-patch-method-to-api-transformationmappings-id (originally requested as a
PATCH
method, but usingPOST
and new action is more straightforward).Usage:
@himdel @michaelkro
https://bugzilla.redhat.com/show_bug.cgi?id=1689896