Create Connect Profile

Creates a new connect profile.

HTTP Request

POST /api/sonar/connect-profiles
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     -d company_guid=6fbe27b7-f1ae-4d7a-a1a5-76d8fa9aa311 \
     -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
company_guidXStringCompany GUID36 characters. The default is the GUID of the company in the current session.
guidXStringConnect profile GUID36 characters. The default is randomly generated.
codeOStringConnect profile nameMinimum 1 to maximum 50 characters
typeOStringConnect profile typeE.g. jdbc
nameOStringConnect profile display nameMinimum 1 to maximum 50 characters
descriptionXStringConnect profile DescriptionMaximum 2,000 characters
grant_usersXStringGUID list of the users with privileges for the profileComma-separated list
grant_groupsXStringGUID list of the user groups with privileges for the profileComma-separated list
configsOString key/valueConfigurationJSON 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": "unknown-profile-type",
  "error_msg": null
}
Duplicate connect profile name

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "duplicate-code: testdb"
}
Invalid company GUID

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "invalid-company-guid: 1fbe27b7-f1ae-4d7a-a1a5-76d8fa9aa311"
}
No privilege to manage the company

HTTP status code 500

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