Did grafana api support multi datasource import at one time

I try to create a binary file to import all our datasource at one time.
But it return fail.
Could you help me to have a look?

Json:

[
{“name”:“collectd1”,“type”:“influxdb”,“url”:“http://10.11.12.13:8086”,“access”:“proxy”,“isDefault”:true,“database”:“collectd1”,“user”:“grafana”,“password”:“123456”},
{“name”:“collectd2”,“type”:“influxdb”,“url”:“http://10.11.12.13:8086”,“access”:“proxy”,“isDefault”:false,“database”:“collectd2”,“user”:“grafana”,“password”:“123456”},
]

Return:

[
{
“classification”: “DeserializationError”,
“message”: “json: cannot unmarshal array into Go value of type models.AddDataSourceCommand”
},
{
“fieldNames”: [
“Name”
],
“classification”: “RequiredError”,
“message”: “Required”
},
{
“fieldNames”: [
“Type”
],
“classification”: “RequiredError”,
“message”: “Required”
},
{
“fieldNames”: [
“Access”
],
“classification”: “RequiredError”,
“message”: “Required”
}
]

The HTTP api for creating or updating data sources only work with one at a time.

Checkout the HTTP api docs:

http://docs.grafana.org/http_api/data_source/#create-data-source

Could we add this feature.
For management multi organization, this feature is very useful.

No. Does not make much sense as this can easily be done by just looping in the import script.

What we hope to do in the future is to make automation setups more easier by allowing admins to define orgs, users, & data sources & dashboards via json files and have these imported/synced automatically at startup (and maybe at other times).

https://github.com/grafana/grafana/issues/5674

Ok. that looks great.
Thanks

Try https://www.terraform.io/docs/providers/grafana/ - it’s not datasource import, but datasource provisioning.