5 =head1 NAME $RCSfile: vobdetails.cgi,v $
15 Andrew DeFaria <Andrew@ClearSCM.com>
23 Mon Oct 25 11:10:47 PDT 2008
27 $Date: 2011/01/14 16:51:58 $
33 Usage vobdetails.cgi: [-u|sage] [-r|egion <region>] -vo|b <vobtag>
37 -u|sage: Displays usage
38 -r|egion <region>: Region to use when looking for the vob
39 -vo|b <vobtag>: Tag of vob to display details for
42 -d|ebug: Output debug messages
46 This script display the details for the given vob
55 use CGI qw(:standard :cgi-lib *table start_Tr end_Tr);
56 use CGI::Carp 'fatalsToBrowser';
58 use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib";
70 my $subtitle = 'VOB Details';
72 if ($Clearcase::CC->region) {
73 $opts{region} ||= $Clearcase::CC->region;
75 $opts{region} ||= 'Clearcase not installed';
78 my $VERSION = '$Revision: 1.11 $';
79 ($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
84 my $active = ($vob->active) ? 'YES' : 'NO';
85 my $gpath = $vob->gpath;
87 $gpath = font {-class => 'unknown'}, '<no-gpath>'
88 if $gpath eq '<no-gpath>';
95 my $clearadm = Clearadm->new;
97 my %clearadmvob = $clearadm->GetVob($vob->tag, $vob->region);
100 display th {class => 'label'}, 'Tag:';
101 display td {class => 'data', colspan => 3}, setField $vob->tag;
102 display th {class => 'label'}, 'Server:';
103 display td {class => 'data'}, a {
104 href => 'systemdetails.cgi?system=' . $vob->shost
106 display th {class => 'label'}, 'Region:';
107 display td {class => 'data', colspan => 3}, $vob->region;
111 display th {class => 'label'}, 'Type:';
112 display td {class => 'data', colspan => 3}, $vob->access;
113 display th {class => 'label'}, 'Attributes:';
114 display td {class => 'data'}, $vob->vob_registry_attributes;
115 display th {class => 'label'}, 'Mount Opts:';
116 display td {class => 'data', colspan => 3}, $vob->mopts;
120 display th {class => 'label'}, 'Owner:';
121 display td {class => 'data', colspan => 3}, $vob->owner;
122 display th {class => 'label'}, 'Active:';
123 display td {class => 'data'}, $active;
124 display th {class => 'label'}, 'ACLs Enabled:';
125 display td {class => 'data', colspan => 3}, $vob->aclsEnabled;
129 display th {class => 'label'}, 'Created by:';
130 display td {class => 'data', colspan => 3}, $vob->ownername;
131 display th {class => 'label'}, 'on:';
132 display td {class => 'data'}, $vob->created;
133 display th {class => 'label'}, 'Atomic Checkin:';
134 display td {class => 'data', colspan => 3}, $vob->atomicCheckin;
138 display th {class => 'label'}, 'Comment:';
139 display td {class => 'data', colspan => 5}, $vob->comment;
140 display th {class => 'label'}, 'Schema Version:';
141 display td {class => 'data', colspan => 3}, $vob->schemaVersion;
145 display th {class => 'label'}, 'Global Path:';
146 display td {class => 'data', colspan => 5}, $gpath;
147 display th {class => 'label'}, 'Registry Attributes:';
148 display td {class => 'data', colspan => 3}, $vob->vob_registry_attributes;
152 display th {class => 'label'}, 'Access Path:';
153 display td {class => 'data', colspan => 5}, $vob->access_path;
154 display th {class => 'label'}, 'Group:';
155 display td {class => 'data', colspan => 3}, $vob->group;
159 display th {class => 'label'}, 'Family UUID:';
160 display td {class => 'data', colspan => 5}, $vob->family_uuid;
161 display th {class => 'label'}, 'Remote Privilage:';
162 display td {class => 'data', colspan => 3}, $vob->remotePrivilege;
166 display th {class => 'label'}, 'Replica UUID:';
167 display td {class => 'data', colspan => 5}, $vob->replica_uuid;
168 display th {class => 'label'}, 'Master Replica:';
169 display td {class => 'data', colspan => 3}, $vob->masterReplica;
172 my $groups = join "<br>", $vob->groups;
175 display th {class => 'label'}, 'Groups:';
176 display td {class => 'data', colspan => 10}, $groups;
179 my %attributes = $vob->attributes;
182 for (keys %attributes) {
183 $attributes .= "$_ = $attributes{$_}<br>";
187 display th {class => 'label'}, 'Attributes:';
188 display td {class => 'data', colspan => 10}, $attributes;
191 my %hyperlinks = $vob->hyperlinks;
194 for (keys %hyperlinks) {
195 $hyperlinks .= "$_ = $hyperlinks{$_}<br>";
199 display th {class => 'label'}, 'Hyperlinks:';
200 display td {class => 'data', colspan => 10}, $hyperlinks;
204 display th {class => 'labelCentered', colspan => 10}, 'VOB Storage Pools';
207 my $image = $clearadmvob{adminsmall}
208 ? "data:image/png;base64,$clearadmvob{adminsmall}"
209 : "plotstorage.cgi?type=vob&storage=admin&tiny=1&tag=" . $vob->tag;
212 display th {class => 'label'}, 'Admin:';
213 display td {class => 'data', colspan => 4, align => 'center'}, a {href =>
214 'plot.cgi?type=vob&storage=admin&scaling=Day&points=7®ion=' . $vob->region . '&tag=' . $vob->tag
220 $image = $clearadmvob{sourcesmall}
221 ? "data:image/png;base64,$clearadmvob{sourcesmall}"
222 : 'plotstorage.cgi?type=vob&storage=source&tiny=1®ion=' . $vob->region . '&tag=' . $vob->tag;
224 display th {class => 'label'}, 'Source Size:';
225 display td {class => 'data', colspan => 4, align => 'center'}, a {href =>
226 'plot.cgi?type=vob&storage=source&scaling=Day&points=7®ion=' . $vob->region . '&tag=' . $vob->tag
234 $image = $clearadmvob{dbsmall}
235 ? "data:image/png;base64,$clearadmvob{dbsmall}"
236 : 'plotstorage.cgi?type=vob&storage=db&tiny=1®ion=' . $vob->region . '&tag=' . $vob->tag;
238 display th {class => 'label'}, 'Database:';
239 display td {class => 'data', colspan => 4, align => 'center'}, a {href =>
240 'plot.cgi?type=vob&storage=db&scaling=Day&points=7®ion=' . $vob->region . '&tag=' . $vob->tag
246 $image = $clearadmvob{derivedobjsmall}
247 ? "data:image/png;base64,$clearadmvob{derivedobjsmall}"
248 : 'plotstorage.cgi?type=vob&storage=derivedobj&tiny=1®ion=' . $vob->region . '&tag=' . $vob->tag;
250 display th {class => 'label'}, 'Derived Obj:';
251 display td {class => 'data', colspan => 4, align => 'center'}, a {href =>
252 'plot.cgi?type=vob&storage=derivedobj&scaling=Day&points=7®ion=' . $vob->region . '&tag=' . $vob->tag
260 $image = $clearadmvob{cleartextsmall}
261 ? "data:image/png;base64,$clearadmvob{cleartextsmall}"
262 : 'plotstorage.cgi?type=vob&storage=cleartext&tiny=1®ion=' . $vob->retion . '&tag=' . $vob->tag;
264 display th {class => 'label'}, 'Cleartext:';
265 display td {class => 'data', colspan => 4, align => 'center'}, a {href =>
266 'plot.cgi?type=vob&storage=cleartext&scaling=Day&points=7®ion=' . $vob->region . '&tag=' . $vob->tag
272 $image = $clearadmvob{totalsmall}
273 ? "data:image/png;base64,$clearadmvob{totalsmall}"
274 : 'plotstorage.cgi?type=vob&storage=total&tiny=1®ion=' . $vob->region . '&tag=' . $vob->tag;
276 display th {class => 'label'}, 'Total Size:';
277 display td {class => 'data', colspan => 4, align => 'center'}, a {href =>
278 'plot.cgi?type=vob&storage=total&scaling=Day&points=7®ion=' . $vob->region . '&tag=' . $vob->tag
290 sub DisplayRegion() {
291 display start_form (action => 'vobdetails.cgi');
295 my ($defaultRegion, @regions) = ('', ('Clearcase not installed'));
299 -values => [@regions],
300 -default => $defaultRegion,
301 -onchange => 'submit();',
316 my @vobs = Clearcase::Vobs->new ($region);
319 push @vobs, 'No VOBs';
322 display start_form(action => 'vobdetails.cgi');
328 -values => [$Clearcase::CC->regions],
330 -onchange => 'submit();',
338 -onchange => 'submit();',
353 'usage' => sub { Usage },
354 'verbose' => sub { set_verbose },
355 'debug' => sub { set_debug },
358 ) or Usage "Invalid parameter";
361 verbose "$FindBin::Script v$VERSION";
369 unless ($opts{tag}) {
370 unless ($opts{region}) {
373 DisplayVobs $opts{region};
379 my $vob = Clearcase::Vob->new($opts{tag}, $opts{region});
387 =head1 CONFIGURATION AND ENVIRONMENT
389 DEBUG: If set then $debug is set to this level.
391 VERBOSE: If set then $verbose is set to this level.
393 TRACE: If set then $trace is set to this level.
401 L<CGI::Carp|CGI::Carp>
405 L<Getopt::Long|Getopt::Long>
407 =head2 ClearSCM Perl Modules
423 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/Clearadm.pm">Clearadm</a><br>
424 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/ClearadmWeb.pm">ClearadmWeb</a><br>
425 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a><br>
426 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/View.pm">Clearcase::View</a><br>
427 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/Views.pm">Clearcase::Views</a><br>
428 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
429 <a href="http://clearscm.com/php/scm_man.php?file=lib/Utils.pm">Utils</a><br>
434 =head1 BUGS AND LIMITATIONS
436 There are no known bugs in this script
438 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
440 =head1 LICENSE AND COPYRIGHT
442 Copyright (c) 2010, ClearSCM, Inc. All rights reserved.