-
Notifications
You must be signed in to change notification settings - Fork 0
Add bucket quota apis #5
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-7
Are you sure you want to change the base?
Conversation
| "description": "Smithy-generated TypeScript client for Cloudserver's internal APIs", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "exports": { |
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 will allow importing with subpath, for example
import { BucketQuotaClient } from '@scality/cloudserverclient/quota'
|
|
||
| namespace cloudserver.bucketquota | ||
|
|
||
| use aws.protocols#restXml |
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.
We have to create a new separate service, as the other client is json, but the quota apis are xml.
And anyways it might just be better for code organisation.
| } from '../build/smithy/cloudserverBucketQuota/typescript-codegen'; | ||
| import { CloudserverClientConfig } from '../build/smithy/cloudserver/typescript-codegen'; | ||
|
|
||
| export class BucketQuotaClient { |
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.
Ended up creating a wrapper, it will be easier to use as you will see in the tests, and i was kinda forced to do it because of the update quota api. Basically we probably made a mistake when designing the update quota apis, which wants to receive a structure like this :
<quota>1000002</quota>
But ideally it should look like this :
<parent>
<quota>1000002</quota>
<otherProperties>
</parent>
When using the first structure, we can't use integers, so I was forced to send a string like this, but since we want a convenient api, I don't want frontend colleagues to have to call
client.updateQuota(bucket, '<quota>12</quota>')) which is ridiculous
so with this they will be able to send
client.updateQuota(bucket, 12'))
5170901 to
48729a4
Compare
| env: | ||
| SMITHY_VERSION: '1.61.0' | ||
| run: | | ||
| # Extract Smithy version from smithy-build.json |
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.
Not directly related with the pr, but this is nicer as we will only have one source of truth for smithy version.
I could definitely see someone updating smithy version here and forgetting about updating it in smithy-build.json
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.
We can create a new folder client or rename these files with client. Quota.ts is not very friendly
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.
I had the same thought, but i thought it would look weird because the import path would end up with "client" twice. But still, I moved everything in a /clients folder it will be better
7d4575b to
6e52335
Compare
6e52335 to
3768de7
Compare
ISSUE: CLDSRVCLT-4