Skip to content

Dataset Status Transition

POST
/v2/datasets/status-transition
curl --request POST \
--url http://localhost:3000/v2/datasets/status-transition \
--header 'Content-Type: application/json' \
--data '{ "id": "api.datasets.status-transition", "ver": "v2", "ts": "2024-04-19T12:58:47+05:30", "params": { "msgid": "4a7f14c3-d61e-4d4f-be78-181834eeff6" }, "request": { "dataset_id": "telemetry-events", "status": "ReadyToPublish" } }'

This API allows you to perform status transition between 2 states. Allowed status transition are Draft to ReadyToPublish, ReadyToPublish to Live, Live to Retired and even Delete a dataset.

Media type application/json
object
Example
{
"id": "api.datasets.status-transition",
"ver": "v2",
"ts": "2024-04-19T12:58:47+05:30",
"params": {
"msgid": "4a7f14c3-d61e-4d4f-be78-181834eeff6"
},
"request": {
"dataset_id": "telemetry-events",
"status": "ReadyToPublish"
}
}

OK

Media type application/json
object
Examples

Delete success: Deleted dataset successfully

{
"id": "api.datasets.status-transition",
"ver": "v2",
"ts": "2024-05-30T12:18:54+05:30",
"params": {
"status": "SUCCESS",
"msgid": "4a7f14c3-d61e-4d4f-be78-181834eeff6",
"resmsgid": "5948e784-37f9-4a70-85ca-86c9077ee30b"
},
"responseCode": "OK",
"result": {
"message": "Dataset status transition to Delete successful",
"dataset_id": "trip-data"
}
}

Bad Request

Media type application/json
object
Examples

Live failure: Dataset in draft state

{
"id": "api.datasets.status-transition",
"ver": "v2",
"ts": "2024-05-30T15:37:43+05:30",
"params": {
"status": "FAILED",
"msgid": "4a7f14c3-d61e-4d4f-be78-181834eeff6",
"resmsgid": "d56e2ed4-f008-48be-a501-164c19178419"
},
"responseCode": "BAD_REQUEST",
"error": {
"code": "DATASET_LIVE_FAILURE",
"message": "Transition failed for dataset: sb-telemetry2 status:Draft with status transition to Live",
"trace": ""
}
}

Not Found

Media type application/json
object
Examples

Delete failure: Dataset not found to delete

{
"id": "api.datasets.status",
"ver": "v2",
"ts": "2024-05-30T12:25:36+05:30",
"params": {
"status": "FAILED",
"msgid": "4a7f14c3-d61e-4d4f-be78-181834eeff6",
"resmsgid": "3cdcf2af-c015-4977-9d66-364e00f1712b"
},
"responseCode": "NOT_FOUND",
"error": {
"code": "DATASET_NOT_FOUND",
"message": "Dataset not found for dataset: master",
"trace": ""
}
}