Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connected Services Filter (API only) #4339

Merged
merged 1 commit into from
Sep 15, 2020
Merged

Conversation

danielsdeleo
Copy link
Contributor

@danielsdeleo danielsdeleo commented Sep 14, 2020

馃敥 Description: What code changed, and why?

[Apps tab] A customer has requested to be able to filter on only connected services. They want to see if all supervisors that are expected to upgrade have indeed upgraded. Their estate includes systems distributed over sometimes unreliable WAN links, which can become disconnected and not expected to update. Therefore it will be helpful to filter out these disconnected systems to show only the connected ones.

This PR implements filtering by status:connected when listing services.

鉀擄笍 Related Resources

UI Card: #4343

馃憤 Definition of Done

You can filter for only connected services in the Automate API

馃憻 How to Build and Test the Change

hab pkg install -bf core/curl
hab pkg install -bf core/jq-static

build components/applications-service
start_all_services
applications_populate_database

At first all the services are connected, so nothing is filtered out. You can see the connected services with something like (adjust the jq query as you like):

curl -fsS -k -H "api-token: ${api_token}" "https://localhost/api/v0/applications/services?filter=status:connected"  | jq '.services | .[] | .id, .disconnected '

After 5 minutes or so, all the services should be disconnected and you won't see them in the above query. At this point, if you re-run applications_populate_database you will have a mix of connected and disconnected, which you can see by flipping the filter from status:connected to status:disconnected.

@netlify
Copy link

netlify bot commented Sep 14, 2020

Deploy preview for chef-automate ready!

Built with commit 0386780

https://deploy-preview-4339--chef-automate.netlify.app

@kagarmoe
Copy link

kagarmoe commented Sep 14, 2020

@danielsdeleo Where would we document this--in https://github.com/chef/automate/blob/master/api/external/applications/applications.proto? As a variation of the GetServices method?

@danielsdeleo
Copy link
Contributor Author

@kagarmoe this is an extension of the status filtering, which is currently here:

// * `status:disconnected`: returns services in a disconnected state

Signed-off-by: Daniel DeLeo <dan@chef.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants