Query object of vCO VCloud

Hello

I wonder if someone can help me.

I am interrogating vCloud for a vCloud:vAppTemplate and a vCloud:Vdc object. The only input parameter, I have right now is a string containing the name of vAppTemplate and VDC Org name.

Is this possible using the methods in the 1.5 Plugin for vCO vCloud?

I can see various query methods but am no Javascript/vCO exprt so trying to figure out how I would be able to return a recognized real Type. I need to update a workflow with the output attribute, so that it can be used to instantiate a VAPP model.

Any help is very appreciated

Thank you

Here's a sample to retrieve all models of VAPP by name.

var queryService = vcdHost.getQueryService();

var expression = new VclExpression(VclQueryVAppTemplateField.NAME, name, VclExpressionType.EQUALS);
var filter = new VclFilter(expression);
var params = new VclQueryParams();
params.setFilter(filter);

var vAppTemplates = new Array();

var resultSet = queryService.queryRecords(VclQueryRecordType.VAPPTEMPLATE, params);

while (resultSet != null)  {
    var records = resultSet.getRecords(new VclQueryResultVAppTemplateRecord());
    //System.log(records.length + " records found");
    for each (var record in records) {
        var vAppTemplateRef = new VclReference();
        vAppTemplateRef.href = record.href;
        vAppTemplateRef.name = record.name;
        vAppTemplateRef.type = record.type;
        vAppTemplates.push(vcdHost.getEntityByReference(VclEntityType.VAPP_TEMPLATE, vAppTemplateRef));
    }
    resultSet = resultSet.getNextPage();
}

return vAppTemplates;

And here are those of a VDC data (call the first action above).

if (vdc == null) throw "getVApptemplatesByNameFromVdc: vdc is null";

var vAppTemplates = System.getModule("com.vmware.pso.library.vcloud.qs").getVAppTemplatesByName(vdc.getHost(), name);

var vAppTemplatesInVdc = new Array();
for each (var vAppTemplate in vAppTemplates) {
    if (vAppTemplate.parent == vdc) vAppTemplatesInVdc.push(vAppTemplate);
}
return vAppTemplatesInVdc;

You could change the other to verify the VDC name instead of the VDC object.

if (vAppTemplate.parent.name == vdcName)

Christophe.

Tags: VMware

Similar Questions

  • Filter the table display of the query object (it can a bug in jdev 12)

    Hello:

    I found an error/bug possible in jdeveloper 12 c when I migrate my application of jdev 11g.

    To test this issue, I did the same test request in jdeveloper 11g and jdeveloper 12 c (to avoid to migrate the process).

    Project template

    -Create a display of the query object. Code:

    SELECT 1 CODE, 100 DESCRIPTION
      FROM DUAL
    UNION ALL
    SELECT 2 CODE, 200 DESCRIPTION
      FROM DUAL
    

    -Create a Module of the Application, and then drag this point of view in.

    ViewController project

    -Create a page and drag in the criteria named 'All searchable attributes' of the previous ViewObject as "ADF table filtered.

    -Run the application

    Results:

    On jdeveloper 11g, however it makes the filter above the table box in jdev not 12 c.

    Is this a bug or I need to select something in jdev12c to get the same functionality?

    Yes, known bug 17279781.  It is currently scheduled for a 12.1.4 fix.  If this issue is crucial to you, please file an SR, mentioning the bug number and indicate your reasons for wanting a fix as soon as possible.

    Note there is a solution:

    To work around the problem, you can configure the filter yourself by adding an af:inputText

    facet filter columns and bind the inputText property value to the EL

    #{vs.filterCriteria. }. The page to rerun the filter for

    the column look and work.

    CM.

  • Cannot exit not request CFC, even if it is a query object

    I try a query from a CFC for output, but I keep getting a "complex object types cannot be converted to simple values.".

    Here is the code:

    promoManager.cfc

    < cfproperty displayname = "promoManager" >

    < cffunction name = "init" returntype = "promoManager" index = "Initialize the controller" >
    < name cfargument = "dsn" type = "string" required = "yes" >
    < cfset variables.dsn = arguments.dsn >
    < cfreturn this >
    < / cffunction >

    < cffunction name = returntype "getPromotions" = "query" >
    < cfset var qGetPromotions = "" > "".
    < name cfquery = "qGetPromotions" datasource = "#variables.dsn #" >
    SELECT promoID, promoName, code promo, promoDesc, promoFromDt, promoToDt, introDiscount, proDiscount, execDiscount, premDiscount
    PROMOTIONS
    ORDER BY promoName
    < / cfquery >
    < cfreturn qGetPromotions >
    < / cffunction >

    < / cfproperty >

    test.cfm

    < cfset promoManager = createObject("component","cfcs.promoManager").init (attributes.dsn) >

    #IsQuery (promoManager.getPromotions ()) < cfoutput > # < / cfoutput > < /p > <-this outputs YES

    < cfset getPromotions = promoManager.getPromotions () >

    < p > < cfdump var = "#getPromotions #" > < / p > <-it export a query object

    < cfoutput query = "#getPromotions #" > here < br / > < / cfoutput > <-WHAT AN ERROR!

    TIA

    It works if you omit the sharps in the query attribute value ( )?

  • Problem with a query object back to a Java class ColdFusion

    Hello!
    I need to return a ColdFusion query object from a Java class using a set of JDBC (java.sql.ResultSet) results;

    I tried to move my result defined JDBC the constructor of the class coldfusion.sql.QueryTable with this code:


    ColdFusion code

    < cfset pra = createObject("java","QueryUtil").init () >
    < cfset newQuery = CreateObject ("java", "coldfusion.sql.QueryTable") >
    < cfset newQuery.init (pra.getColdFusionQuery ()) >

    My java class executes a DB query and returns a QueryTable

    Code Java (QueryUtil.java)

    Import coldfusion.sql.QueryTable; (For the QueryTable class CFusion.jar)
    import com.allaire.cfx //(cfx.jar for class Query used from QueryTable)
    public class QueryUtil
    {
    public static coldfusion.sql.QueryTable getColdFusionQuery (rs java.sql.ResultSet)
    {
    return new coldfusion.sql.QueryTable (SR);
    }
    }

    but when I run the cfm page and coldfusion server tries to run: '< cfset pra createObject("java","QueryUtil").init () = >' this error:

    Object instantiation Exception.
    An exception occurred when instantiating a java object. The cause of this exception was that: coldfusion/sql/QueryTable.

    If I try to run QueryUtil.java with eclipse it all works.

    Also, I tried to return a java.sql.ResultSet directly to coldfusion.sql.QueryTable.init () with failure.

    Do you know another solution?

    Thank you cf_dev2

    This is the solution:

    If you are using another jar file in your java.class, you must write the path of the jar in the jvm classpath:

    -Open C:\CFusionMX7\runtime\bin\jvm.config with a text editor;
    -Add at the bottom of the path full fo your jar files
    -Save
    -coldfusion restar

    I thing you can also add the classpath in coldfusion administrator, but I do not know how;

    I found only CF classpath.

    Hi all.

  • Calculation of the number of rows in the query object

    Hi all
    I have a question:

    Is there a way to get the number of rows in a query object without running it twice?
    I need this for a calculation of total pages.
    I can't do something like:
    "SELECT COUNT (e) FROM employee e"
    because I have a WHERE clause in my expression.

    Thank you

    I don't think I've had this a simple that you would like to, but I was able to reuse the same query named to account real pagination queries request.

    I defined a named query:

            @NamedQuery(name = "Employee.findByNames", query = "select e from Employee e WHERE e.firstName LIKE :FNAME AND e.lastName LIKE :LNAME AND e.gender = :GENDER ORDER BY e.lastName, e.firstName")
    

    Now in the app, I can create an instance of the query for this named query and fill in the parameters using the:

            Query query = em.createNamedQuery("Employee.findByNames");
            query.setParameter("FNAME", "%");
            query.setParameter("LNAME", "%");
            query.setParameter("GENDER", "M");
    

    If I run this query I get all the lines, but instead, I'd like to create an account using the underlying native API query

            ReadAllQuery raq = JpaHelper.getReadAllQuery(query);
            ReportQuery reportQuery = new ReportQuery(raq.getReferenceClass(), new ExpressionBuilder());
            reportQuery.setSelectionCriteria(raq.getSelectionCriteria());
            reportQuery.setOrderByExpressions(raq.getOrderByExpressions());
            reportQuery.setShouldReturnSingleValue(true);
            reportQuery.addCount();
            Query countQuery = JpaHelper.createQuery(reportQuery, em);
    
            countQuery.setParameter("FNAME", "%");
            countQuery.setParameter("LNAME", "%");
            countQuery.setParameter("GENDER", "M");
    
            int count = ((Number)countQuery.getSingleResult()).intValue();
    

    Then, for each page of entities wanted the original query is executed as:

            query.setFirstResult(0);
            query.setMaxResults(5);
            List emps = query.getResultList();
    

    Doug

  • Query VDC of vCO

    I enclose the package that I try to run.  I have an action that finds an OrgvDC based on a string and returns an array of type vCloud:vdc.  I'm calling this action in the workflow and try to write the name and the status of the OrgvDC, but it does not work.  The error is "TypeError: cannot read property 'name' of null (Workflow: CheckGetVDCByName / check VDC (item2) #2).  From what I am writing to System.log there is at least 1 item returned by the action.  I just can't understand what is happening with the workflow script and why he does not see the OrgVDC as an object valid.  Any suggestions?

    Thank you

    Try to use the following code inside your action (just delete your current content and replace it with this):

    var queryService = vcdHost.getQueryService();
    var expression = new VclExpression(VclQueryOrgVdcField.NAME, name, VclExpressionType.EQUALS);
    var filter = new VclFilter(expression);
    var params = new VclQueryParams();
    params.setFilter(filter);
    
    var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINORGVDC, params);
    
    var vdcs = new Array();
    
    while (resultSet != null)  {
        var records = resultSet.getRecords(new VclQueryResultAdminVdcRecord());
        System.log(records.length + " records found");
        for each (record in records) {
            var vdcRef = new VclReference();
            vdcRef.href = record.href;
            vdcRef.name = record.name;
            vdcRef.type = record.type;
            var adminVdc = vcdHost.getEntityByReference(VclFinderType.ADMIN_VDC, vdcRef);
            var vdc = adminVdc.toUserObject();
            //System.log("VDC: "+vdc);
            //System.log("Name: "+record.name+" Type: "+record.type+" HREF: "+record.href);
            vdcs.push(vdc);
        }
        resultSet = resultSet.getNextPage();
    }
    return vdcs;
    

    Since you use the types of query/registration of objects 'ADMIN', I guess you have your plugin connected to vCD with a level SYSTEM account, this is how this code has been tested...

    The entity and the resulting records are objects of Directors, so note the line "var Vcc = adminVdc.toUserObject (); -I convert the object resulting from the adminVdc into a regular vCloud:Vdc object, then push the variable "vdc" in the table.

  • Mapping and querying objects for Contact with REST Api

    Hi all

    We are hoping to get some details on the DataCard management defined via REST API. Our implementation goal is to create Contacts and add the custom for each Contact object or to be more precise, add a set of map data for each Contact.

    At the present time, to associate a map Data Set (or custom object) to an existing contact, we provide a suite of fields in the custom when creating custom object object:

    new CustomObjectField  
    {
                                                                    name = "MappedEntityType",
                                                                    dataType = Enum.GetName(typeof(DataType), DataType.numeric),
                                                                    type = "CustomObjectField",
                                                                    defaultValue = "0"
                                                                },
                                                             new CustomObjectField
                                                                {
                                                                    name = "MappedEntityID",
                                                                    dataType = Enum.GetName(typeof(DataType), DataType.numeric),
                                                                    type = "CustomObjectField",
                                                                    defaultValue = "<ContactId>"
                                                                }
    
    

    This is the right approach? This is based on the information provided here: http://topliners.eloqua.com/community/code_it/blog/2012/05/31/eloqua-api-how-to-mapping-a-data-card-to-an-entity.

    The REST API would query the CustomObjects using the MappedEntityId value for the subsequent updates? If so, pointers on how to approach that?

    Thanks to ad.

    The REST API does not support this.  With the upcoming release of Eloqua, you will be able to update the MappedEntityID, as a query it.

  • vCO vCloud plugin TypeError: cannot find the function

    Hi, I just installed plugin vCloud for the vCO v1.5 and I can browse the inventory of the vCloud successfully in the vCO. However, when I try to start any workflow vCloud, it will fail with an error that the function cannot be found. For example, when I run the workflow "Power we a paralytic", it will fail with the error "TypeError: poweron function could not be found. VCloud packages appear to be installed correctly, but the workflow is not related to them.

    I use vCO device, and I don't know if this is a bug. From what I've read on the Internet, a vCloud plugin installation should be very direct and I don't understand what the problem with my installation. Any advice?

    If I remember well using domain not valid is not accepted. That's certainly why you get the incorrect URL.

    Christophe.

  • Database query object | audit

    Hi guys,.

    I would like to know how interrogate what machine changed a databae object, for example:

    User
    Computer1

    Object_name
    Object1

    Object_type
    procedure

    last_ddl_time
    2010-02-11 14:11:59


    some like this, questioning or USER_OBJECTS only gives me information, but I want to be more specific for audit and trace the change to my patterns

    IvanBalVe wrote:
    That's right, but the DDL change before you enable auditing, it is possible to query?

    You can always ask, but if the details are not available.

    If you are desperate to find out who did it, you can use the DBMS LOGMNR

  • Support - dates in the query object browser!

    Hi all,

    I need help on something simple...

    How can I create a query for the dates in the Explorer objects, Oracle 10g XE?

    I tried: > 1 January 2010 > "January 1, 2010", > 1 January 2010 ", <>January 1, 2010 +... all sorts of diversions and nothing."

    I always have error report:
    ORA-01858: a non-digit character was found here where was waiting for a digital

    I want to just filter a few dates...

    Thank you

    With dates, its generally better to be precise with the date format and does depend not on 'default' well (for American English) January 1, 2011" must have worked, maybe not.

    Are you trying to filter for a specific date, or a beach, that is... where... = or perhaps where between and ...?

    When looking for a date, it may be useful to ignore the component "time" a date with the tronque() function field:

    select ... where trunc( ) = to_date( '01-01-2011','yyyy-mm-dd') ...
    

    Note the to_date with the format mask, which will prevent trouble with assumptions about default date formats (which can also change with the locale... i.e. UK-English customer default date format is "yyyy-mm-dd")

  • Display for a query objects creating complex

    Hi all

    I am trying to create a VO of inner query, but I can't understand what kind of binding variable to select.

    PFB the scenario:
    I have 2 tables, say orders, products
    I'm supposed to run the following query:
    Select * from orders o, p where o.order_id = 123 and p.product_id in (111,222,333...)

    In the original Version when I'm trying to create, I need to create 2 bind variable
    1 for the command id and one for the product id
    the problem I am facing with is to select the type of the variable binding
    I select "Integer" type for the variable binding command id, but I am able to understand what must be the type of liaison for the product id variable.
    I tried to use the 'Picture' type, but in the query, it is "=: bindvariable ' operator instead of ' in (: bindvariable).

    In addition, please note that the number of product_id is not fixed and is dynamic.

    So my question is:
    What should be the type of binding variable that should be used (by product_id case)?
    In addition, please advice if it's how even to apply the criteria in the AMImpl class.

    Thanks in advance.

    Thank you
    Varun

    Varun,
    It won't work because you cannot use bind variables in the queries IN sql.
    Jobinesh has bloged a solution
    http://jobinesh.blogspot.com/2010/12/using-oraclejbodomainarray-with.html and http://jobinesh.blogspot.com/2011/07/tips-on-using-oraclejbodomainarray-as.html
    or my 'trick' explained here http://tompeez.wordpress.com/2011/08/21/extending-viewcriteria-to-use-sql-contains-4/ could help solve this problem.

    Timo

  • VAPP vCloud query by name of vCO

    Hello

    I have been using the following analysis as a reference to query an object of VAPP vCloud vCO using a string name.

    http://communities.VMware.com/thread/391401

    My code looks like:

    queryService var = vcloudServer.getQueryService)
    var expression = new VclExpression (VclQueryVAppField.NAME, vAppName, VclExpressionType.EQUALS);
    filter var = new VclFilter (expression);
    var params = new VclQueryParams();
    params.setFilter (filter);
    var PPPV = new Array();
    resultSet var = queryService.queryRecords (VclQueryRecordType.VAPP, params);
    While (resultSet! = null) {}
    var record = resultSet.getRecords (new VclQueryResultVAppRecord());
    System.log (records.length + "records found");
    for each {(var record in documents)
    If (record.vdc is {vdc.getReference () .href)}
    var vAppRef = new VclReference();
    vAppRef.href = record.href;
    vAppRef.name = record.name;
    vAppRef.type = record.type;
    vAppRef.push (vdc.getHost () .getEntityByReference (VclEntityType.VAPP, vAppRef));
    }
    }
    resultSet = resultSet.getNextPage ();
    }
    System.log (vApp (s) found: "+ vApp.length" ' ")

    Where vcloudServer is the type vCloud:Host and vAppName is the name of vApp I'm looking for (string type).

    The workflow is running, but it never finds anything.

    No idea what is the problem here?

    (vCO 5.1, vCloud Director 5.1)

    Thank you

    Juan.

    Try:

    var vcloudServer = vdc.getHost();
    var queryService = vcloudServer.getQueryService()
    var expression = new VclExpression(VclQueryVAppField.NAME, vAppName, VclExpressionType.EQUALS);
    var filter = new VclFilter(expression);
    var params = new VclQueryParams();
    params.setFilter(filter);
    var vApps = new Array();
    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) {
            if (record.vdc == vdc.getReference().href) {
                var vAppRef = new VclReference();
                vAppRef.href = record.href;
                vAppRef.name = record.name;
                vAppRef.type = record.type;
                vApps.push(vdc.getHost().getEntityByReference(VclFinderType.VAPP, vAppRef));
                }
            }
        resultSet = resultSet.getNextPage();
    }
    System.log("vApp(s) found:"+vApps.length);
    
  • Identify a vCenter for VIM vCloud object instanceUuid

    Hello, I am trying to understand the best way to get the UUID vCenter for VIM vCloud object (in my case a resource pool, for which I have the MoRef) to identify the corresponding object of vCenter.   I want to use a given resource pool reference (Playback a pvDC) to find the purpose of grouping of real resources in vCenter, many vCenters recorded vCO/VCD since the MoRef is not unique between vCenters.  There is an article by William Lam (http://blogs.vmware.com/vsphere/2012/02/uniquely-identifying-virtual-machines-in-vsphere-and-vcloud-part-1-overview.html) that describes the relationships, but an example to solve this with vCO would be appreciated.

    The following should return the UUID of your vCenter Server Server assuming the input object is a vCloud:ProviderVdc object named 'providerVdc '.

    var vcdHost = providerVdc.getHost();
    var pool = providerVdc.toAdminExtensionObject().getResourcePools()[0]; // get the first resource pool (VclVMWProviderVdcResourcePool)
    var vimObjectRef = pool.resourcePoolVimObjectRef;
    var vimServer = vcdHost.getEntityByReference(VclFinderType.VIM_SERVER,vimObjectRef.vimServerRef);
    System.log("VimServer uuid: "+vimServer.uuid);
    
  • The View object: count (*) in the custom query

    Hello

    I want to create a display with custom query object containing the count (*):

    select in_owner,in_processing_status,count(*) from inquiries group by in_owner,in_processing_status;
    

    I need this to create a numerical value for the axis y in the bar chart.

    I get an error message:

    "Either this is not a valid name or an object with that name already exists."
    

    Is there no workaround available, how do I get this to work, or I have to do with a data source by programming?

    Studio Edition Version 12.1.3.0.0

    Thank you and best regards,

    Daniel

    I solved the problem by adding alias for count (*):

    SELECT count from in_owner, in_processing_status, count (*) Group of inquiries by in_owner, in_processing_status;

    Thank you all for the support!

    BR,

    Daniel

  • What will happen to the SQL Query based object View (EmployeesVO)

    Schema used: HR

    1. I created a view through SQL Query view object object (Table Employees - EmployeesVO).
    2. Creates an entity of the Employees (EmployeesEO) table object.
    3. In the section EmployeesVO (View object) entity objects, I chose EmployeesEO (entity object).

    What will happen to the View SQL Query object based on (EmployeesVO) will it change to VO based on entities or still to be based query VO.

    It is there because you can still base your query based Vo EO according to Vo.

    After that you base your VO on EO you can now use 'Add the attribute of the entity' to base your attribute on the atrributes of EO. Or if you skilled enough you can manually change the XML to VO

Maybe you are looking for