Create object event subscription.

POST {{baseUrl}}/objectEventSubscriptions

Allows users to subscribe for event notifications generated when the objects of a tenant or subtenant are created, updated, or deleted. Multiple subscriptions for the same path can be created when each has a different destination. Similarly, multiple subscriptions for the same destination can be created when each has a different path. Maximum 15 subscriptions can be created for a tenant or for a subtenant. Path in request payload should be upto folders and not upto object e.g. myfolder/mysubfolder

Notification Content

Based on the configured subscriptions, event notification messages are published to the destination. The event notification content is formatted in JSON according to this example. If object operation happened in subtenant folder, both tenantId and subtenantId will be part of the message. If object operation happened in tenant folder, only tenantId will be part of the message.:

{
  "path" : "/myfolder/mysubfolder/myobj.ext",
  "storageAccount" : "dlbucketname",
  "storagePath" : "/data/ten=mytenid/myfolder/mysubfolder/myobj.ext"
  "tenantId" : "mytenid",
  "subtenantId" : "204a896c-a23a-11e9-a2a3-2a2ae2dbcce4"
  "eventType" : "MODIFY",
  "timestamp" : "2019-05-17T14:47:44.351Z"
}

where

  • 'path' path applicable for supplying to Data Lake APIs like /objectMetadata

  • 'storageAccount' Bucket name in case of AWS S3

  • 'storagePath' Complete S3 prefix path including the object name. Clients should not rely on a given path structure, but should treat storagePath as opaque.

  • 'tenantId' Tenant Id on whose bucket the object operation happened, resulting in notification message

  • 'subtenantId' Optional. Subtenant Id, in case the object operation happened for a subtenant, resuling in notification message

  • 'eventType' is either 'MODIFY' in case of creation or update, and 'DELETE' in case of object deletion.

  • 'timestamp' records the time when the event happened. It is formatted according to ISO 8601 extended date/time format 'YYYY-MM-DDThh:mm:ss.sssZ'.

Request Body

{"path"=>"<string>", "destination"=>"<string>", "name"=>"<string>", "subtenantId"=>"<string>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: Created

{&quot;id&quot;:&quot;7dc53df5703e49b38670b1c468f47f1f&quot;,&quot;name&quot;:&quot;my-subscription-name&quot;,&quot;storageAccount&quot;:&quot;dlbucketname&quot;,&quot;storagePath&quot;:&quot;data/ten=tenantname/myfolder/mysubfolder OR data/sub=subtenantId/myfolder/mysubfolder&quot;,&quot;destination&quot;:&quot;aws-sns://arn:aws:sns:region:account-id:topicname&quot;,&quot;eTag&quot;:1,&quot;status&quot;:&quot;ACTIVE&quot;,&quot;subtenantId&quot;:&quot;204a896c-a23a-11e9-a2a3-2a2ae2dbcce4&quot;}