-
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 compliances subcollection #742
Add compliances subcollection #742
Conversation
@abellotti any chance I could get you to take a real quick look, please? thanks. |
b9ff9c2
to
16db5df
Compare
@Real-Omar-Afifi want to try running with this PR to see if it gets you the info you want? |
I think @Real-Omar-Afifi also need compliance_details, but this can be added as a start and that as a follow up. |
@@ -1,6 +1,7 @@ | |||
module Api | |||
class VmsController < BaseController | |||
include Subcollections::Disks | |||
include Subcollections::Compliances |
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.
Minor, but can you make alphabetical? nvm...nothing else is alphabetical here for some reason.
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.
yeah i was gonna do a follow-up for it
:get: | ||
- :name: read | ||
:identifier: | ||
- vm_show |
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.
compliances are technically on a bunch of different resources. @abellotti Is there a way to do an "OR" of identifiers? Not sure what the right identifiers are, but I usually go with whatever the UI does... @himdel ?
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.
we can specify multiple identifiers (essentially the OR) via :identifiers instead of :identifier
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.
Note, I'm more thinking of if this as a subcollection under other things than just vms.
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.
There's a bunch of *_check_compliance
features that the UI uses for the "Policy / Check Compliance of the last known configuration" toolbar button.
So, I guess instance_check_compliance
, image_check_compliance
, vm_check_compliance
and miq_template_check_compliance
here?
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.
thanks, I'll get to miq_template_check_compliance
in a follow-up
594c88e
to
f82ed6b
Compare
This is great @d-m-u, thanks for adding the tests that exercises the attributes=compliance_details. 👍 |
@d-m-u could you take care of the rubocop warnings ? Thanks. |
fe35a59
to
2f3e190
Compare
2f3e190
to
23f0ceb
Compare
@d-m-u try the following: Move the subcollection action under the vms directly:
You can see such examples in the :vms: collection. With this no need to class identify since it's per collection, and the :identifier: handles lists. Thanks, |
23f0ceb
to
a62b5f3
Compare
Checked commit d-m-u@a62b5f3 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.20.0, and yamllint |
:description: Compliances | ||
:options: | ||
- :subcollection | ||
:verbs: *g |
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.
what does the value *g
mean?
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.
the verb set that can be used on the subcollection, in this case just the get
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.
higher-level that is like a "pointer" in YAML, and it means to insert the object referenced with the name "&g". g is defined here:
Lines 14 to 15 in a62b5f3
:g: &g | |
- :get |
…e_details Add compliances subcollection (cherry picked from commit 309e538) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1806660
Ivanchuk backport details:
|
Per the convo in the main gitter room last night about api support of compliances February 18, 2020 4:51 PM I thought I may as well go ahead and open this.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1806656