Using The Xml Api - HP P2000 G3 Cli Reference Manual

Msa system
Hide thumbs Also See for P2000 G3:
Table of Contents

Advertisement

if( $name eq 'response' ) {
}
}
print "Session Key = $sessionKey\n";
# Run a sample command to obtain the disks in the system.
$url = 'http://10.0.0.2/api/show/disks';
$req = HTTP::Request->new(GET => $url);
$req->header('sessionKey' => $sessionKey );
$req->header('dataType' => 'ipa' );
$res = $ua->request($req);
$url2 = 'http://10.0.0.2/api/exit';
$req2 = HTTP::Request->new(GET => $url3);
$req2->header('sessionKey' => $sessionKey );
$req2->header('dataType' => 'api' );
$res2 = $ua->request($req2);
print $res->content;
The next section provides more information about using the XML API.

Using the XML API

The Management Controller provides access for monitoring and management via the Telnet and SSH
protocols for command-line interface semantics, or via the HTTP and HTTPS protocols for XML API
request/response semantics.
You can use an XML parser, such as XML::Parser in Perl, to process the XML output and store this
information as objects. The XML parser should use the Document Type Definition (DTD) version that
corresponds to the firmware level to ensure that the XML is validated. The DTD provides the structure of all
content returned by the CLI when XML API format is enabled. By obtaining the latest DTD for validation, the
parser will be forward compatible. To obtain the DTD, go to http://hp.com/go/p2000.
18
Using the CLI
$sessionKey = $prop->textContent;

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents