IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 12, 2008, 12:04:53 PM (18 years ago)
Author:
jhoblitt
Message:

add --timeout option to all ds*ls utilties and other minor doc changes
add the ability to all DataStore::* classes that handle HTTP to pass options directly to LWP::UserAgent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/scripts/dsrootls

    r14879 r17637  
    11#!/usr/bin/env perl
    22
    3 # Copyright (C) 2006-2007  Joshua Hoblitt
     3# Copyright (C) 2006-2008  Joshua Hoblitt
    44#
    5 # $Id: dsrootls,v 1.1 2007-09-18 04:15:09 jhoblitt Exp $
     5# $Id: dsrootls,v 1.2 2008-05-12 22:04:53 jhoblitt Exp $
    66
    77use strict;
     
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($uri);
     18my ($uri, $timeout);
    1919
    2020GetOptions(
    21     'uri|u=s'           => \$uri,
     21    'uri|u=s'       => \$uri,
     22    'timeout|t'     => \$timeout,
    2223) or pod2usage( 2 );
    2324
     
    2829) unless defined $uri;
    2930
     31# default http request timeout is 30s
     32$timeout ||= 30;
     33
    3034my %p = (
    3135    uri     => $uri,
    3236);
    3337
    34 my $response = DataStore::Root->new(%p)->request;
     38my $response = DataStore::Root->new(%p)->request(
     39        ua_args  => { timeout => $timeout },
     40    );
    3541
    3642die "request failed" unless defined $response;
     
    7884The URI of the file to be retrieved.
    7985
     86=item * --timeout|-t
     87
     88The ammount of time (in seconds) to wait for a response from the DataStore
     89after making an HTTP request.  The default is 30s.
     90
     91Optional.
     92
    8093=back
    8194
     
    94107=head1 COPYRIGHT
    95108
    96 Copyright (C) 2006-2007  Joshua Hoblitt.  All rights reserved.
     109Copyright (C) 2006-2008  Joshua Hoblitt.  All rights reserved.
    97110
    98111This program is free software; you can redistribute it and/or modify it under
     
    114127=head1 SEE ALSO
    115128
    116 L<DataStore>, L<DataStore::Product>, L<DataStore::FileSet>
     129L<dsget>, L<dsleech>, L<dsrootls>, L<dsproductls>, L<dsfilesetls>, L<DataStore>
    117130
    118131=cut
Note: See TracChangeset for help on using the changeset viewer.