-
Notifications
You must be signed in to change notification settings - Fork 0
added s3 extended apis #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: improvement/CLDSRVCLT-4
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| $version: "2.0" | ||
|
|
||
| namespace cloudserver.s3extended | ||
|
|
||
| @http(method: "GET", uri: "/{Bucket}") | ||
| @readonly | ||
| operation SearchBucket { | ||
| input := { | ||
| @required | ||
| @httpLabel | ||
| Bucket: String | ||
|
|
||
| @required | ||
| @httpQuery("search") | ||
| Query: String | ||
|
|
||
| @httpQuery("delimiter") | ||
| Delimiter: String | ||
|
|
||
| @httpQuery("encoding-type") | ||
| EncodingType: String | ||
|
|
||
| @httpQuery("marker") | ||
| Marker: String | ||
|
|
||
| @httpQuery("max-keys") | ||
| MaxKeys: Integer | ||
|
|
||
| @httpQuery("prefix") | ||
| Prefix: String | ||
|
|
||
| @httpHeader("x-amz-request-payer") | ||
| RequestPayer: String | ||
| } | ||
| output := @xmlName("ListBucketResult") { | ||
| IsTruncated: Boolean | ||
|
|
||
| Marker: String | ||
|
|
||
| NextMarker: String | ||
|
|
||
| @xmlFlattened | ||
| Contents: ObjectList | ||
|
|
||
| Name: String | ||
|
|
||
| Prefix: String | ||
|
|
||
| Delimiter: String | ||
|
|
||
| MaxKeys: Integer | ||
|
|
||
| @xmlFlattened | ||
| CommonPrefixes: CommonPrefixList | ||
|
|
||
| EncodingType: String | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| $version: "2.0" | ||
|
|
||
| namespace cloudserver.s3extended | ||
|
|
||
| @http(method: "GET", uri: "/{Bucket}?list-type=2") | ||
| @readonly | ||
| operation SearchBucketV2 { | ||
| input := { | ||
| @required | ||
| @httpLabel | ||
| Bucket: String | ||
|
|
||
| @required | ||
| @httpQuery("search") | ||
| Query: String | ||
|
|
||
| @httpQuery("delimiter") | ||
| Delimiter: String | ||
|
|
||
| @httpQuery("encoding-type") | ||
| EncodingType: String | ||
|
|
||
| @httpQuery("max-keys") | ||
| MaxKeys: Integer | ||
|
|
||
| @httpQuery("prefix") | ||
| Prefix: String | ||
|
|
||
| @httpQuery("continuation-token") | ||
| ContinuationToken: String | ||
|
|
||
| @httpQuery("fetch-owner") | ||
| FetchOwner: Boolean | ||
|
|
||
| @httpQuery("start-after") | ||
| StartAfter: String | ||
|
|
||
| @httpHeader("x-amz-request-payer") | ||
| RequestPayer: String | ||
|
|
||
| @httpHeader("x-amz-expected-bucket-owner") | ||
| ExpectedBucketOwner: String | ||
| } | ||
| output := { | ||
| IsTruncated: Boolean | ||
|
|
||
| @xmlFlattened | ||
| Contents: ObjectList | ||
|
|
||
| Name: String | ||
|
|
||
| Prefix: String | ||
|
|
||
| Delimiter: String | ||
|
|
||
| MaxKeys: Integer | ||
|
|
||
| @xmlFlattened | ||
| CommonPrefixes: CommonPrefixList | ||
|
|
||
| EncodingType: String | ||
|
|
||
| KeyCount: Integer | ||
|
|
||
| ContinuationToken: String | ||
|
|
||
| NextContinuationToken: String | ||
|
|
||
| StartAfter: String | ||
| } | ||
| } | ||
|
|
||
| list ObjectList { | ||
| member: S3Object | ||
| } | ||
|
|
||
| structure S3Object { | ||
| Key: String | ||
| LastModified: Timestamp | ||
| ETag: String | ||
| Size: Integer | ||
| StorageClass: String | ||
| Owner: Owner | ||
| } | ||
|
|
||
| structure Owner { | ||
| DisplayName: String | ||
| ID: String | ||
| } | ||
|
|
||
| list CommonPrefixList { | ||
| member: CommonPrefix | ||
| } | ||
|
|
||
| structure CommonPrefix { | ||
| Prefix: String | ||
| } | ||
|
Comment on lines
+73
to
+97
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can't we import/reuse the "official" types from AWS sdk ? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| $version: "2.0" | ||
|
|
||
| namespace cloudserver.s3extended | ||
|
|
||
| @http(method: "GET", uri: "/{Bucket}?versions=true") | ||
| @readonly | ||
| operation SearchBucketVersions { | ||
| input := { | ||
| @required | ||
| @httpLabel | ||
| Bucket: String | ||
|
|
||
| @required | ||
| @httpQuery("search") | ||
| Query: String | ||
|
|
||
| @httpQuery("delimiter") | ||
| Delimiter: String | ||
|
|
||
| @httpQuery("encoding-type") | ||
| EncodingType: String | ||
|
|
||
| @httpQuery("key-marker") | ||
| KeyMarker: String | ||
|
|
||
| @httpQuery("max-keys") | ||
| MaxKeys: Integer | ||
|
|
||
| @httpQuery("prefix") | ||
| Prefix: String | ||
|
|
||
| @httpHeader("x-amz-expected-bucket-owner") | ||
| ExpectedBucketOwner: String | ||
|
|
||
| @httpQuery("version-id-marker") | ||
| VersionIdMarker: String | ||
| } | ||
| output := @xmlName("ListVersionsResult") { | ||
| IsTruncated: Boolean | ||
|
|
||
| KeyMarker: String | ||
|
|
||
| VersionIdMarker: String | ||
|
|
||
| NextKeyMarker: String | ||
|
|
||
| NextVersionIdMarker: String | ||
|
|
||
| @xmlFlattened | ||
| Version: VersionList | ||
|
|
||
| @xmlFlattened | ||
| DeleteMarker: DeleteMarkerList | ||
|
|
||
| Name: String | ||
|
|
||
| Prefix: String | ||
|
|
||
| Delimiter: String | ||
|
|
||
| MaxKeys: Integer | ||
|
|
||
| @xmlFlattened | ||
| CommonPrefixes: CommonPrefixList | ||
|
|
||
| EncodingType: String | ||
| } | ||
| } | ||
|
|
||
| list VersionList { | ||
| member: Version | ||
| } | ||
|
|
||
| structure Version { | ||
| Key: String | ||
|
|
||
| @xmlName("IsLatest") | ||
| IsLatest: Boolean | ||
|
|
||
| LastModified: Timestamp | ||
|
|
||
| ETag: String | ||
|
|
||
| Size: Integer | ||
|
|
||
| StorageClass: String | ||
|
|
||
| Owner: Owner | ||
|
|
||
| VersionId: String | ||
| } | ||
|
|
||
| list DeleteMarkerList { | ||
| member: DeleteMarker | ||
| } | ||
|
|
||
| structure DeleteMarker { | ||
| Key: String | ||
|
|
||
| @xmlName("IsLatest") | ||
| IsLatest: Boolean | ||
|
|
||
| LastModified: Timestamp | ||
|
|
||
| Owner: Owner | ||
|
|
||
| VersionId: String | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,8 @@ | |||||
| "files": [ | ||||||
| "dist", | ||||||
| "build/smithy/cloudserver/typescript-codegen", | ||||||
| "build/smithy/cloudserverBucketQuota/typescript-codegen" | ||||||
| "build/smithy/cloudserverBucketQuota/typescript-codegen", | ||||||
| "build/smithy/cloudserverS3Extended/typescript-codegen" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we bundle |
||||||
| ], | ||||||
| "publishConfig": { | ||||||
| "access": "public", | ||||||
|
|
@@ -31,8 +32,9 @@ | |||||
| "build:smithy": "smithy build", | ||||||
| "build:generated": "cd build/smithy/cloudserver/typescript-codegen && yarn install && yarn build", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| "build:generated:bucketQuota": "cd build/smithy/cloudserverBucketQuota/typescript-codegen && yarn install && yarn build", | ||||||
| "build:generated:s3extended": "cd build/smithy/cloudserverS3Extended/typescript-codegen && yarn install && yarn build", | ||||||
|
Comment on lines
33
to
+35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we have a single step, maybe something like: |
||||||
| "build:wrapper": "tsc", | ||||||
| "build": "yarn install && yarn clean:build && yarn build:smithy && yarn build:generated && yarn build:generated:bucketQuota && yarn build:wrapper", | ||||||
| "build": "yarn install && yarn clean:build && yarn build:smithy && yarn build:generated && yarn build:generated:bucketQuota && yarn build:generated:s3extended && yarn build:wrapper", | ||||||
| "test": "jest", | ||||||
| "test:indexes": "jest tests/testIndexesApis.test.ts", | ||||||
| "test:error-handling": "jest tests/testErrorHandling.test.ts", | ||||||
|
|
@@ -42,7 +44,8 @@ | |||||
| "test:metadata": "jest tests/testMetadataApis.test.ts", | ||||||
| "test:raft": "jest tests/testRaftApis.test.ts", | ||||||
| "test:bucketQuotas": "jest tests/testQuotaApis.test.ts", | ||||||
| "test:mongo-backend": "yarn test:indexes && yarn test:error-handling && yarn test:multiple-backend && yarn test:bucketQuotas", | ||||||
| "test:s3Extended": "jest tests/testS3ExtendedApis.test.ts", | ||||||
| "test:mongo-backend": "yarn test:indexes && yarn test:error-handling && yarn test:multiple-backend && yarn test:bucketQuotas && yarn test:s3Extended", | ||||||
| "test:metadata-backend": "yarn test:api && yarn test:lifecycle && yarn test:metadata && yarn test:raft", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lifecycle should be tested with mongo as well? |
||||||
| "lint": "eslint src tests", | ||||||
| "typecheck": "tsc --noEmit" | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| $version: "2.0" | ||
|
|
||
| namespace cloudserver.s3extended | ||
|
|
||
| use aws.protocols#restXml | ||
| use aws.auth#sigv4 | ||
| use aws.api#service | ||
|
|
||
| @restXml | ||
| @sigv4(name: "s3") | ||
| @service(sdkId: "cloudserverS3Extended") | ||
| service CloudserverS3Extended { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe call this |
||
| version: "2018-07-11", | ||
| operations: [ | ||
| SearchBucket, | ||
| SearchBucketV2, | ||
| SearchBucketVersions, | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { | ||
| CloudserverS3Extended, | ||
| CloudserverS3ExtendedClientConfig | ||
| } from '../../build/smithy/cloudserverS3Extended/typescript-codegen'; | ||
| import { CloudserverClientConfig } from '../../build/smithy/cloudserver/typescript-codegen'; | ||
|
|
||
| export * from '../../build/smithy/cloudserverS3Extended/typescript-codegen'; | ||
| export class S3ExtendedClient extends CloudserverS3Extended { | ||
| constructor(config: CloudserverClientConfig | CloudserverS3ExtendedClientConfig) { | ||
| super(config); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from './clients/cloudserver'; | ||
| export { BucketQuotaClient } from './clients/bucketQuota'; | ||
| export { S3ExtendedClient } from './clients/s3Extended'; | ||
| export * from './utils'; |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is called
ListObjectsin s3:SearchObjects?ListObjectseven if we have extra params for searching?(similar for
ListObjectsV2andListObjectVersionsbelow)