ensembl-hive  2.8.1
peekJob.pl
Go to the documentation of this file.
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 
5  # Finding out own path in order to reference own components (including own modules):
6 use Cwd ();
7 use File::Basename ();
8 BEGIN {
9  $ENV{'EHIVE_ROOT_DIR'} ||= File::Basename::dirname( File::Basename::dirname( Cwd::realpath($0) ) );
10  unshift @INC, $ENV{'EHIVE_ROOT_DIR'}.'/modules';
11 }
12 
13 use Getopt::Long qw(:config no_auto_abbrev);
14 use Pod::Usage;
15 
19 
21 
22 main();
23 
24 
25 sub main {
26  my ($url, $reg_conf, $reg_type, $reg_alias, $nosqlvc, $job_id, $help);
27 
28  GetOptions(
29 
30  # Connection parameters:
31  'url=s' => \$url,
32  'reg_conf|regfile|reg_file=s' => \$reg_conf,
33  'reg_type=s' => \$reg_type,
34  'reg_alias|regname|reg_name=s' => \$reg_alias,
35  'nosqlvc' => \$nosqlvc, # using "nosqlvc" instead of "sqlvc!" for consistency with scripts where it is a propagated option
36 
37  # Task specification parameters:
38  'job_id=i' => \$job_id,
39 
40  # Other commands
41  'h|help' => \$help,
42  ) or die "Error in command line arguments\n";
43 
44  if (@ARGV) {
45  die "ERROR: There are invalid arguments on the command-line: ". join(" ", @ARGV). "\n";
46  }
47 
48  if ($help || !$job_id) {
49  pod2usage({-exitvalue => 0, -verbose => 2});
50  }
51 
52  my $pipeline;
53 
54  if($url or $reg_alias) {
55 
57  -url => $url,
58  -reg_conf => $reg_conf,
59  -reg_type => $reg_type,
60  -reg_alias => $reg_alias,
61  -no_sql_schema_version_check => $nosqlvc,
62  );
63  # $pipeline->hive_dba()->dbc->requires_write_access();
64 
65  } else {
66  die "\nERROR: Connection parameters (url or reg_conf+reg_alias) need to be specified\n";
67  }
68 
69  unless($pipeline->hive_dba) {
70  die "ERROR : no database connection, the pipeline could not be accessed\n\n";
71  }
72 
73  print Bio::EnsEMBL::Hive::Scripts::PeekJob::peek($pipeline, $job_id);
74 }
75 
76 
77 __DATA__
78 
79 =pod
80 
81 =head1 NAME
82 
83 peekJob.pl [options]
84 
85 =head1 DESCRIPTION
86 
87 peekJob.pl is an eHive component script that allows us to peek into the parameters of a given job.
88 
89 =head1 USAGE EXAMPLES
90 
91  # Check the params for job 123456
92  peekJob.pl -url mysql://username:secret@hostname:port/ehive_dbname -job_id 12345
93 
94 =head1 OPTIONS
95 
96 =head2 Connection parameters:
97 
98 =over
99 
100 =item --reg_conf <path>
101 
102 path to a Registry configuration file
103 
104 =item --reg_alias <string>
105 
106 species/alias name for the eHive DBAdaptor
107 
108 =item --reg_type <string>
109 
110 type of the registry entry ("hive", "core", "compara", etc - defaults to "hive")
111 
112 =item --url <url string>
113 
114 URL defining where database is located
115 
116 =item --nosqlvc
117 
118 "No SQL Version Check" - set if you want to force working with a database created by a potentially schema-incompatible API
119 
120 =back
121 
122 =head2 Task specification parameters:
123 
124 =over
125 
126 =item --job_id <id>
127 
128 which Job (as defined by its database id) to peek at
129 
130 =back
131 
132 =head2 Other options:
133 
134 =over
135 
136 =item --help
137 
138 print this help
139 
140 =back
141 
142 =head1 LICENSE
143 
144  See the NOTICE file distributed with this work for additional information
145  regarding copyright ownership.
146 
147  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
148  You may obtain a copy of the License at
149 
150  http://www.apache.org/licenses/LICENSE-2.0
151 
152  Unless required by applicable law or agreed to in writing, software distributed under the License
153  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
154  See the License for the specific language governing permissions and limitations under the License.
155 
156 =head1 CONTACT
157 
158 Please subscribe to the eHive mailing list: http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users to discuss eHive-related questions or to be notified of our updates
159 
160 =cut
main
public main()
Bio::EnsEMBL::Hive::Utils::URL::hide_url_password
public Void hide_url_password()
Bio::EnsEMBL::Hive::Utils::URL
Definition: URL.pm:11
Bio::EnsEMBL::Hive::Scripts::PeekJob::peek
public peek()
Bio::EnsEMBL::Hive::HivePipeline::new
public new()
Bio::EnsEMBL::Hive::HivePipeline
Definition: HivePipeline.pm:13
BEGIN
public BEGIN()
Bio::EnsEMBL::Hive::Scripts::PeekJob
Definition: PeekJob.pm:6