{ "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", "required": true }, { "type": "string", "description": "backup_id", "name": "backup_id", "in": "query", "required": true } ], "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" } } } } } }, "definitions": { "backuppb.BackupInfo": { "type": "object", "properties": { "backup_timestamp": { "description": "backup timestamp", "type": "integer" }, "collection_backups": { "description": "array of collection backup", "type": "array", "items": { "$ref": "#/definitions/backuppb.CollectionBackupInfo" } }, "database_backups": { "type": "array", "items": { "$ref": "#/definitions/backuppb.DatabaseBackupInfo" } }, "end_time": { "type": "integer" }, "errorMessage": { "type": "string" }, "id": { "type": "string" }, "milvus_version": { "type": "string" }, "name": { "type": "string" }, "progress": { "type": "integer" }, "rbac_meta": { "$ref": "#/definitions/backuppb.RBACMeta" }, "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.BackupInfo" } ] }, "msg": { "description": "error msg if fail", "type": "string" }, "requestId": { "description": "uuid of the request to response", "type": "string" } } }, "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.Binlog": { "type": "object", "properties": { "entries_num": { "description": "Deprecated: Marked as deprecated in backup.proto.", "type": "integer" }, "log_id": { "type": "integer" }, "log_path": { "type": "string" }, "log_size": { "type": "integer" }, "timestamp_from": { "description": "Deprecated: Marked as deprecated in backup.proto.", "type": "integer" }, "timestamp_to": { "description": "Deprecated: Marked as deprecated in backup.proto.", "type": "integer" } } }, "backuppb.CollectionBackupInfo": { "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" }, "consistency_level": { "$ref": "#/definitions/backuppb.ConsistencyLevel" }, "db_name": { "type": "string" }, "end_time": { "type": "integer" }, "errorMessage": { "type": "string" }, "has_index": { "type": "boolean" }, "id": { "type": "string" }, "index_infos": { "type": "array", "items": { "$ref": "#/definitions/backuppb.IndexInfo" } }, "l0_segments": { "type": "array", "items": { "$ref": "#/definitions/backuppb.SegmentBackupInfo" } }, "load_state": { "type": "string" }, "partition_backups": { "type": "array", "items": { "$ref": "#/definitions/backuppb.PartitionBackupInfo" } }, "progress": { "type": "integer" }, "properties": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "schema": { "$ref": "#/definitions/backuppb.CollectionSchema" }, "shards_num": { "type": "integer" }, "size": { "type": "integer" }, "start_time": { "type": "integer" }, "state_code": { "$ref": "#/definitions/backuppb.BackupTaskStateCode" } } }, "backuppb.CollectionSchema": { "type": "object", "properties": { "autoID": { "description": "deprecated later, keep compatible with c++ part now", "type": "boolean" }, "description": { "type": "string" }, "enable_dynamic_field": { "description": "mark whether this table has the dynamic field function enabled.", "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" } } } }, "backuppb.ConsistencyLevel": { "type": "integer", "enum": [ 0, 1, 2, 3, 4 ], "x-enum-comments": { "ConsistencyLevel_Customized": "Users pass their own `guarantee_timestamp`.", "ConsistencyLevel_Session": "default in PyMilvus" }, "x-enum-varnames": [ "ConsistencyLevel_Strong", "ConsistencyLevel_Session", "ConsistencyLevel_Bounded", "ConsistencyLevel_Eventually", "ConsistencyLevel_Customized" ] }, "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" }, "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" }, "force": { "description": "force backup skip flush, Should make sure data has been stored into disk when using it", "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", "type": "boolean" }, "rbac": { "description": "whether backup RBAC", "type": "boolean" }, "requestId": { "description": "uuid of request, will generate one if not set", "type": "string" } } }, "backuppb.DataType": { "type": "integer", "enum": [ 0, 1, 2, 3, 4, 5, 10, 11, 20, 21, 22, 23, 100, 101, 102, 103, 104 ], "x-enum-comments": { "DataType_VarChar": "variable-length strings with a specified maximum length" }, "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_BinaryVector", "DataType_FloatVector", "DataType_Float16Vector", "DataType_BFloat16Vector", "DataType_SparseFloatVector" ] }, "backuppb.DatabaseBackupInfo": { "type": "object", "properties": { "db_id": { "type": "integer" }, "db_name": { "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.FieldBinlog": { "type": "object", "properties": { "binlogs": { "type": "array", "items": { "$ref": "#/definitions/backuppb.Binlog" } }, "fieldID": { "type": "integer" } } }, "backuppb.FieldSchema": { "type": "object", "properties": { "autoID": { "type": "boolean" }, "data_type": { "$ref": "#/definitions/backuppb.DataType" }, "default_value": { "description": "default_value only support scalars except array and json for now", "allOf": [ { "$ref": "#/definitions/backuppb.ValueField" } ] }, "default_value_base64": { "type": "string" }, "default_value_proto": { "description": "json not support marshall oneof, so use proto string", "type": "string" }, "description": { "type": "string" }, "element_type": { "description": "For array type, the element type is stored here", "allOf": [ { "$ref": "#/definitions/backuppb.DataType" } ] }, "fieldID": { "type": "integer" }, "index_params": { "type": "array", "items": { "$ref": "#/definitions/backuppb.KeyValuePair" } }, "is_dynamic": { "description": "mark whether this field is the dynamic field", "type": "boolean" }, "is_function_output": { "type": "boolean" }, "is_partition_key": { "description": "enable logic partitions", "type": "boolean" }, "is_primary_key": { "type": "boolean" }, "name": { "type": "string" }, "nullable": { "type": "boolean" }, "state": { "description": "To keep compatible with older version, the default state is `Created`.", "allOf": [ { "$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.GrantEntity": { "type": "object", "properties": { "db_name": { "description": "db name", "type": "string" }, "grantor": { "description": "privilege", "allOf": [ { "$ref": "#/definitions/backuppb.GrantorEntity" } ] }, "object": { "description": "object", "allOf": [ { "$ref": "#/definitions/backuppb.ObjectEntity" } ] }, "object_name": { "description": "object name", "type": "string" }, "role": { "description": "role", "allOf": [ { "$ref": "#/definitions/backuppb.RoleEntity" } ] } } }, "backuppb.GrantorEntity": { "type": "object", "properties": { "privilege": { "$ref": "#/definitions/backuppb.PrivilegeEntity" }, "user": { "$ref": "#/definitions/backuppb.UserEntity" } } }, "backuppb.IndexInfo": { "type": "object", "properties": { "field_name": { "type": "string" }, "index_name": { "type": "string" }, "index_type": { "type": "string" }, "params": { "type": "object", "additionalProperties": { "type": "string" } } } }, "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.BackupInfo" } }, "msg": { "description": "error msg if fail", "type": "string" }, "requestId": { "description": "uuid of the request to response", "type": "string" } } }, "backuppb.ObjectEntity": { "type": "object", "properties": { "name": { "type": "string" } } }, "backuppb.PartitionBackupInfo": { "type": "object", "properties": { "collection_id": { "type": "integer" }, "load_state": { "type": "string" }, "partition_id": { "type": "integer" }, "partition_name": { "type": "string" }, "segment_backups": { "description": "array of segment backup", "type": "array", "items": { "$ref": "#/definitions/backuppb.SegmentBackupInfo" } }, "size": { "type": "integer" } } }, "backuppb.PrivilegeEntity": { "type": "object", "properties": { "name": { "type": "string" } } }, "backuppb.PrivilegeGroupInfo": { "type": "object", "properties": { "group_name": { "type": "string" }, "privileges": { "type": "array", "items": { "$ref": "#/definitions/backuppb.PrivilegeEntity" } } } }, "backuppb.RBACMeta": { "type": "object", "properties": { "grants": { "description": "(role, object, previledge)", "type": "array", "items": { "$ref": "#/definitions/backuppb.GrantEntity" } }, "privilege_groups": { "description": "privilege group", "type": "array", "items": { "$ref": "#/definitions/backuppb.PrivilegeGroupInfo" } }, "roles": { "description": "role", "type": "array", "items": { "$ref": "#/definitions/backuppb.RoleEntity" } }, "users": { "description": "user", "type": "array", "items": { "$ref": "#/definitions/backuppb.UserInfo" } } } }, "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" }, "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" }, "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\n\nDeprecated: Marked as deprecated in backup.proto.", "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.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.RestoreTaskStateCode": { "type": "integer", "enum": [ 0, 1, 2, 3, 4 ], "x-enum-varnames": [ "RestoreTaskStateCode_INITIAL", "RestoreTaskStateCode_EXECUTING", "RestoreTaskStateCode_SUCCESS", "RestoreTaskStateCode_FAIL", "RestoreTaskStateCode_TIMEOUT" ] }, "backuppb.RoleEntity": { "type": "object", "properties": { "name": { "type": "string" } } }, "backuppb.SegmentBackupInfo": { "type": "object", "properties": { "backuped": { "type": "boolean" }, "binlogs": { "type": "array", "items": { "$ref": "#/definitions/backuppb.FieldBinlog" } }, "collection_id": { "type": "integer" }, "deltalogs": { "type": "array", "items": { "$ref": "#/definitions/backuppb.FieldBinlog" } }, "group_id": { "description": "The group ID is a virtual partition ID.\nThe Milvus BulkInsert interface requires a partition prefix,\nbut passing multiple segments is a more suitable option.\nTherefore, a virtual partition ID is used here to enable the functionality of importing multiple segments.", "type": "integer" }, "is_l0": { "type": "boolean" }, "num_of_rows": { "type": "integer" }, "partition_id": { "type": "integer" }, "segment_id": { "type": "integer" }, "size": { "type": "integer" }, "statslogs": { "description": "Deprecated: Marked as deprecated in backup.proto.", "type": "array", "items": { "$ref": "#/definitions/backuppb.FieldBinlog" } }, "v_channel": { "type": "string" } } }, "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.UserEntity": { "type": "object", "properties": { "name": { "type": "string" } } }, "backuppb.UserInfo": { "type": "object", "properties": { "password": { "type": "string" }, "roles": { "type": "array", "items": { "$ref": "#/definitions/backuppb.RoleEntity" } }, "user": { "type": "string" } } }, "backuppb.ValueField": { "type": "object", "properties": { "data": { "description": "Types that are assignable 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" } } } } }