...
 
Commits (57)
......@@ -46,6 +46,10 @@ my $MAINSITE = @TBMAINSITE@;
my $TBOPS = "@TBOPSEMAIL@";
my $SACERT = "$TB/etc/genisa.pem";
# Cache credentials so we do not keep regenerating down inside the
# libraries that make the XMLRPC calls.
my %credcache = ();
#
# Generate the credentials we need.
#
......@@ -66,6 +70,15 @@ sub GenCredentials($$;$)
$speaker_signer = "/usr/testbed/etc/utah-apt.sa";
}
#
# Check cache.
#
my $cachetag = $target->urn() . "::" . $geniuser->urn();
if (exists($credcache{$cachetag})) {
($credential,$speaksfor) = @{ $credcache{$cachetag} };
goto cached;
}
#
# If a local user account, but a nonlocal id, then we should
# have a speaksfor credential stored, as well as a certificate
......@@ -139,6 +152,10 @@ sub GenCredentials($$;$)
print STDERR "Could not sign $target credential\n";
goto bad;
}
if ($wantspeaksfor) {
$credcache{$cachetag} = [$credential, $speaksfor];
}
cached:
if (wantarray) {
return ($credential, $speaksfor);
}
......
This diff is collapsed.
......@@ -781,85 +781,12 @@ sub UpdateDiskImage($$@)
return 0;
}
#
# We need to convert from using URNs to using URLs for disk images,
# since we want to support choosing the backend. This list is the
# list as of the conversion, at the APT. Before we instantiate, look
# at the rspec and update the URNs to URLs based on this list.
#
my %APTImages = (
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:demo-profile' => 'https://www.apt.emulab.net/image_metadata.php?uuid=39383c39-7b2f-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:docker' => 'https://www.apt.emulab.net/image_metadata.php?uuid=5ae53ff8-7b2f-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:docker-running-env' => 'https://www.apt.emulab.net/image_metadata.php?uuid=a1317423-7b2f-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:docker-running-env-02' => 'https://www.apt.emulab.net/image_metadata.php?uuid=f30e8657-7b2f-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:Docker1' => 'https://www.apt.emulab.net/image_metadata.php?uuid=31d9f5c1-7b30-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:ESA' => 'https://www.apt.emulab.net/image_metadata.php?uuid=72d94622-7b35-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:firstclone' => 'https://www.apt.emulab.net/image_metadata.php?uuid=d49e30a8-7b31-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:FPTaylorVM' => 'https://www.apt.emulab.net/image_metadata.php?uuid=f2e99dbe-7b31-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:FrequentDirection' => 'https://www.apt.emulab.net/image_metadata.php?uuid=1c6b4e98-7b32-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:geni-lib' => 'https://www.apt.emulab.net/image_metadata.php?uuid=441fc279-7b32-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:gimiovsomf6' => 'https://www.apt.emulab.net/image_metadata.php?uuid=626184be-7b32-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:hadoop' => 'https://www.apt.emulab.net/image_metadata.php?uuid=ffa8f859-3524-11e4-8944-81966d62745f',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:hg' => 'https://www.apt.emulab.net/image_metadata.php?uuid=91dcd7d5-7b32-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:imageusage' => 'https://www.apt.emulab.net/image_metadata.php?uuid=adc61bad-7b32-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:Iperf' => 'https://www.apt.emulab.net/image_metadata.php?uuid=d0c8aba4-7b32-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:labwikiXORP' => 'https://www.apt.emulab.net/image_metadata.php?uuid=eee5f68d-7b32-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:myapt' => 'https://www.apt.emulab.net/image_metadata.php?uuid=13baa069-7b33-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:myclone' => 'https://www.apt.emulab.net/image_metadata.php?uuid=301d4978-7b33-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:myimage' => 'https://www.apt.emulab.net/image_metadata.php?uuid=03a342be-7b2c-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:myvm' => 'https://www.apt.emulab.net/image_metadata.php?uuid=6334cf1c-7a59-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:myvm2' => 'https://www.apt.emulab.net/image_metadata.php?uuid=aa8b3638-7a79-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:ricci-cav-2014' => 'https://www.apt.emulab.net/image_metadata.php?uuid=b3d6f6f7-7b35-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:rob-profile' => 'https://www.apt.emulab.net/image_metadata.php?uuid=31278fc7-7b34-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:robtestimage' => 'https://www.apt.emulab.net/image_metadata.php?uuid=4d43d6bb-7b34-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:singlenodelime' => 'https://www.apt.emulab.net/image_metadata.php?uuid=60905cf9-7b34-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:singlenodelime-2' => 'https://www.apt.emulab.net/image_metadata.php?uuid=8db24268-7b34-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:singlevmlime' => 'https://www.apt.emulab.net/image_metadata.php?uuid=b192a572-7b34-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:smack-cav2014-test' => 'https://www.apt.emulab.net/image_metadata.php?uuid=a4594b69-7b36-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:ubuntu1204maas' => 'https://www.apt.emulab.net/image_metadata.php?uuid=e532f26d-7b36-11e4-9439-db9edc46fe2c',
'urn:publicid:IDN+utahddc.geniracks.net+image+emulab-net:Ubuntu1404' => 'https://www.apt.emulab.net/image_metadata.php?uuid=0838c611-7b37-11e4-9439-db9edc46fe2c'
);
sub ConvertDiskImages($)
{
my ($self) = @_;
my $modified = 0;
my $rspec = GeniXML::Parse($self->rspec());
if (! defined($rspec)) {
print STDERR "Could not parse rspec\n";
return -1;
}
foreach my $ref (GeniXML::FindNodes("n:node", $rspec)->get_nodelist()) {
my $diskref = GeniXML::GetDiskImage($ref);
next
if (!defined($diskref));
my $imageurn = GeniXML::GetText("name", $diskref);
next
if (!defined($imageurn));
if (exists($APTImages{$imageurn})) {
GeniXML::SetDiskImage($ref, $APTImages{$imageurn});
$modified = 1;
}
}
if ($modified) {
$self->{'DBROW'}->{'rspec'} = GeniXML::Serialize($rspec);
my $profileid = $self->profileid();
my $version = $self->version();
my $safe_rspec = DBQuoteSpecial($self->rspec());
DBQueryWarn("update apt_profile_versions set rspec=$safe_rspec ".
"where profileid='$profileid' and version='$version'")
if (1);
}
return 0;
}
# Total nonsense, to be thrown away.
sub CheckNodeConstraints($$$)
{
my ($self, $iscloudlab, $pmsg) = @_;
my ($self, $default_aggregate_urn, $pmsg) = @_;
my $cloudwww = "www.utah.cloudlab.us";
my $cloudurn = "urn:publicid:IDN+utah.cloudlab.us+authority+cm";
require URI;
my $rspec = GeniXML::Parse($self->rspec());
......@@ -870,6 +797,11 @@ sub CheckNodeConstraints($$$)
foreach my $ref (GeniXML::FindNodes("n:node", $rspec)->get_nodelist()) {
my $client_id = GetVirtualId($ref);
my $virtualization_type = GeniXML::GetVirtualizationSubtype($ref);
my $manager_urn = GetManagerId($ref);
if (! defined($manager_urn)) {
$manager_urn = $default_aggregate_urn;
}
my $iscloudlab = ($manager_urn eq $cloudurn ? 1 : 0);
if (defined($virtualization_type) && $iscloudlab &&
$virtualization_type eq "emulab-xen") {
......@@ -1012,6 +944,81 @@ sub CheckDatasets($$$)
return 0;
}
#
# Set the component_manager_urn for the sites.
#
sub SetSites($$$$)
{
my ($prspecstr, $sitemap, $pneedstitcher, $perrmsg) = @_;
my $rspec = GeniXML::Parse($$prspecstr);
if (! defined($rspec)) {
$$perrmsg = "Could not parse rspec\n";
return -1;
}
foreach my $ref (GeniXML::FindNodes("n:node", $rspec)->get_nodelist()) {
my $client_id = GetVirtualId($ref);
my $site_id = GeniXML::GetJacksSiteId($ref);
if (!defined($site_id)) {
$$perrmsg = "No site ID for node $client_id";
return -1;
}
my $site_mid = "site:" . $site_id;
if (!exists($sitemap->{$site_mid})) {
$$perrmsg = "No site mapping for node $client_id ($site_id)";
return -1;
}
GeniXML::SetManagerId($ref, $sitemap->{$site_mid});
GeniXML::SetJacksSiteManagerId($ref, $sitemap->{$site_mid});
}
foreach my $ref (GeniXML::FindNodes("n:link", $rspec)->get_nodelist()) {
my %linksites = ();
my $client_id = GetVirtualId($ref);
foreach my $siteref (GeniXML::FindNodesNS("n:site", $ref,
$GeniXML::JACKS_NS)->get_nodelist()) {
my $site_id = GeniXML::GetText("id", $siteref);
if (!defined($site_id)) {
$$perrmsg = "No site ID for link $client_id";
return -1;
}
my $site_mid = "site:" . $site_id;
if (!exists($sitemap->{$site_mid})) {
$$perrmsg = "No site mapping for link $client_id ($site_id)";
return -1;
}
GeniXML::AddManagerToLink($ref, $sitemap->{$site_mid});
$linksites{$sitemap->{$site_mid}} = 1;
}
# if more then one site for a link, must use the stitcher.
$$pneedstitcher = 1
if (keys(%linksites) > 1);
}
$$prspecstr = GeniXML::Serialize($rspec);
return 0;
}
#
# Set the component_manager_urn for the rspec
#
sub BindRspec($$$)
{
my ($prspecstr, $aggregate_urn, $perrmsg) = @_;
my $rspec = GeniXML::Parse($$prspecstr);
if (! defined($rspec)) {
$$perrmsg = "Could not parse rspec\n";
return -1;
}
foreach my $ref (GeniXML::FindNodes("n:node", $rspec)->get_nodelist()) {
GeniXML::SetManagerId($ref, $aggregate_urn);
}
$$prspecstr = GeniXML::Serialize($rspec);
return 0;
}
sub IsHead($)
{
my ($self) = @_;
......
This diff is collapsed.
......@@ -167,7 +167,7 @@ sub DoCreate()
my $read_access;
my $write_access;
# imdataset snapshot info.
my ($instance,$nodeid,$bsname);
my ($instance,$aggregate,$nodeid,$bsname);
my $optlist = "ds:t:e:f:w:p:R:W:I:i:";
my %options = ();
......@@ -196,13 +196,16 @@ sub DoCreate()
if (!defined($instance)) {
fatal("Instance does not exist!");
}
$aggregate_urn = $instance->aggregate_urn();
($nodeid,$bsname) = split(",", $options{"I"});
if (! (defined($nodeid) && defined($bsname))) {
print STDERR "Improper -I opton for imdatasets\n";
&$usage();
}
$aggregate = $instance->FindAggregateByNodeId($nodeid);
if (!defined($aggregate)) {
fatal("Could not find aggregate for $nodeid");
}
$aggregate_urn = $aggregate->aggregate_urn();
}
if (defined($options{"f"})) {
$fstype = $options{"f"};
......@@ -343,7 +346,7 @@ sub DoCreate()
# Handoff to snapshot if an imdataset.
#
if ($type eq "imdataset" &&
DoSnapShotInternal($dataset, $instance,
DoSnapShotInternal($dataset, $aggregate,
$bsname, $nodeid, \$errmsg)) {
$instance->Unlock();
goto failed;
......@@ -622,6 +625,10 @@ sub DoSnapshot()
if (!defined($instance)) {
fatal("No such instance");
}
my $aggregate = $instance->FindAggregateByNodeId($nodeid);
if (!defined($aggregate)) {
fatal("Could not find aggregate for $nodeid");
}
if ($dataset->Lock()) {
fatal("dataset is busy, cannot lock it");
}
......@@ -637,7 +644,7 @@ sub DoSnapshot()
# Convenient.
$webtask->AutoStore(1);
}
if (DoSnapShotInternal($dataset, $instance, $bsname, $nodeid, \$errmsg)) {
if (DoSnapShotInternal($dataset, $aggregate, $bsname, $nodeid, \$errmsg)) {
goto failed;
}
if (PollDatasetStatus($dataset, \$errmsg)) {
......@@ -657,10 +664,10 @@ sub DoSnapshot()
sub DoSnapShotInternal($$$$$)
{
my ($dataset, $instance, $bsname, $nodeid, $perrmsg) = @_;
my ($dataset, $aggregate, $bsname, $nodeid, $perrmsg) = @_;
my $errmsg;
my $manifest = GeniXML::Parse($instance->manifest());
my $manifest = GeniXML::Parse($aggregate->manifest());
if (! defined($manifest)) {
$errmsg = "Could not parse manifest";
goto failed;
......@@ -695,8 +702,8 @@ sub DoSnapShotInternal($$$$$)
$errmsg = "Could not find node '$nodeid' in manifest";
goto failed;
}
my $response = $instance->CreateImage($sliver_urn,
$dataset->dataset_id(), $bsname);
my $response = $aggregate->CreateImage($sliver_urn,
$dataset->dataset_id(), 0, $bsname);
if ($response->code() != GENIRESPONSE_SUCCESS) {
$errmsg = "SnapshotDataset failed: ". $response->output() . "\n";
goto failed;
......
This diff is collapsed.
......@@ -51,6 +51,8 @@ my $rspec;
my $script;
my $profile;
my $instance;
my $aggregate;
my $node_id;
my $webtask;
my $webtask_id;
......@@ -318,7 +320,12 @@ if ($snap) {
if (!defined($instance)) {
fatal("Could not look up instance $uuid");
}
my $manifest = GeniXML::Parse($instance->manifest());
if ($instance->AggregateList() != 1) {
$errors{"error"} = "Must be only one aggregate to snapshot";
UserError();
}
($aggregate) = $instance->AggregateList();
my $manifest = GeniXML::Parse($aggregate->manifest());
if (! defined($manifest)) {
fatal("Could not parse manifest");
}
......@@ -327,6 +334,14 @@ if ($snap) {
$errors{"error"} = "Too many nodes (> 1) to snapshot";
UserError();
}
my $sliver_urn = GeniXML::GetSliverId($nodes[0]);
my $manager_urn= GeniXML::GetManagerId($nodes[0]);
$node_id = GeniXML::GetVirtualId($nodes[0]);
if (! (defined($sliver_urn) &&
$manager_urn eq $aggregate->aggregate_urn())) {
$errors{"error"} = "$node_id is not at " . $aggregate->aggregate_urn();
UserError();
}
}
if ($update) {
$profile = APT_Profile->Lookup($uuid);
......@@ -405,13 +420,6 @@ else {
# Now do the snapshot operation.
#
if (defined($instance)) {
my $manifest = GeniXML::Parse($instance->manifest());
if (! defined($manifest)) {
fatal("Could not parse manifest");
}
my ($node) = GeniXML::FindNodes("n:node", $manifest)->get_nodelist();
my $sliver_urn = GeniXML::GetSliverId($node);
my $node_id = GeniXML::GetVirtualId($node);
my $apt_uuid = $instance->uuid();
my $imagename = $profile->name();
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -375,7 +375,10 @@ sub DiscoverResources($)
if (! (defined($credentials))) {
return GeniResponse->MalformedArgsResponse("Missing arguments");
}
my ($credential,$speaksfor,@morecreds) = GeniStd::CheckCredentials($credentials);
my ($credential,$speaksfor,@morecreds) =
GeniStd::CheckCredentials($credentials);
return GeniResponse->MalformedArgsResponse("Missing arguments")
if (!defined($credential));
return $credential
if (GeniResponse::IsResponse($credential));
......
......@@ -542,6 +542,18 @@ sub SetManagerId($$)
return $node;
}
sub AddManagerToLink($$)
{
my ($link, $urn) = @_;
my $ref = AddElement("component_manager", $link);
return undef
if (!defined($ref));
GeniXML::SetText("name", $ref, $urn);
return $link;
}
sub GetColocate($)
{
my ($node) = @_;
......
<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/0.1 http://www.protogeni.net/resources/rspec/0.1/request.xsd"
type="request" >
<node virtual_id="geni1"
virtualization_type="emulab-vnode"
component_id="urn:publicid:IDN+emulab.net+node+pg41"
exclusive="1"
component_manager_urn="urn:publicid:IDN+emulab.net+authority+cm">
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD" />
</node>
<node virtual_id="geni2"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm">
<node_type type_name="pc" type_slots="1"/>
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA8-OVZ-STD" />
</node>
<link virtual_id="ionlink">
<component_manager
name="urn:publicid:IDN+emulab.net+authority+cm"/>
<component_manager
name="urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm"/>
<interface_ref virtual_node_id="geni1"
virtual_interface_id="if0" />
<interface_ref virtual_node_id="geni2"
virtual_interface_id="if0" />
<component_hop
component_urn="urn:publicid:IDN+emulab.net+link+ion">
<interface_ref
component_node_urn="urn:publicid:IDN+emulab.net+node+ion"
component_interface_id="eth0"/>
</component_hop>
<component_hop
component_urn="urn:publicid:IDN+myelab.testbed.emulab.net+link+ion">
<interface_ref
component_node_urn="urn:publicid:IDN+myelab.testbed.emulab.net+node+ion"
component_interface_id="eth0"/>
</component_hop>
</link>
</rspec>
<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/0.1 http://www.protogeni.net/resources/rspec/0.1/request.xsd"
type="request" >
<node virtual_id="geni1"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+emulab.net+authority+cm">
<node_type type_name="pcpg-i2" type_slots="1"/>
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD" />
</node>
<node virtual_id="geni2"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+uky.emulab.net+authority+cm">
<node_type type_name="pc" type_slots="1"/>
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+uky.emulab.net+image+emulab-ops//FEDORA10-STD" />
</node>
<link virtual_id="ionlink">
<bandwidth>100000</bandwidth>
<component_manager
name="urn:publicid:IDN+emulab.net+authority+cm"/>
<component_manager
name="urn:publicid:IDN+uky.emulab.net+authority+cm"/>
<interface_ref virtual_node_id="geni1"
virtual_interface_id="if0" />
<interface_ref virtual_node_id="geni2"
virtual_interface_id="if0" />
<component_hop
component_urn="urn:publicid:IDN+emulab.net+link+ion">
<interface_ref
component_node_urn="urn:publicid:IDN+emulab.net+node+ion"
component_interface_id="eth0"/>
</component_hop>
<component_hop
component_urn="urn:publicid:IDN+uky.emulab.net+link+ion">
<interface_ref
component_node_urn="urn:publicid:IDN+emulab.net+node+ion"
component_interface_id="eth0"/>
</component_hop>
</link>
</rspec>
<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/0.1 http://www.protogeni.net/resources/rspec/0.1/request.xsd"
type="request" >
<node virtual_id="geni1"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+emulab.net+authority+cm">
<node_type type_name="pcpg-i2" type_slots="1"/>
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA10-STD" />
</node>
<node virtual_id="geni2"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+schooner.wail.wisc.edu+authority+cm">
<node_type type_name="pc" type_slots="1"/>
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+schooner.wail.wisc.edu+image+emulab-ops//FC8-STD" />
</node>
<link virtual_id="gpenilink">
<bandwidth>100000</bandwidth>
<component_manager
name="urn:publicid:IDN+emulab.net+authority+cm"/>
<component_manager
name="urn:publicid:IDN+schooner.wail.wisc.edu+authority+cm"/>
<interface_ref virtual_node_id="geni1"
virtual_interface_id="if0" />
<interface_ref virtual_node_id="geni2"
virtual_interface_id="if0" />
<component_hop
component_urn="urn:publicid:IDN+emulab.net+link+gpeni">
<interface_ref
component_node_urn="urn:publicid:IDN+emulab.net+node+gpeni"
component_interface_id="eth0"/>
</component_hop>
<component_hop
component_urn="urn:publicid:IDN+schooner.wail.wisc.edu+link+gpeni">
<interface_ref
component_node_urn="urn:publicid:IDN+emulab.net+node+gpeni"
component_interface_id="eth0"/>
</component_hop>
</link>
</rspec>
<rspec xmlns="http://www.geni.net/resources/rspec/3"
xmlns:planetlab="http://www.planet-lab.org/resources/sfa/ext/planetlab/1"
xmlns:stitch="http://hpn.east.isi.edu/rspec/ext/stitch/0.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
type="request"
xsi:schemaLocation="http://www.geni.net/resources/rspec/3 http://www.geni.net/resources/rspec/3/request.xsd http://hpn.east.isi.edu/rspec/ext/stitch/0.1/ http://hpn.east.isi.edu/rspec/ext/stitch/0.1/stitch-schema.xsd">
<node client_id="utahem"
component_manager_id="urn:publicid:IDN+emulab.net+authority+cm"
exclusive="false">
<sliver_type name="raw-pc"/>
<interface client_id="utahem:if0">
<ip address="192.168.1.1" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
<node client_id="utahcl"
component_manager_id="urn:publicid:IDN+utah.cloudlab.us+authority+cm"
exclusive="false">
<sliver_type name="raw-pc">
<disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//UBUNTU14-64-STD"/>
</sliver_type>
<interface client_id="utahcl:if0">
<ip address="192.168.1.2" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
<link client_id="mylink">
<component_manager
name="urn:publicid:IDN+emulab.net+authority+cm"/>
<component_manager
name="urn:publicid:IDN+utah.cloudlab.us+authority+cm"/>
<component_manager
name="urn:publicid:IDN+stitch.geniracks.net+authority+cm"/>
<interface_ref client_id="utahem:if0"/>
<interface_ref client_id="utahcl:if0"/>
<property capacity="10000" dest_id="utahem:if0" source_id="utahcl:if0"/>
<property capacity="10000" dest_id="utahcl:if0" source_id="utahem:if0"/>
</link>
<stitching xmlns="http://hpn.east.isi.edu/rspec/ext/stitch/0.1/" lastUpdateTime="20150415:17:41:15">
<path id="mylink">
<hop id="1" type="strict">
<link id="urn:publicid:IDN+emulab.net+interface+*:*">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>2</nextHop>
</hop>
<hop id="1" type="strict">
<link id="urn:publicid:IDN+emulab.net+interface+procurve1:7.2">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>2</nextHop>
</hop>
<hop id="2" type="strict">
<link id="urn:publicid:IDN+stitch.geniracks.net+interface+procurveA:1.5">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>3</nextHop>
</hop>
<hop id="3" type="strict">
<link id="urn:publicid:IDN+stitch.geniracks.net+interface+scidmz:2.4">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>4</nextHop>
</hop>
<hop id="4" type="strict">
<link id="urn:publicid:IDN+utah.cloudlab.us+interface+bighp1:4.21">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>null</nextHop>
</hop>
</path>
</stitching>
</rspec>
<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
http://www.protogeni.net/resources/rspec/2/request.xsd"
type="request">
<node client_id="left"
component_manager_id="urn:publicid:IDN+emulab.net+authority+cm"
exclusive="true">
<sliver_type name="raw-pc">
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA15-STD" />
</sliver_type>
<interface client_id="left:if0">
<ip address="192.168.44.1" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
<node client_id="right"
component_manager_id="urn:publicid:IDN+utah.geniracks.net+authority+cm"
exclusive="false">
<sliver_type name="emulab-openvz">
</sliver_type>
<interface client_id="right:if0">
<ip address="192.168.44.2" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
<link client_id="mylink">
<component_manager
name="urn:publicid:IDN+emulab.net+authority+cm"/>
<component_manager
<rspec xmlns="http://www.geni.net/resources/rspec/3"
xmlns:planetlab="http://www.planet-lab.org/resources/sfa/ext/planetlab/1"
xmlns:stitch="http://hpn.east.isi.edu/rspec/ext/stitch/0.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
type="request"
xsi:schemaLocation="http://www.geni.net/resources/rspec/3 http://www.geni.net/resources/rspec/3/request.xsd http://hpn.east.isi.edu/rspec/ext/stitch/0.1/ http://hpn.east.isi.edu/rspec/ext/stitch/0.1/stitch-schema.xsd">
<node client_id="utahddc"
component_manager_id="urn:publicid:IDN+utahddc.geniracks.net+authority+cm"
exclusive="false">
<sliver_type name="emulab-xen"/>
<interface client_id="utahddc:if0">
<ip address="192.168.1.1" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
<node client_id="utahig"
component_manager_id="urn:publicid:IDN+utah.geniracks.net+authority+cm"
exclusive="false">
<sliver_type name="emulab-xen"/>
<interface client_id="utahig:if0">
<ip address="192.168.1.2" netmask="255.255.255.0" type="ipv4"/>
</interface>
</node>
<link client_id="mylink">
<component_manager
name="urn:publicid:IDN+utahddc.geniracks.net+authority+cm"/>
<component_manager
name="urn:publicid:IDN+utah.geniracks.net+authority+cm"/>
<interface_ref client_id="left:if0" />
<interface_ref client_id="right:if0" />
<property source_id="left:if0" dest_id="right:if0" capacity="100000"/>
<property source_id="right:if0" dest_id="left:if0" capacity="100000"/>
</link>
<stitching xmlns="http://hpn.east.isi.edu/rspec/ext/stitch/0.1/"
lastUpdateTime="20110220:09:30:21">
<path id="mylink" >
<component_manager
name="urn:publicid:IDN+stitch.geniracks.net+authority+cm"/>
<interface_ref client_id="utahddc:if0"/>
<interface_ref client_id="utahig:if0"/>
<property capacity="10000" dest_id="utahddc:if0" source_id="utahig:if0"/>
<property capacity="10000" dest_id="utahig:if0" source_id="utahddc:if0"/>
</link>
<stitching xmlns="http://hpn.east.isi.edu/rspec/ext/stitch/0.1/" lastUpdateTime="20150415:17:41:15">
<path id="mylink">
<hop id="1" type="strict">
<link id="urn:publicid:IDN+emulab.net+interface+*:*">
<link id="urn:publicid:IDN+utahddc.geniracks.net+interface+procurve2:2.22">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>2</nextHop>
</hop>
<hop id="2" type="strict">
<link id="urn:publicid:IDN+emulab.net+interface+procurveA:3.19">
<link id="urn:publicid:IDN+stitch.geniracks.net+interface+scidmz:3.3">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<!-- <suggestedVLANRange>null</suggestedVLANRange> -->
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
......@@ -76,19 +72,18 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
</link>
<nextHop>3</nextHop>
</hop>
<hop id="3" type="strict">
<link id="urn:publicid:IDN+utah.geniracks.net+interface+procurve2:1.19">
<link id="urn:publicid:IDN+stitch.geniracks.net+interface+procurveA:3.19">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000000000</capacity>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<!-- <suggestedVLANRange>null</suggestedVLANRange> -->
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
......@@ -96,25 +91,25 @@ http://www.protogeni.net/resources/rspec/2/request.xsd"
</link>
<nextHop>4</nextHop>
</hop>
<hop id="4" type="strict">
<link id="urn:publicid:IDN+utah.geniracks.net+interface+*:*">
<link id="urn:publicid:IDN+utah.geniracks.net+interface+procurve2:1.19">
<trafficEngineeringMetric>10</trafficEngineeringMetric>
<capacity>10000</capacity>
<switchingCapabilityDescriptor>
<switchingcapType>l2sc</switchingcapType>
<encodingType>ethernet</encodingType>
<switchingCapabilitySpecificInfo>
<switchingCapabilitySpecificInfo_L2sc>
<interfaceMTU>9000</interfaceMTU>
<vlanRangeAvailability>2-4094</vlanRangeAvailability>
<suggestedVLANRange>null</suggestedVLANRange>
<interfaceMTU>1500</interfaceMTU>
<vlanRangeAvailability>2100-3499</vlanRangeAvailability>
<suggestedVLANRange>2345</suggestedVLANRange>
<vlanTranslation>false</vlanTranslation>
</switchingCapabilitySpecificInfo_L2sc>
</switchingCapabilitySpecificInfo>
</switchingCapabilityDescriptor>
</link>
<nextHop>null</nextHop>
</hop>
</path>
</stitching>
</rspec>
File mode changed from 100644 to 100755
......@@ -38,7 +38,7 @@ sub usage()
"Spew an image file to a (widearea) node.\n";
exit(-1);
}
my $optlist = "t:k:hs";
my $optlist = "t:k:hsd";
my $debug = 0;
my $headonly = 0;
my $sigfile = 0;
......@@ -99,6 +99,9 @@ if (! getopts($optlist, \%options)) {
if (defined($options{"h"})) {
$headonly = 1;
}
if (defined($options{"d"})) {
$debug = 1;
}
if (defined($options{"s"})) {
$sigfile = 1;
}
......
/*
Common
*/
.wizard,
.tabcontrol
{
display: block;
width: 100%;
overflow: hidden;
}
.wizard a,
.tabcontrol a
{
outline: 0;
}
.wizard ul,
.tabcontrol ul
{
list-style: none !important;
padding: 0;
margin: 0;
}
.wizard ul > li,
.tabcontrol ul > li
{
display: block;
padding: 0;
}
/* Accessibility */
.wizard > .steps .current-info,
.tabcontrol > .steps .current-info
{
position: absolute;
left: -999em;
}
/*
Wizard
*/
.wizard > .steps
{
position: relative;
display: block;
margin-bottom: 10px;
padding: 0 7px 0 8px;
}
.wizard.vertical > .steps
{
display: inline;
float: left;
width: 30%;
}
.wizard > .steps .number
{
font-size: 1.429em;
}
.wizard > .steps > ul > li
{
width: 33.3%;
}
.wizard > .steps > ul > li,
.wizard > .actions > ul > li
{
float: left;
}
.wizard.vertical > .steps > ul > li
{
float: none;
width: 100%;
}
.wizard > .steps a,
.wizard > .steps a:hover,
.wizard > .steps a:active
{
display: block;
width: auto;
margin: 0 0.5em 0.5em;
padding: 1em 1em;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.wizard > .steps .disabled a,
.wizard > .steps .disabled a:hover,
.wizard > .steps .disabled a:active
{
background: #eee;
color: #aaa;
cursor: default;
}
.wizard > .steps .current a,
.wizard > .steps .current a:hover,
.wizard > .steps .current a:active
{
background: #2184be;
color: #fff;
cursor: default;
}
.wizard > .steps .done a,
.wizard > .steps .done a:hover,
.wizard > .steps .done a:active
{
background: #9dc8e2;
color: #fff;
}
.wizard > .steps .error a,
.wizard > .steps .error a:hover,
.wizard > .steps .error a:active
{
background: #ff3111;
color: #fff;
}
.wizard > .actions
{
position: relative;
display: block;
text-align: right;
padding: 0 7px;
}
.wizard.vertical > .actions
{
display: inline;
float: right;
margin: 0 2.5%;
width: 95%;
}
.wizard > .actions > ul
{
display: inline-block;
text-align: right;
}
.wizard > .actions > ul > li
{
margin: 0 0.5em;
}
.wizard.vertical > .actions > ul > li
{
margin: 0 0 0 1em;
}
.wizard > .actions a,
.wizard > .actions a:hover,
.wizard > .actions a:active
{
background: #2184be;
color: #fff;
display: block;
padding: 0.5em 1em;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.wizard > .actions .disabled a,
.wizard > .actions .disabled a:hover,
.wizard > .actions .disabled a:active
{
background: #eee;
color: #aaa;
}
.wizard > .loading
{
}
.wizard > .loading .spinner
{
}
/*
Tabcontrol
*/
.tabcontrol > .steps
{
position: relative;
display: block;
width: 100%;
}
.tabcontrol > .steps > ul
{
position: relative;
margin: 6px 0 0 0;
top: 1px;
z-index: 1;
}
.tabcontrol > .steps > ul > li
{
float: left;
margin: 5px 2px 0 0;
padding: 1px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.tabcontrol > .steps > ul > li:hover
{
background: #edecec;
border: 1px solid #bbb;
padding: 0;
}
.tabcontrol > .steps > ul > li.current
{
background: #fff;
border: 1px solid #bbb;
border-bottom: 0 none;
padding: 0 0 1px 0;
margin-top: 0;
}
.tabcontrol > .steps > ul > li > a
{
color: #5f5f5f;
display: inline-block;
border: 0 none;
margin: 0;
padding: 10px 30px;
text-decoration: none;
}
.tabcontrol > .steps > ul > li > a:hover
{
text-decoration: none;
}
.tabcontrol > .steps > ul > li.current > a
{
padding: 15px 30px 10px 30px;
}
.tabcontrol > .content
{
position: relative;
display: inline-block;
width: 100%;
height: 35em;
overflow: hidden;
border-top: 1px solid #bbb;
padding-top: 20px;
}
.wizard > .content > .title,
.tabcontrol > .content > .title
{
position: absolute;
left: -999em;
}
.wizard form {
margin: 0;
}
#inline_jacks #showtopo_dialog, #inline_jacks #edit_dialog,
#inline_large_jacks #showtopo_dialog, #inline_large_jacks #edit_dialog {
width: auto;
}
#inline_jacks .panel, #inline_jacks .panel-body {
padding: 0;
margin: 0;
}
#inline_jacks #edit_nopicker {
height: auto;
}
.wizard #finalize_container .panel {
margin: 0;
}
.wizard #finalize_container {
padding: 0;
margin-bottom: 20px;
}
.wizard #inline_container {
padding: 0;
margin-bottom: 20px;
position: relative;
}
.wizard #inline_container #inline_overlay {
position: absolute;
display: block;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 20;
}
.wizard #inline_container #inline_overlay span {
color: #aaa;
top: 100%;
left: 17px;
margin-top: -19px;
position: absolute;
}
#inline_large_container button.close {
padding: 1px 5px 0 0;
}
#about_div {
padding-right: 30px;
}
#about_div .panel {
margin-left: -14px;
}
#where_warming {
margin-bottom: 0;
}
@media (min-width: 768px) {
.wizard #finalize_container.col-lg-8 {
padding-right: 5px;
}
.wizard #inline_container {
padding-left: 10px;
}
}
\ No newline at end of file
......@@ -68,9 +68,15 @@ class Instance
$this->instance = null;
return;
}
$this->instance = mysql_fetch_array($query_result);
$this->instance = mysql_fetch_array($query_result);
$this->slivers = InstanceSliver::LookupForInstance($this);
if (!count($this->slivers) && $this->aggregate_urn()) {
$this->slivers =
array(InstanceSliver::Lookup($this, $this->aggregate_urn()));
}
}
# accessors
function slivers() { return $this->slivers; }
function field($name) {
return (is_null($this->instance) ? -1 : $this->instance[$name]);
}
......@@ -431,4 +437,85 @@ class Instance
}
}
}
class InstanceSliver
{
var $sliver;
#
# Constructor by lookup on unique index.
#
function InstanceSliver($instance, $urn) {
$uuid = $instance->uuid();
$query_result =
DBQueryWarn("select * from apt_instance_aggregates ".
"where uuid='$uuid' and aggregate_urn='$urn'");
if (!$query_result || !mysql_num_rows($query_result)) {
$this->sliver = null;
return;
}
$this->sliver = mysql_fetch_array($query_result);
}
# accessors
function field($name) {
return (is_null($this->sliver) ? -1 : $this->sliver[$name]);
}
function uuid() { return $this->field('uuid'); }
function name() { return $this->field('name'); }
function aggregate_urn(){ return $this->field('aggregate_urn'); }
function status() { return $this->field('status'); }
function public_url() { return $this->field('public_url'); }
function webtask_id() { return $this->field('webtask_id'); }
function manifest() { return $this->field('manifest'); }
# Hmm, how does one cause an error in a php constructor?
function IsValid() {
return !is_null($this->sliver);
}
function Lookup($instance, $urn) {
$foo = new InstanceSliver($instance, $urn);
if ($foo->IsValid()) {
return $foo;
}
#
# Backwards compat for a while, create a fake one.
#
$webtask = WebTask::LookupByObject($instance->uuid());
$foo->sliver = array(
"uuid" => $instance->uuid(),
"name" => $instance->name(),
"aggregate_urn" => $instance->aggregate_urn(),
"status" => $instance->status(),
"public_url" => $instance->public_url(),
"manifest" => $instance->manifest(),
"webtask_id" => $webtask->task_id(),
);
return $foo;
}
#
# Lookup all slivers for an instance
#
function LookupForInstance($instance) {
$result = array();
$uuid = $instance->uuid();
$query_result =
DBQueryFatal("select aggregate_urn from apt_instance_aggregates ".
"where uuid='$uuid'");
while ($row = mysql_fetch_array($query_result)) {
$sliver = InstanceSliver::Lookup($instance, $row['aggregate_urn']);
if ($sliver) {
$result[] = $sliver;
}
}
return $result;
}
}
?>
This diff is collapsed.
define(['underscore', 'js/lib/text!template/edit-modal.html'],
function (_, editModalString)
define(['underscore', 'js/lib/text!template/edit-modal.html', 'js/lib/text!template/edit-inline.html'],
function (_, editModalString, editInlineString)
{
'use strict';
......@@ -67,32 +67,60 @@ function (_, editModalString)
alert('Failed to fetch Jacks context from ' + contextUrl);
}
function JacksEditor (root, isViewer)
function JacksEditor (root, isViewer, isInline,
withoutSelection, withoutMenu, withoutMultiSite)
{
console.info("foo");
console.info(withoutMultiSite);
this.root = root;
this.instance = null;
this.input = null;
this.output = null;
this.xml = null;
this.mode = 'editor';
this.selectionPane = true;
this.menu = true;
this.multisite = true;
if (isViewer)
{
this.mode = 'viewer';
}
this.shown = false;
this.render();
this.shown = false;
if (isInline) {
this.inline = 'inline';
}
// A little backward, but I didn't want the addition of these parameters to
// mess up code elsewhere. The previous values for these parts of the context was true.
if (withoutSelection) {
this.selectionPane = false;
}
if (withoutMenu) {
this.menu = false;
}
if (withoutMultiSite) {
this.multisite = false;
}
this.render();
}
JacksEditor.prototype = {
render: function ()
{
this.root.html(editModalString);
if (this.inline == 'inline')
{
this.root.html(editInlineString);
}
else
{
this.root.html(editModalString);
this.root.find('#quickvm_editmodal').on('shown.bs.modal', _.bind(this.handleShown, this));
}
if (this.mode !== 'editor')
{
this.root.find('.modal-header h3').html('Topology Viewer');
}
this.root.find('#quickvm_editmodal').on('shown.bs.modal', _.bind(this.handleShown, this));
this.root.find('#edit-save').click(_.bind(this.fetchXml, this));
this.root.find('#edit-cancel, #edit-dismiss')
.click(_.bind(this.cancelEdit, this));
......@@ -101,14 +129,15 @@ function (_, editModalString)
mode: this.mode,
source: 'rspec',
root: '#edit_nopicker',
nodeSelect: true,
multiSite: this.multisite,
nodeSelect: this.selectionPane,
readyCallback: _.bind(this.jacksReady, this),
show: {
rspec: false,
tour: false,
version: false,
menu: true,
selectInfo: true
menu: this.menu,
selectInfo: this.selectionPane
},
canvasOptions: context.canvasOptions,
constraints: context.constraints
......@@ -143,7 +172,12 @@ function (_, editModalString)
}
if (this.input)
{
this.root.find('#quickvm_editmodal').modal('show');
if (this.inline == 'inline') {
this.handleShown();
}
else {
this.root.find('#quickvm_editmodal').modal('show');
}
}
},
......
......@@ -5,6 +5,7 @@ window.APT_OPTIONS.configObject = {
paths: {
'jquery-ui': 'js/lib/jquery-ui',
'jquery-grid':'js/lib/jquery.appendGrid-1.3.1.min',
'jquery-steps': 'js/lib/jquery.steps.min',