Java Native Functions: com.ibm.streamsx.objectstorage.s3

IBMStreams com.ibm.streamsx.objectstorage Toolkit > com.ibm.streamsx.objectstorage 2.2.5 > com.ibm.streamsx.objectstorage.s3 > Java Native Functions

This page documents native functions that can be invoked from SPL, including the SPL interfaces that can be used to invoke each of the native functions.

Functions

<string T> public boolean createBucket(T bucket)

Creates a bucket if it doesn't exist.

<string T> public boolean createBucket(T bucket, T locationConstraint)

Creates a bucket if it doesn't exist. Select with the locationConstraint argument the bucket type: Standard bucket (us-bucket), Vault bucket (us-vault) or Cold Vault bucket (us-cold)

<string T> public boolean deleteAllObjects(T bucket)

Deletes all objects in a bucket.

<string T> public boolean deleteBucket(T bucket)

Deletes a bucket.

<string T> public boolean deleteObject(T objectName, T bucket)

Deletes an object in a bucket.

<string T> public list<T> getObjectMetadata(T bucket, T objectName)

Get object metadata.

<string T> public T getObjectStorageURI(T bucket)

Converts the bucket to a URI for the objectStorageURI parameter of the ObjectStorageSource, ObjectStorageScan and ObjectStorageSink operators. Returns an URI in format: s3a://<bucket>/

<string T> public T getProtocolFromURI(T uri)

Extracts the protocol of the URI. Returns either cos or s3a

<string T> public boolean initialize(T accessKeyID, T secretAccessKey, T endpoint)

Initialize S3 client using basic authentication. This method must be called first. For IBM COS the recommended endpoint is the public us-geo (CROSS REGION) endpoint s3.us.cloud-object-storage.appdomain.cloud.

<string T> public boolean initialize(T accessKeyID, T secretAccessKey, T endpoint, boolean sslEnabled)

Initialize S3 client using basic authentication. This method must be called first. For IBM COS the recommended endpoint is the public us-geo (CROSS REGION) endpoint s3.us.cloud-object-storage.appdomain.cloud.

<string T> public boolean initialize(T appConfigName, T endpoint)

Initialize S3 client using JSON IAM credentials from IBM Cloud Object Storage service. This method must be called first and requires an application configuration with name given as appConfigName parameter with property cos.creds that contains the IAM credentials. For IBM COS the recommended endpoint is the public us-geo (CROSS REGION) endpoint s3.us.cloud-object-storage.appdomain.cloud.

<string T> public boolean initialize(T endpoint)

Initialize S3 client using JSON IAM credentials from IBM Cloud Object Storage service. This method must be called first and requires cos application configuration with property cos.creds that contains the IAM credentials. . For IBM COS the recommended endpoint is the public us-geo (CROSS REGION) endpoint s3.us.cloud-object-storage.appdomain.cloud.

<string T> public boolean initialize_cos(T credentials, T endpoint)

Initialize S3 client using JSON IAM credentials from IBM Cloud Object Storage service. This method must be called first. For IBM COS the recommended endpoint is the public us-geo (CROSS REGION) endpoint s3.us.cloud-object-storage.appdomain.cloud.

<string T> public boolean initialize_iam(T apiKey, T serviceInstanceId, T endpoint)

Initialize S3 client using IAM credentials. This method must be called first. For IBM COS the recommended endpoint is the public us-geo (CROSS REGION) endpoint s3.us.cloud-object-storage.appdomain.cloud.

public list<rstring> listBuckets()

Lists all bucket names.

<string T> public list<T> listObjects(T bucket)

Lists all object names in a bucket.