+ #plugin which display the gathered topology
+ univbristopology = UnivbrisTopo(
+ page = page,
+ title = 'univbris_topology',
+ domid = 'univbris_topology',
+ query = query_resource_all,
+ )
+
+ # --------------------------------------------------------------------------
+ # Ofelia VTAM Plugin
+ # Bristol Plugin
+
+ #plugin which display a table where an experimenter will add VMs to according to his needs
+ # responsible to send the data to Manifold
+ univbrisvtamplugin = UnivbrisVtamPlugin(
+ page = page,
+ title = 'univbris_vtam',
+ domid = 'univbris_vtam',
+ query = sq_vms,
+ #query = sq_resource,
+ )
+
+ #plugin which display a form where an experimenter will specify
+ # in which testbed and which physical server to setup the VM
+ univbrisvtamform = UnivbrisVtamForm(
+ page = page,
+ title = 'univbris_vtam_form',
+ domid = 'univbris_vtam_form',
+ query = query_resource_all,
+ query_all = None,
+ datatables_options = {
+ 'iDisplayLength': 3,
+ 'bLengthChange' : True,
+ 'bAutoWidth' : True,
+ },
+ )
+
+ # --------------------------------------------------------------------------
+ # SLA View and accept dialog
+
+ sla_dialog = SlaDialog(
+ page = page,
+ title = 'sla dialog',
+ query = main_query,
+ togglable = False,
+ # start turned off, it will open up itself when stuff comes in
+ toggled = True,
+ domid = 'sla_dialog',
+ outline_complete = True,
+ username = request.user,
+ )
+
+ ## check user is pi or not
+ platform_query = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled')
+ account_query = Query().get('local:account').select('user_id','platform_id','auth_type','config')
+ platform_details = execute_query(self.request, platform_query)
+ account_details = execute_query(self.request, account_query)
+
+ # XXX When session has expired, this is None and thus not iterable
+ for platform_detail in platform_details:
+ for account_detail in account_details:
+ if platform_detail['platform_id'] == account_detail['platform_id']:
+ if 'config' in account_detail and account_detail['config'] is not '':
+ account_config = json.loads(account_detail['config'])
+ if 'myslice' in platform_detail['platform']:
+ acc_auth_cred = account_config.get('delegated_authority_credentials','N/A')
+ # assigning values
+ if acc_auth_cred == {} or acc_auth_cred == 'N/A':
+ pi = "is_not_pi"
+ else:
+ pi = "is_pi"
+