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

Re: orgvdcnetwork.toAdminObject() not returning correct value

$
0
0

AH HA!   I think I have figured out my problem. I was retrieving the OrgVDCNetwork via the query service using the query below.  This is where the extra admin was coming from. If I manually specify an OrgVDCNetwork I only get one /admin and all is right with the world.   Any thoughts why this is retrieving the Admin object?

 

Inputs: Network_Name(string), host(vcloud:host)

 

 

var queryService = host.getQueryService();
var expression = new VclExpression(VclQueryOrgVdcNetworkField.NAME, Network_Name, VclExpressionType.EQUALS);
var filter = new VclFilter(expression);
var params = new VclQueryParams();
params.setFilter(filter);
var oNetworks = new Array();
var resultSet = queryService.queryRecords(VclQueryRecordType.ORGVDCNETWORK, params);
while (resultSet != null)  {
    var records = resultSet.getRecords(new VclQueryResultOrgVdcNetworkRecord());
    System.log(records.length + " Org VDC Network record(s) found");
    for each (var record in records) {
        var onetRef = new VclReference();
        onetRef.href = record.href;
        onetRef.name = record.name;
        onetRef.type = record.type;
       oNetworks.push(host.getEntityByReference(VclFinderType.ORG_VDC_NETWORK, onetRef));
    }
    resultSet = resultSet.getNextPage();
}
OrgVDCNetwork = oNetworks[0]

Viewing all articles
Browse latest Browse all 232869

Trending Articles



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