Tivoli Header

Tivoli Storage Manager Using the Application Program Interface

Querying the TSM System

The X/Open API permits an application client to query a TSM server for information on the records stored there. You can define a set of criteria that the records on the server must meet in order to be returned by the query. All query operations must be done within the bounds of a transaction. See The Transaction Model.

A query operation consists of the following steps:

  1. Make the BSABeginTxn call to start a transaction.
  2. Define the parameters of your query.

    Use the data fields in the QueryDescriptor structure to specify the parameters of your query. Start by setting the copyType field to backup, archive, or any, depending on whether you want to query only backup copies, only archive versions, or both.

    For all queries, you can specify an object name in the objName field, or use wildcard characters to identify a group of objects. For backup queries, use the status field to specify only active or inactive copies, or both. For archive queries, specify the description in the description field and set the upper and lower boundaries of the create and expiration times in these fields: createTimeLB, createTimeUB, expireTimeLB, and expireTimeUB.

  3. Make the BSAQueryObject call.

    To start the query operation,make the BSAQueryObject call, passing in the QueryDescriptor structure. One of the following three codes is returned:

  4. Make the BSAGetNextQueryObject call.

    If more than one object satisfied the query parameters, then a BSAGetNextQueryObjectcall must be made to obtain each object after the first. The object descriptor for each object is added to the ObjectDescriptor structure.

    After each object is returned, check the return code. If the BSAGetNextQueryObject call returns the code BSA_RC_MORE_DATA, make the BSAGetNextQueryObject call again. If there is no more data, go to the next step.

  5. Make the BSAEndTxn call to end the transaction.

    When all query data has been retrieved or no further query data is needed, the BSAEndTxn call must be made to end the transaction and stop the query process. This causes the X/Open API to flush any remaining data from the query stream and release any resources utilized for the query.

Flowchart

Figure 22 displays the flowchart for performing query operations.

Figure 22. Flowchart for Query Operations

REQTEXT


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