Buckets
A bucket is a named container for objects. Bucket names are unique across S3 and each bucket belongs to a project — see Project Name for how to read yours.
All requests go to the Storage gateway and need the authentication headers.
Create Bucket
Mutation · s3_createBucket
Creates a bucket.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
input | s3_BucketInput | Yes | Bucket details |
input
| Field | Type | Required | Description |
|---|---|---|---|
bucketName | String | Yes | The name of the bucket and it is unique across s3 |
projectName | String | Yes | The name of the project |
An earlier source named this field name in the argument list while its sample
sent bucketName. The verified source settles it as bucketName, checked
against the frontend and the gateway schema (s3_BucketInput.bucketName: String!). The bucket's name comes back as name in the response.
The web app validates the bucket name before sending it: 3–63 characters, only
lowercase letters, numbers, dots and hyphens, starting and ending with a letter
or number. The Project Name field is pre-filled from
Project Name. Both values are
trimmed. The Create button is disabled once the bucket count reaches the plan's
maxBucketLimit (unless isMaxBucketUnlimited).
Variables
{
"input": {
"bucketName": "bucket03",
"projectName": "Sell-Product Project"
}
}
Request
mutation S3_createBucket($input: s3_BucketInput!) {
s3_createBucket(input: $input) {
id
name
url
privacy
projectName
}
}
Response
{
"data": {
"s3_createBucket": {
"id": "68b571f65f34c302831d923f",
"name": "bucket03",
"url": "https://fsgw.sabay.test/bucket03",
"privacy": "Boolean",
"projectName": "Sell-Product Project"
}
}
}
The source sample shows the type (Boolean) rather than a value for privacy.
See Bucket Privacy for what
true and false mean.
List Buckets
Query · s3_getUserBuckets
Returns the buckets belonging to the authenticated user.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
serviceCode | String | No | Not sent by the web app |
The bucket id returned here is the bucketId used by every
bucket setting and by
sub-user bucket access. In the web app the bucket
settings route is /storage/bucket/setting/{name}/{id}.
Request
query S3_getUserBuckets {
s3_getUserBuckets {
bucketList {
name
url
id
projectName
}
}
}
Response
{
"data": {
"s3_getUserBuckets": {
"bucketList": [
{
"name": "bucket03",
"url": "https://fsgw.sabay.test/bucket03",
"id": "68b571f65f34c302831d923f",
"projectName": "Sell-Product Project"
}
]
}
}
}
Delete Bucket
Mutation · s3_deleteBucket
Deletes a bucket.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
input | s3_BucketInput | Yes | Identifies the bucket to delete |
input
| Field | Type | Required | Description |
|---|---|---|---|
bucketName | String | Yes | The name of the bucket |
projectName | String | Yes | The name of the project |
The web app's delete dialog closes and refetches the bucket list only when
success is true.
Variables
{
"input": {
"bucketName": "bucket03",
"projectName": "Sell-Product Project"
}
}
Request
mutation S3_deleteBucket($input: s3_BucketInput!) {
s3_deleteBucket(input: $input) {
message
success
}
}
Response
{
"data": {
"s3_deleteBucket": {
"message": "Bucket deleted successfully",
"success": true
}
}
}