{ "swagger": "2.0", "info": { "description": "A data backup \u0026 restore tool for Milvus", "title": "Milvus Backup Service", "contact": { "name": "wanganyang", "email": "wayasxxx@gmail.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "basePath": "/api/v1", "paths": { "/create": { "post": { "description": "Create a backup with the given name and collections", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Backup" ], "summary": "Create backup interface", "parameters": [ { "type": "string", "description": "request_id", "name": "request_id", "in": "header" }, { "description": "CreateBackupRequest JSON", "name": "object", "in": "body", "required": true, "schema": { "$ref": "#/definitions/backuppb.CreateBackupRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/backuppb.BackupInfoResponse" } } } } }, "/delete": { "delete": { "description": "Delete a backup with the given name", "produces": [ "application/json" ], "tags": [ "Backup" ], "summary": "Delete backup interface", "parameters": [ { "type": "string", "description": "request_id", "name": "request_id", "in": "header" }, { "type": "string", "description": "backup_name", "name": "backup_name", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/backuppb.DeleteBackupResponse" } } } } }, "/get_backup": { "get": { "description": "Get the backup with the given name or id", "produces": [ "application/json" ], "tags": [ "Backup" ], "summary": "Get backup interface", "parameters": [ { "type": "string", "description": "request_id", "name": "request_id", "in": "header" }, { "type": "string", "description": "backup_name", "name": "backup_name", "in": "query" }, { "type": "string", "description": "backup_id", "name": "backup_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/backuppb.BackupInfoResponse" } } } } }, "/get_restore": { "get": { "description": "Get restore task state with the given id", "produces": [ "application/json" ], "tags": [ "Restore" ], "summary": "Get restore interface", "parameters": [ { "type": "string", "description": "request_id", "name": "request_id", "in": "header" }, { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/backuppb.RestoreBackupResponse" } } } } }, "/list": { "get": { "description": "List all backups in current storage", "produces": [ "application/json" ], "tags": [ "Backup" ], "summary": "List Backups interface", "parameters": [ { "type": "string", "description": "request_id", "name": "request_id", "in": "header" }, { "type": "string", "description": "collection_name", "name": "collection_name", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/backuppb.ListBackupsResponse" } } } } }, "/restore": { "post": { "description": "Submit a request to restore the data from backup", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Restore" ], "summary": "Restore interface", "parameters": [ { "type": "string", "description": "request_id", "name": "request_id", "in": "header" }, { "description": "RestoreBackupRequest JSON", "name": "object", "in": "body", "required": true, "schema": { "$ref": "#/definitions/backuppb.RestoreBackupRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/backuppb.RestoreBackupResponse" } } } } }, "/restore_secondary": { "post": { "description": "Submit a request to restore the data from backup", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Restore" ], "summary": "Restore interface", "parameters": [ { "type": "string", "description": "request_id", "name": "request_id", "in": "header" }, { "description": "RestoreBackupRequest JSON", "name": "object", "in": "body", "required": true, "schema": { "$ref": "#/definitions/backuppb.RestoreSecondaryRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/backuppb.RestoreBackupResponse" } } } } } }, "definitions": { "backuppb.BackupInfoBrief": { "type": "object", "properties": { "backup_timestamp": { "type": "integer" }, "collection_backups": { "type": "array", "items": { "$ref": "#/definitions/backuppb.CollectionBackupInfoBrief" } }, "database_backups": { "type": "array", "items": { "$ref": "#/definitions/backuppb.DatabaseBackupInfo" } }, "end_time": { "type": "integer" }, "errorMessage": { "type": "string" }, "format": { "description": "see BackupInfo.format", "type": "string" }, "id": { "description": "from task", "type": "string" }, "meta_size": { "description": "sum of all meta files size", "type": "integer" }, "milvus_version": { "type": "string" }, "name": { "description": "from backup meta", "type": "string" }, "progress": { "type": "integer" }, "rpc_channel_info": { "$ref": "#/definitions/backuppb.RPCChannelInfo" }, "size": { "type": "integer" }, "start_time": { "type": "integer" }, "state_code": { "$ref": "#/definitions/backuppb.BackupTaskStateCode" } } }, "backuppb.BackupInfoResponse": { "type": "object", "properties": { "code": { "description": "response code. 0 means success. others are fail", "allOf": [ { "$ref": "#/definitions/backuppb.ResponseCode" } ] }, "data": { "description": "backup info entity", "allOf": [ { "$ref": "#/definitions/backuppb.BackupInfoBrief" } ] }, "msg": { "description": "error msg if fail", "type": "string" }, "requestId": { "description": "uuid of the request to response", "type": "string" } } }, "backuppb.BackupSummary": { "type": "object", "properties": { "id": { "type": "string" }, "milvus_version": { "type": "string" }, "name": { "type": "string" }, "size": { "type": "integer" } } }, "backuppb.BackupTaskStateCode": { "type": "integer", "enum": [ 0, 1, 2, 3, 4 ], "x-enum-varnames": [ "BackupTaskStateCode_BACKUP_INITIAL", "BackupTaskStateCode_BACKUP_EXECUTING", "BackupTaskStateCode_BACKUP_SUCCESS", "BackupTaskStateCode_BACKUP_FAIL", "BackupTaskStateCode_BACKUP_TIMEOUT" ] }, "backuppb.CollFilter": { "type": "object", "properties": { "colls": { "type": "array", "items": { "type": "string" } } } }, "backuppb.CollectionBackupInfoBrief": { "type": "object", "properties": { "backup_physical_timestamp": { "description": "physical unix time of backup", "type": "integer" }, "backup_timestamp": { "description": "logical time of backup, used for restore", "type": "integer" }, "channel_checkpoints": { "type": "object", "additionalProperties": { "type": "string" } }, "collection_id": { "type": "integer" }, "collection_name": { "type": "string" }, "db_name": { "type": "string" }, "has_index": { "type": "boolean" }, "id": { "type": "string" }, "index_infos": { "type": "array", "items": { "$ref": "#/definitions/backuppb.IndexInfo" } }, "load_state": { "type": "string" }, "properties": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "schema": { "$ref": "#/definitions/backuppb.CollectionSchema" }, "shards_num": { "type": "integer" }, "size": { "type": "integer" } } }, "backuppb.CollectionSchema": { "type": "object", "properties": { "autoID": { "type": "boolean" }, "description": { "type": "string" }, "enable_dynamic_field": { "type": "boolean" }, "fields": { "type": "array", "items": { "$ref": "#/definitions/backuppb.FieldSchema" } }, "functions": { "type": "array", "items": { "$ref": "#/definitions/backuppb.FunctionSchema" } }, "name": { "type": "string" }, "properties": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "struct_array_fields": { "type": "array", "items": { "$ref": "#/definitions/backuppb.StructArrayFieldSchema" } } } }, "backuppb.CreateBackupRequest": { "type": "object", "properties": { "async": { "description": "async or not", "type": "boolean" }, "backup_name": { "description": "backup name, will generate one if not set", "type": "string" }, "backup_root_path": { "description": "backup root path", "type": "string" }, "collection_names": { "description": "collection names to backup, empty to backup all", "type": "array", "items": { "type": "string" } }, "db_collections": { "description": "database and collections to backup. A json string. To support database. 2023.7.7", "type": "string" }, "filter": { "description": "filter for backup", "type": "object", "additionalProperties": { "$ref": "#/definitions/backuppb.CollFilter" } }, "force": { "description": "force backup skip flush, Should make sure data has been stored into disk when using it\nDeprecated: set strategy=skip_flush instead", "type": "boolean" }, "gc_pause_address": { "description": "gc pause API address", "type": "string" }, "gc_pause_enable": { "description": "if true, stop GC to avoid the data compacted and GCed during backup, use it when the data to backup is very large.", "type": "boolean" }, "gc_pause_seconds": { "description": "gc pause seconds, set it larger than the time cost of backup", "type": "integer" }, "meta_only": { "description": "only backup meta, including collection schema and index info\nDeprecated: set strategy=meta_only instead", "type": "boolean" }, "rbac": { "description": "whether backup RBAC", "type": "boolean" }, "requestId": { "description": "uuid of request, will generate one if not set", "type": "string" }, "strategy": { "description": "strategy for backup, one of [meta_only, skip_flush, bulk_flush, serial_flush], if not set will auto select", "type": "string" }, "with_index_extra": { "type": "boolean" } } }, "backuppb.DataType": { "type": "integer", "enum": [ 0, 1, 2, 3, 4, 5, 10, 11, 20, 21, 22, 23, 24, 25, 26, 100, 101, 102, 103, 104, 105, 106, 200, 201 ], "x-enum-varnames": [ "DataType_None", "DataType_Bool", "DataType_Int8", "DataType_Int16", "DataType_Int32", "DataType_Int64", "DataType_Float", "DataType_Double", "DataType_String", "DataType_VarChar", "DataType_Array", "DataType_JSON", "DataType_Geometry", "DataType_Text", "DataType_Timestamptz", "DataType_BinaryVector", "DataType_FloatVector", "DataType_Float16Vector", "DataType_BFloat16Vector", "DataType_SparseFloatVector", "DataType_Int8Vector", "DataType_ArrayOfVector", "DataType_ArrayOfStruct", "DataType_Struct" ] }, "backuppb.DatabaseBackupInfo": { "type": "object", "properties": { "db_id": { "type": "integer" }, "db_name": { "type": "string" }, "ezk": { "type": "string" }, "properties": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } } } }, "backuppb.DeleteBackupResponse": { "type": "object", "properties": { "code": { "description": "response code. 0 means success. others are fail", "allOf": [ { "$ref": "#/definitions/backuppb.ResponseCode" } ] }, "msg": { "description": "error msg if fail", "type": "string" }, "requestId": { "description": "uuid of the request to response", "type": "string" } } }, "backuppb.FieldSchema": { "type": "object", "properties": { "autoID": { "type": "boolean" }, "data_type": { "$ref": "#/definitions/backuppb.DataType" }, "default_value": { "$ref": "#/definitions/backuppb.ValueField" }, "default_value_base64": { "type": "string" }, "default_value_proto": { "description": "Deprecated: Do not use.", "type": "string" }, "description": { "type": "string" }, "element_type": { "$ref": "#/definitions/backuppb.DataType" }, "fieldID": { "type": "integer" }, "index_params": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "is_dynamic": { "type": "boolean" }, "is_function_output": { "type": "boolean" }, "is_partition_key": { "type": "boolean" }, "is_primary_key": { "type": "boolean" }, "name": { "type": "string" }, "nullable": { "type": "boolean" }, "state": { "$ref": "#/definitions/backuppb.FieldState" }, "type_params": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } } } }, "backuppb.FieldState": { "type": "integer", "enum": [ 0, 1, 2, 3 ], "x-enum-varnames": [ "FieldState_FieldCreated", "FieldState_FieldCreating", "FieldState_FieldDropping", "FieldState_FieldDropped" ] }, "backuppb.FunctionSchema": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "input_field_ids": { "type": "array", "items": { "type": "integer" } }, "input_field_names": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "output_field_ids": { "type": "array", "items": { "type": "integer" } }, "output_field_names": { "type": "array", "items": { "type": "string" } }, "params": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "type": { "$ref": "#/definitions/backuppb.FunctionType" } } }, "backuppb.FunctionType": { "type": "integer", "enum": [ 0, 1, 2 ], "x-enum-varnames": [ "FunctionType_Unknown", "FunctionType_BM25", "FunctionType_TextEmbedding" ] }, "backuppb.IndexInfo": { "type": "object", "properties": { "create_time": { "type": "integer" }, "field_id": { "description": "extra info from etcd", "type": "integer" }, "field_name": { "type": "string" }, "index_id": { "type": "integer" }, "index_name": { "type": "string" }, "index_params": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "index_type": { "type": "string" }, "is_auto_index": { "type": "boolean" }, "max_index_version": { "type": "integer" }, "min_index_version": { "type": "integer" }, "params": { "type": "object", "additionalProperties": { "type": "string" } }, "type_params": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "user_index_params": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } } } }, "backuppb.KeyValuePair": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "backuppb.ListBackupsResponse": { "type": "object", "properties": { "code": { "description": "response code. 0 means success. others are fail", "allOf": [ { "$ref": "#/definitions/backuppb.ResponseCode" } ] }, "data": { "description": "backup info entities", "type": "array", "items": { "$ref": "#/definitions/backuppb.BackupSummary" } }, "msg": { "description": "error msg if fail", "type": "string" }, "requestId": { "description": "uuid of the request to response", "type": "string" } } }, "backuppb.RPCChannelInfo": { "type": "object", "properties": { "name": { "type": "string" }, "position": { "type": "string" } } }, "backuppb.ResponseCode": { "type": "integer", "enum": [ 0, 1, 2, 3, 400, 404 ], "x-enum-varnames": [ "ResponseCode_Success", "ResponseCode_Not_Support", "ResponseCode_No_Permission", "ResponseCode_Fail", "ResponseCode_Parameter_Error", "ResponseCode_Request_Object_Not_Found" ] }, "backuppb.RestoreBackupRequest": { "type": "object", "properties": { "async": { "description": "execute asynchronously or not", "type": "boolean" }, "backup_name": { "description": "backup name to restore", "type": "string" }, "bucket_name": { "description": "if bucket_name and path is set. will override bucket/path in config.", "type": "string" }, "collection_names": { "description": "collections to restore", "type": "array", "items": { "type": "string" } }, "collection_renames": { "description": "2, give a map to rename the collections, if not given, use the original name.\ncollection_renames has higher priority than collection_suffix", "type": "object", "additionalProperties": { "type": "string" } }, "collection_suffix": { "description": "Support two ways to rename the collections while recover\n1, set a suffix", "type": "string" }, "db_collections": { "description": "database and collections to restore. A json string. for example: {\"db1\":[\"collection1\"],\"db2\":[\"collection2\",\"collection3\"]}", "type": "string" }, "db_collections_after_rename": { "description": "determine which database and collections to restore after rename", "type": "string" }, "dropExistCollection": { "description": "if true, drop existing target collection before create", "type": "boolean" }, "dropExistIndex": { "description": "if true, drop existing index of target collection before create", "type": "boolean" }, "ezkMapping": { "description": "map of old ezk to new ezk, used to replace encryption keys during restore", "type": "object", "additionalProperties": { "type": "string" } }, "id": { "type": "string" }, "maxShardNum": { "description": "target max shard number", "type": "integer" }, "metaOnly": { "description": "if true only restore meta, not restore data", "type": "boolean" }, "path": { "description": "if bucket_name and path is set. will override bucket/path in config.", "type": "string" }, "rbac": { "description": "whether restore RBAC", "type": "boolean" }, "requestId": { "description": "uuid of request, will generate one if not set", "type": "string" }, "restoreIndex": { "description": "if true restore index info", "type": "boolean" }, "restorePlan": { "$ref": "#/definitions/backuppb.RestorePlan" }, "skipCreateCollection": { "description": "if true, will skip collection, use when collection exist, restore index or data", "type": "boolean" }, "skipImportDiskQuotaCheck": { "description": "if true, skip the diskQuota in Import", "type": "boolean" }, "skipParams": { "description": "if key is set, will skip the params in restore process", "allOf": [ { "$ref": "#/definitions/backuppb.SkipParams" } ] }, "truncateBinlogByTs": { "description": "if true, truncate binlog by timestamp, for cdc", "type": "boolean" }, "useAutoIndex": { "description": "if true use autoindex when restore vector index", "type": "boolean" }, "useV2Restore": { "type": "boolean" } } }, "backuppb.RestoreBackupResponse": { "type": "object", "properties": { "code": { "description": "response code. 0 means success. others are fail", "allOf": [ { "$ref": "#/definitions/backuppb.ResponseCode" } ] }, "data": { "description": "restore task info entity", "allOf": [ { "$ref": "#/definitions/backuppb.RestoreBackupTaskResponse" } ] }, "msg": { "description": "error msg if fail", "type": "string" }, "requestId": { "description": "uuid of the request to response", "type": "string" } } }, "backuppb.RestoreBackupTaskResponse": { "type": "object", "properties": { "collection_restore_tasks": { "type": "array", "items": { "$ref": "#/definitions/backuppb.RestoreCollectionTaskResponse" } }, "end_time": { "type": "integer" }, "errorMessage": { "type": "string" }, "id": { "type": "string" }, "progress": { "type": "integer" }, "start_time": { "type": "integer" }, "state_code": { "$ref": "#/definitions/backuppb.RestoreTaskStateCode" } } }, "backuppb.RestoreCollectionMapping": { "type": "object", "properties": { "override": { "$ref": "#/definitions/backuppb.RestoreCollectionOverride" }, "source": { "type": "string" }, "target": { "type": "string" } } }, "backuppb.RestoreCollectionOverride": { "type": "object", "properties": { "description": { "type": "string" }, "shardNum": { "type": "integer" } } }, "backuppb.RestoreCollectionTaskResponse": { "type": "object", "properties": { "end_time": { "type": "integer" }, "errorMessage": { "type": "string" }, "id": { "type": "string" }, "progress": { "type": "integer" }, "start_time": { "type": "integer" }, "state_code": { "$ref": "#/definitions/backuppb.RestoreTaskStateCode" }, "target_collection_name": { "type": "string" }, "target_db_name": { "type": "string" } } }, "backuppb.RestoreMapping": { "type": "object", "properties": { "colls": { "type": "array", "items": { "$ref": "#/definitions/backuppb.RestoreCollectionMapping" } }, "source": { "type": "string" }, "target": { "type": "string" }, "withProp": { "type": "boolean" } } }, "backuppb.RestorePlan": { "type": "object", "properties": { "filter": { "type": "object", "additionalProperties": { "$ref": "#/definitions/backuppb.CollFilter" } }, "mapping": { "type": "array", "items": { "$ref": "#/definitions/backuppb.RestoreMapping" } } } }, "backuppb.RestoreSecondaryRequest": { "type": "object", "properties": { "async": { "description": "async or not", "type": "boolean" }, "backup_name": { "description": "backup name to restore", "type": "string" }, "path": { "description": "if bucket_name and path is set. will override bucket/path in config.", "type": "string" }, "requestId": { "description": "uuid of request, will generate one if not set", "type": "string" }, "sourceClusterID": { "description": "cdc source cluster id", "type": "string" }, "targetClusterID": { "description": "cdc target cluster id", "type": "string" } } }, "backuppb.RestoreTaskStateCode": { "type": "integer", "enum": [ 0, 1, 2, 3, 4 ], "x-enum-varnames": [ "RestoreTaskStateCode_INITIAL", "RestoreTaskStateCode_EXECUTING", "RestoreTaskStateCode_SUCCESS", "RestoreTaskStateCode_FAIL", "RestoreTaskStateCode_TIMEOUT" ] }, "backuppb.SkipParams": { "type": "object", "properties": { "collectionProperties": { "type": "array", "items": { "type": "string" } }, "fieldIndexParams": { "type": "array", "items": { "type": "string" } }, "fieldTypeParams": { "type": "array", "items": { "type": "string" } }, "indexParams": { "type": "array", "items": { "type": "string" } } } }, "backuppb.StructArrayFieldSchema": { "type": "object", "properties": { "description": { "type": "string" }, "fieldID": { "type": "integer" }, "fields": { "type": "array", "items": { "$ref": "#/definitions/backuppb.FieldSchema" } }, "name": { "type": "string" } } }, "backuppb.ValueField": { "type": "object", "properties": { "data": { "description": "Types that are valid to be assigned to Data:\n\n\t*ValueField_BoolData\n\t*ValueField_IntData\n\t*ValueField_LongData\n\t*ValueField_FloatData\n\t*ValueField_DoubleData\n\t*ValueField_StringData\n\t*ValueField_BytesData" } } } } }