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
KeyRequiredTypeDescriptionNote
guidNoStringConnect profile GUID36 characters. The default is randomly generated.
codeYesStringConnect profile identifierMinimum 1 to maximum 50 characters
typeYesStringConnect profile typeE.g. jdbc
nameYesStringConnect profile display nameMinimum 1 to maximum 50 characters
descriptionNoStringConnect profile DescriptionMaximum 2,000 characters
grant_usersNoStringGUID list of the users with privileges for the profileComma-separated list
grant_groupsNoStringGUID list of the user groups with privileges for the profileComma-separated list
configsYesString key/valueConfigurationJSON format String
connection_check_enabledNoBooleanWhether connection check is enabledDefault: false
Tip
The connect profile identifier (code) is used as the name referenced in queries, such as the `parse` command.

Success Response

{
  "guid": "b7f00412-8720-4a8f-ac35-7d7f359f797e"
}
  • guid (String): GUID of the created connect profile

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 shorter 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"
}