From 05bee1963bee497f2b80626467c086d4d7fb973a Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 1 Sep 2010 10:19:35 +0200 Subject: [PATCH 1/1] set omf_control is checkbox checked - tweak creation/renewal message --- planetlab/slices/slice.php | 20 ++++++++++++------ planetlab/slices/slice_add.php | 37 ++++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/planetlab/slices/slice.php b/planetlab/slices/slice.php index fbcc6d7..417ab1d 100644 --- a/planetlab/slices/slice.php +++ b/planetlab/slices/slice.php @@ -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
-

You must provide a short description as well as a link to a project website before renewing it. -Do not 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.

+

You must provide a short description, +as well as a link to a project website, before renewing it. + +
Please make sure to provide reasonable details on +the kind of traffic, and copyrights if relevant. +Do not 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.

+

NOTE: Slices cannot be renewed beyond another $max_renewal_weeks week(s) ($max_renewal_date).

@@ -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',...); diff --git a/planetlab/slices/slice_add.php b/planetlab/slices/slice_add.php index 83d954d..704e0fe 100644 --- a/planetlab/slices/slice_add.php +++ b/planetlab/slices/slice_add.php @@ -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
-

You must provide a short description of the new slice -as well as a link to a project website before creating it. -
-Do not 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. -

+

You must provide a short description, +as well as a link to a project website, before creating it. + +
Please make sure to provide reasonable details on +the kind of traffic, and copyrights if relevant. +Do not 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.

+

NOTE: All PlanetLab users are strongly encouraged to join the PlanetLab Users @@ -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

@@ -242,6 +259,10 @@ $instantiation_text = <<< EOF
  • Controller creates a slice on all nodes to manipulate Delegated slices.
  • None allows you to reserve a slice name; you may instantiate the slice later.
  • +

    PLC instantiated slices can be defined as OMF friendly, +in which case slivers come with the OMF Resource Controller pre-installed and pre-configured. +Such slivers can then be easily managed through a centralized tool, the OMF Experiment Controller. +

    EOF; -- 2.43.0