set omf_control is checkbox checked - tweak creation/renewal message
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 1 Sep 2010 08:19:35 +0000 (10:19 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 1 Sep 2010 08:19:35 +0000 (10:19 +0200)
planetlab/slices/slice.php
planetlab/slices/slice_add.php

index fbcc6d7..417ab1d 100644 (file)
@@ -40,8 +40,10 @@ $slice_id=intval($_GET['id']);
 if ( ! $slice_id ) { plc_error('Malformed URL - id not set'); return; }
 
 ////////////////////
-// Get all columns as we focus on only one entry
-$slices= $api->GetSlices( array($slice_id));
+// have to name columns b/c we need the non-native 'omf_control' column
+$slice_columns=array('slice_id','name','peer_id','site_id','person_ids','node_ids',
+                    'url','description','instantiation','omf_control');
+$slices= $api->GetSlices( array($slice_id), $slice_columns);
 
 if (empty($slices)) {
   drupal_set_message ("Slice " . $slice_id . " not found");
@@ -147,10 +149,15 @@ EOF;
      } else {
       print <<< EOF
 <div class='my-slice-renewal'>
-<p>You must provide a short description as well as a link to a project website before renewing it.
-Do <span class='bold'>not</span> provide bogus information; if a complaint is lodged against your slice 
-and PlanetLab Operations is unable to determine what the normal behavior of your slice is, 
-your slice may be deleted to resolve the complaint.</p>
+<p>You <span class='bold'>must</span> provide a short description, 
+as well as a link to a project website, before renewing it.
+
+<br/> Please make sure to provide reasonable details on <span class='bold'>
+the kind of traffic</span>, and <span class='bold'>copyrights</span> if relevant. 
+Do <span class='bold'>not</span> provide bogus information; if a complaint is lodged against 
+your slice  and your PlanetLab Operations Center is unable to determine what the normal behavior 
+of your slice is, your slice may be deleted to resolve the complaint.</p>
+
 <p><span class='bold'>NOTE:</span> 
 Slices cannot be renewed beyond another $max_renewal_weeks week(s) ($max_renewal_date).
 </p>
@@ -253,6 +260,7 @@ $details->th_td('URL',$slice['url'],'url',array('width'=>50));
 $details->tr_submit("submit","Update Slice");
 $details->th_td('Expires',$expires);
 $details->th_td('Instantiation',$slice['instantiation']);
+$details->th_td("OMF-friendly", ($slice['omf_control'] ? 'Yes' : 'No') . " [to change: see 'omf_control' in the tags section below]");
 $details->th_td('Site',l_site_obj($site));
 // xxx show the PIs here
 //$details->th_td('PIs',...);
index 83d954d..704e0fe 100644 (file)
@@ -89,6 +89,14 @@ if ( $_POST['add-slice'] ) {
 
     if ($slice_id > 0) {
       drupal_set_message ("Slice $slice_id created");
+      if (isset($_POST['omf-control'])) {
+       if ($api->SetSliceOmfControl($slice_id,'yes') != 'yes') {
+         drupal_set_error("Could not set the 'omf_control' tag on newly created slice...");
+       } else {
+         drupal_set_message("Successfully set the 'omf_control' tag on slice");
+       }
+      }
+
       if ($person_ids) {
         // Add people
        $success=true;
@@ -183,14 +191,15 @@ if ($multiple_sites) {
                  
 print <<< EOF
 <div class='create-slice-instantiations'>
-<p>You must provide a short description of the new slice 
-as well as a link to a project website before creating it. 
-<br/>
-Do <span class='bold'>not</span> provide bogus information; if a complaint 
-is lodged against your slice and your PlanetLab Operations Center
-is unable to determine what the normal behavior of your slice is, 
-your slice may be deleted to resolve the complaint.
-</p>
+<p>You <span class='bold'>must</span> provide a short description, 
+as well as a link to a project website, before creating it.
+
+<br/> Please make sure to provide reasonable details on <span class='bold'>
+the kind of traffic</span>, and <span class='bold'>copyrights</span> if relevant. 
+Do <span class='bold'>not</span> provide bogus information; if a complaint is lodged against 
+your slice  and your PlanetLab Operations Center is unable to determine what the normal behavior 
+of your slice is, your slice may be deleted to resolve the complaint.</p>
+
 <p><span class='bold'>NOTE</span>: All PlanetLab users are <span class='bold'>strongly</span>
  encouraged to join the PlanetLab 
 <a href='https://lists.planet-lab.org/mailman/listinfo/users'>Users</a> 
@@ -232,6 +241,14 @@ $instantiation_select = $form->select_html ("instantiation", $selectors);
 $details->th_td("Instantiation",$instantiation_select,"instantiation",
                array('input_type'=>'select', 'value'=>$instantiation));
 
+// display the current settings if any (like, we've screwed up the first time)
+if (isset($_POST['omf-control'])) {
+  $omf_options=array('checked'=>'checked');
+} else {
+  $omf_options=array();
+}
+$details->th_td("OMF friendly",
+               $form->checkbox_html('omf-control','yes',$omf_options));
 
 $instantiation_text = <<< EOF
 <div class='create-slice-instantiations'>
@@ -242,6 +259,10 @@ $instantiation_text = <<< EOF
 <li><span class='bold'>Controller</span> creates a slice on all nodes to manipulate Delegated slices. </li>
 <li><span class='bold'>None</span> allows you to reserve a slice name; you may instantiate the slice later.</li>
 </ul>
+<p>PLC instantiated slices can be defined as <span class='bold'>OMF friendly</span>, 
+in which case slivers come with the OMF <span class='bold'>Resource Controller</span> pre-installed and pre-configured. 
+Such slivers can then be easily managed through a centralized tool, the OMF Experiment Controller.
+</p>
 </div>
 EOF;