Veritas NetBackup™ DataStore SDK Programmer's Guide for XBSA 1.1.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
- Initiating a session
- Backup - creating an object
- Query - finding an object descriptor
- Restore - retrieving an object's data
- Delete - deleting an object or image
- Media IDs - obtaining media IDs
- How to build an XBSA application
- How to run a NetBackup XBSA application
- About 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
Create an XBSA object.
int BSACreateObject(BSA_Handle bsaHandle, BSA_ObjectDescriptor *objectDescriptorPtr, BSA_DataBlock32 *dataBlockPtr)
The BSACreateObject() call creates an XBSA object within NetBackup. Duplicate BSA_ObjectNames are allowed.
The BSACreateObject() call is used to create an XBSA object based on the information in the objectDescriptor. This call initiates the communication between the NetBackup XBSA interface and the NetBackup server. The XBSA object data can then be passed in memory buffers. The dataBlockPtr parameter in the BSACreateObject() call allows the caller to obtain information about the buffer structure required by the NetBackup XBSA interface.
The XBSA object data is passed through one or more BSASendData() calls. If there is no data to be sent, then a BSAEndData() call must be used to indicate completion of the XBSA object. The BSASendData() and BSAEndData() calls must follow the BSACreateObject() call and must be in the same transaction.
BSA_Handle bsaHandle (I)
This parameter is the handle that associates this call with a previous BSAInit() call.
BSA_ObjectDescriptor *objectDescriptorPtr (I/O)
This parameter is used to pass XBSA object attributes, including its name, copy type, and so on.
BSA_DataBlock32 *dataBlockPtr (O)
This parameter is a pointer to a structure that is used to obtain the details of the required buffer structure.
Within the XBSA object descriptor, all fields must contain valid values. Enumerations must contain one of their enumerated values. Strings must be null-terminated. All other fields must be in the range of valid values for that field.
The following fields in the XBSA object descriptor are optional: objectOwner, objectDescription, and objectInfo. The optional value for either field of objectOwner and the field objectDescription is the empty string. The optional value for objectInfo is all zeros. If the bsa_ObjectOwner is empty, it defaults to the value specified in BSAInit().
For NetBackup XBSA Version 1.1.0, the NetBackup XBSA interface and NetBackup determine the XBSA object ownership. If the bsa_ObjectOwner field is specified, it is saved with the object but does not define ownership.
The following fields in the XBSA object descriptor are mandatory: objectName, copyType, estimatedSize, resourceType, and objectType. For objectName this means that the pathName must contain a non-empty string. For copyType and objectType the enumeration value "ANY" is not allowed.
The estimatedSize must contain a non-zero estimate if the XBSA application intends to create a non-empty XBSA object (that is, there is XBSA object data). This size is in bytes. If the estimatedSize is zero, this call must be followed by a BSAEndData() without calling BSASendData() in between. There are no resource allocations based on this estimate, only whether the object will have data or not, so the estimate does not need to be accurate.
The NetBackup XBSA interface can return several values to the XBSA application through the objectDescriptorPtr for a newly created XBSA object. The interface returns either all or none of these values.
The copyId attribute is a persistent, fixed-length object identifier that remains unchanged throughout the life of the XBSA object.
For NetBackup XBSA Version 1.1.0, the copyId is only guaranteed to be unique on a given NetBackup master server.
If the copyId field is non-zero, the NetBackup XBSA interface returned values for the copyId, createTime, restoreOrder, and objectStatus fields.
The createTime field is in UTC. The restoreOrder field can have the value zero, which means that the NetBackup XBSA interface did not specify a restore order.
The dataBlockPtr structure does not point to an actual data buffer. All of the values in the dataBlockPtr should be zero, and they are overwritten. The structure is used by the NetBackup XBSA interface to provide the XBSA application with the interface preference for the structure of the data blocks that are used to pass the NetBackup XBSA object's data. The XBSA application should examine the values returned to determine the buffer structure that it should create. The significance of the returned values is as follows:
bufferLen == 0
NetBackup has no restrictions on the buffer length. No trailer portion is required.
bufferLen != 0
NetBackup accepts buffers that are at least bufferLen bytes in length (minimum length). The length of the trailer portion of buffers is: trailerBytes >= (bufferLen - numBytes - headerBytes)
numBytes == 0
NetBackup has no restrictions on the length of the data portion of the buffer.
numBytes != 0
The maximum length of the data portion of buffers accepted by NetBackup must not exceed numBytes bytes.
headerBytes == 0
NetBackup only accepts buffers with no header portion.
headerBytes != 0
The length of the header portion of buffers accepted by NetBackup is headerBytes bytes.
The values returned by the call to BSACreateObject() remain in effect for the duration of the data transfer of the XBSA object being created, that is, until the next BSAEndData() call. The NetBackup XBSA interface currently does not have any header or trailer requirements, so the full buffer specified can be used by the XBSA application. This is documented for completeness with the XBSA specification and to allow for future use of these fields as specified by the XBSA specifications.
The following return codes are returned by this function:
System detected error, operation aborted.
Cannot create the XBSA object with the given descriptor.
The sequence of API calls is incorrect.
The BSA_DataBlock32 parameter contained an inconsistent value.
The handle used to associate this call with a previous BSAInit() call is invalid.
The BSA_ObjectDescriptor was invalid.
A NULL pointer was encountered in one of the arguments
The function succeeded.