trivial perl example for those who may get interested
authorAleš Křenek <ljocha@ics.muni.cz>
Thu, 13 Dec 2007 11:52:25 +0000 (11:52 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Thu, 13 Dec 2007 11:52:25 +0000 (11:52 +0000)
org.glite.jp.primary/Makefile
org.glite.jp.primary/examples/getjobattr.pl [new file with mode: 0644]

index a838b7b..c009692 100644 (file)
@@ -180,6 +180,7 @@ install:
        -mkdir -p ${PREFIX}/bin ${PREFIX}/etc ${PREFIX}/examples ${PREFIX}/etc/init.d  ${PREFIX}/lib
        ${INSTALL} -m 755 ${daemon} ${PREFIX}/bin
        ${INSTALL} -m 755 jpps-test ${PREFIX}/examples/glite-jp-primary-test
+       ${INSTALL} -m 755 ${top_srcdir}/examples/getjobattr.pl ${PREFIX}/examples/glite-jpps-getjobattr.pl
        if [ x${DOSTAGE} = xyes ]; then \
                mkdir -p ${PREFIX}/include/${globalprefix}/${jpprefix} ; \
                (cd ${top_srcdir}/interface && install -m 644 ${HDRS_I} ${PREFIX}/include/${globalprefix}/${jpprefix}) ; \
diff --git a/org.glite.jp.primary/examples/getjobattr.pl b/org.glite.jp.primary/examples/getjobattr.pl
new file mode 100644 (file)
index 0000000..fb4be1c
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+
+use SOAP::Lite;
+use Data::Dumper;
+
+$ENV{HTTPS_CA_DIR}='/etc/grid-security/certificates';
+$ENV{HTTPS_VERSION}='3';
+
+$ENV{HTTPS_CERT_FILE}="$ENV{HOME}/.globus/usercert.pem";
+$ENV{HTTPS_KEY_FILE}="$ENV{HOME}/.globus/userkey.pem";
+
+$proxy = shift;
+$job = shift;
+
+die "usage: $0 https://jp.primary.storage.org:8901/jpps https://some.nice.job/id attr attr ...\n"
+       unless $ARGV[0];
+
+$c = SOAP::Lite
+       -> proxy($proxy)
+       -> uri('http://glite.org/wsdl/services/jp');
+
+service $c 'http://egee.cesnet.cz/cms/export/sites/egee/en/WSDL/3.1/JobProvenancePS.wsdl' or die "service: $1\n";
+
+ns $c 'http://glite.org/wsdl/elements/jp';
+
+print "WSDL OK\n";
+
+push @attr,SOAP::Data->name(attributes => $_) for (@ARGV);
+
+$req = SOAP::Data->value(
+       SOAP::Data->name(jobid => $job),
+       @attr
+#      SOAP::Data->name(attributes => 'http://egee.cesnet.cz/en/Schema/LB/Attributes:CE'),
+#      SOAP::Data->name(attributes => 'http://egee.cesnet.cz/en/Schema/JP/System:owner')
+);
+
+
+
+on_fault $c sub { print Dumper($_[1]->fault); $fault = 1; };
+
+$resp = GetJobAttributes $c $req;
+
+print Dumper $resp->body unless $fault;
+