
18
Using the CLI
if( $name eq 'response' ) {
$sessionKey = $prop->textContent;
}
}
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
.
Summary of Contents for P2000 G3
Page 1: ...HP P2000 G3 MSA System CLI Reference Guide Part number 500912 009 First edition February 2014 ...
Page 14: ...14 About this guide ...
Page 30: ...30 Categorical list of commands ...
Page 199: ...HP P2000 G3 MSA System CLI Reference Guide 199 See also set cache parameters show volumes ...
Page 294: ...294 Alphabetical list of commands See also set volume set vdisk ...
Page 498: ...498 XML API basetype properties PROPERTY name mrc version type uint8 0 PROPERTY OBJECT ...
Page 524: ...524 Glossary ...
Page 532: ...532 Index ...