Managed Service for YDB API, REST: Database.Backup
HTTP request
POST https://ydb.api.cloud.yandex.net/ydb/v1/databases:backup
Body parameters
{
"databaseId": "string",
"backupSettings": {
"name": "string",
"description": "string",
"backupSchedule": {
// Includes only one of the fields `dailyBackupSchedule`, `weeklyBackupSchedule`, `recurringBackupSchedule`
"dailyBackupSchedule": {
"executeTime": {
"hours": "integer",
"minutes": "integer",
"seconds": "integer",
"nanos": "integer"
}
},
"weeklyBackupSchedule": {
"daysOfWeek": [
{
"days": [
"string"
],
"executeTime": {
"hours": "integer",
"minutes": "integer",
"seconds": "integer",
"nanos": "integer"
}
}
]
},
"recurringBackupSchedule": {
"startTime": "string",
"recurrence": "string"
},
// end of the list of possible fields
"nextExecuteTime": "string"
},
"backupTimeToLive": "string",
"sourcePaths": [
"string"
],
"sourcePathsToExclude": [
"string"
],
"type": "string",
"storageClass": "string"
}
}
|
Field |
Description |
|
databaseId |
string |
|
backupSettings |
custom backup options, if required. |
BackupSettings
|
Field |
Description |
|
name |
string name of backup settings The maximum string length in characters is 256. |
|
description |
string human readable description. The maximum string length in characters is 256. |
|
backupSchedule |
provide schedule. if empty, backup will be disabled. |
|
backupTimeToLive |
string (duration) provide time to live of backup. |
|
sourcePaths[] |
string provide a list of source paths. Each path can be directory, table or even database itself. The maximum number of elements is 256. |
|
sourcePathsToExclude[] |
string provide a list of paths to exclude from backup. The maximum number of elements is 256. |
|
type |
enum (Type)
|
|
storageClass |
enum (StorageClass)
|
BackupSchedule
|
Field |
Description |
|
dailyBackupSchedule |
Includes only one of the fields |
|
weeklyBackupSchedule |
Includes only one of the fields |
|
recurringBackupSchedule |
Includes only one of the fields |
|
nextExecuteTime |
string (date-time) output only field: when next backup will be executed String in RFC3339 To work with values in this field, use the APIs described in the |
DailyBackupSchedule
|
Field |
Description |
|
executeTime |
Required field. |
TimeOfDay
Represents a time of day. The date and time zone are either not significant
or are specified elsewhere. An API may choose to allow leap seconds. Related
types are google.type.Date
|
Field |
Description |
|
hours |
integer (int32) Hours of day in 24 hour format. Should be from 0 to 23. An API may choose |
|
minutes |
integer (int32) Minutes of hour of day. Must be from 0 to 59. |
|
seconds |
integer (int32) Seconds of minutes of the time. Must normally be from 0 to 59. An API may |
|
nanos |
integer (int32) Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. |
WeeklyBackupSchedule
|
Field |
Description |
|
daysOfWeek[] |
The number of elements must be in the range 1-7. |
DaysOfWeekBackupSchedule
|
Field |
Description |
|
days[] |
enum (DayOfWeek) The number of elements must be in the range 1-7.
|
|
executeTime |
Required field. |
RecurringBackupSchedule
|
Field |
Description |
|
startTime |
string (date-time) Required field. Timestamp of the first recurrence. String in RFC3339 To work with values in this field, use the APIs described in the |
|
recurrence |
string Required field. An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) for how |
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": "object",
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": "object"
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
|
Field |
Description |
|
id |
string ID of the operation. |
|
description |
string Description of the operation. 0-256 characters long. |
|
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
|
createdBy |
string ID of the user or service account who initiated the operation. |
|
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
|
done |
boolean If the value is |
|
metadata |
object Service-specific metadata associated with the operation. |
|
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
|
response |
object The normal response of the operation in case of success. Includes only one of the fields The operation result. |
Status
The error result of the operation in case of failure or cancellation.
|
Field |
Description |
|
code |
integer (int32) Error code. An enum value of google.rpc.Code |
|
message |
string An error message. |
|
details[] |
object A list of messages that carry the error details. |