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

NameTypeRequiredDescription
inputs3_BucketInputYesBucket details

input

FieldTypeRequiredDescription
bucketNameStringYesThe name of the bucket and it is unique across s3
projectNameStringYesThe name of the project

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"
    }
  }
}

List Buckets

Query · s3_getUserBuckets

Returns the buckets belonging to the authenticated user.

Arguments

NameTypeRequiredDescription
serviceCodeStringNoNot sent by the web app

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

NameTypeRequiredDescription
inputs3_BucketInputYesIdentifies the bucket to delete

input

FieldTypeRequiredDescription
bucketNameStringYesThe name of the bucket
projectNameStringYesThe name of the project

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
    }
  }
}