Skip to content

Commit

Permalink
Delete snapshots API (qdrant#1377)
Browse files Browse the repository at this point in the history
* Delete snapshots API

* remove unecessary plurals
  • Loading branch information
agourlay authored and generall committed Feb 6, 2023
1 parent 6c02ec2 commit fe06844
Show file tree
Hide file tree
Showing 9 changed files with 594 additions and 5 deletions.
51 changes: 51 additions & 0 deletions docs/grpc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
- [CreateFullSnapshotRequest](#qdrant-CreateFullSnapshotRequest)
- [CreateSnapshotRequest](#qdrant-CreateSnapshotRequest)
- [CreateSnapshotResponse](#qdrant-CreateSnapshotResponse)
- [DeleteFullSnapshotRequest](#qdrant-DeleteFullSnapshotRequest)
- [DeleteSnapshotRequest](#qdrant-DeleteSnapshotRequest)
- [DeleteSnapshotResponse](#qdrant-DeleteSnapshotResponse)
- [ListFullSnapshotsRequest](#qdrant-ListFullSnapshotsRequest)
- [ListSnapshotsRequest](#qdrant-ListSnapshotsRequest)
- [ListSnapshotsResponse](#qdrant-ListSnapshotsResponse)
Expand Down Expand Up @@ -2070,6 +2073,52 @@ The JSON representation for `Value` is JSON value.



<a name="qdrant-DeleteFullSnapshotRequest"></a>

### DeleteFullSnapshotRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| snapshot_name | [string](#string) | | Name of the full snapshot |






<a name="qdrant-DeleteSnapshotRequest"></a>

### DeleteSnapshotRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| collection_name | [string](#string) | | Name of the collection |
| snapshot_name | [string](#string) | | Name of the collection snapshot |






<a name="qdrant-DeleteSnapshotResponse"></a>

### DeleteSnapshotResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| time | [double](#double) | | Time spent to process |






<a name="qdrant-ListFullSnapshotsRequest"></a>

### ListFullSnapshotsRequest
Expand Down Expand Up @@ -2143,8 +2192,10 @@ The JSON representation for `Value` is JSON value.
| ----------- | ------------ | ------------- | ------------|
| Create | [CreateSnapshotRequest](#qdrant-CreateSnapshotRequest) | [CreateSnapshotResponse](#qdrant-CreateSnapshotResponse) | Create collection snapshot |
| List | [ListSnapshotsRequest](#qdrant-ListSnapshotsRequest) | [ListSnapshotsResponse](#qdrant-ListSnapshotsResponse) | List collection snapshots |
| Delete | [DeleteSnapshotRequest](#qdrant-DeleteSnapshotRequest) | [DeleteSnapshotResponse](#qdrant-DeleteSnapshotResponse) | Delete collection snapshots |
| CreateFull | [CreateFullSnapshotRequest](#qdrant-CreateFullSnapshotRequest) | [CreateSnapshotResponse](#qdrant-CreateSnapshotResponse) | Create full storage snapshot |
| ListFull | [ListFullSnapshotsRequest](#qdrant-ListFullSnapshotsRequest) | [ListSnapshotsResponse](#qdrant-ListSnapshotsResponse) | List full storage snapshots |
| DeleteFull | [DeleteFullSnapshotRequest](#qdrant-DeleteFullSnapshotRequest) | [DeleteSnapshotResponse](#qdrant-DeleteSnapshotResponse) | List full storage snapshots |



Expand Down
144 changes: 144 additions & 0 deletions docs/redoc/master/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,83 @@
}
},
"/collections/{collection_name}/snapshots/{snapshot_name}": {
"delete": {
"tags": [
"snapshots",
"collections"
],
"summary": "Delete collection snapshot",
"description": "Delete snapshot for a collection",
"operationId": "delete_snapshot",
"parameters": [
{
"name": "collection_name",
"in": "path",
"description": "Name of the collection for which to delete a snapshot",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the snapshot to delete",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string",
"enum": [
"ok"
]
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
},
"get": {
"tags": [
"snapshots",
Expand Down Expand Up @@ -1697,6 +1774,73 @@
}
},
"/snapshots/{snapshot_name}": {
"delete": {
"tags": [
"snapshots"
],
"summary": "Delete storage snapshot",
"description": "Delete snapshot of the whole storage",
"operationId": "delete_full_snapshot",
"parameters": [
{
"name": "snapshot_name",
"in": "path",
"description": "Name of the full snapshot to delete",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"4XX": {
"description": "error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"time": {
"type": "number",
"format": "float",
"description": "Time spent to process this request"
},
"status": {
"type": "string",
"enum": [
"ok"
]
},
"result": {
"type": "boolean"
}
}
}
}
}
}
}
},
"get": {
"tags": [
"snapshots"
Expand Down
20 changes: 20 additions & 0 deletions lib/api/src/grpc/proto/snapshots_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,32 @@ service Snapshots {
*/
rpc List (ListSnapshotsRequest) returns (ListSnapshotsResponse) {}
/*
Delete collection snapshots
*/
rpc Delete (DeleteSnapshotRequest) returns (DeleteSnapshotResponse) {}
/*
Create full storage snapshot
*/
rpc CreateFull (CreateFullSnapshotRequest) returns (CreateSnapshotResponse) {}
/*
List full storage snapshots
*/
rpc ListFull (ListFullSnapshotsRequest) returns (ListSnapshotsResponse) {}
/*
List full storage snapshots
*/
rpc DeleteFull (DeleteFullSnapshotRequest) returns (DeleteSnapshotResponse) {}

}

message CreateFullSnapshotRequest {}

message ListFullSnapshotsRequest {}

message DeleteFullSnapshotRequest {
string snapshot_name = 1; // Name of the full snapshot
}

message CreateSnapshotRequest {
string collection_name = 1; // Name of the collection
}
Expand All @@ -37,6 +49,10 @@ message ListSnapshotsRequest {
string collection_name = 1; // Name of the collection
}

message DeleteSnapshotRequest {
string collection_name = 1; // Name of the collection
string snapshot_name = 2; // Name of the collection snapshot
}

message SnapshotDescription {
string name = 1; // Name of the snapshot
Expand All @@ -53,3 +69,7 @@ message ListSnapshotsResponse {
repeated SnapshotDescription snapshot_descriptions = 1;
double time = 2; // Time spent to process
}

message DeleteSnapshotResponse {
double time = 1; // Time spent to process
}
Loading

0 comments on commit fe06844

Please sign in to comment.