Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
34daf1c1
Commit
34daf1c1
authored
Jan 28, 2013
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add monitor_pid(), publicid(), SetMonitorPid(), ClearMonitorPid(),
and SetPublicID().
parent
a05ffb66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
1 deletion
+62
-1
protogeni/lib/GeniSlice.pm.in
protogeni/lib/GeniSlice.pm.in
+62
-1
No files found.
protogeni/lib/GeniSlice.pm.in
View file @
34daf1c1
#
!/usr/bin/perl -wT
#
#
Copyright
(
c
)
2008
-
201
2
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2008
-
201
3
University
of
Utah
and
the
Flux
Group
.
#
#
{{{
GENIPUBLIC
-
LICENSE
#
...
...
@@ -296,6 +296,7 @@ sub field($$) { return ((! ref($_[0])) ? -1 : $_[0]->{'SLICE'}->{$_[1]}); }
sub
idx
($)
{
return
field
($
_
[
0
],
"idx"
);
}
sub
hrn
($)
{
return
field
($
_
[
0
],
"hrn"
);
}
sub
uuid
($)
{
return
field
($
_
[
0
],
"uuid"
);
}
sub
publicid
($)
{
return
field
($
_
[
0
],
"publicid"
);
}
sub
creator_uuid
($)
{
return
field
($
_
[
0
],
"creator_uuid"
);
}
sub
creator_urn
($)
{
return
field
($
_
[
0
],
"creator_urn"
);
}
sub
created
($)
{
return
field
($
_
[
0
],
"created"
);
}
...
...
@@ -307,6 +308,7 @@ sub exptidx($) { return field($_[0], "exptidx"); }
sub
needsfirewall
($)
{
return
field
($
_
[
0
],
"needsfirewall"
);
}
sub
registered
($)
{
return
field
($
_
[
0
],
"registered"
);
}
sub
isplaceholder
($)
{
return
field
($
_
[
0
],
"isplaceholder"
);
}
sub
monitor_pid
($)
{
return
field
($
_
[
0
],
"monitor_pid"
);
}
sub
cert
($)
{
return
$
_
[
0
]->{
'CERT'
}->
cert
();
}
sub
GetCertificate
($)
{
return
$
_
[
0
]->{
'CERT'
};
}
sub
LOCKED
($)
{
return
$
_
[
0
]->{
'LOCKED'
};
}
...
...
@@ -1072,6 +1074,65 @@ sub ListAll($$;$)
return
0
;
}
#
#
Set
/
Clear
the
monitor
pid
.
#
sub
SetMonitorPid
($$)
{
my
($
self
,
$
pid
)
=
@
_
;
my
$
uuid
=
$
self
->
uuid
();
my
$
query_result
=
DBQueryWarn
(
"update geni_slices set monitor_pid='$pid' "
.
"where uuid='$uuid'"
);
return
-
1
if
(
!$query_result);
$
self
->{
'SLICE'
}->{
'monitor_pid'
}
=
$
pid
;
return
0
;
}
sub
ClearMonitorPid
($)
{
my
($
self
)
=
@
_
;
my
$
uuid
=
$
self
->
uuid
();
my
$
query_result
=
DBQueryWarn
(
"update geni_slices set monitor_pid='0' "
.
"where uuid='$uuid'"
);
return
-
1
if
(
!$query_result);
$
self
->{
'SLICE'
}->{
'monitor_pid'
}
=
0
;
return
0
;
}
#
#
Set
the
public
ID
.
#
sub
SetPublicID
($)
{
my
($
self
)
=
@
_
;
require
libtestbed
;
my
$
uuid
=
$
self
->
uuid
();
my
$
publicid
=
libtestbed
::
TBGenSecretKey
();
return
-
1
if
(
!defined($publicid) || $publicid eq "");
my
$
query_result
=
DBQueryWarn
(
"update geni_slices set publicid='$publicid' "
.
"where uuid='$uuid'"
);
return
-
1
if
(
!$query_result);
$
self
->{
'SLICE'
}->{
'publicid'
}
=
$
publicid
;
return
0
;
}
##########################################################################
#
package
GeniSlice
::
ClientSliver
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment