Skip to content

API Docs - v1.0.2

Tested Siddhi Core version: 5.1.21

It could also support other Siddhi Core minor versions.

Sink

google-cloud-storage (Sink)

Sink extension which can be used to publish events to a GCS bucket.

Syntax

@sink(type="google-cloud-storage", bucket.name="<STRING>", credential.path="<STRING>", versioning.enabled="<BOOL>", storage.class="<STRING>", content.type="<STRING>", bucket.acl="<STRING>", @map(...)))

QUERY PARAMETERS

Name Description Default Value Possible Data Types Optional Dynamic
bucket.name

Name of the GCS bucket

STRING No No
credential.path

Absolute path for the location of the authentication file obtained through the Google Cloud Platform Console, If not defined in the Sink configuration user can set the credential file location by setting the path as System variable with thename GOOGLE_APPLICATION_CREDENTIALS

EMPTY_STRING STRING Yes No
versioning.enabled

Boolean option to indicate whether the bucket should enable versioning or not

false BOOL Yes No
storage.class

Storage class of the objects that are stored in the bucket possible values are, MULTI_REGIONAL, REGIONAL, 'NEARLINE', COLDLINE

STRING No No
content.type

Type of the objects written to the bucket

text/plain STRING Yes No
bucket.acl

Access Control List for the bucket level ACL defined as a key value pair list defined as "'<key>:<value>','<key>:<value>'"

EMPTY_STRING STRING Yes No

Examples EXAMPLE 1

@sink(type='google-cloud-storage', credential.path='<auth.file.path>', bucket.name='<bucket.name>', object.name='test-object-{{suffix}}',  @map(type='text') ) 
define stream outputStream(key string, payload string, suffix string);

Above example demonstrate how an GCS sink is getting configured in order to publish messages to a GCS Bucket.
Once an event is received by outStream, an text file will be generated by 'text' mapper from the attribute values of the event. GCS sink will connect to the bucket using provided configurations and upload the object to the bucket.