- 08 Feb 2024
- 5 Minutes to read
- Print
- DarkLight
- PDF
ProGet Health API
- Updated on 08 Feb 2024
- 5 Minutes to read
- Print
- DarkLight
- PDF
There are two API endpoints that you can use to quickly obtain information about the health and status of ProGet instances and ProGet connectors.
- Get Instance Health - describes the health status of a ProGet instance
- Get Connector Health - describes the health status of ProGet connectors in a ProGet instance
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
)
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": []
}
}
Response | Details |
---|---|
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.
Property | Format | Notes |
---|---|---|
applicationName | string | For this API it will be ProGet as default |
databaseStatus | string | health state of the database. (OK or Error ) |
databaseStatusDetails | string? | a specific error message if databaseStatus is Error (default null ) |
extensionsInstalled | object | describes the extentions installed in the instance and their versions (e.g. "Azure": "2.0.1" ) |
licenseStatus | string | health state of the product license. (OK or Error ) |
licenseStatusDetail | string? | a specific error message if licenseStatus is Error (default null ) |
versionNumber | string | current version number of the instance |
releaseNumber | string | current release number of the instance |
serviceStatus | string | health state of the service. (OK or Error ) |
serviceStatusDetail | string? | a specific error message if serviceStatus is Error (default null ) |
replicationStatus | object | a 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.
Property | Format | Notes |
---|---|---|
serverStatus | string? | health state of a replication server (OK or Error ), or null if there are no replication servers. |
serverError | string? | a specific error message if serverStatus is Error (default null ) |
clientStatus | string? | health state of a replication client (OK or Error ), or null if there are no replication clients. |
clientError | string? | a specific error message if clientStatus is Error (default null ) |
incoming | array | Duplicates and provides information about any existing Replications |
outgoing | array | Duplicates 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.
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"
},
{....}
]
Response | Details |
---|---|
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.
Property | Format | Notes |
---|---|---|
id | int | the unique id of the connector |
name | string | the unique name of the connector |
url | string | the URL of the connector |
state | string | the health state of the connector, (healthy , error , or unknown ) |
errorMessage | object | a specific error message if state is error (default null ) |
lastChecked | datetime | an ISO 8601 UTC date when the connector health was last checked, or null if state is unknown |