Skip to content

restore_model

Restore a deleted model, its fields and its records from the model’s deletion snapshot.

Find the event with list_audit_events: a row whose restorable is model; the model need not exist. Everything comes back in one transaction or nothing does. The result gives restoredCount and skippedCount, the snapshot fields no longer in the published schema (droppedFields) and the records whose credentials must be set again (credentialsResetRequired).

{
"properties": {
"application_id": {
"title": "Application Id",
"type": "string"
},
"event_id": {
"title": "Event Id",
"type": "string"
},
"idempotency_key": {
"title": "Idempotency Key",
"type": "string"
}
},
"required": [
"application_id",
"event_id",
"idempotency_key"
],
"title": "restore_modelArguments",
"type": "object"
}
{
"description": "What restoring one model deletion snapshot did, with its record counts.",
"properties": {
"credentialsResetRequired": {
"items": {
"format": "uuid",
"type": "string"
},
"title": "Credentialsresetrequired",
"type": "array"
},
"droppedFields": {
"items": {
"type": "string"
},
"title": "Droppedfields",
"type": "array"
},
"eventId": {
"format": "uuid",
"title": "Eventid",
"type": "string"
},
"model": {
"description": "The restored model definition, under its original identity.",
"properties": {
"applicationId": {
"format": "uuid",
"title": "Applicationid",
"type": "string"
},
"fieldCount": {
"title": "Fieldcount",
"type": "integer"
},
"id": {
"format": "uuid",
"title": "Id",
"type": "string"
},
"label": {
"title": "Label",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
}
},
"required": [
"id",
"applicationId",
"name",
"label",
"fieldCount"
],
"title": "RestoredModel",
"type": "object"
},
"restoredCount": {
"title": "Restoredcount",
"type": "integer"
},
"skipped": {
"items": {
"description": "A batch record that was not restored, and why.",
"properties": {
"reason": {
"title": "Reason",
"type": "string"
},
"recordId": {
"format": "uuid",
"title": "Recordid",
"type": "string"
}
},
"required": [
"recordId",
"reason"
],
"title": "SkippedRecord",
"type": "object"
},
"title": "Skipped",
"type": "array"
},
"skippedCount": {
"title": "Skippedcount",
"type": "integer"
},
"status": {
"const": "restored",
"title": "Status",
"type": "string"
}
},
"required": [
"eventId",
"status",
"model",
"restoredCount",
"skippedCount",
"skipped",
"droppedFields",
"credentialsResetRequired"
],
"title": "RestoreModelResult",
"type": "object"
}