Create Sentry

Registers a new sentry agent and returns the installation command script.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

POST /api/sonar/sentries
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d sentry_guid="a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
     -d auth_token="your-auth-token" \
     -d os="linux" \
     -d base="https://HOSTNAME" \
     -X POST \
     https://HOSTNAME/api/sonar/sentries
Request Parameters
KeyRequiredTypeDescriptionNotes
sentry_guidYesStringSentry GUID36 characters
auth_tokenYesStringAuthentication tokenUsed for sentry authentication
osYesStringOperating system typeLook up supported OS via getSupportedPlatforms API
baseYesStringControl node address the sentry connects toURL format

Success Response

{
  "script": "curl -sSL https://HOSTNAME/install.sh | bash -s -- ..."
}
  • script (String): Sentry installation command to run on the host

Error Responses

Required parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "sentry_guid should be not null"
}
Sentry name is duplicated

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "duplicated sentry guid: a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}