Tivoli Header

Tivoli Storage Manager Using the Application Program Interface


Querying the TSM System

The API has several queries, such as management class query, that applications can use. All queries that use dsmBeginQuery follow the same steps that are described below:

  1. Send the dsmBeginQuery call with the appropriate query type:

    The dsmBeginQuery call informs the API in what format the data is returning from the server. The appropriate fields can be placed in the data structures that are passed by the dsmGetNextQObj calls. The begin query call also permits the application client to set the scope of the query by properly specifying the parameters on the begin query call.

    Note:
    On the UNIX platform, only the root user can query active backed-up objects (also known as fast path).
  2. Enter the dsmGetNextQObj call to obtain each record from the query. This call passes a buffer that is large enough to hold the data that is returned from the query. Each query type has a corresponding data structure for the data returned. For example, a backup query type has an associated qryRespBackupData structure that is filled in when the dsmGetNextQObj call is sent.
  3. Check the return code. The dsmGetNextQObj call usually returns one of the following codes. You also might receive an error code:
  4. Send the dsmEndQuery call. When all query data is retrieved or additional query data is not needed, enter the dsmEndQuery call to end the query process. This causes the API to flush any remaining data from the query stream and release any resources that were used for the query.

Figure 9 displays the state diagram for performing query operations.

Figure 9. State Diagram for General Queries

REQTEXT

Figure 10 displays the flowchart for performing query operations.

Figure 10. Flowchart for General Queries

REQTEXT


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]