com.vmware.vcloud.sdk
Class QueryService

java.lang.Object
  extended by com.vmware.vcloud.sdk.QueryService
Direct Known Subclasses:
AdminQueryService

public class QueryService
extends Object

This class provides methods to build and run user specific generalized, specialized queries. 1. Generalized query - The query type (mandatory) should be specified along with the query params(if any). 2. Specialized query - These already contain the query type. The query params (if any) - specified.

Since:
API 1.5, SDK 1.5
Author:
Ecosystem Engineering.

Method Summary
 String buildQuery(FormatType formatType)
          Method which builds the query based on the format type.
 String buildQuery(QueryParams<? extends QueryField> queryParams)
          Method which builds the actual query from the query params.
 String buildQuery(String queryTypeValue)
          Method which builds the query from the query type.
<T extends Result>
T
executeQuery(String query)
          Method which executes the given query.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogIdRecords()
          Executes a specialized query for retrieving the list of catalog records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogIdRecords(QueryParams<QueryCatalogField> queryParams)
          Executes a specialized query for retrieving the list of catalogs records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogRecords()
          Executes a specialized query for retrieving the list of catalog records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogRecords(QueryParams<QueryCatalogField> queryParams)
          Executes a specialized query for retrieving the list of catalogs records.
 ReferenceResult queryCatalogReferences()
          Executes a specialized query for retrieving the list of catalog references.
 ReferenceResult queryCatalogReferences(QueryParams<QueryCatalogField> queryParams)
          Executes a specialized query for retrieving the list of catalogs references.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskIdRecords()
          Executes a specialized query for retrieving the list of Disk records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskIdRecords(QueryParams<QueryDiskField> queryParams)
          Executes a specialized query for retrieving the list of disk records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskRecords()
          Executes a specialized query for retrieving the list of Disk records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskRecords(QueryParams<QueryDiskField> queryParams)
          Executes a specialized query for retrieving the list of Disk records.
 ReferenceResult queryDiskReferences()
          Executes a specialized query for retrieving the list of Disk references.
 ReferenceResult queryDiskReferences(QueryParams<QueryDiskField> queryParams)
          Executes a specialized query for retrieving the list of disk references.
 RecordResult queryIdRecords(QueryRecordType queryRecordType)
          Executes the generalized query based on the query type.
 RecordResult queryIdRecords(QueryRecordType queryRecordType, QueryParams<? extends QueryField> queryParams)
          Executes the generalized query based on the query type and query params.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaIdRecords()
          Executes a specialized query for retrieving the list of media records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaIdRecords(QueryParams<QueryMediaField> queryParams)
          Executes a specialized query for retrieving the list of media records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaRecords()
          Executes a specialized query for retrieving the list of media records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaRecords(QueryParams<QueryMediaField> queryParams)
          Executes a specialized query for retrieving the list of media records.
 ReferenceResult queryMediaReferences()
          Executes a specialized query for retrieving the list of media references.
 ReferenceResult queryMediaReferences(QueryParams<QueryMediaField> queryParams)
          Executes a specialized query for retrieving the list of media references
 RecordResult queryRecords(QueryRecordType queryRecordType)
          Executes the generalized query based on the query type.
 RecordResult queryRecords(QueryRecordType queryRecordType, QueryParams<? extends QueryField> queryParams)
          Executes the generalized query based on the query type and query params.
 ReferenceResult queryReferences(QueryReferenceType queryReferenceType)
          Executes the generalized query based on the query type.
 ReferenceResult queryReferences(QueryReferenceType queryReferenceType, QueryParams<? extends QueryField> queryParams)
          Executes the generalized query based on the query type and query params.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppIdRecords()
          Executes a specialized query for retrieving the list of vApps records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppIdRecords(QueryParams<QueryVAppField> queryParams)
          Executes a specialized query for retrieving the list of vApps records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppRecords()
          Executes a specialized query for retrieving the list of vApps records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppRecords(QueryParams<QueryVAppField> queryParams)
          Executes a specialized query for retrieving the list of vApps records.
 ReferenceResult queryvAppReferences()
          Executes a specialized query for retrieving the list of vApp references.
 ReferenceResult queryvAppReferences(QueryParams<QueryVAppField> queryParams)
          Executes a specialized query for retrieving the list of vApps references.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateIdRecords()
          Executes a specialized query for retrieving the list of vAppTemplate records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateIdRecords(QueryParams<QueryVAppTemplateField> queryParams)
          Executes a specialized query for retrieving the list of vAppTemplate records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateRecords()
          Executes a specialized query for retrieving the list of vAppTemplate records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateRecords(QueryParams<QueryVAppTemplateField> queryParams)
          Executes a specialized query for retrieving the list of vAppTemplate records.
 ReferenceResult queryvAppTemplateReferences()
          Executes a specialized query for retrieving the list of vAppTemplates references
 ReferenceResult queryvAppTemplateReferences(QueryParams<QueryVAppTemplateField> queryParams)
          Executes a specialized query for retrieving the list of vAppTemplate references.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmIdRecords()
          Executes a specialized query for retrieving the list of vm records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmIdRecords(QueryParams<QueryVMField> queryParams)
          Executes a specialized query for retrieving the list of vm records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmRecords()
          Executes a specialized query for retrieving the list of vm records.
 RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmRecords(QueryParams<QueryVMField> queryParams)
          Executes a specialized query for retrieving the list of vm records.
 ReferenceResult queryVmReferences()
          Executes a specialized query for retrieving the list of vm references.
 ReferenceResult queryVmReferences(QueryParams<QueryVMField> queryParams)
          Executes a specialized query for retrieving the list of vm references.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildQuery

public String buildQuery(FormatType formatType)
Method which builds the query based on the format type.

Parameters:
formatType - FormatType
Returns:
String

buildQuery

public String buildQuery(String queryTypeValue)
                  throws VCloudException
Method which builds the query from the query type.

Parameters:
queryTypeValue - String
Returns:
String
Throws:
VCloudException

buildQuery

public String buildQuery(QueryParams<? extends QueryField> queryParams)
                  throws VCloudException
Method which builds the actual query from the query params.

Parameters:
queryParams - QueryParams< ? extends QueryField>
Returns:
String
Throws:
VCloudException

executeQuery

public <T extends Result> T executeQuery(String query)
                              throws VCloudException
Method which executes the given query.

Parameters:
query - String
Returns:
Result - ReferenceResult or RecordResult
Throws:
VCloudException

queryReferences

public ReferenceResult queryReferences(QueryReferenceType queryReferenceType,
                                       QueryParams<? extends QueryField> queryParams)
                                throws VCloudException
Executes the generalized query based on the query type and query params. This query returns the reference result.

Parameters:
queryReferenceType - QueryReferenceType
queryParams - QueryParams< ? extends QueryField>
Returns:
ReferenceResult
Throws:
VCloudException

queryRecords

public RecordResult queryRecords(QueryRecordType queryRecordType,
                                 QueryParams<? extends QueryField> queryParams)
                          throws VCloudException
Executes the generalized query based on the query type and query params. This query returns the record result.

Parameters:
queryRecordType - QueryRecordType
queryParams - QueryParams< ? extends QueryField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultRecordType

queryIdRecords

public RecordResult queryIdRecords(QueryRecordType queryRecordType,
                                   QueryParams<? extends QueryField> queryParams)
                            throws VCloudException
Executes the generalized query based on the query type and query params. This query returns the record result.

Parameters:
queryRecordType - QueryRecordType
queryParams - QueryParams< ? extends QueryField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultRecordType

queryReferences

public ReferenceResult queryReferences(QueryReferenceType queryReferenceType)
                                throws VCloudException
Executes the generalized query based on the query type. This query returns the reference result.

Parameters:
queryReferenceType - QueryReferenceType
Returns:
ReferenceResult
Throws:
VCloudException

queryRecords

public RecordResult queryRecords(QueryRecordType queryRecordType)
                          throws VCloudException
Executes the generalized query based on the query type. This query returns the record result.

Parameters:
queryRecordType - QueryRecordType
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultRecordType

queryIdRecords

public RecordResult queryIdRecords(QueryRecordType queryRecordType)
                            throws VCloudException
Executes the generalized query based on the query type. This query returns the record result.

Parameters:
queryRecordType - QueryRecordType
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultRecordType

queryCatalogReferences

public ReferenceResult queryCatalogReferences()
                                       throws VCloudException
Executes a specialized query for retrieving the list of catalog references.

Returns:
ReferenceResult
Throws:
VCloudException

queryCatalogRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogRecords()
                                                                                                 throws VCloudException
Executes a specialized query for retrieving the list of catalog records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultCatalogRecordType

queryCatalogIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogIdRecords()
                                                                                                   throws VCloudException
Executes a specialized query for retrieving the list of catalog records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultCatalogRecordType

queryCatalogRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogRecords(QueryParams<QueryCatalogField> queryParams)
                                                                                                 throws VCloudException
Executes a specialized query for retrieving the list of catalogs records.

Parameters:
queryParams - QueryParams<QueryCatalogField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultCatalogRecordType, QueryCatalogField

queryCatalogIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultCatalogRecordType> queryCatalogIdRecords(QueryParams<QueryCatalogField> queryParams)
                                                                                                   throws VCloudException
Executes a specialized query for retrieving the list of catalogs records.

Parameters:
queryParams - QueryParams<QueryCatalogField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultCatalogRecordType, QueryCatalogField

queryCatalogReferences

public ReferenceResult queryCatalogReferences(QueryParams<QueryCatalogField> queryParams)
                                       throws VCloudException
Executes a specialized query for retrieving the list of catalogs references.

Parameters:
queryParams - QueryParams<QueryCatalogField>
Returns:
ReferenceResult
Throws:
VCloudException

queryvAppReferences

public ReferenceResult queryvAppReferences()
                                    throws VCloudException
Executes a specialized query for retrieving the list of vApp references.

Returns:
ReferenceResult
Throws:
VCloudException

queryvAppRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppRecords()
                                                                                           throws VCloudException
Executes a specialized query for retrieving the list of vApps records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppRecordType

queryvAppIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppIdRecords()
                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of vApps records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppRecordType

queryvAppRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppRecords(QueryParams<QueryVAppField> queryParams)
                                                                                           throws VCloudException
Executes a specialized query for retrieving the list of vApps records.

Parameters:
queryParams - QueryParams
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppRecordType, QueryVAppField

queryvAppIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppRecordType> queryvAppIdRecords(QueryParams<QueryVAppField> queryParams)
                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of vApps records.

Parameters:
queryParams - QueryParams
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppRecordType, QueryVAppField

queryvAppReferences

public ReferenceResult queryvAppReferences(QueryParams<QueryVAppField> queryParams)
                                    throws VCloudException
Executes a specialized query for retrieving the list of vApps references.

Parameters:
queryParams - QueryParams<QueryVAppField>
Returns:
ReferenceResult
Throws:
VCloudException

queryVmReferences

public ReferenceResult queryVmReferences()
                                  throws VCloudException
Executes a specialized query for retrieving the list of vm references.

Returns:
ReferenceResult
Throws:
VCloudException

queryVmRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmRecords(QueryParams<QueryVMField> queryParams)
                                                                                       throws VCloudException
Executes a specialized query for retrieving the list of vm records.

Parameters:
queryParams - QueryParams<QueryVMField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVMRecordType, QueryVMField

queryVmIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmIdRecords(QueryParams<QueryVMField> queryParams)
                                                                                         throws VCloudException
Executes a specialized query for retrieving the list of vm records.

Parameters:
queryParams - QueryParams<QueryVMField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVMRecordType, QueryVMField

queryVmRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmRecords()
                                                                                       throws VCloudException
Executes a specialized query for retrieving the list of vm records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVMRecordType

queryVmIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVMRecordType> queryVmIdRecords()
                                                                                         throws VCloudException
Executes a specialized query for retrieving the list of vm records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVMRecordType

queryVmReferences

public ReferenceResult queryVmReferences(QueryParams<QueryVMField> queryParams)
                                  throws VCloudException
Executes a specialized query for retrieving the list of vm references.

Parameters:
queryParams - QueryParams<QueryVMField>
Returns:
ReferenceResult
Throws:
VCloudException

queryvAppTemplateReferences

public ReferenceResult queryvAppTemplateReferences()
                                            throws VCloudException
Executes a specialized query for retrieving the list of vAppTemplates references

Returns:
ReferenceResult
Throws:
VCloudException

queryvAppTemplateRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateRecords()
                                                                                                           throws VCloudException
Executes a specialized query for retrieving the list of vAppTemplate records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppTemplateRecordType

queryvAppTemplateIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateIdRecords()
                                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of vAppTemplate records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppTemplateRecordType

queryvAppTemplateRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateRecords(QueryParams<QueryVAppTemplateField> queryParams)
                                                                                                           throws VCloudException
Executes a specialized query for retrieving the list of vAppTemplate records.

Parameters:
queryParams - QueryParams<QueryVAppTemplateField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppTemplateRecordType, QueryVAppTemplateField

queryvAppTemplateIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultVAppTemplateRecordType> queryvAppTemplateIdRecords(QueryParams<QueryVAppTemplateField> queryParams)
                                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of vAppTemplate records.

Parameters:
queryParams - QueryParams<QueryVAppTemplateField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultVAppTemplateRecordType, QueryVAppTemplateField

queryvAppTemplateReferences

public ReferenceResult queryvAppTemplateReferences(QueryParams<QueryVAppTemplateField> queryParams)
                                            throws VCloudException
Executes a specialized query for retrieving the list of vAppTemplate references.

Parameters:
queryParams - QueryParams<QueryVAppTemplateField>
Returns:
ReferenceResult
Throws:
VCloudException

queryMediaReferences

public ReferenceResult queryMediaReferences()
                                     throws VCloudException
Executes a specialized query for retrieving the list of media references.

Returns:
ReferenceResult
Throws:
VCloudException

queryMediaRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaRecords()
                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of media records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultMediaRecordType

queryMediaIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaIdRecords()
                                                                                               throws VCloudException
Executes a specialized query for retrieving the list of media records.

Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultMediaRecordType

queryMediaRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaRecords(QueryParams<QueryMediaField> queryParams)
                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of media records.

Parameters:
queryParams - QueryParams<QueryMediaField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultMediaRecordType, QueryMediaField

queryMediaIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultMediaRecordType> queryMediaIdRecords(QueryParams<QueryMediaField> queryParams)
                                                                                               throws VCloudException
Executes a specialized query for retrieving the list of media records.

Parameters:
queryParams - QueryParams<QueryMediaField>
Returns:
RecordResult
Throws:
VCloudException
See Also:
QueryResultMediaRecordType, QueryMediaField

queryMediaReferences

public ReferenceResult queryMediaReferences(QueryParams<QueryMediaField> queryParams)
                                     throws VCloudException
Executes a specialized query for retrieving the list of media references

Parameters:
queryParams - QueryParams<QueryMediaField>
Returns:
ReferenceResult
Throws:
VCloudException

queryDiskReferences

public ReferenceResult queryDiskReferences()
                                    throws VCloudException
Executes a specialized query for retrieving the list of Disk references.

Returns:
ReferenceResult
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

queryDiskRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskRecords(QueryParams<QueryDiskField> queryParams)
                                                                                           throws VCloudException
Executes a specialized query for retrieving the list of Disk records.

Parameters:
queryParams - QueryParams<QueryDiskField>
Returns:
RecordResult
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
QueryResultDiskRecordType, QueryDiskField

queryDiskIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskIdRecords(QueryParams<QueryDiskField> queryParams)
                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of disk records.

Parameters:
queryParams - QueryParams<QueryDiskField>
Returns:
RecordResult
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
QueryResultDiskRecordType, QueryDiskField

queryDiskRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskRecords()
                                                                                           throws VCloudException
Executes a specialized query for retrieving the list of Disk records.

Returns:
RecordResult
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
QueryResultDiskRecordType

queryDiskIdRecords

public RecordResult<com.vmware.vcloud.api.rest.schema.QueryResultDiskRecordType> queryDiskIdRecords()
                                                                                             throws VCloudException
Executes a specialized query for retrieving the list of Disk records.

Returns:
RecordResult
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
QueryResultDiskRecordType

queryDiskReferences

public ReferenceResult queryDiskReferences(QueryParams<QueryDiskField> queryParams)
                                    throws VCloudException
Executes a specialized query for retrieving the list of disk references.

Parameters:
queryParams - QueryParams<QueryDiskField>
Returns:
ReferenceResult
Throws:
VCloudException
Since:
API 5.1, SDK 5.1


Copyright © 2016. All Rights Reserved.