Add VM backup and restore API endpoints

This commit is contained in:
Joshua Boniface 2023-10-24 02:13:54 -04:00
parent b86033f2f3
commit 7e72a0cd66
1 changed files with 149 additions and 0 deletions

View File

@ -6535,6 +6535,102 @@
]
}
},
"/api/v1/vm/{vm}/backup": {
"delete": {
"description": "",
"parameters": [
{
"description": "A local filesystem path on the primary coordinator where the backup is stored",
"in": "query",
"name": "target_path",
"required": true,
"type": "string"
},
{
"description": "The backup datestring identifier (e.g. 20230102030405)",
"in": "query",
"name": "backup_datestring",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Message"
}
},
"400": {
"description": "Execution error",
"schema": {
"$ref": "#/definitions/Message"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Message"
}
}
},
"summary": "Remove a backup of {vm}, including snapshots, from a local primary coordinator filesystem path",
"tags": [
"vm"
]
},
"post": {
"description": "",
"parameters": [
{
"description": "A local filesystem path on the primary coordinator to store the backup",
"in": "query",
"name": "target_path",
"required": true,
"type": "string"
},
{
"description": "A previous backup datestamp to use as an incremental parent; if unspecified a full backup is taken",
"in": "query",
"name": "incremental_parent",
"required": false,
"type": "string"
},
{
"default": false,
"description": "Whether or not to retain this backup's volume snapshots to use as a future incremental parent; full backups only",
"in": "query",
"name": "retain_snapshot",
"required": false,
"type": "boolean"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Message"
}
},
"400": {
"description": "Execution error",
"schema": {
"$ref": "#/definitions/Message"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Message"
}
}
},
"summary": "Create a backup of {vm} and its volumes to a local primary coordinator filesystem path",
"tags": [
"vm"
]
}
},
"/api/v1/vm/{vm}/console": {
"get": {
"description": "",
@ -6867,6 +6963,59 @@
]
}
},
"/api/v1/vm/{vm}/restore": {
"post": {
"description": "",
"parameters": [
{
"description": "A local filesystem path on the primary coordinator where the backup is stored",
"in": "query",
"name": "target_path",
"required": true,
"type": "string"
},
{
"description": "The backup datestring identifier (e.g. 20230102030405)",
"in": "query",
"name": "backup_datestring",
"required": true,
"type": "string"
},
{
"default": true,
"description": "Whether or not to retain the (parent, if incremental) volume snapshot after restore",
"in": "query",
"name": "retain_snapshot",
"required": false,
"type": "boolean"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Message"
}
},
"400": {
"description": "Execution error",
"schema": {
"$ref": "#/definitions/Message"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Message"
}
}
},
"summary": "Restore a backup of {vm} and its volumes from a local primary coordinator filesystem path",
"tags": [
"vm"
]
}
},
"/api/v1/vm/{vm}/state": {
"get": {
"description": "",