Closed ashwinkumar6 closed 2 weeks ago
customEndpoint
https://${customEndpoint}
https://${accountId}.${customEndpoint}
Tested the following code snippets below (internals/). Control plane APIs: listCallerAccessGrants
internals/
await listCallerAccessGrants({ accountId: ACCOUNT_ID, region: REGION, credentialsProvider: async () => ({ credentials: baseCreds }), customEndpoint: `s3-control.dualstack.us-east-2.amazonaws.com`, maxResults=1000&allowedByApplication=true }); // GET 200 // https://<accountId>.s3-control.dualstack.us-east-2.amazonaws.com/v20180820/accessgrantsinstance/caller/grants?maxResults=1000&allowedByApplication=true
getDataAccess
await getDataAccess({ accountId: ACCOUNT_ID, region: REGION, credentialsProvider: async () => ({ credentials: baseCreds }), permission: input.permission, scope: input.scope, customEndpoint: `s3-control.dualstack.us-east-2.amazonaws.com`, }); // GET 200 // https://<accountId>.s3-control.dualstack.us-east-2.amazonaws.com/v20180820/accessgrantsinstance/dataaccess?durationSeconds=900&permission=READWRITE&target=....
Data plane APIs: List
await list({ path: "public/", options: { customEndpoint: `s3-accelerate.amazonaws.com`, }, }); // GET 200 // https://<bucket>.s3-accelerate.amazonaws.com/?list-type=2&max-keys=1000&prefix=public%2F
Copy
await copy({ source: { path: `public/car.jpeg`, }, destination: { path: `public/carCopy.jpeg`, }, options: { customEndpoint: `s3-accelerate.amazonaws.com`, }, }); // PUT 200 // https://<bucket>.s3-accelerate.amazonaws.com/public/carCopy.jpeg
Remove
await remove({ path: `public/diceCopy.jpeg`, options: { customEndpoint: `s3-accelerate.amazonaws.com`, }, }); // DELETE 204 // https://<bucket>.s3-accelerate.amazonaws.com/public/carCopy.jpeg
Get Properties
await getProperties({ path: "public/bus.jpeg", options: { customEndpoint: `s3-accelerate.amazonaws.com`, }, }); // HEAD 200 // https://<bucket>.s3-accelerate.amazonaws.com/public/bus.jpeg
Get Url
const result = await getUrl({ path: `public/bus.jpeg`, options: { customEndpoint: `s3-accelerate.amazonaws.com`, }, }); // GET 200 // https://<bucket>.s3-accelerate.amazonaws.com/public/bus.jpeg?x-amz-content-sha256=....
Download Data
downloadDataTask = downloadData({ path: "public/bus.jpeg", options: { customEndpoint: `s3-accelerate.amazonaws.com`, }, }); const result = await downloadDataTask.result; // GET 200 // https://<bucket>.s3-accelerate.amazonaws.com/public/bus.jpeg
Upload Data
const uploadTask = await uploadData({ path: `public/${file.name}`, data: file, options: { contentType: file.type, customEndpoint: `s3-accelerate.amazonaws.com`, }, }).result; // PUT 200 // https://<bucket>.s3-accelerate.amazonaws.com/public/car.jpeg
yarn test
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description of changes
customEndpoint
advanced option to all Internal APIs (7 data plane APIs + 2 control plane APIs).https://${customEndpoint}
https://${accountId}.${customEndpoint}
Description of how you validated changes
Tested the following code snippets below (
internals/
). Control plane APIs: listCallerAccessGrantsgetDataAccess
Data plane APIs: List
Copy
Remove
Get Properties
Get Url
Download Data
Upload Data
Data plane APIs:
Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.