Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Problems Extracting Value from A DynamicWrapper

$
0
0

I'm very new to vco so please excuse my ignorance...

 

We are using the AWS plugin and I am able to call out and retrieve the info I am looking for but now dont know how to get teh exact value and set it to OUT...

 

//Get the AmazonEC2 client

var ec2client = client.getAmazonEC2Client();

System.log("Instance Name: " + instance_name);

 

//Need to specify some filters

var setResourceType = new EC2Filter();

setResourceType.setName('resource-type');

setResourceType.setValues( [ 'instance' ]);

System.log("setResourceType: " + setResourceType);

 

var setTagName = new EC2Filter();

setTagName.setName('key');

setTagName.setValues( [ 'Name' ]);

System.log("setTagName: " + setTagName);

 

var setTagValue = new EC2Filter();

setTagValue.setName('value');

setTagValue.setValues( [ instance_name ]);

System.log("setTagValue: " + setTagValue);

//Done specifying filters

 

//Tying the filters to the request

var describeTagRequest = new EC2DescribeTagsRequest();

describeTagRequest.withFilters([setResourceType, setTagName, setTagValue]);

System.log("describeTagRequest: " + describeTagRequest);

 

 

var tagDescriptions = new Array();

var tagDescription = new EC2TagDescription();

tagDescription.getResourceId();

 

tagDescriptions.push(tagDescription);

 

//Making the call

var response = ec2client.describeTags(describeTagRequest);

 

instanceID = response.withTags(tagDescriptions);

System.log(instanceID);

 

I get the following returned from the instanceID

 

(From the vco log output)

2015-02-11 16:14:27.442] [I] Item: DynamicWrapper (Instance) : [EC2TagDescription]-[class com.vmware.o11n.plugin.aws.ec2.model.TagDescription] -- VALUE : {}

[2015-02-11 16:14:28.208] [I] DynamicWrapper (Instance) : [EC2DescribeTagsResult]-[class com.vmware.o11n.plugin.aws.ec2.model.DescribeTagsResult] -- VALUE : {Tags: [{ResourceId: i-010e9aaa,ResourceType: instance,Key: Name,Value: TESTSERVR1}, {}],}

 

I am trying to get the ResourceId (i-010e9aaa) from that object.

 

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 6251

Trending Articles