Skip to content
Draft
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
10 changes: 8 additions & 2 deletions models/backbeatRoutes/putMetadata.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,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
}
10 changes: 8 additions & 2 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]
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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 +48,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
5 changes: 3 additions & 2 deletions tests/testApis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
} from '../src/index';
import { S3Client, GetObjectCommand as S3getCommand } from '@aws-sdk/client-s3';
import { createTestClient, testConfig } from './testSetup';
import { describeForMetadataBackend } from './testHelpers';

Check failure on line 16 in tests/testApis.test.ts

View workflow job for this annotation

GitHub Actions / Lint and typecheck

'describeForMetadataBackend' is defined but never used. Allowed unused vars must match /^_/u
import assert from 'assert';

describeForMetadataBackend('CloudServer Backbeat Routes API Tests', () => {
describe('CloudServer Backbeat Routes API Tests', () => {
let backbeatRoutesClient: BackbeatRoutesClient;
let s3client: S3Client;

Expand All @@ -37,7 +37,8 @@
CanonicalID: testConfig.canonicalID,
ContentMD5: etag,
Body: getData.Body,
VersioningRequired: true
VersioningRequired: true,
// MicroVersionId: '12345',
};

const command2 = new PutDataCommand(putInput);
Expand All @@ -46,7 +47,7 @@
getData.ContentLength
);
const data = await backbeatRoutesClient.send(command2);
const locationAny: any = data.Location as any;

Check warning on line 50 in tests/testApis.test.ts

View workflow job for this annotation

GitHub Actions / Lint and typecheck

Unexpected any. Specify a different type
assert.ok(locationAny[0].key !== undefined);
});

Expand Down
Loading