Create Connect Profile
Creates a new connect profile.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
POST /api/sonar/connect-profiles
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d code=testdb \
-d type=jdbc \
-d name="Hyper SQL" \
-d description="Embedded file database" \
-d configs="{""connection_string"":""jdbc:hsqldb:file:testdb"", ""user"":""SA"", ""password"":null, ""read_only"":false}" \
-X POST \
https://HOSTNAME/api/sonar/connect-profiles
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| guid | X | String | Connect profile GUID | 36 characters. The default is randomly generated. |
| code | O | String | Connect profile name | Minimum 1 to maximum 50 characters |
| type | O | String | Connect profile type | E.g. jdbc |
| name | O | String | Connect profile display name | Minimum 1 to maximum 50 characters |
| description | X | String | Connect profile Description | Maximum 2,000 characters |
| grant_users | X | String | GUID list of the users with privileges for the profile | Comma-separated list |
| grant_groups | X | String | GUID list of the user groups with privileges for the profile | Comma-separated list |
| configs | O | String key/value | Configuration | JSON format String |
Tip
The connect profile name (code) is used as the name referenced in queries, such as the `parse` command.
Success Response
{}
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "code should be not null"
}
Invalid argument length
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'name' must be less than or equal to 50 characters."
}
Missing required configuration option value
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "config option must be not null: connection_string"
}
Invalid connect profile type
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "profile type not found: invalid-type"
}
Duplicate connect profile name
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "duplicated profile code: testdb"
}
No administrator privileges
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}