Overview

Hooks are subscriptions to predefined events. With hooks, you can get notified when a specific event is triggered and can react accordingly. There are different context of events, so called event topics, to which you can subscribe.

For example, by using hooks that subscribe the Machine lifecycle and Machine provisioning event topic, you can be notified when a workload is starting, rebooting, etc., or is in a particular state during the deployment (e.g. customizing).

This is an information message

Hooks Activation:

To be able to use hooks please contact the Swisscom Cloud support.

Event Topics

The different event topics are listed in the following table:

Event Topic NameDescriptionService
Blueprint component completedA blueprint component that is part of a composite blueprint finishes provisioning. The component is any blueprint that is part of a composite blueprint.composition-service
Blueprint component requestedA blueprint component that is part of a composite blueprint is requested. The component is any blueprint that is part of a composite blueprint.composition-service
Blueprint configurationA blueprint is created, updated, or deleted.composition-service
Business group configurationA business group is created, updated, or deleted.identity
Catalog item request completedA composite blueprint finished provisioning. This event topic includes all blueprint components. It does not include standalone XaaS blueprints.composition-service
Catalog item requestedA composite blueprint is requested. This event topic does not include XaaS blueprints.composition-service
Component action completedAn action ran on a deployed blueprint component when a deployment action was requested.composition-service
Component action requestedAn action to run on a deployed blueprint component is requested when a deployment action was requested.composition-service
Deployment action completedAn action on a deployed blueprint finished running, including running all the component actions.composition-service
Deployment action requestedAn action on a deployed blueprint is requested.composition-service
EventLog default eventA standard entry is added to the event log.eventlog-service. The log entry is not distributed to subscribers.
IPAM IP lifecycle event completionAn IP allocation or deallocation request is finished.ipam-service
Machine lifecycleA provided IaaS action is run on a provisioned machine.iaas-service
Machine provisioningAn IaaS machine is in the process of being provisioned.iaas-service
Orchestration server configurationA vRealize Orchestrator server configuration is created, updated, deleted, or modified to use a different default instance.o11n-gateway-service
Orchestration server configuration (XaaS) - ObsoleteA vRealize Orchestrator server configuration is created, updated, deleted, or modified to use a different default instance.advanced-designer-service
Post ApprovalA post-approval policy level is configured to use the event subscription option.approval-service
Pre ApprovalA pre-approval policy level is configured to use the event subscription option.approval-service
Resource reclamation completion eventA resource lease expired and the resources are reclaimed.management-service

Events

Once the hooks are active, the events are available to be caught. You have to provide an endpoint (REST) where you want to receive the data payload (JSON) of the event.

Machine lifecycle / Machine provisioning

Using those hooks you can get notification about events regarding your workload (virtual machine) activities. The following is the standard structure of the event data payload that you will receive:

{
    machine: {
        id: STRING, /* IaaS machine ID */
        name: STRING, /* machine name */
        externalReference: STRING, /* machine ID on the hypervisor */
        owner: STRING, /* machine owner */
        type: INTEGER, /* machine type: 0 - virtual machine; 1 - physical machine; 2 - cloud machine */
        properties: Properties /* machine properties, see notes below how to expose virtual machine properties */
    },
    blueprintName: STRING, /* blueprint name */
    componentId: STRING, /* component id */
    componentTypeId: STRING, /* component type id */
    endpointId: STRING, /* endpoint id */
    requestId: STRING, /* request id */
    nicsInfo: ARRAY, /* IP, MAC for each interface */
    lifecycleState: { /* see Life Cycle State Definitions*/
        state: STRING,
        phase: STRING,
        event: STRING
    },
    virtualMachineEvent: STRING, /* fire an event on that machine - only processed by Manager Service as consumer */
    workflowNextState: STRING, /* force the workflow to a specific state - only processed by Manager Service as consumer */
    virtualMachineAddOrUpdateProperties: Properties, /* properties on the machine to add/update - only processed by Manager Service as consumer */
    virtualMachineDeleteProperties: Properties /* properties to remove from the machine - only processed by Manager Service as consumer */
}

The first important information in the payload is the "lifecycleState" element. This contains information like state, phase and the event.

PropertyDescriptionFormat and ValuesExamples
stateContains workflow name and state name{workflowName}.{stateName}VMPSMasterWorkflow32.Requested
VMPSMasterWorkflow32.MachineActivated
BasicVmWorkflow.BuildComplete
phaseContains the phase that triggered a messagePRE, POST, EVENTPRE. An event is published when entering this state.
POST. An event is published when exiting this state.
EVENT. An event is published when an IaaS event is received in this state..
eventContains the event. This property is optional and exists only when the phase is EVENT{workflowName}.{stateName}.EVENT.{eventName}VMPSMasterWorkflow32.Requested.EVENT.OnProvisionMachine
VMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.OnBuildSuccess
BasicVmWorkflow.CreatingMachine.EVENT.OnCreatingMachineComplete

Per default, all the available events are triggered.

The table VMPSMasterWorkflow32 States and Events of the official VMware documentationopen in new window shows the possible catchable events.

Last Updated: