Quantum STORNEXT SNAPI 2.0.1 User Manual

API Guide API GuideAPI Guide API GuideAPI Guide
StorNext® SNAPI 2.0.1
StorNext
6-01375-05
StorNext API Guide, 6-01375-05, Ver. A, Rel. 2.0, April 2008, Made in USA.
Quantum Corporation provides this publication “as is” without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability or fitness for a particular purpose. Quantum Corporation may revise this publication from time to time without notice.
COPYRIGHT STATEMENT
Copyright 2008 by Quantum Corporation. All rights reserved.
StorNext copyright (c) 1991-2008 Advanced Digital Information Corporation (ADIC), Redmond, WA, USA. All rights reserved.
Your right to copy this manual is limited by copyright law. Making copies or adaptations without prior written authorization of Quantum Corporation is prohibited by law and constitutes a punishable violation of the law.
TRADEMARK STATEMENT
Quantum, DLT, DLTtape, the Quantum logo, and the DLTtape logo are all registered trademarks of Quantum Corporation.
SDLT and Super DLTtape are trademarks of Quantum Corporation.
Other trademarks may be mentioned herein which belong to other companies.

Contents

Chapter 1 Introduction 1
About This Guide .............................................................................................. 1
Product Compatibility ...................................................................................... 2
SNAPI/StorNext Compatibility Matrix.................................................. 2
Installing StorNext APIs ................................................................................... 2
Running APIs Remotely ................................................................................... 2
Explanation of Warnings, Cautions and Notes............................................. 3
Related Documents You Might Need............................................................. 3
Getting More Information or Help .......................................................... 4
Quantum Technical Assistance Center........................................................... 4
Chapter 2 StorNext Storage Manager APIs 5
Introduction........................................................................................................ 5
Installing the APIs on the Storage Manager Host......................................... 6
Installing the APIs on a Remote Client........................................................... 7
Configuring SNAPI ........................................................................................... 8
SNAPI Logs and Health Checks...................................................................... 9
Use Cases .......................................................................................................... 10
Using a C or C++ Library with XML Wrapper .................................... 12
Using the SNAPI XML Command Line Interface (snclix).................. 13
API Descriptions and Arguments ................................................................. 15
StorNext API Guide i
Chapter 3 StorNext File System APIs 86
Allocation and Space Management APIs ..................................................... 89
Quality of Service and Real Time I/O APIs.................................................98
File System Configuration and Location Management APIs .................. 108
Access Management APIs............................................................................. 119
Appendix A File System API Example 136
Appendix B Storage Manager API Example 164
C++ Test Program Example .................................................................. 164
C++ XML Interface Test Program Example........................................ 166
Makefile Example for Linux Platforms................................................ 167
Makefile Example for Solaris Platforms.............................................. 168
StorNext API Guide ii

About This Guide

Chapter 1

1Introduction

This guide contains information and instructions necessary to install and use the StorNext APIs (SNAPI). This guide is intended for system administrators, programmers, and anyone interested in learning about installing and using the StorNext APIs.
The StorNext API guide is divided into the following chapters:
StorNext Storage Manager APIs
StorNext File System APIs
File System API Example
Storage Manager API Example
StorNext API (SNAPI) contains StorNext Storage Manager APIs, StorNext File System APIs, and Client APIs that can be used to make calls to third-party applications, resulting in enhanced operations between third-party applications and StorNext.
StorNext API Guide 1

Product Compatibility

The StorNext API (SNAPI) release is compatible with a specific StorNext release. Please refer to the following compatibility matrix to verify you are running compatible versions of both products.

SNAPI/StorNext Compatibility Matrix 1

StorNext API (SNAPI) Version StorNext Version
SNAPI 1.0 StorNext 2.8.1 SNAPI 1.1.0 StorNext 3.0 SNAPI 2.0 StorNext 3.0.2, 3.1
Chapter 1 Introduction
Product Compatibility
SNAPI 2.0.1 StorNext 3.1.1, 3.1.2

Installing StorNext APIs

The StorNext File System APIs are automatically installed when you install the StorNext software.
The StorNext Storage Manager APIs on the CD must be installed before you can call them. For installation instructions, see Installing the APIs
the Storage Manager Host in the chapter StorNext Storage Manager APIs.
on
StorNext API Guide 2

Running APIs Remotely

Beginning with SNAPI 2.0, you can now run StorNext Storage Manager APIs remotely from a client. Functionally, operation from a remote client is identical to running the APIs locally. If you want to use this feature, remote clients must be installed and configured as described in Installing
the APIs on a Remote Client and Configuring SNAPI in the chapter StorNext Storage Manager APIs
StorNext File System APIs continue to run remotely on clients as they always have.
.

Explanation of Warnings, Cautions and Notes

Chapter 1 Introduction
Running APIs Remotely
The following cautions, and notes appear throughout this document to highlight important information.
Caution: Indicates a situation that may cause possible damage to
equipment, loss of data, or interference with other equipment.
Note: Indicates important information that helps you make better
use of your system.

Related Documents You Might Need

The following documents available for StorNext can be found at
www.
quantum.com/manuals.
StorNext API Guide 3
Chapter 1 Introduction

Quantum Technical Assistance Center

• StorNext User’s Guide (6-01658-02)
• StorNext File System Quick Reference Guide (6-00361-21)
• StorNext Storage Manager Quick Reference Guide (6-00361-22)

Getting More Information or Help 1

More information about this product is available on the Customer Service Center website at www.quantum.com/csc contains a collection of information, including answers to frequently asked questions (FAQs). You can also access software, firmware, and drivers through this site.
Quantum Technical Assistance Center
For further assistance, or if training is desired, contact the Quantum Technical Assistance Center:
North America: UK, France and Germany: EMEA: Worldwide Web:
1+800-284-5101 00800 4 QUANTUM +44 1256 848 766
www.quantum.com/support
. The Customer Service Center
StorNext API Guide 4

Introduction

Chapter 2

2StorNext Storage Manager APIs

This chapter describes the application programming interfaces (APIs) available for StorNext Storage Manager.
This chapter contains the following major topics:
Installing the APIs
Installing the APIs on a Remote Client
Configuring SNAPI
SNAPI Logs and Health Checks
Use Cases
API Descriptions and Arguments
Note: Unlike the StorNext File System APIs which are automatically
installed with the StorNext software, you must install the Storage Manager APIs from the CD by following the installation instructions in Installing the APIs
Manager Host on page 6.
Throughout this chapter, the terms library and archive are used. Library refers to an actual physical library (e.g., with robotics), whereas archive is
StorNext API Guide 5
on the Storage Manager Host
on the Storage
Chapter 2 StorNext Storage Manager APIs

Installing the APIs on the Storage Manager Host

a more general term that may refer to a library, a vault, or anywhere else where media can be stored.
A vault is a logical archive type. It is any location that contains copies of media that have been removed from the operational system. Since a vault has no robotics, if a vault has tape drives, tape media must be manually mounted to the drive and dismounted from the drive.
Installing the APIs on the Storage Manager Host
This section describes how to install the SNAPI Storage Manager APIs and the SNAPI Server on the StorNext Storage Manager host. After installation is complete, the SNAPI Server will listen for requests from all local and remote SNAPI clients. The SNAPI Server will log operational
and error messages to /usr/adic/SNAPI/logs/. The SNAPI Server will also
handle all local and remote requests from snclix, the SNAPI command line interface utility.
1 Log on as root. 2 Insert and mount the product CD that contains the StorNext Storage
Manager APIs.
3 Use the cd command to navigate to the directory that corresponds to
your operating system:
SunOS590sparc_32
SunOS5100sparc_32
RedHat40AS_26ia64
RedHat40AS_26x86_32
RedHat40AS_26x86_64
SuSE90ES_26x86_64
SuSE90ES_26ia64
SuSE90ES_26x86_32
SuSE100ES_26x86_64
SuSE100ES_26ia64
StorNext API Guide 6
Chapter 2 StorNext Storage Manager APIs
SuSE100ES_26x86_32
4 From the operating system directory, run the program install.snapi.
This program automatically decompresses the APIs and copies them
to your StorNext directory in the following location: /usr/adic/SNAPI.
5 You can access this API guide by locating the pdf file on the StorNext
API CD.
After installing the Storage Manger APIs, in order to successfully
compile and link with your applications you need the location of the
main header file and the libraries Quantum delivers.
The main header file location: /usr/adic/SNAPI/inc/API.hh
The dynamic library location: /usr/adic/SNAPI/lib/libsnapi.so
The static library location: /usr/adic/SNAPI/lib/static/libsnapi.a

Installing the APIs on a Remote Client

Installing the APIs on a Remote Client
This section describes how to install the SNAPI Storage Manager APIs on a remote client connected to a SNAPI Server host. As a prerequisite, SNAPI must have already been installed on the Storage Manager host as described in Installing the APIs
To install a remote client:
1 Copy the script /usr/adic/SNAPI/bin/install.snapiclient from the
Storage Manager host to the remote host.
Note: To ensure that the install.snapiclient script runs properly,
before proceeding verify that RCP is enabled between the remote client host and the StorNext Storage Manager host.
2 Run the install.snapiclient script on the remote host, passing it the
name of the Storage Manager host. For example:
install.snapiclient <SNAPI_Server_Host>
The installation script also installs the snclix utility, which can be used to run SNAPI API commands on the command line.
StorNext API Guide 7
on the Storage Manager Host.

Configuring SNAPI

Chapter 2 StorNext Storage Manager APIs
Configuring SNAPI
Note: An upgrade of SNAPI on a remote client is accomplished by
running the installation procedure described above. To remove SNAPI from a remote client, simply remove all
contents of the /usr/adic/SNAPI/ directory.
SNAPI configuration for both local and remote clients is accomplished by
editing the /usr/adic/SNAPI/config/snapi.cfg file on the SNAPI server and remote hosts, respectively. The snapi.cfg file allows you to specify the
following:
•SNAPI server names
• INET socket port value for remote clients

Snapi.cfg Example 2

• Client timeout value. This value specifies how long the client should wait for a response from the SNAPI server. This value can be between 0-1000 minutes. The default value is 30 minutes.
You are not required to modify the snapi.cfg file before running the APIs
unless you are enabling HA support for remote clients, or in other special cases. (See HA Failover Support support.)
The following example describes and illustrates each of the parameters in
the snapi.cfg file. (You can find the example in the snapi.cfg.default file installed at /usr/adic/SNAPI/config/snapi.cfg.default.)
<!-- The serverName indicates the host on which the S torNext server is
running. If this is an HA system, add a line to indicate the failover host. -->
<PARAMETER name="serverName" value="localhost"/>
<!-- The serverPort is used for remote client connections. There i s no
need to edit this value unless the port is already in use, in which case the port value on the StorNext server must be edited also. -->
<PARAMETER name="serverPort" value="61776"/>
for more information about enabling HA
StorNext API Guide 8
Chapter 2 StorNext Storage Manager APIs

SNAPI Logs and Health Checks

<!-- The clientT imeOut is the maximum time (in secs) a client will spend
attempting to fulfill a request to the server. Set the value to 0 to indicate the client should try indefinitely to fulfill the request. -->
<PARAMETER name="clientTimeOut" value="1800"/>

HA Failover Support 2

HA failover support applies only to remote clients, and is supported by
the snapi.cfg file on the remote hosts. To enable HA support, specify the
primary and secondary SNAPI server host names in an ordered list on
separate lines in the /usr/adic/SNAPI/config/snapi.cfg file.
For example:
<PARAMETER name="serverName" value="zeus"/> <PARAMETER name="serverName" value="hera"/>
Upon detecting failover, SNAPI internally will reissue the original request to the SNAPI server on behalf of the remote client. Connection attempts to the primary and secondary servers will continue until the client timeout limit is reached.
SNAPI Logs and Health Checks
Logs are available for the SNAPI server host. These logs use the existing
StorNext logging framework, and are located at /usr/adic/SNAPI/logs/tac.
You can configure SNAPI logs by adjusting the parameters located at
/usr/adic/SNAPI/logs/log_params.
Health checks are also available on the SNAPI server host. Health checks are also integrated with the existing StorNext Health Check framework.
To run health checks, from the StorNext home page, choose Health Check from the Service Menu. The Health Check Test screen appears. From this screen run one or both of these health checks:
• Network: This health check validates connections to the StorNext server
StorNext API Guide 9

Use Cases

Chapter 2 StorNext Storage Manager APIs
Use Cases
• Config: This health check validates the contents of the SNAPI
configuration file (snapi.cfg)
Alternatively, you can accomplish the same thing manually by running the following tests:
snapiverifyConnectivity: Verifies connection to the StorNext server. Located at /usr/adic/SNAPI/bin/snapiVerifyConnectivity.
snapiverifyConfig: Validates the SNAPI configuration file (snapi.cfg) contents. Located at /usr/adic/SNAPI/bin/snapiVerifyConfig.
There are three different programmatic entry points for accessing the StorNext Storage Manager APIs:

Using a C or C++ Library

Using a C or C++ Library with XML Wrapper
Using the SNAPI XML Command Line Interface (snclix)
This section contains examples showing how to use the APIs with these methods.
Note: Data types used in these APIs are defined in the header files
located here: /usr/adic/SNAPI/inc/
Using a C or C++ Library2
StorNext API Guide 10
For each API, there is a corresponding C++ class with the same name as the API. Quantum provides both dynamic and static libraries, as well as a header file to link to the application program.
The following example illustrates typical API usage for this case.
#include <API.hh> #include <sys/types.h>
#include <unistd.h> #include <iostream> #include <sstream>
Chapter 2 StorNext Storage Manager APIs
#include <string> using namespace std;
using namespace Quantum::SNAPI; int
main() { Status status;
try { // Create object for requesting file attributes. GetFileAttribute getFileAttrReq("/snfs/testFile.dat");
// Send request to the server and get overall request status code. // Note: This method may throw exceptions (see catch block below). status = getFileAttrReq.process();
// Check the returned status code. if (status.getCode() != SUCCESS) { cout << "StatusCode: " << status.getCodeAsString() << endl; cout << "Description: " << status.getDescription() << endl; cout << "LocalStatus.StatusCode: " << getFileAttrReq.getLocalStatus().getCodeAsString() << endl; cout << "LocalStatus.Description: " << getFileAttrReq.getLocalStatus().getDescription() << endl; } else { // Get the requested data. FileInfo fileInfo = getFileAttrReq.getFileInfo();
Use Cases
cout << "FileName: " << fileInfo.getFileName() << endl; cout << "Location: " << fileInfo.getLocationAsString() << endl; cout << "Existing Copies: " << fileInfo.getNumberOfExistingCopies() << endl; cout << "Target Copies: " << fileInfo.getNumberOfTargetCopies() << endl;
MediaList media = fileInfo.getMedia(); for (int i=0; i<media.size(); i++)
{ cout << "Media ID: " << media[i] << endl; } } }
StorNext API Guide 11
Chapter 2 StorNext Storage Manager APIs
catch (SnException& exception) { switch (exception.getCode()) { case SUBFAILURE: case FAILURE: case SYNTAXERROR: default: { cout << "Exception code: " << exception.what() << endl; cout << "Exception detail: " << exception.getDetail() << endl; } break; } } catch (...) { cout << "Caught unknown exception." << endl; }
return status.getCode(); }
Use Cases

Using a C or C++ Library with XML Wrapper 2

For this approach there is a single function called doXML available to the
third-party program. This function’s input and output are string type, and their contents are in XML format. Different APIs have different specifications on the XML input and output, as described for each API.
Note: It is your responsibility to provide an input string that satisfies
the specification. Otherwise, a failure from the doXML
function call might result.
The following example illustrates typical API usage for this case.
#include <API.hh>
#include <sys/types.h> #include <unistd.h> #include <iostream> #include <sstream> #include <string>
StorNext API Guide 12
Chapter 2 StorNext Storage Manager APIs
Use Cases
using namespace std; using namespace Quantum::SNAPI;
int main() { Status status;
// Initialize input command in XML format. XML xmlIn("<?xml version=\"1.0\"?>" "<COMMAND name=\"GetFileAttribute\">" " <ARGUMENT name=\"fileName\" value=\"/snfs/testFile.dat\"/>" "</COMMAND>");
XML xmlOut;
try { // Perform the request. status = doXML(xmlIn, xmlOut); } catch (SnException& excptn) { cerr << "Exception code: " << excptn.what() << endl; cerr << "Exception detail: " << excptn.getDetail() << endl; status = excptn.getCode(); }
// Stream the results to standard out. cout << xmlOut << endl;
return status.getCode(); }

Using the SNAPI XML Command Line Interface (snclix) 2

The snclix utility is a command line utility that provides an interface for
SNAPI APIs from the SNAPI server and remote client hosts. This utility operates on XML input and output, and is very similar to the doXML() function. Both of these take an XML request definition as input, and return an XML response with requested information embedded in the response.
StorNext API Guide 13
Chapter 2 StorNext Storage Manager APIs
Use Cases
Note: It is your responsibility to generate a properly formatted XML
request and to subsequently access the relative portions of information in the XML response.
Any XML information that is not relevant to the specified request will cause an error. This also applies to cases where single arguments are expected but multiple arguments are supplied.
XML character data must comply with Section 2.4 of the XML specification. In particular, when used in value strings, the following characters must be escaped using their ASCII numeric character references:
& = "&" < = "<" > = ">"
In addition, any non-printing characters (such as new line, tab, etc.) must be escaped using their ASCII numeric character references.
When using the snclix utility, after you create a file containing properly
formatted XML (or optionally an input stream,) you then pass the
information to the snclix executable program. Internally, snclix calls the doXML() function to process the request and
send the resulting XML response to an output file (or optionally streams it to stdout).
The snclix utility is located at /usr/adic/SNAPI/bin/snclix and has the
following usage format:
snclix [-i infile] [-o outfile] [-c config]
-i infile: Specifies an input file. (File contents should be in XML format.)
-o outfile: Specifies an output file. (File contents will be in XML format.) If an
outfile exits, it will be overwritten.
-c config: Specifies a configuration file.
Example of snclix Usage 2
snclix -i /tmp/GetFileAttributeRequest.xml -o /tmp/ GetFileAttributeResponse.xml
Where the /tmp/GetFileAttributeRequest.xml file contains the following input:
StorNext API Guide 14
Chapter 2 StorNext Storage Manager APIs

API Descriptions and Arguments

<?xml version="1.0"?> <COMMAND name="GetFileAttribute">
<ARGUMENT name="fileName" value="/snfs/testFile.dat"/>
</COMMAND>
And the /tmp/GetFileAttributeResponse.xml file contains the following
output:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <RESPONSE name="GetFileAttribute" statusCode="0" status="SUCCESS">
<FILEINFO statusCode="0" status="SUCCESS" statusDescription="Command Successful">
<INFO name="fileName" value="/snfs1/testFile.dat" /> <INFO name="location" value="DISK AND TAPE" /> <INFO name="numberExistingCopies" value="1" /> <INFO name="numberT argetCopies" value="1" /> <INFO name="mediaID" value="000082(1)" />
</FILEINFO>
</RESPONSE>
API Descriptions and Arguments
A brief description is provided for each API, as well as its input arguments and output variables. Also provided for each API is an example showing XML input and output, and the corresponding C++ class declaration.
The following StorNext Storage Manager APIs are described in this section:
Backup
CheckoutMedia
CleanMedia
CopyMedia
EjectMedia
EnterMedia
FileRetrieve
StorNext API Guide 15
GetArchiveCapacity
GetArchiveList
GetBackupStatus
GetDriveList
GetFileAttribute
GetFileTapeLocationI
GetMediaList
GetMediaStatus
GetPolicy
GetPortList
GetSchedule
GetSystemStatus
MoveMedia
PassThru
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
RmDiskCopy
SetArchiveState
SetDirAttributes
SetDriveState
SetFileAttributes
SetMediaState
SetPolicy
SetSchedule
For the C++ class declaration section, all API classes inherit from class Request, which has a public member function process(). The third-party program must call this function to have the API request processed. See the example code in Appendix B.
StorNext API Guide 16
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
Note: The process() function should be called only once for each
instantiation of an API object. API users should instantiate a
new API object every time they need to call the process()
function.
When you enter arguments for the StorNext Storage Manager APIs, wildcard characters such as the asterisk (*) are not
supported. For example, when you run the FileRetrieve API you cannot enter ‘*’ when entering the <filename> parameter.

Backup 2

This API initiates a backup operation.
Input
NA. This API has no command arguments.
Output
status: SUCCESS, FAILURE, SUBFAILURE, or SYNTAXERROR status
code.
XML Example
Request: 2
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- Initiate a system backup operation. --> <COMMAND name="Backup"/>
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <RESPONSE name="Backup" statusCode="0" status="SUCCESS"
statusDescription="Backup initiation successful">
<STATUSDETAIL statusCode="0" status="SUCCESS"
statusDescription="Backup initiation successful"/>
</RESPONSE>
2
2
2
2
StorNext API Guide 17
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
C++ Class Declaration 2
class Backup : public Request { public:
/// Default and Primary Contructor Backup();
/// Method to return the local status const Status& getLocalStatus() const;
}

CheckoutMedia 2

This API allows you to check out media with the specified media IDs.
Input
mediaID: The ID of the media you want to check out. You can specify
multiple media IDs to check out multiple media.
Output
status: SUCCESS, FAILURE, SUBFAILURE, or SYNTAXERROR status
code.
XML Example
Request: 2
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- Checks out all specified media from the system. --> <COMMAND name="CheckOutMedia">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- mediaID : valid media ID --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- One or more mediaID must be specified. --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <ARGUMENT name="mediaID" value="025311"/> <ARGUMENT name="mediaID" value="025312"/>
2
2
2
StorNext API Guide 18
</COMMAND>
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <RESPONSE name="CheckOutMedia" statusCode="0" status="SUCCESS"
statusDescription="Command Successful">
<!-- A status detail element will be returned for each media -->
<STATUSDETAIL name="mediaID" value="025311"
statusCode="0" status="SUCCESS" statusDescription="Command Successful"/>
<STATUSDETAIL name="mediaID" value="025312"
statusCode="0" status="SUCCESS" statusDescription="Command Successful"/>
</RESPONSE>
C++ Class Declaration 2
class CheckOutMedia : public Request { public:
/// Primary Constructor /// This constructor is intended for primary instantiation of the object, /// given a single media ID. CheckOutMedia(const std::string& inMediaID);
/// Secondary Constructor /// This constructor is for instantiation of the object from a list of /// media ID to eject. CheckOutMedia(const MediaList& inMediaList);
2
/// Method to return the list of media const MediaList& getMediaList() const;
/// Method to return the collection of status pairs const StatusPairList& getLocalStatus() const;
/// Method to return the status pair for a specific mediaID const StatusPair& getLocalStatus(const std::string& mediaID) const;
}
StorNext API Guide 19
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments

CleanMedia 2

This API cleans media by removing inactive files from the specified media.
Input
mediaID: The ID of the media you want to clean. You can specify multiple
media IDs to clean multiple media.
Output
status: SUCCESS, FAILURE, SUBFAILURE, or SYNTAXERROR status
code.
XML Example
Request: 2
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- Remove inactive files from all specified media. --> <COMMAND name="CleanMedia">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- mediaID : valid media ID --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- One or more mediaID must be specified. --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <ARGUMENT name="mediaID" value="025311"/> <ARGUMENT name="mediaID" value="025312"/>
</COMMAND>
2
2
2
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <RESPONSE name="CleanMedia" statusCode="0" status="SUCCESS"
statusDescription="Command Successful">
<!-- A status detail element will be returned for each media -->
<STATUSDETAIL name="mediaID" value="025311"
statusCode="0" status="SUCCESS" statusDescription="Command Successful"/>
<STATUSDETAIL name="mediaID" value="025312"
statusCode="0" status="SUCCESS"
StorNext API Guide 20
2
</RESPONSE>
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
statusDescription="Command Successful"/>
C++ Class Declaration
class CleanMedia : public Request { public:
/// Primary Constructor /// This constructor is intended for primary instantiation of the object. CleanMedia(const std::string& inMediaID);
/// Secondary Constructor /// This constructor is intended for instantiation of the object fro m a /// vector of media ids. CleanMedia(const MediaList& inMedia);
/// Method to return the list of media MediaList getMediaList() const;
/// Method to return the list of local status pairs const StatusPairList& getLocalStatus() const;
/// Method to return the specific local status pair for a given mediaID const StatusPair& getLocalStatus(const std::string& mediaID) const; }
2

CopyMedia 2

This API copies the content of all specified media to a piece of blank media.
Input
mediaID: The ID of the media you want to copy. You can specify multiple
media IDs to copy multiple media.
StorNext API Guide 21
2
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
Output 2
status: SUCCESS, FAILURE, SUBFAILURE, or SYNTAXERROR status
code.
XML Example
Request: 2
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- Copy the content of all specified media to blank media. --> <COMMAND name="CopyMedia">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- mediaID : valid media ID --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- One or more mediaID must be specified. --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <ARGUMENT name="mediaID" value="025311"/> <ARGUMENT name="mediaID" value="025312"/>
</COMMAND>
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <RESPONSE name="CopyMedia" statusCode="0" status="SUCCESS"
statusDescription="Command Successful">
<!-- A status detail element will be returned for each media -->
<STATUSDETAIL name="mediaID" value="025311"
statusCode="0" status="SUCCESS" statusDescription="Command Successful"/>
<STATUSDETAIL name="mediaID" value="025312"
statusCode="0" status="SUCCESS" statusDescription="Command Successful"/>
</RESPONSE>
2
2
C++ Class Declaration
class CopyMedia : public Request { public:
/// Primary Constructor
StorNext API Guide 22
2
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
/// This constructor is intended for primary instantiation of the object. CopyMedia(const std::string& inMediaID);
/// Secondary Constructor /// This constructor is intended for instantiation of the object fro m a /// vector of media ids. CopyMedia(const MediaList& inMedia);
/// Method to return the list of media MediaList getMediaList() const;
/// Method to return the list of local status pairs const StatusPairList& getLocalStatus() const;
/// Method to return the specific local status pair for a given mediaID const StatusPair& getLocalStatus(const std::string& mediaID) const;
}

EjectMedia 2

This API moves the specified media from the archive to a media I/E slot. EjectMedia does an automated media eject. This API must be used with the MoveMedia API.
After running this API, you must call the EnterMedia API to physically move the media from the mailbox into the destination library, or in the case of a vault, to logically enter the media into the vault.
Input
portID: The port used for ejecting media. The port ID is in the format
0,0,15,###. Only the digits following the final comma are needed, indicated as ### in the format example. It is not needed for vault
archives.
mediaID: The ID of the media to eject.
Output
status: SUCCESS, FAILURE, SUBFAILURE, or SYNTAXERROR status
code.
2
2
StorNext API Guide 23
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
XML Example 2
Request: 2
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- Eject a specific media from the system. --> <COMMAND name="EjectMedia">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- portId : IE port id to eject media to --> <!-- mediaId : media to eject --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Exactly one each of the above arguments are requ ire d . --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <ARGUMENT name="portId" value="16"/> <ARGUMENT name="mediaId" value="012345"/>
</COMMAND>
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <RESPONSE name="EjectMedia" statusCode="0" status="SUCCESS"
statusDescription="Command Successful">
<STATUSDETAIL name="mediaID" value="012345"
statusCode="0" status="SUCCESS" statusDescription="Command Successful"/>
</RESPONSE>
C++ Class Declaration
class EjectMedia : public Request { public:
/// Primary Constructor /// This constructor is intended for primary instantiation of the object, /// given a port Id and a single media Id. EjectMedia(const std::string& inMediaId, const std::string& inPortId = "0");
/// Method to set port Id void setPortId(const std::string& inPortId);
2
2
/// Method to return the media Id
StorNext API Guide 24
Chapter 2 StorNext Storage Manager APIs
const std::string& getMediaId() const;
/// Method to return the local status pair const StatusPair& getLocalStatus() const;
}
API Descriptions and Arguments

EnterMedia 2

This API adds (inserts) media into the specified archive from the I/E slot. This API must be used after you run the EjectMedia API, and must be used with the MoveMedia API.
Input
archiveID: The archive ID to which media is added. portID: The port used for entering media. The port ID is in the format
0,0,15,###. Only the digits following the final comma are needed,
indicated as ### in the format example. It is not needed for vault archives.
mediaID: The media ID to insert into the archive.
Output
status: SUCCESS, FAILURE, SUBFAILURE, or SYNTAXERROR status
code.
XML Example
Request: 2
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- Enter a specific media into the system. --> <COMMAND name="EnterMedia">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- archiveId : archive name to add media to --> <!-- portId : IE port id to move media from --> <!-- mediaId : media to add to archive --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Exactly one each of the above arguments are required. --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2
2
2
StorNext API Guide 25
Chapter 2 StorNext Storage Manager APIs
API Descriptions and Arguments
<ARGUMENT name="archiveId" value="archive2"/> <ARGUMENT name="portId" value="16"/> <ARGUMENT name="mediaId" value="012345"/>
</COMMAND>
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <RESPONSE name="EnterMedia" statusCode="0" status="SUCCESS"
statusDescription="Command Successful">
<STATUSDETAIL name="mediaID" value="012345"
statusCode="0" status="SUCCESS" statusDescription="Command Successful"/>
</RESPONSE>
C++ Class Declaration
class EnterMedia : public Request { public:
/// Primary Constructor /// This constructor is intended for primary instantiation of the object, /// given a archive Id, a port Id, and a single media Id. EnterMedia(const std::string& inArchiveId, const std::string& inMediaId, const std::string& inPortId = "0");
/// Method to set portId void setPortId(const std::string& inPortId);
2
2
/// Method to return the media Id const std::string& getMediaId() const;
/// Method to return the local status pair const StatusPair& getLocalStatus() const;
}

FileRetrieve 2

StorNext API Guide 26
This API retrieves the specified single file from secondary storage to primary storage.
Loading...
+ 143 hidden pages