dsmBeginQuery

The dsmBeginQuery function call starts a query request to the server for information about data, file spaces, and management classes.

Specifically, dsmBeginQuery can query:

  • Archived data
  • Backed-up data
  • Active backed-up data
  • File spaces
  • Management classes

The query data that is returned from the call is obtained by one or more calls to dsmGetNextQObj. When the query is complete, the dsmEndQuery call is sent.

Syntax

dsInt16_t dsmBeginQuery  (dsUint32_t        dsmHandle,
   dsmQueryType  queryType,
   dsmQueryBuff  *queryBuffer);

Parameters

dsUint32_t dsmHandle (I)

The handle that associates this call with a previous dsmInitEx call.

dsmQueryType queryType (I)

Identifies the type of query to run. Assign one of the following options:

qtArchive

Queries archived objects.

qtBackup

Queries backed-up objects.

qtBackupActive
Queries active, backed-up objects only for the entire file space name that you pass. This query is called a fast path and is an efficient way to query active objects from storage.
Prerequisite: You must be logged on as a root user on a UNIX or Linux® operating system.
qtFilespace

Queries registered file spaces.

qtMC

Queries defined management classes.

qtBackupGroups

Queries groups that are closed.

qtOpenGroups

Queries groups that are open.

qtProxyNodeAuth

Queries nodes to which this node can proxy.

qtProxyNodePeer

Queries peer nodes with the same target.

dsmQueryBuff *queryBuffer (I)

Identifies a pointer to a buffer that is mapped to a particular data structure. This structure is associated with the query type that you pass. These structures contain the selection criteria for each query type. Complete the fields in each structure to specify the scope of the query that you want to run. The stVersion field in each structure contains the structure version number.

The data structures and their related fields include the following items:
qryArchiveData
objName
The complete object name. You can use a wildcard character, such as an asterisk (*) or a question mark (?), in the high-level or low-level portion of the name. An asterisk matches zero or more characters, and a question mark matches one character. The objType field of objName can have one of the following values:
  • DSM_OBJ_FILE
  • DSM_OBJ_DIRECTORY
  • DSM_OBJ_ANY_TYPE

For more information about high-level and low-level names, see the following topic: High-level and low-level names.

owner

The owner name of the object.

insDateLowerBound

The lower boundary for the insert date that the object was archived. Set the year component to DATE_MINUS_INFINITE for an unbounded lower boundary.

insDateUpperBound

The upper boundary for the insert date that the object was archived. Set the year component to DATE_PLUS_INFINITE for an unbounded upper boundary.

expDateLowerBound

The lower boundary for the expiration date. Set the year component to DATE_MINUS_INFINITE for an unbounded lower boundary.

expDateUpperBound

The upper boundary for the expiration date. To match a management class RETVer setting of NOLIMIT, set the year component to DATE_PLUS_INFINITE.

descr

The archive description. Enter an asterisk (*) to search all descriptions.

qryBackupData
objName
The complete object name. You can use a wildcard character, such as an asterisk (*) or a question mark (?), in the high-level or low-level portion of the name. An asterisk matches zero or more characters, and a question mark matches one character. The objType field of objName can have one of the following values:
  • DSM_OBJ_FILE
  • DSM_OBJ_DIRECTORY
  • DSM_OBJ_ANY_TYPE

For more information about high-level and low-level names, see the following topic: High-level and low-level names.

owner

The owner name of the object.

objState
You can query for one of the following object states:
  • DSM_ACTIVE
  • DSM_INACTIVE
  • DSM_ANY_MATCH
pitDate
The point-in-time value. A query with this field returns the most recent object that is backed up before this date and time. The objState can be active or inactive. Objects that are deleted before the pitDate are not returned. For example:
   Mon - backup ABC(1), DEF, GHI
   Tue - backup ABC(2), delete DEF
   Thr - backup ABC(3)
On Friday, call the query with a point-in-time value of Wednesday at 12:00:00 a.m. The call returns the following information:
    ABC(2) - an Inactive copy
    GHI    - an Active copy
The call does not return DEF because that object as deleted prior to the point-in-time value.
qryABackupData
objName
The complete object name. You can use a wildcard character, such as an asterisk (*) or a question mark (?), in the high-level or low-level portion of the name. An asterisk matches zero or more characters, and a question mark matches one character. The objType field of objName can have one of the following values:
  • DSM_OBJ_FILE
  • DSM_OBJ_DIRECTORY
  • DSM_OBJ_ANY_TYPE

For more information about high-level and low-level names, see the following topic: High-level and low-level names.

qryFSData
fsName

Enter the name of a specific file space in this field, or enter an asterisk (*) to retrieve information about all registered file spaces.

qryMCData
mcName
Enter the name of a specific management class, or enter an empty string ( ) to retrieve information about all management classes.
Note: You cannot use an asterisk (*).
mcDetail
Determines whether information on the backup and archive copy groups of the management class is returned. The following values are valid:
  • bTrue
  • bFalse
qryBackupGroup:
groupType

The group type is DSM_GROUPTYPE_PEER.

fsName

The file space name.

owner

The owner ID.

groupLeaderObjId

The group leader object ID.

objType
The object type.
qryProxyNodeAuth:
targetNodeName

The target node name.

peerNodeName

The peer node name.

hlAddress

The peer address of the high-level name.

llAddress

The peer address of the low-level name.

qryProxyNodePeer:
targetNodeName

The target node name.

peerNodeName

The peer node name.

hlAddress

The peer address of the high-level name.

llAddress

The peer address of the low-level name.

Return codes

The following table describes the return codes for the dsmBeginQuery function call.

Table 1. Return codes for dsmBeginQuery

Return code

Return code number

Explanation

DSM_RC_NO_MEMORY

102

There is not enough memory to complete the request.

DSM_RC_FILE_SPACE_NOT_FOUND

124

The specified file space was not found.

DSM_RC_NO_POLICY_BLK

2007

Server policy information was not available.

DSM_RC_INVALID_OBJTYPE

2010

Invalid object type.

DSM_RC_INVALID_OBJOWNER

2019

Invalid object owner name.

DSM_RC_INVALID_OBJSTATE

2024

Invalid object condition.

DSM_RC_WRONG_VERSION_PARM

2065

The API version of the application client is different from the IBM® Storage Protect library version.