Please enter search query.
Search <book_title>...
Veritas NetBackup™ DataStore SDK Programmer's Guide for XBSA 1.1.0
Last Published:
2021-01-01
Product(s):
NetBackup (9.0.0.1, 9.0)
- Introduction to NetBackup XBSA
- How to set up the SDK
- Using the NetBackup XBSA interface
- NetBackup XBSA data structures
- NetBackup XBSA environment
- XBSA sessions and transactions
- Creating a NetBackup XBSA application
- How to build an XBSA application
- How to run a NetBackup XBSA application
- API reference
- Function calls
- Function specifications
- Type definitions
- Process flow and troubleshooting
- How to use the sample files
- Support and updates
- Appendix A. Register authorized locations
Media ID example
This Media ID example assumes that the copyId has been populated from a previous query or from information stored by the XBSA application.
BSA_Handle BsaHandle; BSA_ObjectOwner BsaObjectOwner; BSA_SecurityToken *security_tokenPtr; BSA_ObjectDescriptor *object_desc; BSA_QueryDescriptor *query_desc; BSA_UInt32 Size; char *envx[3]; char ErrorString[512]; char msg[1024]; int status; char buffer[100]; char *p; BSA_UInt32 buffer_len; . . BSAInit(&BsaHandle, security_tokenPtr, &BsaObjectOwner, envx); . . BSABeginTxn(BsaHandle); buffer_len = 100; status = NBBSAGetMediaIds(BsaHandle, object_desc->copyId, &buffer_len, buffer); if (status != BSA_RC_SUCCESS) { Size = 512; NBBSAGetErrorString(status, &Size, ErrorString); sprintf(msg, "ERROR: NBBSAGetMediaIds() failed with error: %s", ErrorString); NBBSALogMsg(BsaHandle, MSERROR, msg, "Media Ids"); BSAEndTxn(BsaHandle, BSA_Vote_ABORT); BSATerminate(BsaHandle); exit(status); } p = buffer; while (*p != '\0') { printf("Media Id = %s\n", p); p = p + (strlen(p) + 1); } printf("Buffer size used = %d\n", str_len); status = BSAEndTxn(BsaHandle, BSA_Vote_COMMIT); if (status != BSA_RC_SUCCESS) { Size = 512; NBBSAGetErrorString(status, &Size, ErrorString); sprintf(msg, "ERROR: BSAEndTxn() failed with error: %s", ErrorString); NBBSALogMsg(BsaHandle, MSERROR, msg, "Media Ids"); BSAEndTxn(BsaHandle, BSA_Vote_ABORT); BSATerminate(BsaHandle); }