Get status of a microservice over API

Hey there,

I am wondering if there is a way to get the status of a microservice over the API (e.g. active, unhealthy, etc).
As to my knowledge this is only possible in the UI.

Thank you for the help :slight_smile:

Use Dev Tools to see the calls being made to get this information.

e.g.

…/inventory/managedObjects?pageSize=100&type=c8y_Application_45230&withTotalPages=true

…returns lots of info.

There’s also usually a health endpoint that can be called.

e.g.

…/service/hello-notification/health

1 Like

This is what you get when querying the /health endpoint (assumed you are using microservice sdk):

{
	"status": "UP",
	"components": {
		"diskSpace": {
			"status": "UP",
			"details": {
				"total": 53667172352,
				"free": 28344782848,
				"threshold": 10485760,
				"exists": true
			}
		},
		"heapMemory": {
			"status": "UP",
			"details": {
				"init": 16777216,
				"used": 83886080,
				"committed": 238026752,
				"max": 830472192,
				"threshold": 41523609
			}
		},
		"livenessState": {
			"status": "UP"
		},
		"nonHeapMemory": {
			"status": "UP",
			"details": {
				"init": 7667712,
				"used": 113263944,
				"committed": 118972416,
				"max": 425721856,
				"threshold": 21286092
			}
		},
		"ping": {
			"status": "UP"
		},
		"readinessState": {
			"status": "UP"
		}
	},
	"groups": [
		"liveness",
		"readiness"
	]
}
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.