Querying the IBM® Storage Protect system

The API has several queries, such as management class query, that applications can use.

Procedure

All queries that use the dsmBeginQuery call follow these steps:

  1. Send the dsmBeginQuery call with the appropriate query type:
    • Backup
    • Archive
    • Active backed-up objects
    • File space
    • Management class
    The dsmBeginQuery call informs the API of the data format that is returned 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.
    Restriction: On UNIX or Linux® systems, only the root user can query active backed-up objects. This query type is 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 populated when the dsmGetNextQObj call is sent.
  3. The dsmGetNextQObj call usually returns one of the following codes:
    • DSM_RC_MORE_DATA: Send the dsmGetNextQObj call again.
    • DSM_RC_FINISHED: There is no more data. Send the dsmEndQuery call.
  4. Send the dsmEndQuery call. When all query data are retrieved or more query data are not needed, enter the dsmEndQuery call to end the query process. The API flushes any remaining data from the query stream and releases any resources that were used for the query.

Results

Figure 1 displays the state diagram for query operations.
Figure 1. State diagram for general queries
State diagram for query operations
Figure 2 displays the flowchart for query operations.
Figure 2. Flowchart for general queries
Flowchart for query operations