VMware Cloud Community
schmitz3michael
Contributor
Contributor
Jump to solution

get owner from vRA 8.x Deployment

Hi,

in vRA 7 it was possible to read out the owner of a deployment via the payload. Unfortunately, when I look at the event topics of the subscriptions in vRA 8, I no longer find this in the properties.

Does anyone have an idea how to otherwise read the owner of a deployment / VM via a vRO workflow?

Reply
0 Kudos
1 Solution

Accepted Solutions
paul_xtravirt
Expert
Expert
Jump to solution

Hey there,

 

Assuming that the Owner is the same as the Requester (which it normally is), create a workflow in vRO, as follows

Workflow Name: Show Properties

Single input, called inputProperties of type Properties

Add a script object to the canvas and set the inputProperties workflow input as an input to the script object. Use the following code to show the properties as well as the requestors name:

 

for each (var inputProp in inputProperties) {
    for each (var key in inputProp.keys) {
        System.log("Name: " + key + " = " + inputProp.get(key));
    }
}

System.log("Username: " + System.getContext().getParameter("__metadata_userName"));
System.log("EventTopicId: " + System.getContext().getParameter("__metadata_eventTopicId"));

 

From there, you can adapt and modify to suit your needs and use case.

If you found this helpful, please consider awarding some points

View solution in original post

3 Replies
paul_xtravirt
Expert
Expert
Jump to solution

Hey there,

 

Assuming that the Owner is the same as the Requester (which it normally is), create a workflow in vRO, as follows

Workflow Name: Show Properties

Single input, called inputProperties of type Properties

Add a script object to the canvas and set the inputProperties workflow input as an input to the script object. Use the following code to show the properties as well as the requestors name:

 

for each (var inputProp in inputProperties) {
    for each (var key in inputProp.keys) {
        System.log("Name: " + key + " = " + inputProp.get(key));
    }
}

System.log("Username: " + System.getContext().getParameter("__metadata_userName"));
System.log("EventTopicId: " + System.getContext().getParameter("__metadata_eventTopicId"));

 

From there, you can adapt and modify to suit your needs and use case.

If you found this helpful, please consider awarding some points
schmitz3michael
Contributor
Contributor
Jump to solution

It worked, thanks for the quick reply! 😃

Reply
0 Kudos
carl1
Expert
Expert
Jump to solution

Different solution would be to simply add the property in your Cloud Template

 

myco_owner: ${env.requestedBy}

 

Carl L.

Reply
0 Kudos