2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 00:00:12 +00:00

add usage example for genreq and send_req.

This commit is contained in:
bybai
2015-08-14 01:16:49 -04:00
parent 7f726db1d0
commit 3bd62937f6

View File

@ -225,12 +225,19 @@ sub process_request {
=head3 genreq
Generate the REST API http request
Generate the docker REST API http request
Input:
$dochost: hash, keys: name, port, user, pw
$method: GET, PUT, POST, DELETE
$api: the url of rest api
$content: an xml section which including the data to perform the rest api
Return:
The REST API http request
Usage example:
my $api = "/images/json";
my $method = "GET";
my %dockerhost = ( name => "bybc0604", port => "2375", );
my $request = genreq(\%dockerhost, $method,$api, "");
=cut
@ -276,7 +283,9 @@ sub genreq {
2-http response error;
3-return a http error message;
5-operation failed
$response is the output of docker REST API.
Usage example:
my ($rc, $response) = send_req(\%dockerhost,\%ssl_file,$request->as_string());
=cut