1
1
syntax = "proto3" ;
2
+ package vss ;
2
3
option java_multiple_files = true ;
3
- package org.vss ;
4
+ option java_package = " org.vss" ;
4
5
6
+ // Request payload to be used for `GetObject` API call to server.
5
7
message GetObjectRequest {
6
8
7
9
// store_id is a keyspace identifier.
@@ -24,12 +26,14 @@ message GetObjectRequest {
24
26
string key = 2 ;
25
27
}
26
28
29
+ // Server response for `GetObject` API.
27
30
message GetObjectResponse {
28
31
29
32
// Fetched value and version along with the corresponding key in the request.
30
33
KeyValue value = 2 ;
31
34
}
32
35
36
+ // Request payload to be used for `PutObject` API call to server.
33
37
message PutObjectRequest {
34
38
35
39
// store_id is a keyspace identifier.
@@ -65,9 +69,9 @@ message PutObjectRequest {
65
69
// Clients can choose to encrypt the keys client-side in order to obfuscate their usage patterns.
66
70
// If the write is successful, the previous value corresponding to the key will be overwritten.
67
71
//
68
- // Multiple items in transaction_items of a single PutObjectRequest are written in
72
+ // Multiple items in transaction_items and delete_items of a single PutObjectRequest are written in
69
73
// a database-transaction in an all-or-nothing fashion.
70
- // Items in a single PutObjectRequest must have distinct keys.
74
+ // All Items in a single PutObjectRequest must have distinct keys.
71
75
//
72
76
// Clients are expected to store a version against every key.
73
77
// The write will succeed if the current DB version against the key is the same as in the request.
@@ -93,11 +97,56 @@ message PutObjectRequest {
93
97
// All PutObjectRequests are strongly consistent i.e. they provide read-after-write and
94
98
// read-after-update consistency guarantees.
95
99
repeated KeyValue transaction_items = 3 ;
100
+
101
+ // Items to be deleted as a result of this PutObjectRequest.
102
+ //
103
+ // Each item in the `delete_items` field consists of a key and its corresponding version.
104
+ // The version is used to perform a version check before deleting the item.
105
+ // The delete will only succeed if the current database version against the key is the same as the version
106
+ // specified in the request.
107
+ //
108
+ // Fails with `CONFLICT_EXCEPTION` as the ErrorCode if:
109
+ // * The requested item does not exist.
110
+ // * The requested item does exist but there is a version-number mismatch with the one in the database.
111
+ //
112
+ // Multiple items in the `delete_items` field, along with the `transaction_items`, are written in a
113
+ // database transaction in an all-or-nothing fashion.
114
+ //
115
+ // All items within a single `PutObjectRequest` must have distinct keys.
116
+ repeated KeyValue delete_items = 4 ;
96
117
}
97
118
119
+ // Server response for `PutObject` API.
98
120
message PutObjectResponse {
99
121
}
100
122
123
+ // Request payload to be used for `DeleteObject` API call to server.
124
+ message DeleteObjectRequest {
125
+ // store_id is a keyspace identifier.
126
+ // Ref: https://en.wikipedia.org/wiki/Keyspace_(distributed_data_store)
127
+ // All APIs operate within a single store_id.
128
+ // It is up to clients to use single or multiple stores for their use-case.
129
+ // This can be used for client-isolation/ rate-limiting / throttling on the server-side.
130
+ // Authorization and billing can also be performed at the store_id level.
131
+ string store_id = 1 ;
132
+
133
+ // Item to be deleted as a result of this DeleteObjectRequest.
134
+ //
135
+ // An item consists of a key and its corresponding version.
136
+ // The item is only deleted if the current database version against the key is the same as the version
137
+ // specified in the request.
138
+ // This operation is idempotent, that is, multiple delete calls for the same item will not fail.
139
+ //
140
+ // If the requested item does not exist, this operation will not fail.
141
+ // If you wish to perform stricter checks while deleting an item, consider using PutObject API.
142
+ KeyValue key_value = 2 ;
143
+ }
144
+
145
+ // Server response for `DeleteObject` API.
146
+ message DeleteObjectResponse {
147
+ }
148
+
149
+ // Request payload to be used for `ListKeyVersions` API call to server.
101
150
message ListKeyVersionsRequest {
102
151
103
152
// store_id is a keyspace identifier.
@@ -133,6 +182,7 @@ message ListKeyVersionsRequest {
133
182
optional string page_token = 4 ;
134
183
}
135
184
185
+ // Server response for `ListKeyVersions` API.
136
186
message ListKeyVersionsResponse {
137
187
138
188
// Fetched keys and versions.
@@ -206,6 +256,7 @@ enum ErrorCode {
206
256
INTERNAL_SERVER_EXCEPTION = 3 ;
207
257
}
208
258
259
+ // Represents KeyValue pair to be stored or retrieved.
209
260
message KeyValue {
210
261
211
262
// Key against which the value is stored.
0 commit comments