This is the TypeScript definition of policy specifically an AMQP Subscription which can be downloaded from the VMware GitHub repository.
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: Policy_AMQP.pl.ts
import{PolicyTemplate}from"vrotsc-annotations";
@PolicyTemplate({
name:"Event Listener",
path:"Policies/AMQP",
templateVersion:"v2",
variables:{
sample:{
type:"string",
value:"",
description:"Description"
}
},
elements:{
sample:{
type:"AMQP:Subscription",
events:{
onMessage:"onMessage"
}
}
}
})
exportclassEventListener{
onMessage(self:AMQPSubscription,event:any):void{
letobjAMQPMessage:AMQPMessage=self.retrieveMessage(event);
System.log(`Received message${objAMQPMessage.bodyAsText}`);
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
