Create datasource
POST
/v1/admin/datasources
const url = 'https://localhost:8080/v1/admin/datasources';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"config_fields":[{"clear":true,"key":"example","value":"example"}],"name":"example","scan_policy":"example","secret_refs":{"backend":"example","mappings":{"additionalProperty":"example"},"reference":"example"},"type":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:8080/v1/admin/datasources \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "config_fields": [ { "clear": true, "key": "example", "value": "example" } ], "name": "example", "scan_policy": "example", "secret_refs": { "backend": "example", "mappings": { "additionalProperty": "example" }, "reference": "example" }, "type": "example" }'Creates a datasource definition with config fields and secret references
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Datasource payload
Media typeapplication/json
object
config_fields
required
Array<object>
object
clear
boolean
key
required
string
value
string
name
required
string
scan_policy
string
secret_refs
object
backend
string
mappings
object
key
additional properties
string
reference
string
type
required
string
Example generated
{ "config_fields": [ { "clear": true, "key": "example", "value": "example" } ], "name": "example", "scan_policy": "example", "secret_refs": { "backend": "example", "mappings": { "additionalProperty": "example" }, "reference": "example" }, "type": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
config_fields
Array<object>
object
has_value
boolean
key
string
value
string
created_at
string
id
string
is_disabled
boolean
name
string
scan_policy
string
secret_refs
object
backend
string
mappings
object
key
additional properties
string
reference
string
type
string
updated_at
string
Example generated
{ "config_fields": [ { "has_value": true, "key": "example", "value": "example" } ], "created_at": "example", "id": "example", "is_disabled": true, "name": "example", "scan_policy": "example", "secret_refs": { "backend": "example", "mappings": { "additionalProperty": "example" }, "reference": "example" }, "type": "example", "updated_at": "example"}Bad Request
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}Unauthorized
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}Forbidden
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}Internal Server Error
Media typeapplication/json
object
error
string
message
string
success
boolean
Example
{ "error": "", "message": "Success", "success": true}