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
| Key | Required | Type | Description | Notes |
|---|---|---|---|---|
| sentry_guid | Yes | String | Sentry GUID | 36 characters |
| auth_token | Yes | String | Authentication token | Used for sentry authentication |
| os | Yes | String | Operating system type | Look up supported OS via getSupportedPlatforms API |
| base | Yes | String | Control node address the sentry connects to | URL 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"
}