Provisioning: Add API endpoint to reload provisioning configs (#16579)
* Add api to reaload provisioning * Refactor and simplify the polling code * Add test for the provisioning service * Fix provider initialization and move some code to file reader * Simplify the code and move initialization * Remove unused code * Update comment * Add comment * Change error messages * Add DashboardProvisionerFactory type * Update imports * Use new assert lib * Use mutext for synchronizing the reloading * Fix typo Co-Authored-By: aocenas <mr.ocenas@gmail.com> * Add docs about the new api
This commit is contained in:
@@ -447,3 +447,36 @@ Content-Type: application/json
|
||||
"message": "User auth token revoked"
|
||||
}
|
||||
```
|
||||
|
||||
## Reload provisioning configurations
|
||||
|
||||
`POST /api/admin/provisioning/dashboards/reload`
|
||||
|
||||
`POST /api/admin/provisioning/datasources/reload`
|
||||
|
||||
`POST /api/admin/provisioning/notifications/reload`
|
||||
|
||||
Reloads the provisioning config files for specified type and provision entities again. It won't return
|
||||
until the new provisioned entities are already stored in the database. In case of dashboards, it will stop
|
||||
polling for changes in dashboard files and then restart it with new configs after returning.
|
||||
|
||||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||||
|
||||
**Example Request**:
|
||||
|
||||
```http
|
||||
POST /api/admin/provisioning/dashboards/reload HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
```
|
||||
|
||||
**Example Response**:
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"message": "Dashboards config reloaded"
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user