ProGet Documentation

Connector Health API

  • Last Modified: 2019-05-06

The Connector Health API Endpoints offer a simple mechanism for querying the health status of the connectors in ProGet.

This API is available starting in ProGet 5.2.

Authentication

For security and simplicity, these endpoints require that a Connector Health API Key is created first. This key can be supplied to the API using any of the methods documented in the API Key Usage section.

Object Models

Each endpoint responds with entities as JSON objects:

Connector Health Data Model

PropertyDetails
namestring - the unique name of the connector
urlstring - the URL of the connector
statestring - the health state of the connector, one of: healthy, error, or unknown
errorMessagestring - a specific error message if state is error; otherwise null
lastCheckeddatetime - an ISO 8601 UTC date when the connector health was last checked, or null if state is unknown

Endpoint Specifications

There are two endpoints available for querying connector health:

All Connectors

URL Format:

GET/HEAD /api/connector-health

Response Codes:
CodeDescription
200Success; response body contains an array of connector health objects
403Invalid/unauthorized API key, or impersonated user not granted Feeds_Manage privilege
Example Response:
[
    {
        "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"
    },
    {....}

]
PowerShell Example:
Invoke-RestMethod `
  -Uri http://{proget-server}/api/connector-health `
  -Headers @{"X-ApiKey" = "secure123"}

Single Connector

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

Response Codes:
CodeDescription
200Success; response body contains a connector health object
403Invalid/unauthorized API key, or impersonated user not granted Feeds_Manage privilege
404Specified connector-id was not found
Example Response:
{
    "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"
}
PowerShell Example:
Invoke-RestMethod `
  -Uri http://{proget-server}/api/connector-health/3 `
  -Headers @{"X-ApiKey" = "secure123"}

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.