GetQueryRuns

Article:HOWTO76896  |  Created: 2012-05-07  |  Updated: 2012-05-08  |  Article URL http://www.symantec.com/docs/HOWTO76896
Article Type
How To


Subject


Name

GetQueryRuns — Gathers data for all query runs of the given query.

Syntax

.NET syntax:

QueryRun[] GetQueryRuns(Query query);

Service URLs

Use the following URLs to access the IQueriesService:

  • http://<localhost>/CCS/Services/Applications/Queries/IQueriesService/WS/WindowsSecurity

  • https://<localhost>:<portnumber>/CCS/Services/Applications/Queries/IQueriesService/WS/WindowsSecurity

  • https://<localhost>:<portnumber>/CCS/Services/Applications/Queries/IQueriesService/WS/UsernameSecurity

  • https://<localhost>:<portnumber>/CCS/Services/Applications/Queries/IQueriesService/Basic/UsernameSecurity

Authorization Requirements

You must have the following CCS tasks to use the API:

  • View Queries

  • View All Jobs

You must have the permissions on the following folder to use the API:

  • Queries folder

Input parameters

The GetQueryRuns API requires the Query data contract as an input.

The following table describes the fields in the Query data contract that the API requires:

Table: IQueriesService- GetQueryRuns- input parameters

Field name

Field type

Data type

Description

name

Optional

String

The query name used for search.

QueryID

Mandatory

Guid

The unique identifier of query.

platform

Optional

String

The platform of query.

dataSource

Optional

String

The data source of query.

containerPath

Optional

String

The path of the container used for search.

searchSubtree

Optional

Boolean

The search criteria which is either current level or subtree.

Return value

The GetQueryRuns API returns a QueryRun object which contains the following query attributes in array form:

Table: QueryRun Object

Field name

Data type

Description

StartDate

DateTime

The date when the query started.

EndDate

DateTime

The date when the query completed.

RunDuration

String

The duration of query run.

RunStatus

String

The status of query run.

ResultReceived

long

The number of records received.

ErrorCount

long

The number of errors received.

RunID

Guid

The unique identifier of query run.

SOAP faults

All the error results are returned to the calling application as SOAP faults:

Table: IQueriesService - GetQueryRuns - SOAP faults

Event

Description

InvalidArgumentError

You may be overriding the limitations of certain input parameters.

Sample: C#

// GetQueryRuns
            QueriesServiceClient client = new QueriesServiceClient();
            client.ClientCredentials.UserName.UserName = "e2edom\\administrator";
            client.ClientCredentials.UserName.Password = "password@123";
            System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);

            try
            {
                // Search for sepcific query.
                string queryName = "Query1";
                string platform = "Windows";
                Query[] queries = client.SearchQuery(queryName, platform, null, null, true);
                // Get query runs.
                QueryRun[] queryRun = client.GetQueryRuns(queries[0]);
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.Message);
            }

Sample: Java client

try
        {
            // Call Web Service Operation
            QueriesService service = new QueriesService();
            IQueriesService port = service.getBasicHttpBindingIQueriesService();
            // TODO initialize WS operation arguments here
            Query query = new Query();
            query.setQueryID("ae1ac02a-b795-413c-aa30-2b9dc76b0cc7");
            // TODO process result here
            ArrayOfQueryRun result = port.getQueryRuns(query);
            System.out.println("Result = "+result);
        }
        catch (Exception exception)
        {
            System.out.println(exception.getMessage());
        }
   

Related links

See About IQueriesService.


Legacy ID



v71889722_v74603629


Article URL http://www.symantec.com/docs/HOWTO76896


Terms of use for this information are found in Legal Notices