submitJob.pl - CGI script to receive jobs for Helios via HTTP POST
#[] more doc!
#[] more documentation here later
Example of submitting a Helios job by POSTing an XML stream:
#!/usr/bin/env perl use strict; use warnings; use LWP::UserAgent; use HTTP::Request::Common; my $ua = LWP::UserAgent->new(); my $jobXML = <<ENDXML; <?xml version="1.0" encoding="UTF-8"?> <job type="Helios::TestService"> <params> <arg1>a posted test job!</arg1> <note>this time without the class map</note> </params> </job> ENDXML my $r = $ua->request(POST 'http://localhost/cgi-bin/submitJob.pl', Content_Type => 'text/xml', Content => $message ); print $response->as_string;
HTTP/1.1 200 OK Connection: close Date: Fri, 16 Dec 2011 04:24:30 GMT Server: Apache/2.2.14 (Ubuntu) Vary: Accept-Encoding Content-Type: text/xml; charset=ISO-8859-1 Client-Date: Fri, 16 Dec 2011 04:24:30 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked <?xml version="1.0" encoding="UTF-8"?> <response> <status>0</status> <jobid>42</jobid> </response>
Given a job type, lookupJobClass() queries the HELIOS_CLASS_MAP table to determine if a Helios service class is associated with that job type. If there is, the function returns that service class. If it isn't, the original type is assumed to be the name of the desired service class, and it is returned to the caller instead.
helios_job_submit.pl, helios.pl, Helios::Service, Helios::Job
Andrew Johnson, <lajandy at cpan dot org>
Copyright (C) 2011 Andrew Johnson.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
This software comes with no warranty of any kind.
To install Helios, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Helios
CPAN shell
perl -MCPAN -e shell install Helios
For more information on module installation, please visit the detailed CPAN module installation guide.