NWSMTSScanTargetServiceResource

Returns the name of one primary resource.

Syntax

  #include <smstsapi.h> 
   
  CCODE NWSMTSScanTargetServiceResource (
     UINT32   connection, 
     UINT32  *rsnSequence, 
     STRING   resourceName);
  

Parameters

connection

(IN) Specifies the connection information returned by NWSMTSConnectToTargetService or NWSMTSConnectToTargetServicEx.

rsnSequence

(IN/OUT) Points to the resource sequence number.

resourceName

(OUT) Receives the name of a primary resource (maximum buffer size is NWSM_MAX_RESOURCE_LEN bytes).

Return Values

See Section 9.3, Target Service Return Values for more information.

The following table lists the return values associated with the function.

0x00000000

Successful

0xFFFDFFB9

NWSMTS_UNSUPPORTED_FUNCTION

0xFFFDFFC5

NWSMTS_RESOURCE_NAME_NOT_FOUND

0xFFFDFFE7

NWSMTS_INVALID_CONNECTION_HANDL

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

Remarks

Before NWSMTSScanTargetServiceResource is called, the engine must be connected to the TSA and Target Service and you must call NWSMTSBuildResourceList.

When provided with supporting code, NWSMTSScanTargetServiceResource provides the same functionality as NWSMTSListTSResources.

The behavior of NWSMTSScanTargetServiceResource differs from cluster backup and normal backup. If the engine is connected to a pool, NWSMTSScanTargetServiceResource only lists the mounted resources under the pool. If the engine is connected to the server node, then all the non-clustered resources that are mounted on the server are listed.

rsnSequence is used by the TSA to keep track of which primary resource was returned. The engine sets rsnSequence to zero before calling NWSMTSScanTargetServiceResource the first time.

If rsnSequence is set to zero (0), resourceName returns the resource that represents all the resources on a Target Service. For example, if the Target Service is a NetWare file server, the first resource name is "File Server." For NetWare, if this first resource name is passed to NWSMTSScanDataSetBegin, all binderies, volumes, directories, and files are scanned. For example, if the Target Service is a Linux server, the first resource name is "/". If a resource is passed to NWSMTSScanDataSetBegin, only the current mount point’s directories and files are scanned, all other mount points under the current mount point are excluded. Additionaly, pseudo-file systems like proc, tmpfs, _admin, devpts, usbfs and device files under /dev are always excluded.

To get all the primary resources, the engine calls NWSMTSScanTargetServiceResource repeatedly until NWSMTS_RESOURCE_NAME_NOT_FOUND is returned.

Before passing a resource name to NWSMTSScanDataSetBegin, the engine must convert it to an NWSM_DATA_SET_NAME_LIST structure. Use the data set name functions described in Storage Management Services Utilities Library to help convert the name.

See Also

NWSMTSGetNameSpaceTypeInfo, NWSMTSGetOpenModeOptionString, NWSMTSGetTargetResourceInfo, NWSMTSGetTargetScanTypeString, NWSMTSGetTargetSelectionTypeStr, NWSMTSListSupportedNameSpaces, NWSMTSListTSResources, NWSMTSScanDataSetBegin, NWSMTSScanSupportedNameSpaces

Example

  /* See NWSMTSListTargetServiceResource's example. Replace the following code for the call to NWSMTSListTSResources. */ 
   
  UINT32 sequence; 
  char resourceName[NWSM_MAX_RESOURCE_LEN]; 
  STRING string; 
  /*Build a complete list of primary resources that are on the file server. */ 
  sequence = 0; 
  string = resourceName; 
  while(NWSMTSScanTargetServiceResource(connection, &sequence, string) == 0) 
  { 
     /* Insert resource name into a list. nameList will contain the list. */ 
  }