Skip to content

Event Subscriptions

Overview

Event subscriptions (fka Event Broker Service subscriptions or EBS subscriptions) in VCF Automation are configuration rules that link deployment lifecycle events to external actions. They listen for specific triggers, apply filters, and run custom code that allows administrators to modify provisioning properties or integrate with third-party tools when a system action occurs.

Project Structure

Build Tools for VMware Aria stores an event subscription object in a single JSON file with the name of the subscription under the src/main/resources/subscriptions directory in the project content on the local filesystem. The JSON file contains the full definition of the event subscription.

Following is a sample listing of the local filesystem for an event subscription with the name Add user to deployment.

Local Project Content
src/
└── main/
    └── resources/
        └── subscriptions/
            └── Add user to deployment.json

Sample Project File Content

Following is a sample listing of the content of an event subscription definition (as defined in the project archetype) that is stored in the src/main/resources/subscriptions/<subscription name>.json1 file in the project content on the local filesystem.

src/main/resources/subscriptions/Add user to deployment.json
{
  "id" : "sub_1782898962554",
  "name" : "Add user to deployment",
  "type" : "RUNNABLE",
  "eventTopicId" : "deployment.request.post",
  "ownerId" : "admin",
  "subscriberId" : "service-account-project-serviceaccount",
  "blocking" : false,
  "description" : "Sample subscription",
  "criteria" : "event.data.blueprintId =='cb5c3112-3a7e-46c5-be3a-2917d0aa7741'",
  "constraints" : {
    "projectId" : null
  },
  "timeout" : 0,
  "broadcast" : false,
  "priority" : 10,
  "disabled" : false,
  "system" : false,
  "contextual" : false,
  "runnableType" : "extensibility.vro",
  "runnableId" : "95808080808080808080808080808080F281808001175609873343b6bbd2e3eea"
}

Export

To export the definition of an event subscription from the VCF Automation server (pull the content), you need to add the subscription name as a list item of the subscription element in the content.yaml content descriptor file for the project.

Tip

Alternatively, if you want to export all event subscription objects from the project on the VCF Automation server, you can configure the subscription element with no value (i.e. its value is null). For details, see the Content Filtering section.

Following is a sample listing of the content.yaml file for a project that exports only the Add user to deployment event subscription from the project on the VCF Automation server.

content.yaml
subscription:
  - Add user to deployment
# ...

Import

When you import an event subscription to a project on a VCF Automation server (push operation), Build Tools for VMware Aria matches the subscription object by its name (the name of the JSON definition file under src/main/resources/subscriptions in the project content on your local filesystem) and performs one of the following operations.

Warning

Note that for push operations for VCF Automation projects for All Apps organizations, Build Tools for VMware Aria uses the content filtering rules that you define in the content.yaml content descriptor file. For details, see the Content Filtering section.

  • If an event subscription with the same name does not exist on the server, Build Tools for VMware Aria creates a new event subscription with the details from the local project file.
  • If an event subscription with the same name already exists on the server, Build Tools for VMware Aria checks if there are any differences between the local copy and the server copy and performs one of the following operations.
    • If there are no differences between the local copy and the server copy, BTVA skips the operation and does not update the event subscription on the server.
    • If there are differences between the local copy and the server copy, BTVA updates the existing event subscription object on the server with the definition from the local project.

  1. The <subscription name> placeholder stands for the name of the event subscription.