List vApps, redux

I wrote a code to find a TIME given a name (String), and as usual, he did work as expected.  So I did some research more and found this http://communities.vmware.com/message/2023720 which was code similar to my attempt (s) if at least I was on the right track.

However, even with the code of this thread I keep seeing the behavior where the table does not meet with entity objects.  The last two messages in this thread indicate some sort of shift of the URL, but I'm sure about what delay was implicit or find?  We turn a nice stock vCO and vCD and were able to get objects of entity via the references orgNetworks, vAppTemplates, and orgVDCs from similar code successfully.

For convenience, the code is:

var vApps = new Array();

var queryService = vcdHost.getQueryService();
var expression = new VclExpression(VclQueryAdminVAppField.NAME, "*" , VclExpressionType.EQUALS);
var filter = new VclFilter(expression);
var params = new VclQueryParams();
params.setFilter(filter);
var fields = new Array();
fields.push(VclQueryVAppField.NAME);
params.addSortFields(fields, VclSortType.SORT_ASC);
var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINVAPP, params);
while (resultSet != null{
     var records = resultSet.getRecords(new VclQueryResultAdminVAppRecord());
     System.log(records.length+" records found");
     for each (var record in records) {
         var vAppRef = new VclReference();
         vAppRef.href = record.href;
         vAppRef.name = record.name;
         vAppRef.type = record.type;
         vApps.push(vcdHost.getEntityByReference(VclEntityType.VAPP, vAppRef));
System.log("vapp with name"+record.name+"Found in VDC"+record.vdcName)
     }
     resultSet = resultSet.getNextPage();
}

return vApps;

Thanks!

Are you trying to run it with vCO 5.1, using the vCD plugin 5.1 for vCO? If so, you need to change

vApps.push(vcdHost.getEntityByReference(VclEntityType.VAPP, vAppRef));

TO:

vApps.push(vcdHost.getEntityByReference(VclFinderType.VAPP, vAppRef));

According to the guidelines of this doc: http://communities.vmware.com/docs/DOC-20431

Tags: VMware

Similar Questions

  • Whats New in vSphere 4 - hands on upgrade?

    Hello!

    In the course "Whats New in vSphere", actually do an upgrade of 3.5 or you are only talking about how it should be done?

    In addition, cover your vShield Zones or the Data Protection? vApps? vCloud?

    / Henrik

    There is a whole section on the ESX upgrade, all 4.0 Update Manager and vCenter. There is a large practical workshop where all of these updates are performed, as well as the update of a virtual and hardware VMs VMware Tools.

    In your list, vApps are covered in What's New. There is nothing on vShield Zones, or Data Protection, and vCloud is a concept, rather than on a specific part of the technology.

    Scott.

    -

  • return list of vApps system org

    Everyone was able to return a list of vApps using the API that is connected to the SYSTEM ORG? I'm looking to collect this list using VCO and difficulties. See my other thread here

    Yes, if you are logged in as system administrator, you can exploit the Serivce of query and use the type of "adminVApp", not "paralytic" and this will give you all the vApps in the instance of vCloud Director.

    For more information about the query Service, take a look at this article - http://blogs.vmware.com/vsphere/2012/04/quickly-finding-objects-using-the-vcloud-api-query-service.html

  • Get a list of all the vApps?

    I'm having bad to write a VCL query to get all the vApps in VCD infrastructure and have hit a roadblock. I can't return the results. My code is below, and I think it's okay...

    Any help would be appreciated.

    queryService var = vcdHost.getQueryService ();
    expression of var = new VclExpression (VclQueryVAppField.NAME, "*", VclExpressionType.EQUALS);
    filter var = new VclFilter (expression);
    var params = new VclQueryParams();
    params.setFilter (filter);
    Vapps var = new Array();
    resultSet var = queryService.queryRecords (VclQueryRecordType.VAPP, params);
    While (resultSet! = null) {}
    var record = resultSet.getRecords (new VclQueryResultVAppRecord());
    System.log("Found"+Records.length+"Records")
    for each {(var record in documents)
    var VAppRef = new VclReference();
    VAppRef.name = record.name;
    VAppRef.status = record.status;
    VAppRef.vdc = record.vdc;
    VAppRef.type = record.type;
    vApps.push (vcdHost.getEntityByReference (VclEntityType.VAPP, VAppRef));
    }
    resultSet = resultSet.getNextPage ();
    }
    vAppArray = vapps;

    And here is mine.

    As you can see, all right.

    You can connect using its originalStringRepresentation property the string representation of an object notFound. From there, you can check the URL (you can also you can connect the href of the records).

    I think it's that you may have configured differently vCD plugin url, and the URL of the API public vCD. Please check.

    Christophe.

  • ESX host is listed in DVSwitch, but not in DVportgroups

    Hello

    I have the following in a CLuster (5.5 Vcenter, ESXi hosts 5.1) problem:

    I added a new ESX to the cluster (number 9 of ESX), then added 4 network cards to the DVSwitch (uses the LACP Protocol).

    In this DVSwitch I 2 DVportGroups / tag VLAN

    The problem is the host is listed in the tab "Hosts" in VCenter to level DVSwicth, but do not appear in the DVportgroups tabs (all hosts are listed here but not the last one..)

    vmk0 migrated successfully to the VLAN 1 St... but now, it appears limited to ""... I can migrate to the DVportGroup right... and VCenter says 'ok'... but nothing changes...

    I tried to migrate a virtual machine on the ESX (2nd VLAN) = > VM pings OK...

    So "technically" it works very well... but the ESX does NOT appear as members of DVportGroup.

    The problem appeared when I tried to deploy a vApp (antivirus) on the ESX... I'm stuck at the "select VLANS for the NETWORK card"... There is no VIRTUAL LAN in the list... (because the ESX host is no not part of any dvportgroup..)

    I tried "adding the ESX to the DVportGroup" after having asked for credentials, VCenter says 'ESX is already part of the pole '...

    Someone had this strange behavior?

    What can I do?

    Help!

    Best regards

    S

    I had a similar case, where the hosts have been posted under DVS, but not under DVS exchanges.

    A restart of vCenter Service fixed the problem. However, I was not deploy any TIME or such.

    Suhas

  • How to control the default visibility of a column in the grid by using the extension. vsphere.core point ${objectType}.list.columns

    It seems that certain built-in objects have some hidden by default (in the objects tab) the grid columns. For example, the object of vApps has the column "managed by" hidden. How a column in the grid on the tab of object can be hidden by default in the sample of chassis-ui?

    Thanks in advance,

    -Darrell

    It is not possible to control the visibility of the column by an extension point.  The built-in objects using their own point of view of list.

  • vCD 5.1.2 - How can we suspend all vApps running using the API or a command?

    I can browse a list of deployed vApps, but is there a better way?  We must suspend all vApps running before kick off a backup using SAN snapshots.

    Is there a doc internal API, such as Lab Manager?

    Thank you!

    Here is my understanding... Right suspension does not release reserves... Suspend the needs to maintain the reserves there to make sure that a resume is successful. It's just for CPU/MB of the reserves on virtual machines / pools.

    Stop will also cancel the deployment, but disables the virtual machines... even as a 'stop' of the user interface.

    One of these should be good for you to perform, the aim being to turn the VMs to take a glance SAN, just that suspend which takes much more time off.

  • VApps children?

    The vCD API has a method Vapp.GetChildrenVapps, which returns a list of vApps are nested in the current TIME. No doubt, every child VAPP can have child vApps clean, so that we can create a whole hierarchy of vApps within a single TIME.

    However, I couldn't find a way to do this since the UI vCD (I use vCD 5.1). Is it possible to have a paralyzed man in a paralytic?

    No, you can't nest a VAPP object inside an object of vApp.

    Children refers to those created/Associates to the questioned VAPP.

    In the vCloud Director UI is from the view, because it "shouldn't" question.

  • VAPP removed from inventory

    We lack 5.0.1 and I removed the paralytic of inventory, not knowing that I would lose the VAPP configuration (thought it would be just to delete the virtual machines to the breast and let the VAPP "shell").  The vApp settings and configuration stored on the data store somewhere re - import?  If they are, what type of file I am looking for?  I'm more concerned to find the remains of it and remove it because we intend to deploy a new copy of Operations Manager anyway.  I looked through a list of directories of our data warehouses and couldn't find anything that resembled what I was looking for.

    Thank you

    Josh

    -from the point of view of your CV, vApp settings are lost

    -from the point of view of VCOps, they are kept - it's an improvement, we have done in 5.0.1 - your vcops should continue to work properly even if the TIME itself is destroyed. The settings are stored internally on virtual machines

  • Query for all vApps expired using the REST API

    Hello

    I'm not able to find the query that will return me a list of vApps expired. I see that there are in the result set for the VAPP models that have isExpired field, but this field is missing for the result set of vApp. Does anyone know how to achieve this, I have no need of vApps query by one?

    Thank you

    Tomas

    The storage contract information is available only in the LeaseSettingsSection (aka LeaseSettingsSectionType), which I think is queryable by using the query service.

    The only place where I see a request that might work is the adminVApp query that has an autoDeleteDate attribute that seems to be the ISO 8601 timestamp when the (storage) lease expires or expired. Although I can't make it work in a filter expression because there is no date comparison operators, so you have to know the specific value to match on...

  • VAPP network edge firewall is not available?

    Hi there guys

    I hope someone can help me with this one. We are developing a point of Contact for our company to prove the business value of VCloud Director (VDC1.5). We have put in place everything but we have one last question with VAPP networks. According to our understanding, we can place an edge device Vshield between a paralytic and the Organization's network.

    We have implemented the scenario like that, but we can not activate the firewall option, that option remains grayed out depending on the attached screenshot.

    If we turn on the DHCP service, VM perimeter firewall is created, but even in this case the firewall option in the interface VCD remains grayed out.

    Firewall/routing options will become available when your VAPP network is "patched" to the Organization's network.  You can configure it by going to the networking of your VAPP tab and selecting a network of organizations in the connection drop-down list.  Without having to set up a connection, your network of vApp is only available inside your VAPP and only the DHCP of the on-board equipment features.

  • To access the OVF. VAPP properties

    I configured blocking the creation of vApp.  I would like to capture the name associated, pairs of value that are custom settings OVF.  I created the following code and I can see the settings, but I'm not able to determine how to retrieve the values.

    Thank you

    var arr = System.getModule("com.vmware.library.vCloud.vApp").getVAppCustomParameterList (targetvApp, 'Property_1');
    for (var i = 0; i < arr.length; i ++) {}
    System.log ("< b > arr [" + i + "] is < /b > = >" + arr [i] + "< br >");
    }

    Here's my version. I tested it with success. I think the key is tha valueAttrib property.

    var resultProperties = new Properties();
    if ( vApp == null ) {
        return resultProperties;
    }
    var productSections = vApp.getProductSections();
    for each ( var productSection in productSections) {
        var catList = productSection.categoryOrProperty;
        var elements = catList.find(new VclProductSectionProperty()) ;
        for each ( var cat in elements ) {
            resultProperties.put(cat.key, cat.valueAttrib);
        }
    }
    return resultProperties;
    

    To list the contents of the properties:

    for each (var key in properties.keys) {
        System.log(key + " : " + properties.get(key));
    }
    

    Christophe.

  • The list of all the virtual machines of an organization

    Hi all

    I use .net api for vcloud. I need the list of all virtual machines of an organization. How I do that?

    Kamal

    Hello

    A paralytic can contain several virtual machines. Once, you get the use of vApp, the GetChildrenVms() for the confined list of the VM.

    VAPP vapp = Vapp.GetVappByReference (customer, vAppRef);

    foreach (VAPP vm in VAPP. {GetChildrenVms()})

    Console.WriteLine ("" + vm.) Reference.Name);

    Console.WriteLine ("" + vm.) Reference.href);

    }

    Creating a paralyzed man from a vAppTemplate will contain the same number of VM contained in a vAppTempalte.

    If the vAppTemplate contains 3 VM inside. VApp created using the vAppTempalte would also contain the same 3 VM.

    Ex: If the Ex vAppTempalte: WebApplication-vAppTemplate contains a DatabaseVM and AppServerVM.

    VApp created from the Ex vAppTemplate: WebApplication-VAPP will also contain a DatabaseVM and AppServerVM.

    Kind regards

    Rajesh Kamal.

  • How to export the list of devices in the Profile Manager?

    Hello

    is there a way to export the list of devices in the Profile Manager on a mini mac running OS Server 5.3?

    Thank you

    How to export data from device in the Profile Manager

    How to export a list of devices and their info?

  • Rename the mac for a list of the devices apple ID?

    After getting a new MBP 15"I have now two devices listed under my identifier Apple as 'Cynthia MacBookPro 15"... »

    If I wanted to continue to use the other oldest, I wish I could tell them apart. How can I rename them? I thought naming drives was sufficient, but these names do not appear (these are the names that a be assigned in the pane sharing preferences).

    Remove the device that you want to rename your Apple ID account. Go to system-> sharing Preferences and change the name as desired, then re - register this device with its new name.

Maybe you are looking for