Skip to main content
Skip table of contents

Handling of S3 Buckets

With the S3 adapter, you can create, delete and list buckets of an S3 endpoint, and retrieve contents and status information of a bucket.

Creating a Bucket

Using the createBucket operation of the S3 adapter, you can create a new bucket to the S3 endpoint.

Name

Type

Direction

Description

Allowed Values / Examples

bucketName

String

in

Name of the bucket to create.

The name of the bucket should be prefixed with the PAS client.

If a bucket with the same name is already existing or if the bucket name does not match the S3 bucket naming rules, an exception is thrown.

pas-doc-examples

We recommend to prefix bucket name with the PAS client code (e.g. pas-test) because multiple PAS clients may use the same S3 installation.

Listing all Available Buckets

Using the listBuckets operation of the S3 adapter, you can get a list of all buckets that are available from the S3 endpoint.

Name

Type

Direction

Description

Allowed Values / Examples

bucketNames

Array of String

out

List of buckets that are available from the specified S3 endpoint.

Deleting a Bucket

Using the deleteBucket operation of the S3 adapter on a bucket, you can delete a bucket from your S3 endpoint. In case the bucket is not empty, you need to set deleteRecursively to true to remove the bucket and all of its contents - otherwise you will get an exception.

Name

Type

Direction

Description

Allowed Values / Examples

bucketName

String

in

Name of the bucket to delete.

There will be no exception if the bucket you want to delete is not existing.

deleteRecursively

Boolean

in

With S3, as a rule, only empty buckets can be deleted. Specify here whether to delete the bucket and all of its contents in one go.

true

Delete the bucket and all its contents.

false

Bucket must be empty to be deleted (default).

Reading the Contents of a Bucket

Using the listObjects operation of the S3 adapter, you can get a list of all objects that are contained in the given bucket.

  • listObjects ( bucketName: String, objectNames: String[] )

Name

Type

Direction

Description

Allowed Values / Examples

bucketName

String

in

Name of the bucket to list the contents of.

If the bucket is not existing, an exception is thrown.

objectNames

Array of String

out

List of objects that reside within the given bucket.

Retrieving Bucket Information

Using the bucketStatus operation of the S3 adapter, you can get some general information on the bucket including a list of its contained objects.

Name

Type

Direction

Description

Allowed Values / Examples

bucketName

String

in

Name of the bucket to get the status of.

bucketStatus

BucketStatus

out

Object containing the status information as described further below.

The returned status information has the following structure:

Attribute

Type

Description

name

String

Name of the bucket.

size

Integer

Size of the bucket in bytes.

containedObjects

Array of String

List of objects that reside within the bucket.

creationDate

DateTime

Creation timestamp of the bucket.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.