-
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
Add DELETE service_templates/X/schedules/X #414
Add DELETE service_templates/X/schedules/X #414
Conversation
3a2ece1
to
888aff5
Compare
@@ -50,6 +50,10 @@ def schedules_query_resource(object) | |||
object.miq_schedules | |||
end | |||
|
|||
def delete_resource_schedules(_parent, type, id, data) |
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.
I think this method should go to app/controllers/api/subcollections/schedules.rb
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.
I couldn't include that mixin here since the relation works differently for ServiceTemplates than it previously did.
@@ -2518,9 +2518,12 @@ | |||
:identifier: miq_report_reports | |||
:options: | |||
- :subcollection | |||
:verbs: *gp | |||
:verbs: *gpd | |||
:klass: MiqSchedule | |||
:subcollection_actions: |
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.
maybe add the post equivalent (POST action "delete") for completeness. No additional coded needed just the added specs.
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.
unless you wanted this PR for just the DELETE
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.
👍 done
config/api.yml
Outdated
:klass: MiqSchedule | ||
:subcollection_actions: | ||
:delete: |
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.
hmm, the delete should probably move to a subresource_actions section
888aff5
to
22fd104
Compare
:klass: MiqSchedule | ||
:subcollection_actions: | ||
:get: | ||
- :name: read | ||
:identifier: miq_report_view | ||
:post: | ||
- :name: delete | ||
:identifier: schedule_delete |
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.
Is this okay? ¯\_(ツ)_/¯
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.
👍
a87b1b2
to
80269c0
Compare
6675f01
to
86a65d6
Compare
end | ||
|
||
describe "POST /api/service_templates/:id/schedules/:id with delete action" do | ||
it "can queue a flavor for deletion" do |
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 delete a schedule
86a65d6
to
1671344
Compare
Checked commit bdunne@1671344 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
LGTM!! Thanks @bdunne for the API enhancement. 👍 will merge when 🍏 |
@bdunne Should this be |
…lates Add DELETE service_templates/X/schedules/X (cherry picked from commit b8d1480) https://bugzilla.redhat.com/show_bug.cgi?id=1608351
Gaprindashvili backport details:
|
@abellotti Please review
Enables deleting schedules for ServiceTemplates for V2V
https://bugzilla.redhat.com/show_bug.cgi?id=1564255