Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

API commands to access the health of connectors



  • Hi,

    I need the api commands and format to access the health of the connectors.so that i can automate it in powershell to restart the service whenever the connectore goes down.

    https://devget.syhapp.com:8798/api/json/Connectors_GetConnectors?API_Key=****&Feed_Id=

    have tried this but it throws me error .

    Product: ProGet
    Version: 4.8.7


  • inedo-engineer

    Hello Subash,

    To check whether any connectors are unhealthy, you could use a PowerShell script like this:

    $someConnectorsUnhealthy = (
        Invoke-RestMethod 'https://devget.syhapp.com:8798/api/json/Connectors_GetConnectors?API_Key=*******&Feed_Id=***' |
        Where-Object { $_.Status_Code -ne 'H' }).Count -gt 0
    

    After this, $someConnectorsUnhealthy is $True if any connectors for that feed are not in a healthy state, and $False if all connectors are healthy.

    If your API key contains = or +, it needs to be URL-encoded, with = replaced by %3D and + replaced by %2B. Alternatively, you can change the API key to be URL-safe.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation