Get VIM object by reference using plugin vCloud

Hello, any suggestions on how to recover a VIM oppose in reference to a host vCloud?  I am looking for resource support provider TDC pools.  Here's what I'm trying that produces a null result:

for each (var in {VclHostManager.getHostList () vcdInstance)}

vcdInstance.login ();

for each (var in {vcdInstance.toAdminObject () .toAdminExtensionObject () .getVMWProviderVdcs () pvdc)}

for each (var rp in {pvdc.getResourcePools ()})

var rpVimObj = vcdInstance.getEntityByReference (VclFinderType.VIM_RESOURCE_POOL, rp.resourcePoolVimObjectRef);

rpVimObj is null

}

}

}


I also tried some variations of types of finder as VclVimObjectTypeEnum.RESOURCE_POOL but also using rp.resourcePoolRef as parameters to getEntityByReference.  The vCloud host/plugin version is 1.5, with vCO 5.1.

Hello

There is a way! First, you must get the MoRef of the providerVdc to identify the resourcepool in a VC. But beware, in environments with multiple vCenter servers the MoRef is perhaps not unique (see here and here).

I think this code will fit your needs:

//A Moref is a VC-Identifier
var rpMorefs = new Array();

//do this for all vcdHosts
for each (var vcdInstance in VclHostManager.getHostList()) {

     vcdInstance.login();
     //get all Provider-vDCs from vcdHost
     for each ( var providerVdc in vcdInstance.toAdminObject().getProviderVdcs())
     {
        //Prepare query - getProviderVdc by name
        var expression = new VclExpression(VclQueryProviderVdcResourcePoolRelationField.NAME, providerVdc.name, VclExpressionType.EQUALS);
        var filter = new VclFilter(expression);
        var params = new VclQueryParams();
        params.setFilter(filter);

        while (resultSet != null)  {
            // retrieve ProviderVdcResourcePoolRelationRecord record
            var records = resultSet.getRecords(new VclQueryResultProviderVdcResourcePoolRelationRecord());

            for each (var record in records) {
                //get all resourcePoolMorefs
                rpMorefs.push(record.resourcePoolMoref);
            }
            resultSet = resultSet.getNextPage();
            }
     }
}

var resourcePools = VcPlugin.getAllResourcePools();

//get the vCenter-resourcePoolObject by Moref
for each (var moref in rpMorefs){

    for each (var resourcePool in resourcePools) {
        if ( moref == resourcePool.id) {
            System.log("Resourcepool of the providerVdc: " + resourcePool.name);
        }
    }

}

Another way to retrieve the MoRef is to extract the XML providerVdc (providerVdc.toXml ()).

See you soon,.

Thomas

Tags: VMware

Similar Questions

  • Get the user AD attributes using plugin

    Hello

    I used to use the:

    requester = Server.getCurrentLdapUser().displayName;
    requesterToAddress = Server.getCurrentLdapUser().emailAddress;
    

    But now with 6.03 VRO with plugin AD 2.0.3.2824604 the .emailAddress no longer works.

    I found this link written by Burke (http://www.vcoteam.info/articles/learn-vco/273-how-to-get-active-directory-user-properties.html) that seems to put me on the right track.

    My problem is that I get an error when I run the present.  I get the very first attrib (userPrincipalName) and then I get "[B cannot be cast to java.lang.String (Workflow: TEMP_getAdUserAttributes / Scriptable task (item1) #6)]"

    Any ideas?

    Thank you

    B

    One of the problems is that ActiveDirectory.searchExactMatch () returns an array of objects, not a single object.

    So even if the search criteria is matched by only one user, the method returns an array containing a single element, not a single item. So instead of

    adUser = targetUser;
    

    You must use

    adUser = targetUser[0];
    

    (you can also add a control to check that the returned array contains at least one element)

    BTW, if you are interested in only to get the value of an attribute unique ("mail"), you need not to iterate over all the attributes; You can extract its value directly with

    adUser.getAttribute("mail");
    

    and check if the value returned nil or a string empty "" where there is no attribute for that user.

  • Get the object of StoragePod storage profiles [vCloud Director]

    Hi all

    I'm automating DTS stuff for the creation of new vApps in vCloud Director and I want to integrate and use the workflow to Change Storage DRS by virtual machine configuration , but to do this I need to provide him with an object of type VC:StoragePod...  I have worked out how to get the default storage of each virtual computer profile, but may not know how to get to the StoragePod that it covers.

    Don't laugh, but I only managed to get this far before getting stuck:

    var vms = vApp.getChildrenVms();
    for each (var vm in vms) {
     storageProfile = vm.storageProfile;
     ....
    }
    

    Can someone show me how to get a StoragePod of a profile of storage object ideally default virtual machines?

    Thank you!

    Mark

    Have you had the opportunity to see this thread: http://communities.vmware.com/message/2147437#2147437 - it seems debating what you are interested... The catch here is that you are trying to do from the side the cloud... I can't look at this right now, but I suspect that you MUST have access to the underlying infrastructure to do what you ask... in this case, you will need to extract the object from VC:VirtualMachine of your vCloud:VM object, then the thread above can deepen assistance.

  • Getting context object null when using the custom menu item.

    Hi all

    I implemented a sample application to add menu item custom to the list of messages and we test this build on 9000 os 5.0.0.41 Blackberryy 1

    On BB 9000, we have 2 message inbox, A like Blackberry by default message inbox and B as long as the Inbox for the e-mail account, I have set up on BB 900.
    I implemented the menu custom application to add menu on the message list option.
    I see this option on both my inbox, the question that I am facing is when I click on the menu item by selecting the email in the message of default A Blackberry inbox I can get the context object were like when I click on the same message next to the Inbox B I'm always get the context as a NULL object.

    Below is the code I used to add the custom menu item.

    Public Shared Sub main (String [] args)
    {
    If (args! = null & args.length > 0) {}
    call from another entry point. Add menu items mark as Spam and mark as suspects.
    {if(args[0].) (Equals ("GUI"))}
    try {}
                            
    create menu items.

    MyMenu ApplicationMenuItem = new EmailFile();
    Add the menu item in the list view and send by e-mail.
    Amir ApplicationMenuItemRepository = ApplicationMenuItemRepository.getInstance ();
    amir.addMenuItem (ApplicationMenuItemRepository.MENUITEM_MESSAGE_LIST, mymenu);
    } catch (Exception e) {}
    Utility.debugLog (try (), CLASSNAME, 'hand', Utility.EXCEPTION_INFO);
    System.out.println("Error:"+e.ToString());)
    }
    } else {}
    show on the application of spam...
    AppMain _theApp = new AppMain();
    _theApp.enterEventDispatcher ();
    }
    } else {}
    show on the application of spam...
    AppMain _theApp = new AppMain();
    _theApp.enterEventDispatcher ();
    }
    }

    Can we know what is the problem in my code or something I'm missing.

    Thanks in advance.

    Navneet Gupta.

    application menu items have been bugged for ages. There is nothing you can do except change your workflow. in some cases, you can recover the app screen and trying to extract something of these fields, but becomes more difficult in the new OS versions because of custom fields used by rim.

  • How to get the storage allocated profile and used the plugin vCloud 5.1 Vdc

    How can I get the storage allocated and used for a Vdc in vCloud 5.1 plugin?

    VCloud plugin 1.5, there was a property of VclVdc.storageCapacity give us the space allotted, limit, use (s) and overhead costs.

    VCloud plugin 5.1 we allways null VclVdc.storageCapacity. Then VclVdc.getStorageProfiles () but presents the objects, there is that the "limit value".

    ¿WHERE are the other values?

    I have attached two screenshots. vCloud console shows the data, but not vCloud plugin.

    Thank you very much.

    Damian

    Tell me if this work. This was written in a few minutes.

    var host = vdc.getHost();
    
    var queryService = host.getQueryService();// toAdminObject().getAdminQueryService();
    
    var profs = vdc.getStorageProfiles();
    
    for each (var prof in profs) {
    
        var expression = new VclExpression(VclQueryAdminOrgVdcStorageProfileField.HREF, prof.getReference().href  , VclExpressionType.EQUALS);
        var filter = new VclFilter(expression);
        var params = new VclQueryParams();
        params.setFilter(filter);
        var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINORGVDCSTORAGEPROFILE,params);
    
        while (resultSet != null) {
            var records = resultSet.getRecords(new VclQueryResultAdminOrgVdcStorageProfileRecord);
            System.log(records.length + " records found");
                for each (var record in records) {
                    //obtain data from record
                    System.log("storageUsedMB : " + record.storageUsedMB);
                    System.log("storageLimitMB : " + record.storageLimitMB);
                }
        resultSet = resultSet.getNextPage();
        }
    
    }
    
  • Is it possible to get the object of doc JS of a PDF document that is opened in a web browser?

    As I mentioned in a previous post on the Scripting Forum (http://forums.adobe.com/thread/427791), methods that previously worked in Acrobat 8 to get the object of doc JS of a PDF document that is opened in a web browser - for example App.activeDocs . using the JS object and AcroApp.GetAVDoc (index). GetPDDoc using OLE automation - no longer works in Acrobat 9.  Therefore, in Acrobat 9, it is impossible to access a PDF file that is opened in a browser or in its annotations (except, of course, the PDF is downloaded to the computer and open through the NTFS, which kind of defeated the purpose).


    What is someone is aware can explain how to get the object of doc JS of a PDF document that is opened in a web browser?

    If the plugin exposes a DDE interface - of course.  But this assumes that he is there--it is not automatic.  You will need to write your own plugin or get an update if necessary.

    And thanks for the info: I'm passing along!

  • I need to get a certificate to continue using WI - FI how di I find the certificate?

    I need to get a certificate to continue using WI - FI how di I find the certificate?

    Original title: WiFi problem

    Hello

     
     
    1. who is the operating system installed on your computer?
    2. What is the exact error message that you receive?
    3. who is your Internet service provider?  Have you tried to contact them about this?
     
     
    Follow the steps mentioned below and check if that helps.
     
    Method 1: You can check if the router is configured for WPA and WPA2 connection:
    a. If the router is configured for WPA and the configuration of your wireless network on your computer must be configured the same way. That is to say, WPA.
    (b) if the router is configured for WPA2, then the configuration of your wireless network on your computer must be configured the same way. That is to say, WPA2.
     
     
     
     
    Method 2: You can manually disable authentication IEEE 802. 1 x. Subsequently, re - enable authentication IEEE 802. 1 x and see if the problem still occurs.
     
    See: If you use a NETGEAR wireless router, you can follow this link:
    Unable to connect to the network: Validation and certificate in Windows XP and Vista errors
    http://support.NETGEAR.com/app/answers/detail/A_ID/7334/~/unable-to-connect-to-network%3A-validation-and-certificate-errors-in-Windows-XP
     
     
     
     
     
  • Get "Not responding" when you use law ON the.

    Get "Not responding" after each keystroke when you use law on the.  I see the message and then after about 10-15 seconds, if you press the tab key.  Literally, it happens after every key stroke.  I've never had this happen before.  My laptop has Windows 8.  At this rate, it'll take a week to complete my tax return.

    Hello

    Thank you for your response.

    I'm sorry for the late reply.

    I appreciate your efforts to resolve the issue.

    I suggest you run the system file checker (SFC) and see if it helps.
    Reference:
    Use the System File Checker tool to repair missing or corrupted system files
    http://support.Microsoft.com/kb/929833

    System File Checker is a Windows utility that allows users to find corruptions in Windows system files and restore the damaged files.

    Note: It can ask the difficulty Windows installation DVD and allowing SFC to do more than minor repairs. Could some of the files saved on your computer are deleted when fixing corrupted files.

    Please keep us updated on the status of the issue.

    Thank you

  • Sharing a vApp, catalog by using the vCloud API

    I need to share the vApp using the vCloud API but cannot find anything it either relating to the sharing of operation in the API documentation. If someone was able to perform using the API please give me the steps or the example code to do the same.

    Hello

    You can share vApps among members of your organization.

    'Control of access to the catalogues and vApps' - vCloud API Guide 1.5, Pg No. 157.

    GET https://vcloud/api/vApp/{VAPP id} / controlAccess - read access control settings on the vApp.

    POST https://vcloud/api/vApp/{VAPP id} / action/controlAccess - update settings for access control on the paralytic.

    Kind regards

    Rajesh Kamal.

  • object on a simple object null reference

    Turn it on some of the projects currently working on.

    So I have this


    main.conductor.gotoAndStop (4);

    get the "#1009: cannot access a property or method of an object. null reference" error.

    Its scope, I think. the same framework and not at course time am damned a subject are right.

    frustrating it is like script101 of the action and can't make it work.

    Click the object on the stage that you think is key (to select).  take a screenshot showing the chronology, the object on stage and the properties panel.  Attach the screen shot here.

  • Get information about a class using generic drugs...

    Hello.

    I have declared a class: "public class test < SC extends test > {/ * do something * /} '.

    Can someone tell me why a statement such as "System.out.println (SC.class.getSimpleName ());" within a method defined in test will not compile? Is there another way to achieve what I want?

    Owen Thomas wrote:
    It seems that the two examples given need me get instances. When I write code, no instance of haven, not more than I know the subclass.

    You can get close to erasing boundaries using a field, at whatever level it held, containing the class type object. In this case you set the class field in the superclass and, for example, set it in a protected constructor.

    In my opinion, this technique is what would a non-erasasure of the generic type behind the scenes still and it happens seldom enough to make the provision of generic drugs to no unnecessary deletion.

  • Mac question: could not get the object file Photoshop Document object

    Hello

    I posted this question in my previous post, I hope I can get some aid.

    I created a group of Photoshop using Extension Builder 1.5, the Panel works perfectly in the window, but when I switch to Mac, broken things. I found the SDK on Mac is unable to me the Document.fullName when I open an image file in the formats JPG/GIF/PNG, event with the workaround provided by Bob (tml http://cookbooks.adobe.com/post_Creative_Suite_Extensions_and_the_Photoshop_CS5_Re-17727.h( )

    Actually, it is not question of Photoshop event, is open a JPG of my disk image, click a button in my Panel that will get the activeDocument, then try to get the object File from it, the Document.fullName always null. However, if I open the image in the Photoshop folder installed, it looks very good.

    Thank you

    Hi Alan,

    I took the project I have included in my response to your other thread and changed it so that I can open a file, click a button and see the contents of app.activeDocument in the debugger. Then I open a JPG file and debugged to the extension in Photoshop.

    No problem at this end.

    Concerning

  • A tap above an object can be used to make the clip through the object?

    A tap above an object can be used to make the clip through the object?  So that transparency can see through the object.


    I have a square that has a line above it.  I would like to see the transparent background behind the square in the area occupied by STROKE. Example below:

    Transparent.jpg

    I would like the white area (which was created using the Brush tool and applying a stroke) to display the transparent background behind the red square - or whatever that fall behind the place.


    I have read and tried many tutorials and suggestions on the forum without success. (Group of knockouts, mask opacity, etc...)  I even created a much simpler red square with an accident stroke by default and still unable to get transparency through red square.


    I'm probably just missing something.


    Is this possible using a stoke?  Anyone able to help?


    Thank you

    -Chris

    Or:

    Stroke (s) select 0) and Ctrl + G for group races if more than one,

    (1) with the stroke (s) selected object > decompose the aspect, and

    (2) with all selected Pathfinder > Subtract from shape area / less Front according to version.

  • How to get an object attribute complex without deserializing?

    Hello

    I have a cache partitioned my complex objects. The complex object implements PortableObject. Client-side (client Extend) I need to get the object of the key cache, to get one of his attributes (double) and send it (back) to the outside. How can I get my attribute of the object without deserialize the entire object? My intention was to use PofExtractor, but I don't see how it can be used in my scenario. Is it possible to do?

    Thank you, Denis.

    Hi Denis,.

    See http://download.oracle.com/otn_hosted_doc/coherence/353/com/tangosol/util/processor/ExtractorProcessor.html:

        Double d = (Double) cache.invoke(oKey, new ExtractorProcessor(new PofExtractor(Double.class,  iProp)));
    

    Kind regards
    Dimitri

  • Why do I get "Message Agent wants to use the"login"keychain and how to stop it and 7 other bunch of connection."

    Why do I get "Message Agent wants to use Keychain 'login' and how to stop it and 7 other bunch of connection points most every time I login?

    Hey Roman man,

    I understand that you see a prompt for your login keychain. I can't anymore how do I fix this.

    Now if you have recently changed your password for your Mac, then the password for your keychain will need to be updated. You can make this change in the Keychain Access application. If you do not know the password, then you need to reset the password in the keychain. Take a look at the article below for specific details get this sorted out.

    If your Mac keeps asking for the password in the keychain
    https://support.Apple.com/en-us/HT201609

    Take it easy

Maybe you are looking for

  • I can edit more kinds of playlist is

    Well, here's my gripe with iTunes 12.4, and I hope that someone who thought of it can hint me.  Before this upgrade, I could change how my playlists have been sorted.  I could sorted them by Playlist, which is essentially the order they are added, or

  • Thermotron TCP/IP interface

    Anyone converted Thermotron drivers for control of the House of VI which will run in LabView worm 9 or 10? Specificaly I have an attempt to interface with a controller Thermotron 3800 via TCP/IP.

  • Error code: 0 x 643

    Installation failure Error code: 0 x 643 Try to install the update again, or seek help from one of the following resources. For self-help options: Frequently asked Questions Find Solutions Windows Update Newsgroup To support options: Microsoft online

  • Passport link BB blackBerry connection problem

    My PP has developed a problem where it would not recognize the security password, so I used the link for the backup of the device, and then reload the operating system. I was in the process of configuration of the unit and abandoned out of it somehow

  • You can disable "Fast user switching" in window 7 Professional?

    Windows Help on the 'Welcome' screen, said that "Fast User Switching is enabled by default," which means that it can be disabled.  But Windows Help does not say how this could be done.  Can someone explain? I also want to turn off the display of the