API: add ID to snapshot API responses (#29600)
* API: add ID to snapshot API responses * API: update snapshot tests
This commit is contained in:
@@ -132,6 +132,7 @@ func CreateDashboardSnapshot(c *models.ReqContext, cmd models.CreateDashboardSna
|
||||
"deleteKey": cmd.DeleteKey,
|
||||
"url": url,
|
||||
"deleteUrl": setting.ToAbsUrl("api/snapshots-delete/" + cmd.DeleteKey),
|
||||
"id": cmd.Result.Id,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -223,7 +224,10 @@ func DeleteDashboardSnapshotByDeleteKey(c *models.ReqContext) Response {
|
||||
return Error(500, "Failed to delete dashboard snapshot", err)
|
||||
}
|
||||
|
||||
return JSON(200, util.DynMap{"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."})
|
||||
return JSON(200, util.DynMap{
|
||||
"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches.",
|
||||
"id": query.Result.Id,
|
||||
})
|
||||
}
|
||||
|
||||
// DELETE /api/snapshots/:key
|
||||
@@ -269,7 +273,10 @@ func DeleteDashboardSnapshot(c *models.ReqContext) Response {
|
||||
return Error(500, "Failed to delete dashboard snapshot", err)
|
||||
}
|
||||
|
||||
return JSON(200, util.DynMap{"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."})
|
||||
return JSON(200, util.DynMap{
|
||||
"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches.",
|
||||
"id": query.Result.Id,
|
||||
})
|
||||
}
|
||||
|
||||
// GET /api/dashboard/snapshots
|
||||
|
||||
Reference in New Issue
Block a user