aboutsummaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-04-10 18:41:40 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-04-10 18:41:40 +0200
commit4d6c0500cb76135b24d3a6a16510a562bea1b88b (patch)
treeb04f81e31f0b233103f88b492f440920c4356023 /model
parent0fbc9bbb05dd9dcfc4c064e20113629fd1af8de9 (diff)
downloadgarage-4d6c0500cb76135b24d3a6a16510a562bea1b88b.tar.gz
garage-4d6c0500cb76135b24d3a6a16510a562bea1b88b.zip
first build of the modelsmithy2
Diffstat (limited to 'model')
-rw-r--r--model/k2v.smithy96
1 files changed, 96 insertions, 0 deletions
diff --git a/model/k2v.smithy b/model/k2v.smithy
new file mode 100644
index 00000000..bf51f25b
--- /dev/null
+++ b/model/k2v.smithy
@@ -0,0 +1,96 @@
+$version: "2"
+namespace org.deuxfleurs.garage.k2v
+
+use aws.api#service
+use aws.auth#sigv4
+use aws.protocols#restJson1
+
+@service(sdkId: "k2v")
+@sigv4(name: "k2v")
+@restJson1
+service K2V {
+ version: "2023-04-10"
+ resources: [ Item ]
+ //operations: [ PollItem, ReadIndex, InsertBatch, DeleteBatch, PollRange ]
+}
+
+resource Item {
+ read: ReadItem
+ put: InsertItem
+ //delete: DeleteItem
+ //list: ReadBatch
+}
+
+@mixin
+structure KeySelector {
+ @required
+ @httpLabel
+ bucketName: String
+
+ @required
+ @httpLabel
+ partitionKey: String
+
+ @required
+ @httpQuery("sort_key")
+ sortKey: String
+}
+
+@readonly
+@http(method: "GET", uri: "/{bucketName}/{partitionKey}", code: 200)
+operation ReadItem {
+ input: ReadItemInput
+ output: ReadItemOutput
+}
+
+@input
+structure ReadItemInput with [KeySelector] {}
+
+@output
+structure ReadItemOutput {
+ value: ItemList
+}
+
+@sparse
+list ItemList {
+ member: Blob
+}
+
+@idempotent
+@http(method: "PUT", uri: "/{bucketName}/{partitionKey}", code: 204)
+operation InsertItem {
+ input: InsertItemInput
+}
+
+@input
+structure InsertItemInput with [KeySelector] {}
+
+//operation DeleteItem {
+// input: String
+// output: String
+//}
+
+//operation PollItem {
+// input: String
+// output: String
+//}
+
+//operation ReadIndex {
+// input: String
+// output: String
+//}
+
+//operation InsertBatch {
+// input: String
+// output: String
+//}
+
+//operation DeleteBatch {
+// input: String
+// output: String
+//}
+
+//operation PollRange {
+// input: String
+// output: String
+//}