Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
78f183ff
Commit
78f183ff
authored
Jun 06, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add LookupByType().
parent
a49ace41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
db/Node.pm.in
db/Node.pm.in
+24
-0
No files found.
db/Node.pm.in
View file @
78f183ff
...
...
@@ -332,6 +332,30 @@ sub BulkLookup($$$)
return
0
;
}
#
#
Lookup
all
nodes
of
a
type
#
sub
LookupByType
($$)
{
my
($
class
,
$
type
)
=
@
_
;
my
@
result
=
();
my
$
query_result
=
DBQueryWarn
(
"select node_id from nodes as n where n.type='$type'"
);
return
()
if
(
!$query_result);
while
(
my
($
node_id
)
=
$
query_result
->
fetchrow_array
())
{
my
$
node
=
Node
->
Lookup
($
node_id
);
if
(
!defined($node)) {
print
STDERR
"No such node $node_id
\n
"
;
next
;
}
push
(@
result
,
$
node
);
}
return
@
result
;
}
sub
Create
($$$$)
{
my
($
class
,
$
node_id
,
$
experiment
,
$
argref
)
=
@
_
;
...
...
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