GCP plug-in structure

In this topic you can find information about configuring GCP event sources and GCP event conditions.

Configuring a GCP event source

A PubSub event source that receives GCP event types can be configured in the following way:
projectId
  • Type: string
  • minlength: 1
  • maxlength: 1000
  • Required
The unique identifier for the GCP project you want to receive events from.
serviceFile
  • Type: string
  • minlength: 1
  • maxlength: 1000
  • Required*
The path of the service file used for authentication.
Note: If the serviceFile value is not specified, it is taken from the local environment configuration. If it is not configured in the local environment, it needs to be specified.
privateKey
  • Type: string
  • minlength: 1
  • maxlength: 2000
The private key used for authentication.
clientEmail
  • Type: string
  • minlength: 1
  • maxlength: 1000
The client email of the service account used for authentication.
subscriptionId
  • Type: string
  • minlength: 1
  • maxlength: 1000
  • Required
The session token used for authentication.

Example

The following is an example of a generic type event source configured to receive GCP event types:
$eventsource

EVENT_SOURCE /GCP1
DESCRIPTION "GCP testing"
PLUGIN GCPEvents
TYPE PubSub
CONFIGURATION {

      "projectId": "projectIdvalue",
      "serviceFile": "/home/username/Documents/Project/example.txt",
      "subscriptionId": "subscriptionIdvalue",

         }
END

GCP event condition

GCPEvent type event conditions can be configured in workflows specifying the following required properties:
  • Name
    Restriction: If you want to start the event condition name with the prefix "in", ensure that the name is enclosed within double quotes.
  • Type
  • Event source
Note: When defining event conditions, all the relative fields are case insensitive
You can also specify any number of properties that filter the events received from the event source:
Message
  • Type: string
  • Operator: EQ("=") or NE("!=")
  • minlength: 1
  • maxlength: 1000
  • Wildcard allowed: true
  • Multiple filters: false
  • Single predicate: true
  • Case sensitive: false
Specify the PubSub message body to enable filtering of events that either match or do not match the specified input.
Attributes
  • Type: map
  • Operator: KEY_VALUE("keyvalue")
  • minlength: 1
  • maxlength: 1000
  • Wildcard allowed: true
  • Multiple filters: false
  • Single predicate: false
  • Case sensitive: false
Specify the attributes contained in the PubSub message to enable filtering of events that either match or do not match the specified input.
messageId
  • Filtering allowed
The PubSub message ID to enable filtering of events that either match or do not match the specified input.
timestamp
  • Filtering allowed
The PubSub message timestamp to enable filtering of events that either match or do not match the specified input.
orderingKey
  • Type: string
  • Operator: EQ("=") or NE("!=")
  • minlength: 1
  • maxlength: 1000
  • Wildcard allowed: true
  • Multiple filters: false
  • Single predicate: true
  • Case sensitive: false
Specify the PubSub message odering key to enable filtering of events that either match or do not match the specified input.

Example

The following is an example of a workflow with two GCP event conditions:
$jobstream

WORKFLOW /WS_AGT_1#/WF_EVT_TRIGGER_GCP
  DESCRIPTION "Event driven workflow"
  TRIGGER TRIGGER_GCP DESCRIPTION "Sample event trigger" TIMEOUT PT1M CORRELATIONS message CONDITIONS
    NAME EC TYPE "GCPEvents/PubSubEvent" SOURCE /GCP1 FILTERS message = message
    NAME EC_ATTR TYPE "GCPEvents/PubSubEvent" SOURCE /GCP1 FILTERS attributes keyvalue {attributeKey,attributeValue}
  ENDTRIGGER
:
END