Ransomware attackers specifically target and attempt to destroy backup systems to increase the probability of payment. Hardening your system is critical. Please ensure you have reviewed your platform security using the Security Hardening Checklist
Cohesity

COHESITY Documentation

Explore our documentation to get started, discover products & new features, access troubleshooting guides, register sources, platforms support.

Products
Data Security Alliance
Visit Cohesity.com
Demos
Support
Blogs
Developers
Partner Portals
Cohesity Community
© 2026 Cohesity, Inc. All Rights Reserved.
Terms of Use|
Privacy Policy|
Legal|
  1. Home
  2. Veritas NetBackup™ DataStore SDK Programmer's Guide for XBSA 1.1.0
  3. API reference
  4. Function specifications
  5. NBBSAGetMediaIds
Veritas NetBackup™ DataStore SDK Programmer's Guide for XBSA 1.1.0

NBBSAGetMediaIds

Obtain media IDs for a NetBackup image.

SYNOPSIS

#include <nbbsa.h>

int NBBSAGetMediaIds(BSA_Handle bsaHandle, BSA_UInt64 copyId, BSA_UInt32 *sizePtr, char *MediaIdsPtr)

DESCRIPTION

NBBSAGetMediaIds() returns a null delimited text string containing the media IDs that are associated with a NetBackup image given the copyId of any XBSA object in the image. The value for copyId can be obtained from a previous BSAQueryObject() call. The list of null delimited media IDs is terminated with an empty string. This can also be called a double null terminated string.

Examples are as follows:

  • Image with two media IDs: MediaId1\0MediaId2\0\0

  • Image with one media ID: MediaId3\0\0

PARAMETERS

BSA_Handle bsaHandle (I)

The handle that associates this call with a previous BSAInit() call.

BSA_UInt64 copyId (I)

The unique ID of an XBSA Object that is contained in the image being queried for media IDs. The value for a specific XBSA object can be obtained through a BSAQueryObject() call.

BSA_UInt32 *sizePtr (I/O)

Pointer to the size, in characters, of the buffer pointed to by the MediaIdsPtr parameter. Returns the size of the string pointed to by MediaIdsPtr.

char * MediaIdsPtr (O)

Pointer to a buffer that receives a null delimited character string of media IDs.

RETURN VALUE

The following return codes are returned by this function:

BSA_RC_BUFFER_TOO_SMALL

The buffer pointed to by MediaIdsPtr is not large enough. The buffer size, in characters, required to hold the media ID string and its terminating null character is stored in the location pointed to by sizePtr.

BSA_RC_NULL_ARGUMENT

There was a NULL pointer in one of the arguments.

BSA_RC_ABORT_SYSTEM_ERROR

System detected error, operation aborted.

BSA_RC_ACCESS_FAILURE

Cannot access the requested image. Cannot retrieve the media IDs with the given copyId.

BSA_RC_INVALID_CALL_SEQUENCE

The sequence of API calls is incorrect. Within a transaction calling NBBSAGetMediaIds(), you can embed BSAQueryObject() and BSAGetNextQueryObject() calls. This allows the XBSA application to intermix get NBBSAGetMediaIds() calls with BSAQueryObject() and BSAGetNextQueryObject() calls to obtain the media IDs of multiple images within one transaction. Backup and restore operations are not allowed within a transaction that calls NBBSAGetMediaIds().

BSA_RC_INVALID_COPYID

The copyId field cannot be zero.

BSA_RC_INVALID_HANDLE

The handle that is used to associate this call with a previous BSAInit() call is invalid.

BSA_RC_OBJECT_NOT_FOUND

The given copyId does not exist.

BSA_RC_SUCCESS

The function succeeded.

Feedback

Was this page helpful?
Previous

NBBSAGetJobInfo

Next

NBBSAGetMultipleObjects

Feedback

Was this page helpful?