chef / automate

Chef Automate provides a full suite of enterprise capabilities for maintaining continuous visibility into application, infrastructure, and security automation.
https://automate.chef.io/
Apache License 2.0
227 stars 113 forks source link

Nodes API Failed nodes query #2333

Closed Doltair closed 4 years ago

Doltair commented 5 years ago

Describe the bug

Using Nodes API with filters:

{
  "filters": [
    {"key": "last_run_status", "values": ["FAILED"]},
    {"key": "last_run_status", "values": ["PASSED"]}
  ]
}

The nodes listed from the response are too old or no longer exists in the Chef server. Although when using the Automate's UI, when searching the node, its no longer exists. Is it a normal behavior that when using the API, the node does not match from the Chef Server and Automate's UI? We have an automation in place and we want to leverage using its great feature provided by Nodes API.

https://automate.chef.io/docs/nodes/

To Reproduce

Steps to reproduce the behavior:

vjeffrey commented 5 years ago

hi @Doltair , your issue seems like it is related to https://github.com/chef/automate/issues/616 -- we're planning on getting that on the board sometime over the next month. as a note, if a filter key is the same, you can always include multiple values, i.e. {"key": "last_run_status", "values": ["PASSED, FAILED"]

vjeffrey commented 5 years ago

also note that you can filter by a status using the api mentioned here: https://github.com/chef/automate/issues/2334#issuecomment-557163550

using failure or success as the status value

Doltair commented 5 years ago

This is acknowledged @vjeffrey. Anyhow since issue #2334 has been closed and I know the related feature is in-progress with it.

Anyhow one more thing, Do you have some sort of Swagger API info documentation or at least info about the routes you mentioned for:

It might help us fetch from it, and maybe failed runs with cookbook handler errors too?

vjeffrey commented 5 years ago

yes, we have swagger available right now and the next automate release to current will have nicer api docs! 🌟 swagger: https://a2-url/api/v0/openapi/ui/#/ documentation that will be powering the api docs that will be released in the next promotion to current: https://github.com/chef/automate/blob/master/api/external/cfgmgmt/cfgmgmt.proto https://github.com/chef/automate/blob/master/components/automate-gateway/api/compliance/reporting/reporting.proto https://github.com/chef/automate/blob/master/components/automate-gateway/api/compliance/reporting/stats/stats.proto

vjeffrey commented 5 years ago

failed runs with cookbook handler errors too anything that's possible in the ui is also possible via api. we support filtering by failed status, and you could also filter by error msg, but i don't believe we have anything that fits that ask exactly

vjeffrey commented 4 years ago

we'll be picking up the work associated with this issue in the next sprint (#616). im going to close this issue

Doltair commented 4 years ago

@vjeffrey where can we follow the updates regarding automate's openapi? is the URI has changed now https://a2-url/api/v0/openapi/ui/#/? this works for me before. Gives me 404

vjeffrey commented 4 years ago

@Doltair we've moved our api docs to: https://automate.chef.io/docs/api/