ProGet Health API
  • 08 Feb 2024
  • 5 Minutes to read
  • Dark
    Light
  • PDF

ProGet Health API

  • Dark
    Light
  • PDF

Article Summary

There are two API endpoints that you can use to quickly obtain information about the health and status of ProGet instances and ProGet connectors.

Instance Health

The Get Instance Health is an endpoint that will return a ProGetHealth object describing the health of a ProGet instance.

Using this endpoint does not require an API key and can be accessed by simply adding /health to your ProGet URL (e.g. https://proget.corp.local/health)

🚀 Quick Example: Get the Health of a ProGet Instance with Curl

This example will get the health of a ProGet instance with the URL proget.corp.local:

curl -H "Content-Type: application/json" -X GET https://proget.corp.local/health

Request Specification

To return the health status of a ProGet instance, simply GET to the URL.

GET /health

Response Specification

A successful (200) response body will return a ProGetHealth object. For example, to querying the health of a ProGet instance, the request would return this:

GET /health

{
  "applicationName": "ProGet",
  "databaseStatus": "OK",
  "databaseStatusDetails": null,
  "extensionsInstalled": {
    "ProGetCoreEx": "23.0.27",
    "Inedo.SDK": "2.3.0",
    "Amazon AWS": "2.0.3",
    "Azure": "2.0.1",
    "InedoCore": "2.3.2",
    "Sonatype": "2.0.1"
  },
  "licenseStatus": "OK",
  "licenseStatusDetail": null,
  "versionNumber": "2023.27 (Build 5)",
  "releaseNumber": "23.0.27",
  "serviceStatus": "OK",
  "serviceStatusDetail": null,
  "replicationStatus": {
    "serverStatus": null,
    "serverError": null,
    "clientStatus": null,
    "clientError": null,
    "incoming": [],
    "outgoing": []
  }
}
ResponseDetails
200 (Success)body will contain a ProGetHealth object
500 (Server Error)indicates an unexpected error; the body will contain the message and stack trace, and this will also be logged

ProGetHealth Object Attributes

ProGetHealth is a set of key/value pairs that describe the health status of a ProGet instance. It's used as output data for the Get ProGet Health endpoint as a JSON-formatted object.

PropertyFormatNotes
applicationNamestringFor this API it will be ProGet as default
databaseStatusstringhealth state of the database. (OK or Error)
databaseStatusDetailsstring?a specific error message if databaseStatus is Error (default null)
extensionsInstalledobjectdescribes the extentions installed in the instance and their versions (e.g. "Azure": "2.0.1")
licenseStatusstringhealth state of the product license. (OK or Error)
licenseStatusDetailstring?a specific error message if licenseStatus is Error (default null)
versionNumberstringcurrent version number of the instance
releaseNumberstringcurrent release number of the instance
serviceStatusstringhealth state of the service. (OK or Error)
serviceStatusDetailstring?a specific error message if serviceStatus is Error (default null)
replicationStatusobjecta ReplicationStatus Object

ReplicationStatus Object Attributes

ReplicationStatus is a subset of data on the ProGetHealth Object that describes the status of replication servers and clients. It's used as output data for the Get ProGet Health endpoint.

Note that all values are optional (indicated by string?), and may be set to null or omitted.

PropertyFormatNotes
serverStatusstring?health state of a replication server (OK or Error), or null if there are no replication servers.
serverErrorstring?a specific error message if serverStatus is Error (default null)
clientStatusstring?health state of a replication client (OK or Error), or null if there are no replication clients.
clientErrorstring?a specific error message if clientStatus is Error (default null)
incomingarrayDuplicates and provides information about any existing Replications
outgoingarrayDuplicates and provides information about any existing Replications

ProGet Connector Health

The Get Connector Health is an endpoint that will return either a ConnectorHealth object or an array of objects describing the health of either one or all connectors in a ProGet instance.

The System API Key View Connector Health is required for this endpoint

To specify an API Key, use the request header (X-ApiKey), querystring (key), or api:«api-key» as the username. See API Key Usage to learn more.

🚀 Quick Example: Get the Health of a single connector in a ProGet instance with Curl

This example will get the health of the connector with an id of 3, authenticating with the API key abc12345:

curl --header "X-ApiKey: abc12345" -H "Content-Type: application/json" -X GET https://proget.corp.local/api/connector-health/3

If the provided API key is either missing, unknown/incorrect or does not have permission, the following message is returned:

403 The specified API key does not have the proper permissions to perform this action.

Request Specification

To return the health status of a ProGet connector, simply GET to the URL with an appropriate API Key

GET /api/connector-health/«connector-id»

Getting the health of a single ProGet connector requires the id (e.g. 3):

GET /api/connector-health/3

Getting the health of all ProGet connectors requires omitting the id:

GET /api/connector-health/

Response Specification

A successful (200) response body will return either a ConnectorHealth object or an array of objects.

To querying the health of a single ProGet connector, the request would return this:

GET /api/connector-health/3

{
    "id": 3,
    "name": "nuget.org",
    "url": "https://www.nuget.org/api/v2",
    "state": "unhealthy",
    "errorMessage": "Connection timed out."
    "lastChecked": "2019-03-29T17:41:55.05+00:00"
}

To querying the health of all ProGet connectors, the request would return this:

GET /api/connector-health/
[
    {
        "id": 1,
        "name": "npmjs.org",
        "url": "https://registry.npmjs.org",
        "state": "healthy",
        "lastChecked": "2019-03-29T17:41:59.907+00:00"
    },
    {
        "id": 2,
        "name": "chocolatey.org",
        "url": "https://www.chocolatey.org/api/v2",
        "state": "healthy",
        "lastChecked": "2019-03-29T17:41:59.903+00:00"
    },
    {
        "id": 3,
        "name": "nuget.org",
        "url": "https://www.nuget.org/api/v2",
        "state": "unhealthy",
        "erroMessage": "Connection timed out."
        "lastChecked": "2019-03-29T17:41:55.05+00:00"
    },
    {....}
]
ResponseDetails
200 (Success)body will contain either a ConnectorHealth object or an array of objects
403 (Unauthorized API Key)indicates a missing, unknown, or unauthorized API Key; the body will be empty
404 (Connector not Found)Specified connector id was not found
500 (Server Error)indicates an unexpected error; the body will contain the message and stack trace, and this will also be logged

ConnectorHealth Object Attributes

ConnectorHealth is a set of key/value pairs that describe the health status of connectors in a ProGet instance. It's used as output data for the Get ProGet Connector Health endpoint as a JSON-formatted object.

Some values are optional (indicated by string?), and may be set to null or an empty string.

PropertyFormatNotes
idintthe unique id of the connector
namestringthe unique name of the connector
urlstringthe URL of the connector
statestringthe health state of the connector, (healthy, error, or unknown)
errorMessageobjecta specific error message if state is error (default null)
lastCheckeddatetimean ISO 8601 UTC date when the connector health was last checked, or null if state is unknown

Was this article helpful?