[transfer-api] Example of globus-connect usage in the API

Bryce Allen ballen at ci.uchicago.edu
Mon Feb 6 18:30:56 CST 2012


I have a unit test that downloads GC and executes setup/start/stop
scripts via subprocess. It's all a bit messy and makes a lot of
assumptions about relative paths, but it may be a useful starting point
if you want to script endpoint setup.

A pure Python client would be awesome, but would require a huge amount
of work to implement a GridFTP server. I think the best that could be
done is adapt the test code into a clean API, so it's easier to manage
the download and setup of GC.

Anyway I've attached the test scripts. There are three shell scripts
that download GC to the 'gc' subdirectory under their exe location,
and the test_endpoint_gc_transfer function calls them with subprocess.
GC_SERVER should be 'relay.globusonline.org' in a production
environment - some of the ugliness of the scripts is to work around
limitations of the GC scripts for passing an alternate relay server
(needed for the testing envirnment).

-Bryce

On Mon, 06 Feb 2012 19:06:54 -0500
Maxim Potekhin <potekhin at bnl.gov> wrote:
> Thanks Bryce,
> 
> I just successfully activated a globus-connect endpoint, using 
> endpoint_create
> and the "delegate" just like I did in other cases.
> 
> The only thing that bothers me is that I need to do things outside of 
> the Python
> API, such as d/l globusconnect and then execute a few commands by it.
> I means
> it's doable, but I really wanted to converge to the situation where I 
> have a Python
> module and that's it. I realize that certain things aren't practical 
> implement in
> short term or even at all. But I suppose you would agree that having
> a completely
> programmatic endpoint in the Python client would be sweet.
> 
> Cheers,
> Maxim
> 
> 
> 
> On 2/6/2012 6:44 PM, Bryce Allen wrote:
> > I'm not sure what you mean by "operating an endpoint". You can
> > create an endpoint record for an existing GridFTP server like this:
> >
> >    api.endpoint_create("myendpointname",
> > hostname="gridftp.example.org")
> >
> > To create a globusconnect endpoint, just pass is_globus_connect=True
> > instead of a hostname:
> >
> >    _, _, result = api.endpoint_create("mygcendpoint",
> >                                       is_globus_connect=True)
> >    print "GC setup key: ", result["globus_connect_setup_key"]
> >
> > Offhand I'm not sure how this varies for GCMU - let me know if you
> > need a GCMU example.
> >
> > The Python API is a pretty thin wrapper of the raw API, so these
> > docs can be instructive, especially the result examples:
> > https://transfer.api.globusonline.org/v0.10/doc/index.html#endpoint-management
> >
> > -Bryce
> >
> > On Mon, 06 Feb 2012 18:27:21 -0500
> > Maxim Potekhin<potekhin at bnl.gov>  wrote:
> >> Hello Bryce,
> >>
> >> do you have a working example of operating an endpoint on
> >> globus-online? I understand that the service gives you a token to
> >> use. We did this with gsissh
> >> before, but now I need to migrate the code to API.
> >>
> >> Regards,
> >> Maxim
> >>
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc-setup.sh
Type: application/x-shellscript
Size: 488 bytes
Desc: not available
URL: <https://lists.globusonline.org/mailman/private/transfer-api/attachments/20120206/9614afc6/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc-start.sh
Type: application/x-shellscript
Size: 141 bytes
Desc: not available
URL: <https://lists.globusonline.org/mailman/private/transfer-api/attachments/20120206/9614afc6/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc-stop.sh
Type: application/x-shellscript
Size: 140 bytes
Desc: not available
URL: <https://lists.globusonline.org/mailman/private/transfer-api/attachments/20120206/9614afc6/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: globusconnect_tests.py
Type: text/x-python
Size: 4493 bytes
Desc: not available
URL: <https://lists.globusonline.org/mailman/private/transfer-api/attachments/20120206/9614afc6/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <https://lists.globusonline.org/mailman/private/transfer-api/attachments/20120206/9614afc6/attachment-0001.pgp>


More information about the transfer-api mailing list