7c72374b20a447962b0d2e302feceb27e371e10b hiram Mon Apr 1 14:28:05 2019 -0700 now using official help page refs #18869 diff --git src/hg/hubApi/tests/jsonConsumer.pl src/hg/hubApi/tests/jsonConsumer.pl index 221b7b6..5c51eec 100755 --- src/hg/hubApi/tests/jsonConsumer.pl +++ src/hg/hubApi/tests/jsonConsumer.pl @@ -27,31 +27,31 @@ my $maxItemsOutput = ""; ############################################################################## sub usage() { printf STDERR "usage: ./jsonConsumer.pl [arguments]\n"; printf STDERR "arguments: -test0 - perform test of /list/publicHubs and /list/ucscGenomes endpoints -hubUrl=<URL> - use the URL to access the track or assembly hub -db=<dbName> - use one of the UCSC databases for data access -track=<trackName> - specify a single track in a hub or database -chrom=<chromName> - restrict the operation to a single chromosome -start=<coordinate> - restrict the operation to a range, use both start and end -end=<coordinate> - restrict the operation to a range, use both start and end -maxItemsOutput=<N> - limit output to this number of items. Default 1,000 maximum allowed 1,000,000 --endpoint=<function> - were <function> is one of the following: +-endpoint=<function> - where <function> is one of the following: /list/publicHubs - provide a listing of all available public hubs /list/ucscGenomes - provide a listing of all available UCSC genomes /list/hubGenomes - list genomes from a specified hub (with hubUrl=...) /list/tracks - list data tracks available in specified hub or database genome /list/chromosomes - list chromosomes from specified data track /getData/sequence - return sequence from specified hub or database genome /getData/track - return data from specified track in hub or database genome "; } ############################################################################## ### ### these functions were copied from Ensembl HTTP::Tiny example code: ### https://github.com/Ensembl/ensembl-rest/wiki/Example-Perl-Client ### @@ -108,31 +108,31 @@ # After sleeping see that we re-request return performRestAction($endpoint, $parameters, $headers); } else { my ($status, $reason) = ($response->{status}, $response->{reason}); die "Failed for $endpoint! Status code: ${status}. Reason: ${reason}\n"; } } $request_count++; if(length $response->{content}) { return $response->{content}; } return; } -# generic output of a has pointer +# generic output of a hash pointer sub hashOutput($) { my ($hashRef) = @_; foreach my $key (sort keys %$hashRef) { my $value = $hashRef->{$key}; $value = "<array>" if (ref($value) eq "ARRAY"); $value = "<hash>" if (ref($value) eq "HASH"); printf STDERR "%s - %s\n", $key, $hashRef->{$key}; } } sub arrayOutput($) { my ($ary) = @_; my $i = 0; foreach my $element (@$ary) { printf STDERR "# %d\t%s\n", $i++, ref($element);