Create sentry

Registers a new sentry agent. Returns an installation script after the sentry is created.

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":"sentry-001","auth_token":"a1b2c3d4e5f6","os":"linux_x64","base":"https://198.51.100.1:8443"}' \
     -X POST https://HOSTNAME/api/sonar/sentries
Request Parameters
KeyRequiredTypeDescriptionNote
sentry_guidYesStringSentry identifier
auth_tokenYesStringAuthentication token
osYesStringOS type
baseYesStringConnection address

Success Response

{
  "script": "curl -sL https://198.51.100.1:8443/sentry/install | bash -s -- sentry-001 a1b2c3d4e5f6"
}

Error Responses

Required parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "sentry_guid should be not null"
}
The sentry identifier already exists

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "duplicated sentry guid: c3d4e5f6-a7b8-9012-cdef-123456789012"
}
Unsupported operating system type

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "no install command for os [aix]"
}
Permission denied

HTTP status code 500

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