|
|
|
@ -147,6 +147,10 @@ func CreateDashboardSnapshot(c *models.ReqContext, cmd models.CreateDashboardSna |
|
|
|
|
// GET /api/snapshots/:key
|
|
|
|
|
func GetDashboardSnapshot(c *models.ReqContext) response.Response { |
|
|
|
|
key := macaron.Params(c.Req)[":key"] |
|
|
|
|
if len(key) == 0 { |
|
|
|
|
return response.Error(404, "Snapshot not found", nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
query := &models.GetDashboardSnapshotQuery{Key: key} |
|
|
|
|
|
|
|
|
|
err := bus.Dispatch(query) |
|
|
|
@ -211,6 +215,9 @@ func deleteExternalDashboardSnapshot(externalUrl string) error { |
|
|
|
|
// GET /api/snapshots-delete/:deleteKey
|
|
|
|
|
func DeleteDashboardSnapshotByDeleteKey(c *models.ReqContext) response.Response { |
|
|
|
|
key := macaron.Params(c.Req)[":deleteKey"] |
|
|
|
|
if len(key) == 0 { |
|
|
|
|
return response.Error(404, "Snapshot not found", nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
query := &models.GetDashboardSnapshotQuery{DeleteKey: key} |
|
|
|
|
|
|
|
|
@ -241,6 +248,9 @@ func DeleteDashboardSnapshotByDeleteKey(c *models.ReqContext) response.Response |
|
|
|
|
// DELETE /api/snapshots/:key
|
|
|
|
|
func DeleteDashboardSnapshot(c *models.ReqContext) response.Response { |
|
|
|
|
key := macaron.Params(c.Req)[":key"] |
|
|
|
|
if len(key) == 0 { |
|
|
|
|
return response.Error(404, "Snapshot not found", nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
query := &models.GetDashboardSnapshotQuery{Key: key} |
|
|
|
|
|
|
|
|
|