Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions models/backbeatRoutes/commonStructures.smithy
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
$version: "2.0"
namespace cloudserver.backbeatRoutes

@error("client")
@httpError(409)
structure ConflictException {
@required
message: String
}

/// Streaming blob type for binary data transfer
@streaming
@requiresLength
Expand Down
13 changes: 10 additions & 3 deletions models/backbeatRoutes/putMetadata.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ namespace cloudserver.backbeatRoutes
@http(method: "PUT", uri: "/_/backbeat/metadata/{Bucket}/{Key+}")
operation PutMetadata {
input: PutMetadataInput,
output: PutMetadataOutput
output: PutMetadataOutput,
errors: [ConflictException]
}

structure PutMetadataInput {
Expand Down Expand Up @@ -33,12 +34,18 @@ structure PutMetadataInput {

@httpHeader("X-Scal-Request-Uids")
RequestUids: String,


@httpHeader("x-scal-micro-version-id")
MicroVersionId: String,

@httpPayload
Body: Blob
}

structure PutMetadataOutput {
/// Version ID of the stored metadata
versionId: String
versionId: String,

@httpHeader("x-scal-cascade-loop-detected")
CascadeLoopDetected: Boolean
}
13 changes: 10 additions & 3 deletions models/backbeatRoutes/putdata.smithy
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To document errors:

/// Returned when a version of an object already exists
@error("client")
@httpError(409)
structure ConflictException {
    @required
    message: String
}

@http(method: "PUT", uri: "/_/backbeat/data/{Bucket}/{Key+}?v2")
@unsignedPayload
operation PutData {
    input: PutDataInput,
    output: PutDataOutput,
    errors: [ConflictException]
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First I added some tests, but they were too functional and not really oriented toward just testing the client itself. + we already have test testing the client itself for putData/putMetadata

So I added the test in Cloudserver : They are functional test using Cloudserver client with the micro version id, testing 409 error, actual api behavior etc. I think they are better in cloudserver than in here

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use aws.auth#unsignedPayload
@unsignedPayload
operation PutData {
input: PutDataInput,
output: PutDataOutput
output: PutDataOutput,
errors: [ConflictException]
}

structure PutDataInput {
Expand All @@ -31,6 +32,9 @@ structure PutDataInput {
@httpHeader("X-Scal-Request-Uids")
RequestUids: String,

@httpHeader("x-scal-micro-version-id")
MicroVersionId: String,

@httpPayload
@default("")
Body: StreamingBlob
Expand All @@ -45,7 +49,10 @@ structure PutDataOutput {

@httpHeader("x-amz-server-side-encryption-customer-algorithm")
SSECustomerAlgorithm: String,

@httpHeader("x-amz-server-side-encryption-aws-kms-key-id")
SSEKMSKeyId: String
SSEKMSKeyId: String,

@httpHeader("x-scal-cascade-loop-detected")
CascadeLoopDetected: Boolean
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scality/cloudserverclient",
"version": "1.0.8",
"version": "1.0.9",
"engines": {
"node": ">=20"
},
Expand Down
Loading