Tivoli Header

Tivoli Storage Manager Using the Application Program Interface

Query Management Classes

Applications can query management classes to determine what management classes are possible for a given node, and to determine what the attributes are within the management class. You can only bind objects to management classes by using the dsmBindMC call. You might want your applications to query the management class attributes and display them to end users. See Querying the TSM System for more information.

In the example in Figure 8, a switch statement is used to distinguish between backup and archive operations when calling dsmBindMC. The information returned from this call is stored in the MCBindKey structure.

Figure 8. An Example of Associating A Management Class With An Object

+--------------------------------------------------------------------------------+
|dsUint16_t     send_type;                                                       |
|dsUint32_t     dsmHandle;                                                       |
|dsmObjName   objName;     /* structure containing the object name  */           |
|mcBindKey    MCBindKey;   /* management class information          */           |
|char         *dest;       /* save destination value                */           |
|                                                                                |
|switch (send_type)                                                              |
|{                                                                               |
|   case (Backup_Send) :                                                         |
|      rc = dsmBindMC(dsmHandle,&objName,stBackup,&MCBindKey);                   |
|      dest = MCBindKey.backup_copy_dest;                                        |
|      break;                                                                    |
|   case (Archive_Send) :                                                        |
|      rc = dsmBindMC(dsmHandle,&objName,stArchive,&MCBindKey);                  |
|      dest = MCBindKey.archive_copy_dest;                                       |
|      break;                                                                    |
|   default : ;                                                                  |
|}                                                                               |
|                                                                                |
|if (rc)                                                                         |
|{                                                                               |
|   printf("*** dsmBindMC failed: ");                                            |
|   rcApiOut(dsmHandle, rc);                                                     |
|   rc = (RC_SESSION_FAILED);                                                    |
|   return;                                                                      |
|}                                                                               |
+--------------------------------------------------------------------------------+


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