Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 214415

Re: QueryVMField.VAPPNAME causes VCloudException

$
0
0

kvp511,

 

Thank you for the response. I apologize, I should have been more clear in my post. I currently have a list of vAppReferences, and for each vAppReference, I would like to get the corresponding VMs using the QueryService. Here are the steps I am taking:

 

 

VCloudClient = new vCloudClient(mVCUrl, com.vmware.vcloud.sdk.constants.Version.V5_1);

VCloudClient.Login(mVCUsername + "@" + mVCOrg, mVCPassword);

List<ReferenceType> vAppRefs = VCloudClient.GetQueryService().QueryvAppReferences().GetReferences();

 

QueryService qs = VCloudClient.GetQueryService();

QueryParams<QueryVMField> query = new QueryParams<QueryVMField>();

query.Fields.Add(QueryVMField.VAPPNAME);

query.Filter = new Filter(new Expression(QueryVMField.VAPPNAME, vAppRefs[0].name, ExpressionType.EQUALS));

List<ReferenceType> vMRefs = qs.QueryVmReferences(query).GetReferences();


Since I am using the QueryVMField class to define the field and types, is it possible to use wrong ones? Wouldn't the compiler throw a compilation error?


Thanks again for you help, I appreciate the time.


t



Viewing all articles
Browse latest Browse all 214415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>