Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

TEM-90: add utility external systems check route #225

Merged
merged 5 commits into from Oct 14, 2018
Merged

Conversation

bonedaddy
Copy link
Contributor

馃懛 Purpose

Adds a permission-less check used to check basic system status from an external point of view, such as a load balancer, or user wanting to check if the API is online.

馃殌 Changes

Basic 200 OK utility route which requires 0 permissions.

鈿狅笍 Breaking Changes

None

@codecov
Copy link

codecov bot commented Oct 13, 2018

Codecov Report

Merging #225 into V2 will increase coverage by 0.04%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff            @@
##               V2    #225      +/-   ##
=========================================
+ Coverage   13.26%   13.3%   +0.04%     
=========================================
  Files          41      42       +1     
  Lines        3975    3979       +4     
=========================================
+ Hits          527     529       +2     
- Misses       3361    3363       +2     
  Partials       87      87
Impacted Files Coverage 螖
api/routes_utils.go 0% <0%> (酶)
api/api.go 80.86% <100%> (+0.28%) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update ba769bf...6de3929. Read the comment docs.

@bonedaddy bonedaddy changed the title api: add utility external systems check route TEM-90: add utility external systems check route Oct 13, 2018
Copy link
Contributor

@bobheadxi bobheadxi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bobheadxi
Copy link
Contributor

@postables looks like the route got lost in the merge (only the handler is left)

api/api.go Outdated
// external checks used by services like load balances
externalChecksProtected := v1.Group("/external-checks")
{
externalChecksProtected.GET("/systems-check", api.ExternalSystemsCheck)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not:

/external/systems/check

this allows better REST expandability:

/external/api/check
/external/systems/check
/external/systems/list

etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or even better:

/status/systems/check
/status/systems/...
/status/...

etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel a lot of the other APIs can be collapsed this way as well, to reduce the number of subroutes and have better grouping, though since that will likely cause compatibility havoc it's not something particularly urgent. I'll open up a ticket tho

@@ -161,6 +161,12 @@ func (api *API) setupRoutes() {
// V1 API
v1 := api.r.Group("/api/v1")

// system checks used to verify the integrity of our services
systemChecks := v1.Group("/systems")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to confirm, these APIs should be accessible to anyone right?

Copy link
Contributor Author

@bonedaddy bonedaddy Oct 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! It's only intended to give a very basic response. Ie, status 200 and a basic "systems online" as the response body.

Copy link
Contributor

@bobheadxi bobheadxi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 馃榿

@bonedaddy bonedaddy merged commit 671e8c6 into V2 Oct 14, 2018
@bonedaddy bonedaddy deleted the api/lb-check branch October 14, 2018 23:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:review Pending review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants