You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by nd...@apache.org on 2015/11/19 22:27:50 UTC
[1/3] airavata-php-gateway git commit: storage resource updates in
progress.
Repository: airavata-php-gateway
Updated Branches:
refs/heads/develop e8ff6b16c -> cce422518
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/storage-resource/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/storage-resource/edit.blade.php b/app/views/storage-resource/edit.blade.php
new file mode 100644
index 0000000..80dde1c
--- /dev/null
+++ b/app/views/storage-resource/edit.blade.php
@@ -0,0 +1,809 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+{{ HTML::style('css/admin.css')}}
+{{ HTML::style('css/datetimepicker.css')}}
+@stop
+
+@section('content')
+
+<div id="wrapper">
+<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+@include( 'partials/dashboard-block')
+<div id="page-wrapper">
+
+<div class="container-fluid">
+<div class="col-md-offset-2 col-md-8">
+
+<input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
+
+<div class="well">
+ <h4>Storage Resource : {{ $storageResource->hostName }}</h4>
+</div>
+@if( Session::has("message"))
+<span class="alert alert-success col-md-12">{{Session::get("message")}}</span>
+{{Session::forget("message") }}
+@endif
+
+<div class="col-md-12">
+ <ul class="nav nav-tabs nav-justified" id="tabs" role="tablist">
+ <li class="active"><a href="#tab-desc" data-toggle="tab">Description</a></li>
+ <!--
+ <li><a href="#tab-queues" data-toggle="tab">Queues</a></a></li>
+ <li><a href="#tab-filesystem" data-toggle="tab">FileSystem</a></li>
+ <li><a href="#tab-jobSubmission" data-toggle="tab">Job Submission Interfaces</a></li>
+ -->
+ <li><a href="#tab-dataMovement" data-toggle="tab">Data Movement Interfaces</a></li>
+ </ul>
+</div>
+
+<div class="tab-content">
+
+<div class="tab-pane active" id="tab-desc">
+
+ <form role="form" method="POST" action="{{ URL::to('/') }}/sr/edit">
+ <input type="hidden" name="srId" value="{{Input::get('srId') }}"/>
+ <input type="hidden" name="sr-edit" value="resDesc"/>
+
+ <div class="form-group required">
+ <label class="control-label">Host Name</label>
+ <input class="form-control hostName" value="{{ $storageResource->hostName }}" maxlength="100"
+ name="hostname" required="required"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Resource Description</label>
+ <textarea class="form-control" maxlength="255" name="description">{{ $storageResource->resourceDescription
+ }}</textarea>
+ </div>
+ <div class="form-group">
+ <input type="submit" class="btn btn-primary" name="step1" value="Save changes"/>
+ </div>
+
+ </form>
+
+</div>
+
+<!--
+<div class="tab-pane" id="tab-queues">
+
+ @if( is_array( $storageResource->batchQueues) )
+ <h3>Existing Queues :</h3>
+
+ <div class="panel-group" id="accordion">
+ @foreach( $storageResource->batchQueues as $index => $queue)
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ <a class="accordion-toggle collapsed existing-queue-name" data-toggle="collapse"
+ data-parent="#accordion" href="#collapse-{{$index}}">{{ $queue->queueName }}</a>
+
+ <div class="pull-right col-md-1">
+ <span class="glyphicon glyphicon-trash delete-queue" style="cursor:pointer;" data-toggle="modal"
+ data-target="#delete-queue" data-queue-name="{{ $queue->queueName }}"></span>
+ </div>
+ </h4>
+ </div>
+ <div id="collapse-{{$index}}" class="panel-collapse collapse">
+ <div class="panel-body">
+ <form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+
+ <div class="queue">
+ <input type="hidden" name="cr-edit" value="queue"/>
+
+ <div class="form-group required">
+ <label class="control-label">Queue Name
+ <small> ( cannot be changed.)</small>
+ </label>
+ <input class="form-control" value="{{ $queue->queueName }}" maxlength="30" name="qname"
+ placeholder="Queue Name" readonly/>
+ </div>
+ @include('partials/queue-block', array('queueData'=>$queue))
+ <div class="form-group">
+ <input type="submit" min="0" class="btn" name="step1" value="Update"/>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ @endforeach
+ </div>
+ @endif
+ <div class="queue-block hide">
+ <form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+
+ <div class="queue">
+ <div class="queue">
+ <input type="hidden" name="cr-edit" value="queue"/>
+
+ <div class="form-group required">
+ <label class="control-label">Queue Name
+ <small> ( A queue name is unique and cannot be changed later.)</small>
+ </label>
+ <input class="form-control create-queue-name" maxlength="30" name="qname"
+ placeholder="Queue Name" required="required"/>
+ </div>
+ @include('partials/queue-block')
+
+ </div>
+ <div class="form-group">
+ <input type="button" class="btn create-queue-form btn-primary" name="step1" value="Create"/>
+ <input type="reset" class="btn btn-success" value="Reset"/>
+ </div>
+ </div>
+ </form>
+ </div>
+ <div class="form-group well add-queue-block">
+ <button type="button" class="btn btn-sm btn-default add-queue">Add a Queue</button>
+ </div>
+
+</div>
+
+<div class="tab-pane" id="tab-filesystem">
+
+ <form role="form" method="POST" action="{{URL::to('/')}}/cr/edit">
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+ <input type="hidden" name="cr-edit" value="fileSystems"/>
+
+ <div class="form-group">
+ <h3>FileSystem</h3>
+ @foreach( $fileSystems as $index => $fileSystem)
+ <label class="control-label">{{ $fileSystem }}</label>
+ <input class="form-control" name="fileSystems[{{ $index }}]" placeholder="{{ $fileSystem }}"
+ value="@if( isset( $storageResource->fileSystems[ $index]) ){{ $storageResource->fileSystems[ $index] }} @endif"/>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <button class="btn btn-prim">Update</button>
+ </div>
+ </form>
+
+</div>
+
+<div class="tab-pane" id="tab-jobSubmission">
+
+ <div class="form-group">
+ <div class="job-submission-info row hide"></div>
+ <button type="button" class="btn btn-sm btn-default add-job-submission">Add a new Job Submission Interface
+ </button>
+ @if( count( $jobSubmissionInterfaces ) > 1)
+ <button type="button" class="btn btn-sm btn-default update-priority" data-type="jsi" data-toggle="modal"
+ data-target="#update-jsi-priority">Update Priority
+ </button>
+ @endif
+ </div>
+
+ @if( count( $jobSubmissionInterfaces ) )
+ <div class="job-edit-info">
+ @foreach( $jobSubmissionInterfaces as $index => $JSI )
+
+ <div class="job-protocol-block">
+ <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+ <input type="hidden" name="cr-edit" value="edit-jsp"/>
+ <input type="hidden" name="jsiId" value="{{ $JSI->jobSubmissionInterfaceId }}"/>
+ <?php $selectedJspIndex = $storageResource->jobSubmissionInterfaces[$index]->jobSubmissionProtocol; ?>
+
+ <h4>Job Submission Protocol : {{ $jobSubmissionProtocols[ $selectedJspIndex] }}
+ <button type='button' class='close delete-jsi' data-toggle="modal" data-target="#confirm-delete-jsi"
+ data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}">
+ <span class="glyphicon glyphicon-trash delete-jsi" data-toggle="modal"
+ data-target="#confirm-delete-jsi"
+ data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}"></span>
+ </button>
+ </h4>
+ <input type="hidden" name="jobSubmissionProtocol" value="{{ $selectedJspIndex }}"/>
+ @if( $selectedJspIndex == $jobSubmissionProtocolsObject::LOCAL)
+ <div class="select-resource-manager-type">
+ <div class="form-group required">
+ <label class="control-label">Select resource manager type</label>
+ <select name="resourceJobManagerType" class="form-control selected-resource-manager"
+ required="required">
+ @foreach( $resourceJobManagerTypes as $index => $rJmT)
+ <option value="{{ $index }}"
+ @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{ $rJmT
+ }}</option>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Push Monitoring End Point</label>
+ <input type="text" class="form-control" name="pushMonitoringEndpoint"
+ value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Job Manager Bin Path</label>
+ <input type="text" class="form-control" name="jobManagerBinPath"
+ value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
+ </div>
+ <div class="form-group">
+ <h3>Job Manager Commands</h3>
+ @foreach( $jobManagerCommands as $index => $jmc)
+ <label class="control-label">{{ $jmc }}</label>
+ <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"
+ value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
+ @endforeach
+ </select>
+ </div>
+ </div>
+ @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::SSH || $jobSubmissionProtocolsObject::SSH_FORK)
+ <div class="form-group required">
+ <label class="control-label">Select Security Protocol</label>
+ <select name="securityProtocol" required="required">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+
+ <div class="form-group">
+ <label class="control-label">Alternate SSH Host Name</label>
+ <input class='form-control' name='alternativeSSHHostName'
+ value="{{ $JSI->alternativeSSHHostName}}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">SSH Port</label>
+ <input class='form-control' name='sshPort' value="{{ $JSI->sshPort }}"/>
+ </div>
+
+ <div class="form-group required">
+ <label class="control-label">Select Monitoring Mode</label>
+ <select name="monitorMode" required>
+ @foreach( $monitorModes as $index => $mode)
+ <option value="{{ $index }}"
+ @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
+ @endforeach
+ </select>
+ </div>
+
+ <div class="form-group">
+ <div class="select-resource-manager-type">
+ <div class="form-group required">
+ <label class="control-label">Select resource manager type</label>
+ <select name="resourceJobManagerType" class="form-control selected-resource-manager"
+ required="required">
+ @foreach( $resourceJobManagerTypes as $index => $rJmT)
+ <option value="{{ $index }}"
+ @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{
+ $rJmT }}</option>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Push Monitoring End Point</label>
+ <input type="text" class="form-control" name="pushMonitoringEndpoint"
+ value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Job Manager Bin Path</label>
+ <input type="text" class="form-control" name="jobManagerBinPath"
+ value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
+ </div>
+ <div class="form-group">
+ <h3>Job Manager Commands</h3>
+ @foreach( $jobManagerCommands as $index => $jmc)
+ <label class="control-label">{{ $jmc }}</label>
+ <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"
+ value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
+ @endforeach
+ </div>
+ </div>
+ </div>
+
+ @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::UNICORE)
+ <div class="form-group required">
+ <label class="control-label">Select Security Protocol</label>
+ <select name="securityProtocol" required="required">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="form-label">Unicore End Point URL</label>
+ <input class='form-control' name='unicoreEndPointURL' value="{{ $JSI->unicoreEndPointURL }}"/>
+ </div>
+ @endif
+ <div class="form-group">
+ <button type="submit" class="btn">Update</button>
+ </div>
+ </form>
+
+ </div>
+ @endforeach
+ </div>
+ @endif
+
+ <div class="select-job-protocol hide">
+ <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+ <input type="hidden" name="cr-edit" value="jsp"/>
+
+ <div class="form-group">
+ <label class="control-label">Job Submission Protocol:</label>
+ <select name="jobSubmissionProtocol" class="form-control selected-job-protocol" required="required">
+ <option></option>
+ @foreach( $jobSubmissionProtocols as $index => $jobSubmissionProtocol)
+ @if( ! in_array( $index, $addedJSP))
+ <option value="{{ $index }}">{{ $jobSubmissionProtocol }}</option>
+ @endif
+ @endforeach
+ </select>
+ </div>
+
+ <div class="form-group">
+ <button type="submit" class="btn btn-primary jspSubmit hide">Add Job Submission Protocol</button>
+ </div>
+ </form>
+ </div>
+
+</div>
+
+-->
+
+<div class="tab-pane" id="tab-dataMovement">
+
+ <div class="form-group">
+ <div class="data-movement-info row hide"></div>
+ <button type="button" class="btn btn-sm btn-default add-data-movement">Add a new Data Movement Interface
+ </button>
+ @if( count( $dataMovementInterfaces ) > 1)
+ <button type="button" class="btn btn-sm btn-default update-priority" data-type="dmi" data-toggle="modal"
+ data-target="#update-dmi-priority">Update Priority
+ </button>
+ @endif
+ </div>
+
+ @if( count( $dataMovementInterfaces ) )
+ <div class="job-edit-info">
+ @foreach( $dataMovementInterfaces as $index => $DMI )
+ <div class="data-movement-block">
+ <form role="form" method="POST" action="{{ URL::to('/') }}/sr/edit">
+ <input type="hidden" name="srId" class="srId" value="{{Input::get('srId') }}"/>
+ <input type="hidden" name="sr-edit" value="edit-dmi"/>
+ <input type="hidden" name="dmiId" value="{{ $DMI->dataMovementInterfaceId }}"/>
+
+ <?php $selectedDMIIndex = $storageResource->dataMovementInterfaces[$index]->dataMovementProtocol; ?>
+
+ <h4>Data Movement Protocol : {{ $dataMovementProtocols[ $selectedDMIIndex] }}
+ <button type='button' class='close delete-dmi' data-toggle="modal" data-target="#confirm-delete-dmi"
+ data-dmi-id="{{ $DMI->dataMovementInterfaceId }}">
+ <span class="glyphicon glyphicon-trash delete-dmi" data-toggle="modal"
+ data-target="#confirm-delete-dmi"
+ data-dmi-id="{{ $DMI->dataMovementInterfaceId }}"></span>
+ </button>
+ </h4>
+ <input type="hidden" name="dataMovementProtocol" value="{{ $selectedDMIIndex }}"/>
+ @if( $selectedDMIIndex == $dataMovementProtocolsObject::LOCAL)
+ <!-- Nothing here on local UI -->
+ @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::SCP)
+ <div class="form-group">
+ <label class="control-label">Select Security Protocol</label>
+ <select name="securityProtocol">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+{{-- <div class="form-group">
+ <label class="control-label">Select Monitoring Mode</label>
+ <select name="monitorMode">
+ @foreach( $monitorModes as $index => $mode)
+ <option value="{{ $index }}"
+ @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
+ @endforeach
+ </select>
+ </div>--}}
+ <div class="form-group">
+ <label class="control-label">Alternate SSH Host Name</label>
+ <input class='form-control' name='alternativeSSHHostName'
+ value="{{ $DMI->alternativeSCPHostName }}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">SSH Port</label>
+ <input class='form-control' name='sshPort' value="{{ $DMI->sshPort }}"/>
+ </div>
+ <div class="form-group">
+ <button type="submit" class="btn">Update</button>
+ </div>
+ @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::GridFTP)
+ <div class="form-group">
+ <label class="control-label">Select Security Protocol</label>
+ <select name="securityProtocol">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+{{-- <div class="form-group">
+ <label class="control-label">Select Monitoring Mode</label>
+ <select name="monitorMode">
+ @foreach( $monitorModes as $index => $mode)
+ <option value="{{ $index }}"
+ @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
+ @endforeach
+ </select>
+ </div>--}}
+
+ <div>
+ <div class="form-group required">
+ <label class="control-label">Grid FTP End Points</label>
+ @foreach( $DMI->gridFTPEndPoints as $endPoint)
+ <input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required="required"
+ value="{{$endPoint}}"/>
+ @endforeach
+ <button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP
+ End Points
+ </button>
+ </div>
+ </div>
+ <div class="form-group">
+ <button type="submit" class="btn">Update</button>
+ </div>
+ @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::UNICORE_STORAGE_SERVICE)
+ <div class="form-group">
+ <label class="control-label">Select Security Protocol</label>
+ <select name="securityProtocol">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+{{-- <div class="form-group">
+ <label class="control-label">Select Monitoring Mode</label>
+ <select name="monitorMode">
+ @foreach( $monitorModes as $index => $mode)
+ <option value="{{ $index }}"
+ @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
+ @endforeach
+ </select>
+ </div>--}}
+
+ <div>
+ <div class="form-group required">
+ <label class="control-label">Unicore End Point URL</label>
+ <input class="form-control" maxlength="30" name="unicoreEndPointURL" required="required"
+ value="{{ $DMI->unicoreEndPointURL }}"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <button type="submit" class="btn">Update</button>
+ </div>
+ @endif
+ </form>
+ </div>
+ @endforeach
+ </div>
+ @endif
+ <div class="select-data-movement hide">
+
+ <form role="form" method="POST" action="{{ URL::to('/') }}/sr/edit">
+ <input type="hidden" name="srId" class="srId" value="{{Input::get('srId') }}"/>
+ <input type="hidden" name="sr-edit" value="dmp"/>
+ <h4>
+ Select the Data Movement Protocol
+ </h4>
+
+ <select name="dataMovementProtocol" class="form-control selected-data-movement-protocol">
+ <option></option>
+ @foreach( $dataMovementProtocols as $index => $dmp)
+ //GridFTP and SFTP not supported in Airavata backend. Therefore commenting out from UI
+ @if( ! in_array( $index, $addedDMI) && $dmp!="GridFTP" && $dmp!="SFTP")
+ <option value="{{ $index }}">{{ $dmp }}</option>
+ @endif
+ @endforeach
+ </select>
+
+ <div class="form-group">
+ <button type="submit" class="btn btn-primary dmpSubmit hide">Add Data Movement Protocol</button>
+ </div>
+
+ </form>
+
+ </div>
+
+</div>
+
+
+</div>
+
+
+<div class="resource-manager-block hide">
+ <div class="select-resource-manager-type">
+ <div class="form-group required">
+ <label class="control-label">Select resource manager type</label>
+ <select name="resourceJobManagerType" class="form-control selected-resource-manager" required="required">
+ @foreach( $resourceJobManagerTypes as $index => $rJmT)
+ <option value="{{ $index }}">{{ $rJmT }}</option>
+ @endforeach
+ </select>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Push Monitoring End Point</label>
+ <input type="text" class="form-control" name="pushMonitoringEndpoint"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Job Manager Bin Path</label>
+ <input type="text" class="form-control" name="jobManagerBinPath"/>
+ </div>
+ <div class="form-group">
+ <h3>Job Manager Commands</h3>
+ @foreach( $jobManagerCommands as $index => $jmc)
+ <label class="control-label">{{ $jmc }}</label>
+ <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"/>
+ @endforeach
+ </select>
+ </div>
+</div>
+
+<div class="ssh-block hide">
+ <div class="form-group required">
+ <label class="control-label">Select Security Protocol </label>
+ <select name="securityProtocol" required>
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}">{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+
+<!-- <div class="form-group required">-->
+<!-- <label class="control-label">Select Monitoring Mode </label>-->
+<!-- <select name="monitorMode" required>-->
+<!-- @foreach( $monitorModes as $index => $mode)-->
+<!-- <option value="{{ $index }}">{{ $mode}}</option>-->
+<!-- @endforeach-->
+<!-- </select>-->
+<!-- </div>-->
+
+ <div class="form-group addedScpValue hide">
+ <label class="control-label">Alternate SSH Host Name</label>
+ <input class='form-control' name='alternativeSSHHostName'/>
+ </div>
+ <div class="form-group addedScpValue hide">
+ <label class="control-label">SSH Port</label>
+ <input class='form-control' name='sshPort'/>
+ </div>
+</div>
+
+<div class="cloud-block hide">
+ <div class="form-group">
+ <label class="control-label">Node Id</label>
+ <input class="form-control" name="nodeId" placeholder="nodId"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Node Id</label>
+ <input class="form-control" name="nodeId" placeholder="nodId"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Executable Type</label>
+ <input class="form-control" name="nodeId" placeholder="executableType"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Select Provider Name</label>
+ <select class="form-control">
+ <option name="EC2">EC2</option>
+ <option name="AWSEC2">AWEC2</option>
+ <option name="RACKSPACE">RACKSPACE</option>
+ </select>
+ </div>
+</div>
+
+<div class="dm-gridftp hide">
+ <div class="form-group required">
+ <label class="control-label">Grid FTP End Points</label>
+ <input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required/>
+ <button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP End Points</button>
+ </div>
+</div>
+
+<!--
+<div class="form-group">
+ <input type="submit" class="btn btn-primary" name="step2" value="Continue"/>
+ <input type="reset" class="btn btn-success" value="Reset"/>
+</div>
+
+-->
+</div>
+</div>
+</div>
+</div>
+
+<!-- modals -->
+<!--
+<div class="modal fade" id="confirm-delete-jsi" tabindex="-1" role="dialog" aria-labelledby="delete-modal"
+ aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <form action="{{ URL::to('sr/delete-jsi') }}" method="POST">
+ <input type="hidden" name="srId" value="{{Input::get('srId') }}"/>
+ <input type="hidden" name="jsiId" value="" class="delete-jsi-confirm"/>
+
+ <div class="modal-header">
+ Confirmation
+ </div>
+ <div class="modal-body">
+ Do you really want to delete this Job Submission Interface ?
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+ <button type="submit" class="btn btn-danger danger">Delete</button>
+ </div>
+ </form>
+
+ </div>
+ </div>
+</div>
+-->
+
+<div class="modal fade" id="confirm-delete-dmi" tabindex="-1" role="dialog" aria-labelledby="delete-modal"
+ aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <form action="{{ URL::to('sr/delete-jsi') }}" method="POST">
+ <input type="hidden" name="srId" value="{{Input::get('srId') }}"/>
+ <input type="hidden" name="dmiId" value="" class="delete-dmi-confirm"/>
+
+ <div class="modal-header">
+ Confirmation
+ </div>
+ <div class="modal-body">
+ Do you really want to delete this Data Movement Interface ?
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+ <button type="submit" class="btn btn-danger danger">Delete</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<!--
+<div class="modal fade" id="add-jsi" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ Add a Job Submission Interface
+ </div>
+ <div class="modal-body add-jsi-body row">
+
+ </div>
+ </div>
+ </div>
+</div>
+
+@if( count( $jobSubmissionInterfaces ) > 1)
+<div class="modal fade" id="update-jsi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+ aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ Update the Priority Order
+ </div>
+ <div class="modal-body">
+ <form></form>
+
+ <form action="{{URL::to('/')}}/cr/edit" method="POST" id="jsi-priority-form">
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+ <input type="hidden" name="cr-edit" value="jsi-priority"/>
+ @foreach( $storageResource->jobSubmissionInterfaces as $index => $JSI )
+ <div class="row">
+ <div class="col-md-offset-1 col-md-5">
+ <label>
+ {{ $jobSubmissionProtocols[ $JSI->jobSubmissionProtocol] }}
+ </label>
+ </div>
+ <input type="hidden" name="jsi-id[]" maxlength="2"
+ value="{{ $JSI->jobSubmissionInterfaceId }}"/>
+
+ <div class="col-md-4">
+ <input type="number" name="jsi-priority[]" min="0"
+ max="{{ count( $jobSubmissionInterfaces) }}" value="{{ $JSI->priorityOrder }}"
+ required/>
+ </div>
+ </div>
+ @endforeach
+ <button type="submit" class="btn btn-update">Update</button>
+ <div class='priority-updated alert alert-success hide'>
+ The Job Submission Interface Priority has been updated.
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+</div>
+@endif
+-->
+
+<div class="modal fade" id="add-dmi" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ Add a Data Model Interface
+ </div>
+ <div class="modal-body add-dmi-body row">
+
+ </div>
+ </div>
+ </div>
+</div>
+
+@if( count( $dataMovementInterfaces ) > 1)
+<div class="modal fade" id="update-dmi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+ aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ Update the Priority Order
+ </div>
+ <div class="modal-body">
+ <form action="{{URL::to('/')}}/sr/edit" method="POST" id="dmi-priority-form">
+ <input type="hidden" name="srId" value="{{Input::get('srId') }}"/>
+ <input type="hidden" name="sr-edit" value="dmi-priority"/>
+ @foreach( $storageResource->dataMovementInterfaces as $index => $DMI )
+ <div class="row">
+ <div class="col-md-offset-1 col-md-5">
+ <label>
+ {{ $dataMovementProtocols[ $DMI->dataMovementProtocol] }}
+ </label>
+ </div>
+ <input type="hidden" name="dmi-id[]" maxlength="2" value="{{ $DMI->dataMovementInterfaceId }}"/>
+
+ <div class="col-md-4">
+ <input type="number" min="0" name="dmi-priority[]" value="{{ $DMI->priorityOrder }}"
+ required/>
+ </div>
+ </div>
+ @endforeach
+ <button type="submit" class="btn btn-update">Update</button>
+ <div class='priority-updated alert alert-success hide'>
+ The Data Movement Interface Priority has been updated.
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+</div>
+@endif
+
+<!--
+<div class="modal fade" id="delete-queue" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <form></form>
+ <form action="{{URL::to('/')}}/cr/edit" method="POST"/>
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+ <input type="hidden" name="cr-edit" value="delete-queue"/>
+ <input type="hidden" name="queueName" class="delete-queueName" value=""/>
+
+ <div class="modal-header">
+ Confirmation to Delete Queue
+ </div>
+ <div class="modal-body">
+ Do you really want to delete the Batch Queue - <span class="delete-queueName"></span>?
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="btn btn-danger">Delete</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+ </div>
+ </form>
+ </div>
+ </div>
+</div>
+@stop
+-->
+
+@section('scripts')
+@parent
+{{ HTML::script('js/script.js') }}
+
+@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/storage-resource/view.blade.php
----------------------------------------------------------------------
diff --git a/app/views/storage-resource/view.blade.php b/app/views/storage-resource/view.blade.php
new file mode 100644
index 0000000..4f91ac9
--- /dev/null
+++ b/app/views/storage-resource/view.blade.php
@@ -0,0 +1,379 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+{{ HTML::style('css/admin.css')}}
+{{ HTML::style('css/datetimepicker.css')}}
+@stop
+
+@section('content')
+
+<div id="wrapper">
+<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+@include( 'partials/dashboard-block')
+<div id="page-wrapper">
+<div class="container-fluid">
+<div class="col-md-offset-2 col-md-8">
+
+<input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
+
+<div class="well">
+ <h4>Compute Resource : {{ $computeResource->hostName }}
+ @if(Session::has("admin"))
+ <div class="pull-right">
+ <a href="{{URL::to('/')}}/cr/edit?crId={{Input::get('crId') }}" title="Edit">
+ <span class="glyphicon glyphicon-pencil"></span>
+ </a>
+ </div>
+ @endif
+ </h4>
+</div>
+@if( Session::has("message"))
+<span class="alert alert-success col-md-12">{{Session::get("message")}}</span>
+{{Session::forget("message") }}
+@endif
+
+<div class="col-md-12">
+ <ul class="nav nav-tabs nav-justified" id="tabs" role="tablist">
+ <li class="active"><a href="#tab-desc" data-toggle="tab">Description</a></li>
+ <li><a href="#tab-queues" data-toggle="tab">Queues</a></a></li>
+ <li><a href="#tab-filesystem" data-toggle="tab">FileSystem</a></li>
+ <li><a href="#tab-jobSubmission" data-toggle="tab">Job Submission Interfaces</a></li>
+ <li><a href="#tab-dataMovement" data-toggle="tab">Data Movement Interfaces</a></li>
+ </ul>
+</div>
+
+<div class="tab-content">
+
+<div class="tab-pane active" id="tab-desc">
+
+ <form>
+ <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+ <input type="hidden" name="cr-edit" value="resDesc"/>
+
+ <div class="form-group required">
+ <label>Host Name</label>
+ <input readonly class="form-control hostName" value="{{ $computeResource->hostName }}"/>
+ </div>
+ <div class="form-group">
+ @if( count( $computeResource->hostAliases) )
+ <label>Host Aliases</label>
+ @foreach( $computeResource->hostAliases as $hostAlias )
+ <input readonly class="form-control" value="{{$hostAlias}}" maxlength="30" name="hostaliases[]"/>
+ @endforeach
+ @endif
+ </div>
+ <div class="form-group">
+ @if( count( $computeResource->ipAddresses))
+ <label class="control-label">IP Addresses</label>
+ @foreach( $computeResource->ipAddresses as $ip )
+ <input readonly class="form-control" value="{{ $ip }}" maxlength="30" name="ips[]"/>
+ @endforeach
+ @endif
+ </div>
+ <div class="form-group">
+ <label class="control-label">Resource Description</label>
+ <textarea readonly class="form-control" maxlength="255" name="description">{{
+ $computeResource->resourceDescription
+ }}</textarea>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Maximum Memory Per Node ( In MB )</label>
+ <input readonly type="number" min="0" class="form-control" value="{{ $computeResource->maxMemoryPerNode }}"
+ maxlength="30" name="maxMemoryPerNode"/>
+ </div>
+ </form>
+
+</div>
+
+<div class="tab-pane" id="tab-queues">
+
+ @if( is_array( $computeResource->batchQueues) )
+ <h3>Existing Queues :</h3>
+
+ <div class="panel-group" id="accordion">
+ @foreach( $computeResource->batchQueues as $index => $queue)
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ <a class="accordion-toggle collapsed existing-queue-name" data-toggle="collapse"
+ data-parent="#accordion" href="#collapse-{{$index}}">{{ $queue->queueName }}</a>
+ </h4>
+ </div>
+ <div id="collapse-{{$index}}" class="panel-collapse collapse">
+ <div class="panel-body">
+ <form>
+ <div class="queue">
+ <div class="form-group required">
+ <label>Queue Name
+ <small> ( cannot be changed.)</small>
+ </label>
+ <input class="form-control" value="{{ $queue->queueName }}" maxlength="30" name="qname"
+ placeholder="Queue Name" readonly/>
+ </div>
+ @include('partials/queue-block', array('queueData'=>$queue, 'readOnly'=>true))
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ @endforeach
+ </div>
+ @endif
+
+</div>
+
+<div class="tab-pane" id="tab-filesystem">
+
+ <form role="form">
+ <div class="form-group">
+ <h3>FileSystem</h3>
+ @foreach( $fileSystems as $index => $fileSystem)
+ <label>{{ $fileSystem }}</label>
+ <input readonly class="form-control" name="fileSystems[{{ $index }}]" placeholder="{{ $fileSystem }}"
+ value="@if( isset( $computeResource->fileSystems[ $index]) ){{ $computeResource->fileSystems[ $index] }} @endif"/>
+ @endforeach
+ </select>
+ </div>
+ </form>
+
+</div>
+
+<div class="tab-pane" id="tab-jobSubmission">
+ <br/><br/><br/><br/>
+ @if( count( $jobSubmissionInterfaces ) )
+ <div class="job-edit-info">
+ @foreach( $jobSubmissionInterfaces as $index => $JSI )
+
+ <div class="job-protocol-block">
+ <form role="form">
+ <?php $selectedJspIndex = $computeResource->jobSubmissionInterfaces[$index]->jobSubmissionProtocol; ?>
+
+ <h4>Job Submission Protocol : {{ $jobSubmissionProtocols[ $selectedJspIndex] }}</h4>
+ @if( $selectedJspIndex == $jobSubmissionProtocolsObject::LOCAL)
+ <div class="select-resource-manager-type">
+ <div class="form-group required">
+ <label>Selected resource manager type</label>
+ <select disabled="true" name="resourceJobManagerType"
+ class="form-control selected-resource-manager"
+ required="required">
+ @foreach( $resourceJobManagerTypes as $index => $rJmT)
+ <option value="{{ $index }}"
+ @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{ $rJmT
+ }}</option>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Push Monitoring End Point</label>
+ <input disabled type="text" class="form-control" name="pushMonitoringEndpoint"
+ value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Job Manager Bin Path</label>
+ <input disabled type="text" class="form-control" name="jobManagerBinPath"
+ value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
+ </div>
+ <div class="form-group">
+ <h3>Job Manager Commands</h3>
+ @foreach( $jobManagerCommands as $index => $jmc)
+ <label class="control-label">{{ $jmc }}</label>
+ <input disabled class="form-control" name="jobManagerCommands[{{ $index }}]"
+ placeholder="{{ $jmc }}"
+ value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
+ @endforeach
+ </select>
+ </div>
+ </div>
+ @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::SSH || $jobSubmissionProtocolsObject::SSH_FORK)
+ <div class="form-group required">
+ <label>Selected Security Protocol</label>
+ <select disabled="true" name="securityProtocol" required="required">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+
+ <div class="form-group">
+ <label class="control-label">Alternate SSH Host Name</label>
+ <input readonly class='form-control' name='alternativeSSHHostName'
+ value="{{ $JSI->alternativeSSHHostName}}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">SSH Port</label>
+ <input readonly class='form-control' name='sshPort' value="{{ $JSI->sshPort }}"/>
+ </div>
+
+ <div class="form-group required">
+ <label>Selected Monitoring Mode</label>
+ <select disabled="true" name="monitorMode" required>
+ @foreach( $monitorModes as $index => $mode)
+ <option value="{{ $index }}"
+ @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
+ @endforeach
+ </select>
+ </div>
+
+ <div class="form-group">
+ <div class="select-resource-manager-type">
+ <div class="form-group required">
+ <label>Selected resource manager type</label>
+ <select disabled="true" name="resourceJobManagerType"
+ class="form-control selected-resource-manager"
+ required="required">
+ @foreach( $resourceJobManagerTypes as $index => $rJmT)
+ <option value="{{ $index }}"
+ @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{
+ $rJmT }}</option>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Push Monitoring End Point</label>
+ <input disabled type="text" class="form-control" name="pushMonitoringEndpoint"
+ value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Job Manager Bin Path</label>
+ <input disabled type="text" class="form-control" name="jobManagerBinPath"
+ value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
+ </div>
+ <div class="form-group">
+ <h3>Job Manager Commands</h3>
+ @foreach( $jobManagerCommands as $index => $jmc)
+ <label class="control-label">{{ $jmc }}</label>
+ <input disabled class="form-control" name="jobManagerCommands[{{ $index }}]"
+ placeholder="{{ $jmc }}"
+ value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
+ @endforeach
+ </div>
+ </div>
+ </div>
+
+ @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::UNICORE)
+ <div class="form-group required">
+ <label>Selected Security Protocol</label>
+ <select disabled="true" name="securityProtocol" required="required">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="form-label">Unicore End Point URL</label>
+ <input readonly class='form-control' name='unicoreEndPointURL'
+ value="{{ $JSI->unicoreEndPointURL }}"/>
+ </div>
+ @endif
+ </form>
+
+ </div>
+ @endforeach
+ </div>
+ @endif
+
+ <div class="select-job-protocol hide">
+ <form>
+ <div class="form-group">
+ <label class="control-label">Job Submission Protocol:</label>
+ <select disabled="true" name="jobSubmissionProtocol" class="form-control selected-job-protocol"
+ required="required">
+ <option></option>
+ @foreach( $jobSubmissionProtocols as $index => $jobSubmissionProtocol)
+ @if( ! in_array( $index, $addedJSP))
+ <option value="{{ $index }}">{{ $jobSubmissionProtocol }}</option>
+ @endif
+ @endforeach
+ </select>
+ </div>
+ </form>
+ </div>
+
+</div>
+
+<div class="tab-pane" id="tab-dataMovement">
+ @if( count( $dataMovementInterfaces ) )
+ <div class="job-edit-info">
+ <br/><br/><br/>
+ @foreach( $dataMovementInterfaces as $index => $DMI )
+ <div class="data-movement-block">
+ <form>
+ <?php $selectedDMIIndex = $computeResource->dataMovementInterfaces[$index]->dataMovementProtocol; ?>
+ <h4>Data Movement Protocol : {{ $dataMovementProtocols[ $selectedDMIIndex] }}</h4>
+ @if( $selectedDMIIndex == $dataMovementProtocolsObject::LOCAL)
+ <!-- Nothing here on local UI -->
+ @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::SCP)
+ <div class="form-group">
+ <label class="control-label">Selected Security Protocol</label>
+ <select disabled="true" name="securityProtocol">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Alternate SSH Host Name</label>
+ <input readonly class='form-control' name='alternativeSSHHostName'
+ value="{{ $DMI->alternativeSCPHostName }}"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">SSH Port</label>
+ <input readonly class='form-control' name='sshPort' value="{{ $DMI->sshPort }}"/>
+ </div>
+ @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::GridFTP)
+ <div class="form-group">
+ <label class="control-label">Select Security Protocol</label>
+ <select disabled="true" name="securityProtocol">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+
+ <div>
+ <div class="form-group required">
+ <label class="control-label">Grid FTP End Points</label>
+ @foreach( $DMI->gridFTPEndPoints as $endPoint)
+ <input readonly class="form-control" maxlength="30" name="gridFTPEndPoints[]"
+ required="required"
+ value="{{$endPoint}}"/>
+ @endforeach
+ </div>
+ </div>
+ </div>
+ @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::UNICORE_STORAGE_SERVICE)
+ <div class="form-group">
+ <label class="control-label">Select Security Protocol</label>
+ <select disabled="true" name="securityProtocol">
+ @foreach( $securityProtocols as $index => $sp)
+ <option value="{{ $index }}"
+ @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+ @endforeach
+ </select>
+
+ <div>
+ <div class="form-group required">
+ <label class="control-label">Unicore End Point URL</label>
+ <input readonly class="form-control" maxlength="30" name="unicoreEndPointURL"
+ required="required"
+ value="{{ $DMI->unicoreEndPointURL }}"/>
+ </div>
+ </div>
+ </div>
+ @endif
+ </form>
+ </div>
+ @endforeach
+ </div>
+ @endif
+</div>
+
+</div>
+</div>
+</div>
+</div>
+@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/composer.bat
----------------------------------------------------------------------
diff --git a/composer.bat b/composer.bat
new file mode 100644
index 0000000..9748644
--- /dev/null
+++ b/composer.bat
@@ -0,0 +1 @@
+@php "%~dp0composer.phar" %*
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/public/js/script.js
----------------------------------------------------------------------
diff --git a/public/js/script.js b/public/js/script.js
index f087813..1f28e98 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -25,18 +25,26 @@ $(document).ready( function(){
$('a[href="#' + openTab + '"]').click();
//tab open code ends here.
+ /* list additions for compute resources create ui */
$(".add-queue").click( function(){
$(this).before( $(".queue-block").html() );
});
+ /* list additions for compute resources create ui */
$(".add-alias").click( function(){
$(this).before( '<input class="form-control" maxlength="30" name="hostaliases[]"/>');
});
+ /* list additions for compute resources create ui */
$(".add-ip").click( function(){
$(this).before( '<input class="form-control" maxlength="30" name="ips[]"/>');
})
+ /* list additions for storage resources create ui */
+ $(".add-datamovementinterface").click( function(){
+ $(this).before( '<input class="form-control" maxlength="30" name="dataMovementInterfaces[]"/>');
+ });
+
/*
* code that relates to Job Submission Protocol Interface starts here.
*/
[2/3] airavata-php-gateway git commit: storage resource updates in
progress.
Posted by nd...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/data-storage/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/data-storage/browse.blade.php b/app/views/data-storage/browse.blade.php
deleted file mode 100644
index c9b5382..0000000
--- a/app/views/data-storage/browse.blade.php
+++ /dev/null
@@ -1,213 +0,0 @@
-@extends('layout.basic')
-
-@section('page-header')
-@parent
-{{ HTML::style('css/admin.css')}}
-{{ HTML::style('css/datetimepicker.css')}}
-@stop
-
-@section('content')
-
-<div id="wrapper">
- <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
- @include( 'partials/dashboard-block')
- <div id="page-wrapper">
-
-<div class="container-fluid">
- @if( Session::has("message"))
- <div class="col-md-12">
- <span class="alert alert-success">{{ Session::get("message") }}</span>
- </div>
- {{ Session::forget("message") }}
- @endif
-
- @if ( isset( $allCRs) )
- @if (sizeof($allCRs) == 0)
- {{ CommonUtilities::print_warning_message('No Compute Resources are registered. Please use "Register Compute
- Resource" to
- register a new resources.') }}
- @else
- <br/>
- <div class="col-md-12">
- <div class="panel panel-default form-inline">
- <div class="panel-heading">
- <h3 style="margin:0;">Search Compute Resources</h3>
- </div>
- <div class="panel-body">
- <div class="form-group search-text-block">
- <label>Compute Resource Name </label>
- <input type="search" class="form-control filterinput"/>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="table-responsive">
- <table class="table">
-
- <tr>
-
- <th>Name</th>
- <th>Id</th>
- @if(Session::has("admin"))
- <th>Enabled</th>
- <th>Edit</th>
- @endif
- <th>View</th>
- @if(Session::has("admin"))
- <th>Delete</th>
- @endif
- </tr>
-
- @foreach($allCRs as $resource)
- <?php
- $crId = $resource->computeResourceId;
- $crName = $resource->hostName;
- $enabled = $resource->enabled;
- ?>
- <tr id="crDetails">
- <td>{{ $crName }}</td>
- <td>{{ $crId }}</td>
- @if(Session::has("admin"))
- <td>
- @if(!$enabled)
- <div class="checkbox">
- <input class="resource-status" resourceId="{{$crId}}" type="checkbox">
- </div>
- @else
- <div class="checkbox">
- <input class="resource-status" type="checkbox" resourceId="{{$crId}}" checked>
- </div>
- @endif
- </td>
- <td><a href="{{URL::to('/')}}/cr/edit?crId={{ $crId }}" title="Edit">
- <span class="glyphicon glyphicon-pencil"></span>
- </a>
- </td>
- @endif
- <td>
- <a href="{{URL::to('/')}}/cr/view?crId={{ $crId }}" title="Edit">
- <span class="glyphicon glyphicon-list"></span>
- </a>
- </td>
- @if(Session::has("admin"))
- <td>
- <a href="#" title="Delete">
- <span class="glyphicon glyphicon-trash del-cr" data-toggle="modal"
- data-target="#delete-cr-block" data-delete-cr-name="{{$crName}}"
- data-deployment-count="{{$connectedDeployments[$crId]}}"
- data-crid="{{$crId}}"></span>
- </a>
- </td>
- @endif
- </tr>
- @endforeach
-
- </table>
- </div>
- </div>
- @endif
- @endif
-
- <div class="modal fade" id="delete-cr-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
- aria-hidden="true">
- <div class="modal-dialog">
-
- <form action="{{URL::to('/')}}/cr/delete-cr" method="POST">
- <div class="modal-content">
- <div class="modal-header">
- <h3 class="text-center">Delete Compute Resource Confirmation</h3>
- </div>
- <div class="modal-body">
- <input type="hidden" class="form-control delete-crId" name="del-crId"/>
- The Compute Resource, <span class="delete-cr-name"></span> is connected to <span
- class="deploymentCount">0</span> deployments.
- Do you really want to delete it? This action cannot be undone.
- </div>
- <div class="modal-footer">
- <div class="form-group">
- <input type="submit" class="btn btn-danger" value="Delete"/>
- <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
- </div>
- </div>
- </div>
-
- </form>
- </div>
- </div>
-
- </div>
-</div>
-</div>
-
- @stop
- @section('scripts')
- @parent
- <script type="text/javascript">
- $('.filterinput').keyup(function () {
- var value = $(this).val();
- if (value.length > 0) {
- $("table tr").each(function (index) {
- if (index != 0) {
-
- $row = $(this);
-
- var id = $row.find("td:first").text();
- id = $.trim(id);
- id = id.substr(0, value.length);
- if (id == value) {
- $(this).slideDown();
- }
- else {
- $(this).slideUp();
- }
- }
- });
- } else {
- $("table tr").slideDown();
- }
- return false;
- });
-
- $(".del-cr").click(function () {
- $(".delete-cr-name").html("'" + $(this).data("delete-cr-name") + "'");
- $(".delete-crId").val($(this).data("crid"));
- $(".deploymentCount").html($(this).data("deployment-count"));
- });
-
- $('.resource-status').click(function() {
- var $this = $(this);
- if ($this.is(':checked')) {
- //enable compute resource
- $resourceId = $this.attr("resourceId");
- $.ajax({
- type: 'POST',
- url: "{{URL::to('/')}}/admin/enable-cr",
- data: {
- 'resourceId': $resourceId
- },
- async: true,
- success: function (data) {
- console.log("enabled cr " + $resourceId);
- $(".success-message").html("<span class='alert alert-success col-md-12'>Successfully enabled compute resource</span>");
- }
- });
- } else {
- //disabled compute resource
- $resourceId = $this.attr("resourceId");
- $.ajax({
- type: 'POST',
- url: "{{URL::to('/')}}/admin/disable-cr",
- data: {
- 'resourceId': $resourceId
- },
- async: true,
- success: function (data) {
- console.log("disabled cr " + $resourceId);
- $(".success-message").html("<span class='alert alert-success col-md-12'>Successfully disabled compute resource</span>");
- }
- });
- }
- });
- </script>
- @stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/data-storage/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/data-storage/create.blade.php b/app/views/data-storage/create.blade.php
deleted file mode 100644
index 1d44c22..0000000
--- a/app/views/data-storage/create.blade.php
+++ /dev/null
@@ -1,53 +0,0 @@
-@extends('layout.basic')
-
-@section('page-header')
-@parent
-{{ HTML::style('css/admin.css')}}
-{{ HTML::style('css/datetimepicker.css')}}
-@stop
-
-@section('content')
-
-<div id="wrapper">
- <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
- @include( 'partials/dashboard-block')
- <div id="page-wrapper">
-
-<div class="container-fluid">
- <div class="col-md-offset-2 col-md-8">
- <h3>Create a Resource</h3>
-
- <form role="form" method="POST" action="{{ URL::to('/') }}/cr/create">
- <div class="form-group required">
- <label class="control-label">Host Name</label>
- <input class="form-control hostName" maxlength="100" name="hostname" required="required"/>
- </div>
- <div class="form-group">
- <label class="control-label">Host Aliases</label>
- <input class="form-control" maxlength="30" name="hostaliases[]"/>
- <button type="button" class="btn btn-sm btn-default add-alias">Add More Aliases</button>
- </div>
- <div class="form-group">
- <label class="control-label">IP Addresses</label>
- <input class="form-control" maxlength="30" name="ips[]"/>
- <button type="button" class="btn btn-sm btn-default add-ip">Add More IP Addresses</button>
- </div>
- <div class="form-group">
- <label class="control-label">Resource Description</label>
- <textarea class="form-control" maxlength="255" name="description"></textarea>
- </div>
- <div class="form-group">
- <input type="submit" class="btn btn-lg btn-primary" name="step1" value="Create"/>
- <input type="reset" class="btn btn-lg btn-success" value="Reset"/>
- </div>
- </form>
- </div>
-</div>
-</div>
-</div>
-@stop
-
-@section('scripts')
-@parent
-{{ HTML::script('js/script.js') }}
-@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/data-storage/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/data-storage/edit.blade.php b/app/views/data-storage/edit.blade.php
deleted file mode 100644
index c5a2671..0000000
--- a/app/views/data-storage/edit.blade.php
+++ /dev/null
@@ -1,836 +0,0 @@
-@extends('layout.basic')
-
-@section('page-header')
-@parent
-{{ HTML::style('css/admin.css')}}
-{{ HTML::style('css/datetimepicker.css')}}
-@stop
-
-@section('content')
-
-<div id="wrapper">
-<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-@include( 'partials/dashboard-block')
-<div id="page-wrapper">
-
-<div class="container-fluid">
-<div class="col-md-offset-2 col-md-8">
-
-<input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
-
-<div class="well">
- <h4>Compute Resource : {{ $computeResource->hostName }}</h4>
-</div>
-@if( Session::has("message"))
-<span class="alert alert-success col-md-12">{{Session::get("message")}}</span>
-{{Session::forget("message") }}
-@endif
-
-<div class="col-md-12">
- <ul class="nav nav-tabs nav-justified" id="tabs" role="tablist">
- <li class="active"><a href="#tab-desc" data-toggle="tab">Description</a></li>
- <li><a href="#tab-queues" data-toggle="tab">Queues</a></a></li>
- <li><a href="#tab-filesystem" data-toggle="tab">FileSystem</a></li>
- <li><a href="#tab-jobSubmission" data-toggle="tab">Job Submission Interfaces</a></li>
- <li><a href="#tab-dataMovement" data-toggle="tab">Data Movement Interfaces</a></li>
- </ul>
-</div>
-
-<div class="tab-content">
-
-<div class="tab-pane active" id="tab-desc">
-
- <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="resDesc"/>
-
- <div class="form-group required">
- <label class="control-label">Host Name</label>
- <input class="form-control hostName" value="{{ $computeResource->hostName }}" maxlength="100"
- name="hostname" required="required"/>
- </div>
- <div class="form-group">
- <label class="control-label">Host Aliases</label>
- @if( count( $computeResource->hostAliases) )
- @foreach( $computeResource->hostAliases as $hostAlias )
- <input class="form-control" value="{{$hostAlias}}" maxlength="30" name="hostaliases[]"/>
- @endforeach
- @else
- <input class="form-control" value="" maxlength="30" name="hostaliases[]"/>
- @endif
- <button type="button" class="btn btn-sm btn-default add-alias">Add Aliases</button>
- </div>
- <div class="form-group">
- <label class="control-label">IP Addresses</label>
- @if( count( $computeResource->ipAddresses))
- @foreach( $computeResource->ipAddresses as $ip )
- <input class="form-control" value="{{ $ip }}" maxlength="30" name="ips[]"/>
- @endforeach
- @else
- <input class="form-control" value="" maxlength="30" name="ips[]"/>
- @endif
- <button type="button" class="btn btn-sm btn-default add-ip">Add IP Addresses</button>
- </div>
- <div class="form-group">
- <label class="control-label">Resource Description</label>
- <textarea class="form-control" maxlength="255" name="description">{{ $computeResource->resourceDescription
- }}</textarea>
- </div>
- <div class="form-group">
- <label class="control-label">Maximum Memory Per Node ( In MB )</label>
- <input type="number" min="0" class="form-control" value="{{ $computeResource->maxMemoryPerNode }}"
- maxlength="30" name="maxMemoryPerNode"/>
- </div>
- <div class="form-group">
- <input type="submit" class="btn btn-primary" name="step1" value="Save changes"/>
- </div>
-
- </form>
-
-</div>
-
-<div class="tab-pane" id="tab-queues">
-
- @if( is_array( $computeResource->batchQueues) )
- <h3>Existing Queues :</h3>
-
- <div class="panel-group" id="accordion">
- @foreach( $computeResource->batchQueues as $index => $queue)
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a class="accordion-toggle collapsed existing-queue-name" data-toggle="collapse"
- data-parent="#accordion" href="#collapse-{{$index}}">{{ $queue->queueName }}</a>
-
- <div class="pull-right col-md-1">
- <span class="glyphicon glyphicon-trash delete-queue" style="cursor:pointer;" data-toggle="modal"
- data-target="#delete-queue" data-queue-name="{{ $queue->queueName }}"></span>
- </div>
- </h4>
- </div>
- <div id="collapse-{{$index}}" class="panel-collapse collapse">
- <div class="panel-body">
- <form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-
- <div class="queue">
- <input type="hidden" name="cr-edit" value="queue"/>
-
- <div class="form-group required">
- <label class="control-label">Queue Name
- <small> ( cannot be changed.)</small>
- </label>
- <input class="form-control" value="{{ $queue->queueName }}" maxlength="30" name="qname"
- placeholder="Queue Name" readonly/>
- </div>
- @include('partials/queue-block', array('queueData'=>$queue))
- <div class="form-group">
- <input type="submit" min="0" class="btn" name="step1" value="Update"/>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- @endforeach
- </div>
- @endif
- <div class="queue-block hide">
- <form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-
- <div class="queue">
- <div class="queue">
- <input type="hidden" name="cr-edit" value="queue"/>
-
- <div class="form-group required">
- <label class="control-label">Queue Name
- <small> ( A queue name is unique and cannot be changed later.)</small>
- </label>
- <input class="form-control create-queue-name" maxlength="30" name="qname"
- placeholder="Queue Name" required="required"/>
- </div>
- @include('partials/queue-block')
-
- </div>
- <div class="form-group">
- <input type="button" class="btn create-queue-form btn-primary" name="step1" value="Create"/>
- <input type="reset" class="btn btn-success" value="Reset"/>
- </div>
- </div>
- </form>
- </div>
- <div class="form-group well add-queue-block">
- <button type="button" class="btn btn-sm btn-default add-queue">Add a Queue</button>
- </div>
-
-</div>
-
-<div class="tab-pane" id="tab-filesystem">
-
- <form role="form" method="POST" action="{{URL::to('/')}}/cr/edit">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="fileSystems"/>
-
- <div class="form-group">
- <h3>FileSystem</h3>
- @foreach( $fileSystems as $index => $fileSystem)
- <label class="control-label">{{ $fileSystem }}</label>
- <input class="form-control" name="fileSystems[{{ $index }}]" placeholder="{{ $fileSystem }}"
- value="@if( isset( $computeResource->fileSystems[ $index]) ){{ $computeResource->fileSystems[ $index] }} @endif"/>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <button class="btn btn-prim">Update</button>
- </div>
- </form>
-
-</div>
-
-<div class="tab-pane" id="tab-jobSubmission">
-
- <div class="form-group">
- <div class="job-submission-info row hide"></div>
- <button type="button" class="btn btn-sm btn-default add-job-submission">Add a new Job Submission Interface
- </button>
- @if( count( $jobSubmissionInterfaces ) > 1)
- <button type="button" class="btn btn-sm btn-default update-priority" data-type="jsi" data-toggle="modal"
- data-target="#update-jsi-priority">Update Priority
- </button>
- @endif
- </div>
-
- @if( count( $jobSubmissionInterfaces ) )
- <div class="job-edit-info">
- @foreach( $jobSubmissionInterfaces as $index => $JSI )
-
- <div class="job-protocol-block">
- <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="edit-jsp"/>
- <input type="hidden" name="jsiId" value="{{ $JSI->jobSubmissionInterfaceId }}"/>
- <?php $selectedJspIndex = $computeResource->jobSubmissionInterfaces[$index]->jobSubmissionProtocol; ?>
-
- <h4>Job Submission Protocol : {{ $jobSubmissionProtocols[ $selectedJspIndex] }}
- <button type='button' class='close delete-jsi' data-toggle="modal" data-target="#confirm-delete-jsi"
- data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}">
- <span class="glyphicon glyphicon-trash delete-jsi" data-toggle="modal"
- data-target="#confirm-delete-jsi"
- data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}"></span>
- </button>
- </h4>
- <input type="hidden" name="jobSubmissionProtocol" value="{{ $selectedJspIndex }}"/>
- @if( $selectedJspIndex == $jobSubmissionProtocolsObject::LOCAL)
- <div class="select-resource-manager-type">
- <div class="form-group required">
- <label class="control-label">Select resource manager type</label>
- <select name="resourceJobManagerType" class="form-control selected-resource-manager"
- required="required">
- @foreach( $resourceJobManagerTypes as $index => $rJmT)
- <option value="{{ $index }}"
- @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{ $rJmT
- }}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <label class="control-label">Push Monitoring End Point</label>
- <input type="text" class="form-control" name="pushMonitoringEndpoint"
- value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
- </div>
- <div class="form-group">
- <label class="control-label">Job Manager Bin Path</label>
- <input type="text" class="form-control" name="jobManagerBinPath"
- value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
- </div>
- <div class="form-group">
- <h3>Job Manager Commands</h3>
- @foreach( $jobManagerCommands as $index => $jmc)
- <label class="control-label">{{ $jmc }}</label>
- <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"
- value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
- @endforeach
- </select>
- </div>
- </div>
- @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::SSH || $jobSubmissionProtocolsObject::SSH_FORK)
- <div class="form-group required">
- <label class="control-label">Select Security Protocol</label>
- <select name="securityProtocol" required="required">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- <label class="control-label">Alternate SSH Host Name</label>
- <input class='form-control' name='alternativeSSHHostName'
- value="{{ $JSI->alternativeSSHHostName}}"/>
- </div>
- <div class="form-group">
- <label class="control-label">SSH Port</label>
- <input class='form-control' name='sshPort' value="{{ $JSI->sshPort }}"/>
- </div>
-
- <div class="form-group required">
- <label class="control-label">Select Monitoring Mode</label>
- <select name="monitorMode" required>
- @foreach( $monitorModes as $index => $mode)
- <option value="{{ $index }}"
- @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- <div class="select-resource-manager-type">
- <div class="form-group required">
- <label class="control-label">Select resource manager type</label>
- <select name="resourceJobManagerType" class="form-control selected-resource-manager"
- required="required">
- @foreach( $resourceJobManagerTypes as $index => $rJmT)
- <option value="{{ $index }}"
- @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{
- $rJmT }}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <label class="control-label">Push Monitoring End Point</label>
- <input type="text" class="form-control" name="pushMonitoringEndpoint"
- value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
- </div>
- <div class="form-group">
- <label class="control-label">Job Manager Bin Path</label>
- <input type="text" class="form-control" name="jobManagerBinPath"
- value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
- </div>
- <div class="form-group">
- <h3>Job Manager Commands</h3>
- @foreach( $jobManagerCommands as $index => $jmc)
- <label class="control-label">{{ $jmc }}</label>
- <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"
- value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
- @endforeach
- </div>
- </div>
- </div>
-
- @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::UNICORE)
- <div class="form-group required">
- <label class="control-label">Select Security Protocol</label>
- <select name="securityProtocol" required="required">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <label class="form-label">Unicore End Point URL</label>
- <input class='form-control' name='unicoreEndPointURL' value="{{ $JSI->unicoreEndPointURL }}"/>
- </div>
- @endif
- <div class="form-group">
- <button type="submit" class="btn">Update</button>
- </div>
- </form>
-
- </div>
- @endforeach
- </div>
- @endif
-
- <div class="select-job-protocol hide">
- <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="jsp"/>
-
- <div class="form-group">
- <label class="control-label">Job Submission Protocol:</label>
- <select name="jobSubmissionProtocol" class="form-control selected-job-protocol" required="required">
- <option></option>
- @foreach( $jobSubmissionProtocols as $index => $jobSubmissionProtocol)
- @if( ! in_array( $index, $addedJSP))
- <option value="{{ $index }}">{{ $jobSubmissionProtocol }}</option>
- @endif
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- <button type="submit" class="btn btn-primary jspSubmit hide">Add Job Submission Protocol</button>
- </div>
- </form>
- </div>
-
-</div>
-
-<div class="tab-pane" id="tab-dataMovement">
-
- <div class="form-group">
- <div class="data-movement-info row hide"></div>
- <button type="button" class="btn btn-sm btn-default add-data-movement">Add a new Data Movement Interface
- </button>
- @if( count( $dataMovementInterfaces ) > 1)
- <button type="button" class="btn btn-sm btn-default update-priority" data-type="dmi" data-toggle="modal"
- data-target="#update-dmi-priority">Update Priority
- </button>
- @endif
- </div>
-
- @if( count( $dataMovementInterfaces ) )
- <div class="job-edit-info">
- @foreach( $dataMovementInterfaces as $index => $DMI )
- <div class="data-movement-block">
- <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
- <input type="hidden" name="crId" class="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="edit-dmi"/>
- <input type="hidden" name="dmiId" value="{{ $DMI->dataMovementInterfaceId }}"/>
-
- <?php $selectedDMIIndex = $computeResource->dataMovementInterfaces[$index]->dataMovementProtocol; ?>
-
- <h4>Data Movement Protocol : {{ $dataMovementProtocols[ $selectedDMIIndex] }}
- <button type='button' class='close delete-dmi' data-toggle="modal" data-target="#confirm-delete-dmi"
- data-dmi-id="{{ $DMI->dataMovementInterfaceId }}">
- <span class="glyphicon glyphicon-trash delete-dmi" data-toggle="modal"
- data-target="#confirm-delete-dmi"
- data-dmi-id="{{ $DMI->dataMovementInterfaceId }}"></span>
- </button>
- </h4>
- <input type="hidden" name="dataMovementProtocol" value="{{ $selectedDMIIndex }}"/>
- @if( $selectedDMIIndex == $dataMovementProtocolsObject::LOCAL)
- <!-- Nothing here on local UI -->
- @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::SCP)
- <div class="form-group">
- <label class="control-label">Select Security Protocol</label>
- <select name="securityProtocol">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
-{{-- <div class="form-group">
- <label class="control-label">Select Monitoring Mode</label>
- <select name="monitorMode">
- @foreach( $monitorModes as $index => $mode)
- <option value="{{ $index }}"
- @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
- @endforeach
- </select>
- </div>--}}
- <div class="form-group">
- <label class="control-label">Alternate SSH Host Name</label>
- <input class='form-control' name='alternativeSSHHostName'
- value="{{ $DMI->alternativeSCPHostName }}"/>
- </div>
- <div class="form-group">
- <label class="control-label">SSH Port</label>
- <input class='form-control' name='sshPort' value="{{ $DMI->sshPort }}"/>
- </div>
- <div class="form-group">
- <button type="submit" class="btn">Update</button>
- </div>
- @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::GridFTP)
- <div class="form-group">
- <label class="control-label">Select Security Protocol</label>
- <select name="securityProtocol">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
-{{-- <div class="form-group">
- <label class="control-label">Select Monitoring Mode</label>
- <select name="monitorMode">
- @foreach( $monitorModes as $index => $mode)
- <option value="{{ $index }}"
- @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
- @endforeach
- </select>
- </div>--}}
-
- <div>
- <div class="form-group required">
- <label class="control-label">Grid FTP End Points</label>
- @foreach( $DMI->gridFTPEndPoints as $endPoint)
- <input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required="required"
- value="{{$endPoint}}"/>
- @endforeach
- <button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP
- End Points
- </button>
- </div>
- </div>
- <div class="form-group">
- <button type="submit" class="btn">Update</button>
- </div>
- @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::UNICORE_STORAGE_SERVICE)
- <div class="form-group">
- <label class="control-label">Select Security Protocol</label>
- <select name="securityProtocol">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
-{{-- <div class="form-group">
- <label class="control-label">Select Monitoring Mode</label>
- <select name="monitorMode">
- @foreach( $monitorModes as $index => $mode)
- <option value="{{ $index }}"
- @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
- @endforeach
- </select>
- </div>--}}
-
- <div>
- <div class="form-group required">
- <label class="control-label">Unicore End Point URL</label>
- <input class="form-control" maxlength="30" name="unicoreEndPointURL" required="required"
- value="{{ $DMI->unicoreEndPointURL }}"/>
- </div>
- </div>
- <div class="form-group">
- <button type="submit" class="btn">Update</button>
- </div>
- @endif
- </form>
- </div>
- @endforeach
- </div>
- @endif
- <div class="select-data-movement hide">
-
- <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
- <input type="hidden" name="crId" class="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="dmp"/>
- <h4>
- Select the Data Movement Protocol
- </h4>
-
- <select name="dataMovementProtocol" class="form-control selected-data-movement-protocol">
- <option></option>
- @foreach( $dataMovementProtocols as $index => $dmp)
- //GridFTP and SFTP not supported in Airavata backend. Therefore commenting out from UI
- @if( ! in_array( $index, $addedDMI) && $dmp!="GridFTP" && $dmp!="SFTP")
- <option value="{{ $index }}">{{ $dmp }}</option>
- @endif
- @endforeach
- </select>
-
- <div class="form-group">
- <button type="submit" class="btn btn-primary dmpSubmit hide">Add Data Movement Protocol</button>
- </div>
-
- </form>
-
- </div>
-
-</div>
-
-
-</div>
-
-
-<div class="resource-manager-block hide">
- <div class="select-resource-manager-type">
- <div class="form-group required">
- <label class="control-label">Select resource manager type</label>
- <select name="resourceJobManagerType" class="form-control selected-resource-manager" required="required">
- @foreach( $resourceJobManagerTypes as $index => $rJmT)
- <option value="{{ $index }}">{{ $rJmT }}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label">Push Monitoring End Point</label>
- <input type="text" class="form-control" name="pushMonitoringEndpoint"/>
- </div>
- <div class="form-group">
- <label class="control-label">Job Manager Bin Path</label>
- <input type="text" class="form-control" name="jobManagerBinPath"/>
- </div>
- <div class="form-group">
- <h3>Job Manager Commands</h3>
- @foreach( $jobManagerCommands as $index => $jmc)
- <label class="control-label">{{ $jmc }}</label>
- <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"/>
- @endforeach
- </select>
- </div>
-</div>
-
-<div class="ssh-block hide">
- <div class="form-group required">
- <label class="control-label">Select Security Protocol </label>
- <select name="securityProtocol" required>
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}">{{ $sp }}</option>
- @endforeach
- </select>
- </div>
-
-<!-- <div class="form-group required">-->
-<!-- <label class="control-label">Select Monitoring Mode </label>-->
-<!-- <select name="monitorMode" required>-->
-<!-- @foreach( $monitorModes as $index => $mode)-->
-<!-- <option value="{{ $index }}">{{ $mode}}</option>-->
-<!-- @endforeach-->
-<!-- </select>-->
-<!-- </div>-->
-
- <div class="form-group addedScpValue hide">
- <label class="control-label">Alternate SSH Host Name</label>
- <input class='form-control' name='alternativeSSHHostName'/>
- </div>
- <div class="form-group addedScpValue hide">
- <label class="control-label">SSH Port</label>
- <input class='form-control' name='sshPort'/>
- </div>
-</div>
-
-<div class="cloud-block hide">
- <div class="form-group">
- <label class="control-label">Node Id</label>
- <input class="form-control" name="nodeId" placeholder="nodId"/>
- </div>
- <div class="form-group">
- <label class="control-label">Node Id</label>
- <input class="form-control" name="nodeId" placeholder="nodId"/>
- </div>
- <div class="form-group">
- <label class="control-label">Executable Type</label>
- <input class="form-control" name="nodeId" placeholder="executableType"/>
- </div>
- <div class="form-group">
- <label class="control-label">Select Provider Name</label>
- <select class="form-control">
- <option name="EC2">EC2</option>
- <option name="AWSEC2">AWEC2</option>
- <option name="RACKSPACE">RACKSPACE</option>
- </select>
- </div>
-</div>
-
-<div class="dm-gridftp hide">
- <div class="form-group required">
- <label class="control-label">Grid FTP End Points</label>
- <input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required/>
- <button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP End Points</button>
- </div>
-</div>
-
-<!--
-<div class="form-group">
- <input type="submit" class="btn btn-primary" name="step2" value="Continue"/>
- <input type="reset" class="btn btn-success" value="Reset"/>
-</div>
-
--->
-</div>
-</div>
-</div>
-</div>
-
-<!-- modals -->
-
-<div class="modal fade" id="confirm-delete-jsi" tabindex="-1" role="dialog" aria-labelledby="delete-modal"
- aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <form action="{{ URL::to('cr/delete-jsi') }}" method="POST">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="jsiId" value="" class="delete-jsi-confirm"/>
-
- <div class="modal-header">
- Confirmation
- </div>
- <div class="modal-body">
- Do you really want to delete this Job Submission Interface ?
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="submit" class="btn btn-danger danger">Delete</button>
- </div>
- </form>
-
- </div>
- </div>
-</div>
-
-<div class="modal fade" id="confirm-delete-dmi" tabindex="-1" role="dialog" aria-labelledby="delete-modal"
- aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <form action="{{ URL::to('cr/delete-jsi') }}" method="POST">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="dmiId" value="" class="delete-dmi-confirm"/>
-
- <div class="modal-header">
- Confirmation
- </div>
- <div class="modal-body">
- Do you really want to delete this Data Movement Interface ?
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="submit" class="btn btn-danger danger">Delete</button>
- </div>
- </div>
- </div>
-</div>
-
-
-<div class="modal fade" id="add-jsi" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- Add a Job Submission Interface
- </div>
- <div class="modal-body add-jsi-body row">
-
- </div>
- </div>
- </div>
-</div>
-
-@if( count( $jobSubmissionInterfaces ) > 1)
-<div class="modal fade" id="update-jsi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal"
- aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- Update the Priority Order
- </div>
- <div class="modal-body">
- <!-- dirty hack to avoid some code that removes the form tag below this. Needs better fix. -->
- <form></form>
-
- <form action="{{URL::to('/')}}/cr/edit" method="POST" id="jsi-priority-form">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="jsi-priority"/>
- @foreach( $computeResource->jobSubmissionInterfaces as $index => $JSI )
- <div class="row">
- <div class="col-md-offset-1 col-md-5">
- <label>
- {{ $jobSubmissionProtocols[ $JSI->jobSubmissionProtocol] }}
- </label>
- </div>
- <input type="hidden" name="jsi-id[]" maxlength="2"
- value="{{ $JSI->jobSubmissionInterfaceId }}"/>
-
- <div class="col-md-4">
- <input type="number" name="jsi-priority[]" min="0"
- max="{{ count( $jobSubmissionInterfaces) }}" value="{{ $JSI->priorityOrder }}"
- required/>
- </div>
- </div>
- @endforeach
- <button type="submit" class="btn btn-update">Update</button>
- <div class='priority-updated alert alert-success hide'>
- The Job Submission Interface Priority has been updated.
- </div>
- </form>
- </div>
- </div>
- </div>
-</div>
-@endif
-
-<div class="modal fade" id="add-dmi" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- Add a Data Model Interface
- </div>
- <div class="modal-body add-dmi-body row">
-
- </div>
- </div>
- </div>
-</div>
-
-@if( count( $dataMovementInterfaces ) > 1)
-<div class="modal fade" id="update-dmi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal"
- aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- Update the Priority Order
- </div>
- <div class="modal-body">
- <form action="{{URL::to('/')}}/cr/edit" method="POST" id="dmi-priority-form">
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="dmi-priority"/>
- @foreach( $computeResource->dataMovementInterfaces as $index => $DMI )
- <div class="row">
- <div class="col-md-offset-1 col-md-5">
- <label>
- {{ $dataMovementProtocols[ $DMI->dataMovementProtocol] }}
- </label>
- </div>
- <input type="hidden" name="dmi-id[]" maxlength="2" value="{{ $DMI->dataMovementInterfaceId }}"/>
-
- <div class="col-md-4">
- <input type="number" min="0" name="dmi-priority[]" value="{{ $DMI->priorityOrder }}"
- required/>
- </div>
- </div>
- @endforeach
- <button type="submit" class="btn btn-update">Update</button>
- <div class='priority-updated alert alert-success hide'>
- The Data Movement Interface Priority has been updated.
- </div>
- </form>
- </div>
- </div>
- </div>
-</div>
-@endif
-
-
-<div class="modal fade" id="delete-queue" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <!-- dirty hack to neutralise form problem in code by just adding an empty form tag before the actual form. Needs fix.-->
- <form></form>
- <form action="{{URL::to('/')}}/cr/edit" method="POST"/>
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="delete-queue"/>
- <input type="hidden" name="queueName" class="delete-queueName" value=""/>
-
- <div class="modal-header">
- Confirmation to Delete Queue
- </div>
- <div class="modal-body">
- Do you really want to delete the Batch Queue - <span class="delete-queueName"></span>?
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-danger">Delete</button>
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- </div>
- </form>
- </div>
- </div>
-</div>
-@stop
-
-@section('scripts')
-@parent
-{{ HTML::script('js/script.js') }}
-
-<script type="text/javascript">
- $(".delete-queue").click(function () {
- $(".delete-queueName").val($(this).data("queue-name"));
- $(".delete-queueName").html($(this).data("queue-name"));
- })
-</script>
-@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/data-storage/view.blade.php
----------------------------------------------------------------------
diff --git a/app/views/data-storage/view.blade.php b/app/views/data-storage/view.blade.php
deleted file mode 100644
index 4f91ac9..0000000
--- a/app/views/data-storage/view.blade.php
+++ /dev/null
@@ -1,379 +0,0 @@
-@extends('layout.basic')
-
-@section('page-header')
-@parent
-{{ HTML::style('css/admin.css')}}
-{{ HTML::style('css/datetimepicker.css')}}
-@stop
-
-@section('content')
-
-<div id="wrapper">
-<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-@include( 'partials/dashboard-block')
-<div id="page-wrapper">
-<div class="container-fluid">
-<div class="col-md-offset-2 col-md-8">
-
-<input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
-
-<div class="well">
- <h4>Compute Resource : {{ $computeResource->hostName }}
- @if(Session::has("admin"))
- <div class="pull-right">
- <a href="{{URL::to('/')}}/cr/edit?crId={{Input::get('crId') }}" title="Edit">
- <span class="glyphicon glyphicon-pencil"></span>
- </a>
- </div>
- @endif
- </h4>
-</div>
-@if( Session::has("message"))
-<span class="alert alert-success col-md-12">{{Session::get("message")}}</span>
-{{Session::forget("message") }}
-@endif
-
-<div class="col-md-12">
- <ul class="nav nav-tabs nav-justified" id="tabs" role="tablist">
- <li class="active"><a href="#tab-desc" data-toggle="tab">Description</a></li>
- <li><a href="#tab-queues" data-toggle="tab">Queues</a></a></li>
- <li><a href="#tab-filesystem" data-toggle="tab">FileSystem</a></li>
- <li><a href="#tab-jobSubmission" data-toggle="tab">Job Submission Interfaces</a></li>
- <li><a href="#tab-dataMovement" data-toggle="tab">Data Movement Interfaces</a></li>
- </ul>
-</div>
-
-<div class="tab-content">
-
-<div class="tab-pane active" id="tab-desc">
-
- <form>
- <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
- <input type="hidden" name="cr-edit" value="resDesc"/>
-
- <div class="form-group required">
- <label>Host Name</label>
- <input readonly class="form-control hostName" value="{{ $computeResource->hostName }}"/>
- </div>
- <div class="form-group">
- @if( count( $computeResource->hostAliases) )
- <label>Host Aliases</label>
- @foreach( $computeResource->hostAliases as $hostAlias )
- <input readonly class="form-control" value="{{$hostAlias}}" maxlength="30" name="hostaliases[]"/>
- @endforeach
- @endif
- </div>
- <div class="form-group">
- @if( count( $computeResource->ipAddresses))
- <label class="control-label">IP Addresses</label>
- @foreach( $computeResource->ipAddresses as $ip )
- <input readonly class="form-control" value="{{ $ip }}" maxlength="30" name="ips[]"/>
- @endforeach
- @endif
- </div>
- <div class="form-group">
- <label class="control-label">Resource Description</label>
- <textarea readonly class="form-control" maxlength="255" name="description">{{
- $computeResource->resourceDescription
- }}</textarea>
- </div>
- <div class="form-group">
- <label class="control-label">Maximum Memory Per Node ( In MB )</label>
- <input readonly type="number" min="0" class="form-control" value="{{ $computeResource->maxMemoryPerNode }}"
- maxlength="30" name="maxMemoryPerNode"/>
- </div>
- </form>
-
-</div>
-
-<div class="tab-pane" id="tab-queues">
-
- @if( is_array( $computeResource->batchQueues) )
- <h3>Existing Queues :</h3>
-
- <div class="panel-group" id="accordion">
- @foreach( $computeResource->batchQueues as $index => $queue)
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a class="accordion-toggle collapsed existing-queue-name" data-toggle="collapse"
- data-parent="#accordion" href="#collapse-{{$index}}">{{ $queue->queueName }}</a>
- </h4>
- </div>
- <div id="collapse-{{$index}}" class="panel-collapse collapse">
- <div class="panel-body">
- <form>
- <div class="queue">
- <div class="form-group required">
- <label>Queue Name
- <small> ( cannot be changed.)</small>
- </label>
- <input class="form-control" value="{{ $queue->queueName }}" maxlength="30" name="qname"
- placeholder="Queue Name" readonly/>
- </div>
- @include('partials/queue-block', array('queueData'=>$queue, 'readOnly'=>true))
- </div>
- </form>
- </div>
- </div>
- </div>
- @endforeach
- </div>
- @endif
-
-</div>
-
-<div class="tab-pane" id="tab-filesystem">
-
- <form role="form">
- <div class="form-group">
- <h3>FileSystem</h3>
- @foreach( $fileSystems as $index => $fileSystem)
- <label>{{ $fileSystem }}</label>
- <input readonly class="form-control" name="fileSystems[{{ $index }}]" placeholder="{{ $fileSystem }}"
- value="@if( isset( $computeResource->fileSystems[ $index]) ){{ $computeResource->fileSystems[ $index] }} @endif"/>
- @endforeach
- </select>
- </div>
- </form>
-
-</div>
-
-<div class="tab-pane" id="tab-jobSubmission">
- <br/><br/><br/><br/>
- @if( count( $jobSubmissionInterfaces ) )
- <div class="job-edit-info">
- @foreach( $jobSubmissionInterfaces as $index => $JSI )
-
- <div class="job-protocol-block">
- <form role="form">
- <?php $selectedJspIndex = $computeResource->jobSubmissionInterfaces[$index]->jobSubmissionProtocol; ?>
-
- <h4>Job Submission Protocol : {{ $jobSubmissionProtocols[ $selectedJspIndex] }}</h4>
- @if( $selectedJspIndex == $jobSubmissionProtocolsObject::LOCAL)
- <div class="select-resource-manager-type">
- <div class="form-group required">
- <label>Selected resource manager type</label>
- <select disabled="true" name="resourceJobManagerType"
- class="form-control selected-resource-manager"
- required="required">
- @foreach( $resourceJobManagerTypes as $index => $rJmT)
- <option value="{{ $index }}"
- @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{ $rJmT
- }}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <label class="control-label">Push Monitoring End Point</label>
- <input disabled type="text" class="form-control" name="pushMonitoringEndpoint"
- value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
- </div>
- <div class="form-group">
- <label class="control-label">Job Manager Bin Path</label>
- <input disabled type="text" class="form-control" name="jobManagerBinPath"
- value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
- </div>
- <div class="form-group">
- <h3>Job Manager Commands</h3>
- @foreach( $jobManagerCommands as $index => $jmc)
- <label class="control-label">{{ $jmc }}</label>
- <input disabled class="form-control" name="jobManagerCommands[{{ $index }}]"
- placeholder="{{ $jmc }}"
- value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
- @endforeach
- </select>
- </div>
- </div>
- @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::SSH || $jobSubmissionProtocolsObject::SSH_FORK)
- <div class="form-group required">
- <label>Selected Security Protocol</label>
- <select disabled="true" name="securityProtocol" required="required">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- <label class="control-label">Alternate SSH Host Name</label>
- <input readonly class='form-control' name='alternativeSSHHostName'
- value="{{ $JSI->alternativeSSHHostName}}"/>
- </div>
- <div class="form-group">
- <label class="control-label">SSH Port</label>
- <input readonly class='form-control' name='sshPort' value="{{ $JSI->sshPort }}"/>
- </div>
-
- <div class="form-group required">
- <label>Selected Monitoring Mode</label>
- <select disabled="true" name="monitorMode" required>
- @foreach( $monitorModes as $index => $mode)
- <option value="{{ $index }}"
- @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- <div class="select-resource-manager-type">
- <div class="form-group required">
- <label>Selected resource manager type</label>
- <select disabled="true" name="resourceJobManagerType"
- class="form-control selected-resource-manager"
- required="required">
- @foreach( $resourceJobManagerTypes as $index => $rJmT)
- <option value="{{ $index }}"
- @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{
- $rJmT }}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <label class="control-label">Push Monitoring End Point</label>
- <input disabled type="text" class="form-control" name="pushMonitoringEndpoint"
- value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
- </div>
- <div class="form-group">
- <label class="control-label">Job Manager Bin Path</label>
- <input disabled type="text" class="form-control" name="jobManagerBinPath"
- value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
- </div>
- <div class="form-group">
- <h3>Job Manager Commands</h3>
- @foreach( $jobManagerCommands as $index => $jmc)
- <label class="control-label">{{ $jmc }}</label>
- <input disabled class="form-control" name="jobManagerCommands[{{ $index }}]"
- placeholder="{{ $jmc }}"
- value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
- @endforeach
- </div>
- </div>
- </div>
-
- @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::UNICORE)
- <div class="form-group required">
- <label>Selected Security Protocol</label>
- <select disabled="true" name="securityProtocol" required="required">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <label class="form-label">Unicore End Point URL</label>
- <input readonly class='form-control' name='unicoreEndPointURL'
- value="{{ $JSI->unicoreEndPointURL }}"/>
- </div>
- @endif
- </form>
-
- </div>
- @endforeach
- </div>
- @endif
-
- <div class="select-job-protocol hide">
- <form>
- <div class="form-group">
- <label class="control-label">Job Submission Protocol:</label>
- <select disabled="true" name="jobSubmissionProtocol" class="form-control selected-job-protocol"
- required="required">
- <option></option>
- @foreach( $jobSubmissionProtocols as $index => $jobSubmissionProtocol)
- @if( ! in_array( $index, $addedJSP))
- <option value="{{ $index }}">{{ $jobSubmissionProtocol }}</option>
- @endif
- @endforeach
- </select>
- </div>
- </form>
- </div>
-
-</div>
-
-<div class="tab-pane" id="tab-dataMovement">
- @if( count( $dataMovementInterfaces ) )
- <div class="job-edit-info">
- <br/><br/><br/>
- @foreach( $dataMovementInterfaces as $index => $DMI )
- <div class="data-movement-block">
- <form>
- <?php $selectedDMIIndex = $computeResource->dataMovementInterfaces[$index]->dataMovementProtocol; ?>
- <h4>Data Movement Protocol : {{ $dataMovementProtocols[ $selectedDMIIndex] }}</h4>
- @if( $selectedDMIIndex == $dataMovementProtocolsObject::LOCAL)
- <!-- Nothing here on local UI -->
- @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::SCP)
- <div class="form-group">
- <label class="control-label">Selected Security Protocol</label>
- <select disabled="true" name="securityProtocol">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <label class="control-label">Alternate SSH Host Name</label>
- <input readonly class='form-control' name='alternativeSSHHostName'
- value="{{ $DMI->alternativeSCPHostName }}"/>
- </div>
- <div class="form-group">
- <label class="control-label">SSH Port</label>
- <input readonly class='form-control' name='sshPort' value="{{ $DMI->sshPort }}"/>
- </div>
- @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::GridFTP)
- <div class="form-group">
- <label class="control-label">Select Security Protocol</label>
- <select disabled="true" name="securityProtocol">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
-
- <div>
- <div class="form-group required">
- <label class="control-label">Grid FTP End Points</label>
- @foreach( $DMI->gridFTPEndPoints as $endPoint)
- <input readonly class="form-control" maxlength="30" name="gridFTPEndPoints[]"
- required="required"
- value="{{$endPoint}}"/>
- @endforeach
- </div>
- </div>
- </div>
- @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::UNICORE_STORAGE_SERVICE)
- <div class="form-group">
- <label class="control-label">Select Security Protocol</label>
- <select disabled="true" name="securityProtocol">
- @foreach( $securityProtocols as $index => $sp)
- <option value="{{ $index }}"
- @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
- @endforeach
- </select>
-
- <div>
- <div class="form-group required">
- <label class="control-label">Unicore End Point URL</label>
- <input readonly class="form-control" maxlength="30" name="unicoreEndPointURL"
- required="required"
- value="{{ $DMI->unicoreEndPointURL }}"/>
- </div>
- </div>
- </div>
- @endif
- </form>
- </div>
- @endforeach
- </div>
- @endif
-</div>
-
-</div>
-</div>
-</div>
-</div>
-@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/partials/dashboard-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/dashboard-block.blade.php b/app/views/partials/dashboard-block.blade.php
index f0c04cb..6df9978 100644
--- a/app/views/partials/dashboard-block.blade.php
+++ b/app/views/partials/dashboard-block.blade.php
@@ -43,18 +43,18 @@
</li>
<li>
- <a><span class="glyphicon glyphicon-folder-open"></span> Data Storages</a>
+ <a><span class="glyphicon glyphicon-folder-open"></span> Storage Resources</a>
<ul>
@if(Session::has("admin"))
<li
@if( Session::has("admin-nav") && Session::get("admin-nav") == "cr-create") class="active" @endif>
- <a class="dashboard-link" href="{{ URL::to('/')}}/ds/create"><i class="fa fa-fw fa-table"></i>Register</a>
+ <a class="dashboard-link" href="{{ URL::to('/')}}/sr/create"><i class="fa fa-fw fa-table"></i>Register</a>
</li>
@endif
@if(Session::has("admin") || Session::has("admin-read-only"))
<li
@if( Session::has("admin-nav") && Session::get("admin-nav") == "cr-browse") class="active" @endif>
- <a class="dashboard-link" href="{{ URL::to('/')}}/ds/browse"><i class="fa fa-fw fa-table"></i>Browse</a>
+ <a class="dashboard-link" href="{{ URL::to('/')}}/sr/browse"><i class="fa fa-fw fa-table"></i>Browse</a>
</li>
@endif
</ul>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/resource/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/browse.blade.php b/app/views/resource/browse.blade.php
index 9bfc3b8..c9b5382 100644
--- a/app/views/resource/browse.blade.php
+++ b/app/views/resource/browse.blade.php
@@ -23,18 +23,19 @@
@if ( isset( $allCRs) )
@if (sizeof($allCRs) == 0)
- <?php $registerDataStorageURL = URL::to('/') . "/ds/create";?>
- {{ CommonUtilities::print_warning_message('No Data Storage Resources are registered. <br/> <a href="{{$registerDataStorageURL}}" class="btn btn-primary"></a>') }}
+ {{ CommonUtilities::print_warning_message('No Compute Resources are registered. Please use "Register Compute
+ Resource" to
+ register a new resources.') }}
@else
<br/>
<div class="col-md-12">
<div class="panel panel-default form-inline">
<div class="panel-heading">
- <h3 style="margin:0;">Search Data Storage Resources</h3>
+ <h3 style="margin:0;">Search Compute Resources</h3>
</div>
<div class="panel-body">
<div class="form-group search-text-block">
- <label>Data Storage Resource Name </label>
+ <label>Compute Resource Name </label>
<input type="search" class="form-control filterinput"/>
</div>
</div>
@@ -45,11 +46,11 @@
<table class="table">
<tr>
+
+ <th>Name</th>
<th>Id</th>
- <th>Login Username</th>
- <th>File System Root Location</th>
- <th>Resource Specific Credential Store Token</th>
@if(Session::has("admin"))
+ <th>Enabled</th>
<th>Edit</th>
@endif
<th>View</th>
@@ -58,34 +59,44 @@
@endif
</tr>
- @foreach($allDSRs as $resource)
+ @foreach($allCRs as $resource)
<?php
- $dsId = $resource->dataMovememtResourceId;
- $userName = $resource->loginUserName;
- $fileSystemRootLocation = $resource->fileSystemRootLocation;
- $resourceSpecificCredentialStoreToken = $resource->resourceSpecificCredentialStoreToken;
+ $crId = $resource->computeResourceId;
+ $crName = $resource->hostName;
+ $enabled = $resource->enabled;
?>
- <tr id="dsDetails">
- <td>{{ $dsId }}</td>
- <td>{{ $userName }}</td>
- <td>{{ $fileSystemRootLocation }}</td>
- <td>{{ resourceSpecificCredentialStoreToken }}</td>
+ <tr id="crDetails">
+ <td>{{ $crName }}</td>
+ <td>{{ $crId }}</td>
@if(Session::has("admin"))
- <td><a href="{{URL::to('/')}}/ds/edit?crId={{ $dsId }}" title="Edit">
+ <td>
+ @if(!$enabled)
+ <div class="checkbox">
+ <input class="resource-status" resourceId="{{$crId}}" type="checkbox">
+ </div>
+ @else
+ <div class="checkbox">
+ <input class="resource-status" type="checkbox" resourceId="{{$crId}}" checked>
+ </div>
+ @endif
+ </td>
+ <td><a href="{{URL::to('/')}}/cr/edit?crId={{ $crId }}" title="Edit">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</td>
@endif
<td>
- <a href="{{URL::to('/')}}/ds/view?crId={{ $crId }}" title="Edit">
+ <a href="{{URL::to('/')}}/cr/view?crId={{ $crId }}" title="Edit">
<span class="glyphicon glyphicon-list"></span>
</a>
</td>
@if(Session::has("admin"))
<td>
<a href="#" title="Delete">
- <span class="glyphicon glyphicon-trash del-ds" data-toggle="modal"
- data-target="#delete-ds-block" data-dsid="{{$dsId}}"></span>
+ <span class="glyphicon glyphicon-trash del-cr" data-toggle="modal"
+ data-target="#delete-cr-block" data-delete-cr-name="{{$crName}}"
+ data-deployment-count="{{$connectedDeployments[$crId]}}"
+ data-crid="{{$crId}}"></span>
</a>
</td>
@endif
@@ -98,17 +109,20 @@
@endif
@endif
- <div class="modal fade" id="delete-ds-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+ <div class="modal fade" id="delete-cr-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
aria-hidden="true">
<div class="modal-dialog">
- <form action="{{URL::to('/')}}/ds/delete-ds" method="POST">
+
+ <form action="{{URL::to('/')}}/cr/delete-cr" method="POST">
<div class="modal-content">
<div class="modal-header">
- <h3 class="text-center">Delete Data Storage Resource Confirmation</h3>
+ <h3 class="text-center">Delete Compute Resource Confirmation</h3>
</div>
<div class="modal-body">
<input type="hidden" class="form-control delete-crId" name="del-crId"/>
- Do you really want to delete Data Storage Resource, <span class="delete-ds-id"></span>? This action cannot be undone.
+ The Compute Resource, <span class="delete-cr-name"></span> is connected to <span
+ class="deploymentCount">0</span> deployments.
+ Do you really want to delete it? This action cannot be undone.
</div>
<div class="modal-footer">
<div class="form-group">
@@ -155,9 +169,45 @@
return false;
});
- $(".del-ds").click(function () {
- $(".delete-ds-id").html("'" + $(this).data("delete-ds-id") + "'");
- $(".delete-dsId").val($(this).data("dsid"));
+ $(".del-cr").click(function () {
+ $(".delete-cr-name").html("'" + $(this).data("delete-cr-name") + "'");
+ $(".delete-crId").val($(this).data("crid"));
+ $(".deploymentCount").html($(this).data("deployment-count"));
+ });
+
+ $('.resource-status').click(function() {
+ var $this = $(this);
+ if ($this.is(':checked')) {
+ //enable compute resource
+ $resourceId = $this.attr("resourceId");
+ $.ajax({
+ type: 'POST',
+ url: "{{URL::to('/')}}/admin/enable-cr",
+ data: {
+ 'resourceId': $resourceId
+ },
+ async: true,
+ success: function (data) {
+ console.log("enabled cr " + $resourceId);
+ $(".success-message").html("<span class='alert alert-success col-md-12'>Successfully enabled compute resource</span>");
+ }
+ });
+ } else {
+ //disabled compute resource
+ $resourceId = $this.attr("resourceId");
+ $.ajax({
+ type: 'POST',
+ url: "{{URL::to('/')}}/admin/disable-cr",
+ data: {
+ 'resourceId': $resourceId
+ },
+ async: true,
+ success: function (data) {
+ console.log("disabled cr " + $resourceId);
+ $(".success-message").html("<span class='alert alert-success col-md-12'>Successfully disabled compute resource</span>");
+ }
+ });
+ }
});
</script>
@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/storage-resource/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/storage-resource/browse.blade.php b/app/views/storage-resource/browse.blade.php
new file mode 100644
index 0000000..775b51f
--- /dev/null
+++ b/app/views/storage-resource/browse.blade.php
@@ -0,0 +1,165 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+{{ HTML::style('css/admin.css')}}
+{{ HTML::style('css/datetimepicker.css')}}
+@stop
+
+@section('content')
+
+<div id="wrapper">
+ <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+ @include( 'partials/dashboard-block')
+ <div id="page-wrapper">
+
+<div class="container-fluid">
+ @if( Session::has("message"))
+ <div class="col-md-12">
+ <span class="alert alert-success">{{ Session::get("message") }}</span>
+ </div>
+ {{ Session::forget("message") }}
+ @endif
+
+ @if ( isset( $allSRs) )
+ @if (sizeof( $allSRs) == 0)
+ {{ CommonUtilities::print_warning_message('No Storage Resources are registered.') }}
+ <br/>
+ <a href="{{ URL::to('/')}}/sr/create" class="btn btn-primary">Create a new Storage Resource</a>
+ @else
+ <br/>
+ <div class="col-md-12">
+ <div class="panel panel-default form-inline">
+ <div class="panel-heading">
+ <h3 style="margin:0;">Search Storage Resources</h3>
+ </div>
+ <div class="panel-body">
+ <div class="form-group search-text-block">
+ <label>Data Storage Resource Name </label>
+ <input type="search" class="form-control filterinput"/>
+ </div>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="table-responsive">
+ <table class="table">
+
+ <tr>
+ <th>Id</th>
+ <th>Login Username</th>
+ <th>File System Root Location</th>
+ <th>Resource Specific Credential Store Token</th>
+ @if(Session::has("admin"))
+ <th>Edit</th>
+ @endif
+ <th>View</th>
+ @if(Session::has("admin"))
+ <th>Delete</th>
+ @endif
+ </tr>
+
+ @foreach($allSRRs as $resource)
+ <?php
+ $srId = $resource->dataMovememtResourceId;
+ $userName = $resource->loginUserName;
+ $fileSystemRootLocation = $resource->fileSystemRootLocation;
+ $resourceSpecificCredentialStoreToken = $resource->resourceSpecificCredentialStoreToken;
+ ?>
+ <tr id="srDetails">
+ <td>{{ $srId }}</td>
+ <td>{{ $userName }}</td>
+ <td>{{ $fileSystemRootLocation }}</td>
+ <td>{{ resourceSpecificCredentialStoreToken }}</td>
+ @if(Session::has("admin"))
+ <td><a href="{{URL::to('/')}}/sr/edit?srId={{ $srId }}" title="Edit">
+ <span class="glyphicon glyphicon-pencil"></span>
+ </a>
+ </td>
+ @endif
+ <td>
+ <a href="{{URL::to('/')}}/sr/view?srId={{ $srId }}" title="Edit">
+ <span class="glyphicon glyphicon-list"></span>
+ </a>
+ </td>
+ @if(Session::has("admin"))
+ <td>
+ <a href="#" title="Delete">
+ <span class="glyphicon glyphicon-trash del-sr" data-toggle="modal"
+ data-target="#delete-sr-block" data-srid="{{$srId}}"></span>
+ </a>
+ </td>
+ @endif
+ </tr>
+ @endforeach
+
+ </table>
+ </div>
+ </div>
+ </div>
+ @endif
+ @endif
+
+ <div class="modal fade" id="delete-sr-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+ aria-hidden="true">
+ <div class="modal-dialog">
+ <form action="{{URL::to('/')}}/sr/delete-sr" method="POST">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h3 class="text-center">Delete Data Storage Resource Confirmation</h3>
+ </div>
+ <div class="modal-body">
+ <input type="hidden" class="form-control delete-srId" name="del-srId"/>
+ Do you really want to delete Data Storage Resource, <span class="delete-sr-id"></span>? This action cannot be undone.
+ </div>
+ <div class="modal-footer">
+ <div class="form-group">
+ <input type="submit" class="btn btn-danger" value="Delete"/>
+ <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+ </div>
+ </div>
+ </div>
+
+ </form>
+ </div>
+ </div>
+
+</div>
+</div>
+
+@stop
+
+@section('scripts')
+@parent
+<script type="text/javascript">
+ $('.filterinput').keyup(function () {
+ var value = $(this).val();
+ if (value.length > 0) {
+ $("table tr").each(function (index) {
+ if (index != 0) {
+
+ $row = $(this);
+
+ var id = $row.find("td:first").text();
+ id = $.trim(id);
+ id = id.substr(0, value.length);
+ if (id == value) {
+ $(this).slideDown();
+ }
+ else {
+ $(this).slideUp();
+ }
+ }
+ });
+ } else {
+ $("table tr").slideDown();
+ }
+ return false;
+ });
+
+ $(".del-sr").click(function () {
+ $(".delete-sr-id").html("'" + $(this).data("delete-sr-id") + "'");
+ $(".delete-srId").val($(this).data("srid"));
+ });
+</script>
+@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/storage-resource/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/storage-resource/create.blade.php b/app/views/storage-resource/create.blade.php
new file mode 100644
index 0000000..40c096d
--- /dev/null
+++ b/app/views/storage-resource/create.blade.php
@@ -0,0 +1,43 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+{{ HTML::style('css/admin.css')}}
+{{ HTML::style('css/datetimepicker.css')}}
+@stop
+
+@section('content')
+
+<div id="wrapper">
+ <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+ @include( 'partials/dashboard-block')
+ <div id="page-wrapper">
+
+<div class="container-fluid">
+ <div class="col-md-offset-2 col-md-8">
+ <h3>Create a Resource</h3>
+
+ <form role="form" method="POST" action="{{ URL::to('/') }}/sr/create">
+ <div class="form-group required">
+ <label class="control-label">Host Name</label>
+ <input class="form-control hostName" maxlength="100" name="hostname" required="required"/>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Stoage Resource Description</label>
+ <textarea class="form-control" maxlength="255" name="description"></textarea>
+ </div>
+ <div class="form-group">
+ <input type="submit" class="btn btn-lg btn-primary" name="step1" value="Create"/>
+ <input type="reset" class="btn btn-lg btn-success" value="Reset"/>
+ </div>
+ </form>
+ </div>
+</div>
+</div>
+</div>
+@stop
+
+@section('scripts')
+@parent
+{{ HTML::script('js/script.js') }}
+@stop
\ No newline at end of file
[3/3] airavata-php-gateway git commit: storage resource updates in
progress.
Posted by nd...@apache.org.
storage resource updates in progress.
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/cce42251
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/cce42251
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/cce42251
Branch: refs/heads/develop
Commit: cce4225183db0ada643e884119e0ed758ee295e5
Parents: e8ff6b1
Author: Nipurn Doshi <Nipurn Doshi>
Authored: Thu Nov 19 16:27:05 2015 -0500
Committer: Nipurn Doshi <Nipurn Doshi>
Committed: Thu Nov 19 16:27:05 2015 -0500
----------------------------------------------------------------------
app/controllers/DatastorageController.php | 251 -------
app/controllers/ResourceController.php | 2 +-
app/controllers/StorageresourceController.php | 238 ++++++
app/libraries/DSUtilities.php | 600 ---------------
app/libraries/SRUtilities.php | 564 ++++++++++++++
app/libraries/Wsis/Wsis.php | 2 -
app/routes.php | 22 +-
app/views/account/dashboard.blade.php | 6 +-
app/views/data-storage/browse.blade.php | 213 ------
app/views/data-storage/create.blade.php | 53 --
app/views/data-storage/edit.blade.php | 836 ---------------------
app/views/data-storage/view.blade.php | 379 ----------
app/views/partials/dashboard-block.blade.php | 6 +-
app/views/resource/browse.blade.php | 106 ++-
app/views/storage-resource/browse.blade.php | 165 ++++
app/views/storage-resource/create.blade.php | 43 ++
app/views/storage-resource/edit.blade.php | 809 ++++++++++++++++++++
app/views/storage-resource/view.blade.php | 379 ++++++++++
composer.bat | 1 +
public/js/script.js | 8 +
20 files changed, 2303 insertions(+), 2380 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/controllers/DatastorageController.php
----------------------------------------------------------------------
diff --git a/app/controllers/DatastorageController.php b/app/controllers/DatastorageController.php
deleted file mode 100644
index 80778d6..0000000
--- a/app/controllers/DatastorageController.php
+++ /dev/null
@@ -1,251 +0,0 @@
-<?php
-
-class DatastorageController extends BaseController
-{
-
- /**
- * Instantiate a new Compute Resource Controller Instance
- **/
-
- public function __construct()
- {
- $this->beforeFilter('verifyadmin');
- Session::put("nav-active", "data-storage");
-
- }
-
- public function createView()
- {
- $this->beforeFilter('verifyeditadmin');
- Session::put("admin-nav", "ds-create");
- return View::make("data-storage/create");
- }
-
- public function createSubmit()
- {
- $this->beforeFilter('verifyeditadmin');
- $hostAliases = Input::get("hostaliases");
- $ips = Input::get("ips");
- //Compute resource is by default enabled
- $computeDescription = array(
- "hostName" => trim(Input::get("hostname")),
- "hostAliases" => array_unique(array_filter($hostAliases)),
- "ipAddresses" => array_unique(array_filter($ips)),
- "resourceDescription" => Input::get("description"),
- "enabled" => true
- );
- $computeResource = DSUtilities::register_or_update_compute_resource($computeDescription);
-
- return Redirect::to("ds/edit?dsId=" . $computeResource->computeResourceId);
- }
-
- public function editView()
- {
- $this->beforeFilter('verifyeditadmin');
- $data = DSUtilities::getEditDSData();
- $computeResourceId = "";
- if (Input::has("dsId"))
- $computeResourceId = Input::get("dsId");
- else if (Session::has("dataStorage")) {
- $computeResource = Session::get("dataStorage");
- $computeResourceId = $computeResource->computeResourceId;
- }
-
- if ($computeResourceId != "") {
- $computeResource = DSUtilities::get_compute_resource($computeResourceId);
- $jobSubmissionInterfaces = array();
- $dataMovementInterfaces = array();
- $addedJSP = array();
- $addedDMI = array();
- //var_dump( $computeResource->jobSubmissionInterfaces); exit;
- if (count($computeResource->jobSubmissionInterfaces)) {
- foreach ($computeResource->jobSubmissionInterfaces as $JSI) {
- $jobSubmissionInterfaces[] = DSUtilities::getJobSubmissionDetails($JSI->jobSubmissionInterfaceId, $JSI->jobSubmissionProtocol);
- $addedJSP[] = $JSI->jobSubmissionProtocol;
- }
- }
- //var_dump( CRUtilities::getJobSubmissionDetails( $data["computeResource"]->jobSubmissionInterfaces[0]->jobSubmissionInterfaceId, 1) ); exit;
- if (count($computeResource->dataMovementInterfaces)) {
- foreach ($computeResource->dataMovementInterfaces as $DMI) {
- $dataMovementInterfaces[] = CRUtilities::getDataMovementDetails($DMI->dataMovementInterfaceId, $DMI->dataMovementProtocol);
- $addedDMI[] = $DMI->dataMovementProtocol;
- }
- }
-
- $data["computeResource"] = $computeResource;
- $data["jobSubmissionInterfaces"] = $jobSubmissionInterfaces;
- $data["dataMovementInterfaces"] = $dataMovementInterfaces;
- $data["addedJSP"] = $addedJSP;
- $data["addedDMI"] = $addedDMI;
- //var_dump($data["jobSubmissionInterfaces"]); exit;
- return View::make("resource/edit", $data);
- } else
- return View::make("resource/browse")->with("login-alert", "Unable to retrieve this Compute Resource. Please report this error to devs.");
-
- }
-
- public function editSubmit()
- {
- $this->beforeFilter('verifyeditadmin');
- $tabName = "";
- if (Input::get("cr-edit") == "resDesc") /* Modify compute Resource description */ {
- $computeDescription = CRUtilities::get_compute_resource(Input::get("crId"));
- $computeDescription->hostName = trim(Input::get("hostname"));
- $computeDescription->hostAliases = array_unique(array_filter(Input::get("hostaliases")));
- $computeDescription->ipAddresses = array_unique(array_filter(Input::get("ips")));
- $computeDescription->resourceDescription = Input::get("description");
- $computeDescription->maxMemoryPerNode = Input::get("maxMemoryPerNode");
- //var_dump( $computeDescription); exit;
-
- $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
-
- $tabName = "#tab-desc";
- }
- if (Input::get("cr-edit") == "queue") /* Add / Modify a Queue */ {
- $queue = array("queueName" => Input::get("qname"),
- "queueDescription" => Input::get("qdesc"),
- "maxRunTime" => Input::get("qmaxruntime"),
- "maxNodes" => Input::get("qmaxnodes"),
- "maxProcessors" => Input::get("qmaxprocessors"),
- "maxJobsInQueue" => Input::get("qmaxjobsinqueue"),
- "maxMemory" => Input::get("qmaxmemoryinqueue")
- );
-
- $computeDescription = CRUtilities::get_compute_resource(Input::get("crId"));
- $computeDescription->batchQueues[] = CRUtilities::createQueueObject($queue);
- $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
- //var_dump( $computeResource); exit;
- $tabName = "#tab-queues";
- } else if (Input::get("cr-edit") == "delete-queue") {
- CRUtilities::deleteQueue(Input::get("crId"), Input::get("queueName"));
- $tabName = "#tab-queues";
- } else if (Input::get("cr-edit") == "fileSystems") {
- $computeDescription = CRUtilities::get_compute_resource(Input::get("crId"));
- $computeDescription->fileSystems = array_filter(Input::get("fileSystems"), "trim");
- $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
-
- $tabName = "#tab-filesystem";
- } else if (Input::get("cr-edit") == "jsp" || Input::get("cr-edit") == "edit-jsp") /* Add / Modify a Job Submission Interface */ {
- $update = false;
- if (Input::get("cr-edit") == "edit-jsp")
- $update = true;
-
- $jobSubmissionInterface = CRUtilities::create_or_update_JSIObject(Input::all(), $update);
-
- $tabName = "#tab-jobSubmission";
- } else if (Input::get("cr-edit") == "jsi-priority") {
- $inputs = Input::all();
- $computeDescription = CRUtilities::get_compute_resource(Input::get("crId"));
- foreach ($computeDescription->jobSubmissionInterfaces as $index => $jsi) {
- foreach ($inputs["jsi-id"] as $idIndex => $jsiId) {
- if ($jsiId == $jsi->jobSubmissionInterfaceId) {
- $computeDescription->jobSubmissionInterfaces[$index]->priorityOrder = $inputs["jsi-priority"][$idIndex];
- break;
- }
- }
- }
- $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
-
- return 1; //currently done by ajax.
- } else if (Input::get("cr-edit") == "dmp" || Input::get("cr-edit") == "edit-dmi") /* Add / Modify a Data Movement Interface */ {
- $update = false;
- if (Input::get("cr-edit") == "edit-dmi")
- $update = true;
- $dataMovementInterface = CRUtilities::create_or_update_DMIObject(Input::all(), $update);
-
- $tabName = "#tab-dataMovement";
- } else if (Input::get("cr-edit") == "dmi-priority") {
- $inputs = Input::all();
- $computeDescription = CRUtilities::get_compute_resource(Input::get("crId"));
- foreach ($computeDescription->dataMovementInterfaces as $index => $dmi) {
- foreach ($inputs["dmi-id"] as $idIndex => $dmiId) {
- if ($dmiId == $dmi->dataMovementInterfaceId) {
- $computeDescription->dataMovementInterfaces[$index]->priorityOrder = $inputs["dmi-priority"][$idIndex];
- break;
- }
- }
- }
- $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
-
- return 1; //currently done by ajax.
- }
-
- return Redirect::to("cr/edit?crId=" . Input::get("crId") . $tabName);
- }
-
- public function viewView()
- {
- $data = CRUtilities::getEditCRData();
- $computeResourceId = "";
- if (Input::has("crId"))
- $computeResourceId = Input::get("crId");
- else if (Session::has("computeResource")) {
- $computeResource = Session::get("computeResource");
- $computeResourceId = $computeResource->computeResourceId;
- }
-
- if ($computeResourceId != "") {
- $computeResource = CRUtilities::get_compute_resource($computeResourceId);
- $jobSubmissionInterfaces = array();
- $dataMovementInterfaces = array();
- $addedJSP = array();
- $addedDMI = array();
- //var_dump( $computeResource->jobSubmissionInterfaces); exit;
- if (count($computeResource->jobSubmissionInterfaces)) {
- foreach ($computeResource->jobSubmissionInterfaces as $JSI) {
- $jobSubmissionInterfaces[] = CRUtilities::getJobSubmissionDetails($JSI->jobSubmissionInterfaceId, $JSI->jobSubmissionProtocol);
- $addedJSP[] = $JSI->jobSubmissionProtocol;
- }
- }
- //var_dump( CRUtilities::getJobSubmissionDetails( $data["computeResource"]->jobSubmissionInterfaces[0]->jobSubmissionInterfaceId, 1) ); exit;
- if (count($computeResource->dataMovementInterfaces)) {
- foreach ($computeResource->dataMovementInterfaces as $DMI) {
- $dataMovementInterfaces[] = CRUtilities::getDataMovementDetails($DMI->dataMovementInterfaceId, $DMI->dataMovementProtocol);
- $addedDMI[] = $DMI->dataMovementProtocol;
- }
- }
-
- $data["computeResource"] = $computeResource;
- $data["jobSubmissionInterfaces"] = $jobSubmissionInterfaces;
- $data["dataMovementInterfaces"] = $dataMovementInterfaces;
- $data["addedJSP"] = $addedJSP;
- $data["addedDMI"] = $addedDMI;
- //var_dump($data["jobSubmissionInterfaces"]); exit;
- return View::make("resource/view", $data);
- } else
- return View::make("resource/browse")->with("login-alert", "Unable to retrieve this Compute Resource. Please report this error to devs.");
-
- }
-
- public function deleteActions()
- {
- $this->beforeFilter('verifyeditadmin');
- $result = CRUtilities::deleteActions(Input::all());
- if (Input::has("jsiId")) {
- return Redirect::to("cr/edit?crId=" . Input::get("crId") . "#tab-jobSubmission")
- ->with("message", "Job Submission Interface was deleted successfully");
- }
- if (Input::has("dmiId")) {
- return Redirect::to("cr/edit?crId=" . Input::get("crId") . "#tab-dataMovement")
- ->with("message", "Data Movement Protocol was deleted successfully");
- } elseif (Input::has("del-crId")) {
- return Redirect::to("cr/browse")->with("message", "The Compute Resource has been successfully deleted.");
- } else
- return $result;
- }
-
- public function browseView()
- {
- $data = DSUtilities::getBrowseDSData(false);
- var_dump( $data); exit;
- $allDSRs = $data["dsObjects"];
-
- Session::put("admin-nav", "cr-browse");
- return View::make("resource/browse", array(
- "allDSRs" => $allDSRs
- ));
-
- }
-}
-
-?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/controllers/ResourceController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ResourceController.php b/app/controllers/ResourceController.php
index 91530a2..4c658c0 100755
--- a/app/controllers/ResourceController.php
+++ b/app/controllers/ResourceController.php
@@ -9,6 +9,7 @@ class ResourceController extends BaseController
public function __construct()
{
+ print_r("test"); exit;
$this->beforeFilter('verifyadmin');
Session::put("nav-active", "compute-resource");
@@ -37,7 +38,6 @@ class ResourceController extends BaseController
public function editView()
{
-
$data = CRUtilities::getEditCRData();
$computeResourceId = "";
if (Input::has("crId"))
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/controllers/StorageresourceController.php
----------------------------------------------------------------------
diff --git a/app/controllers/StorageresourceController.php b/app/controllers/StorageresourceController.php
new file mode 100644
index 0000000..70ee281
--- /dev/null
+++ b/app/controllers/StorageresourceController.php
@@ -0,0 +1,238 @@
+<?php
+
+class StorageresourceController extends BaseController
+{
+
+ /**
+ * Instantiate a new Compute Resource Controller Instance
+ **/
+
+ public function __construct()
+ {
+ $this->beforeFilter('verifyadmin');
+ Session::put("nav-active", "storage-resource");
+
+ }
+
+ public function createView()
+ {
+ $this->beforeFilter('verifyeditadmin');
+ Session::put("admin-nav", "sr-create");
+ $data = SRUtilities::getEditSRData();
+ return View::make("storage-resource/create", $data);
+ }
+
+ public function createSubmit()
+ {
+ $this->beforeFilter('verifyeditadmin');
+ //Compute resource is by default enabled
+ $storageDescription = array(
+ "hostName" => trim(Input::get("hostname")),
+ "storageResourceDescription" => trim(Input::get("hostname")),
+ "enabled" => true
+ );
+ $storageResource = SRUtilities::register_or_update_storage_resource($storageDescription);
+
+ return Redirect::to("sr/edit?srId=" . $storageResource->storageResourceId);
+ }
+
+ public function editView()
+ {
+ $this->beforeFilter('verifyeditadmin');
+ $data = SRUtilities::getEditSRData();
+ $storageResourceId = "";
+ if (Input::has("srId"))
+ $storageResourceId = Input::get("srId");
+ else if (Session::has("storageResource")) {
+ $storageResource = Session::get("storageResource");
+ $storageResourceId = $storageResource->storageResourceId;
+ }
+ if ($storageResourceId != "") {
+ $storageResource = SRUtilities::get_storage_resource($storageResourceId);
+ $dataMovementInterfaces = array();
+ $addedDMI = array();
+ //var_dump( CRUtilities::getJobSubmissionDetails( $data["computeResource"]->jobSubmissionInterfaces[0]->jobSubmissionInterfaceId, 1) ); exit;
+ if (count($storageResource->dataMovementInterfaces)) {
+ foreach ($storageResource->dataMovementInterfaces as $DMI) {
+ $dataMovementInterfaces[] = SRUtilities::getDataMovementDetails($DMI->dataMovementInterfaceId, $DMI->dataMovementProtocol);
+ $addedDMI[] = $DMI->dataMovementProtocol;
+ }
+ }
+
+ $data["storageResource"] = $storageResource;
+ $data["dataMovementInterfaces"] = $dataMovementInterfaces;
+ $data["addedDMI"] = $addedDMI;
+ return View::make("resource/edit", $data);
+ } else{
+ Session::put("message", "Unable to retrieve this Storage Resource. Please try again later or submit a bug report using the link in the Help menu.");
+ return View::make("storage-resource/browse");
+ }
+
+ }
+
+ public function editSubmit()
+ {
+ $this->beforeFilter('verifyeditadmin');
+ $tabName = "";
+ if (Input::get("sr-edit") == "resDesc") /* Modify compute Resource description */ {
+ $storageResourceDescription = SRUtilities::get_storage_resource(Input::get("srId"));
+ $storageResourceDescription->hostName = trim(Input::get("hostname"));
+ $storageResourceDescription->resourceDescription = Input::get("description");
+ //var_dump( $computeDescription); exit;
+
+ $storageResource = SRUtilities::register_or_update_compute_resource($storageResourceDescription, true);
+
+ $tabName = "#tab-desc";
+ }
+ /*
+ if (Input::get("sr-edit") == "queue"){
+ $queue = array("queueName" => Input::get("qname"),
+ "queueDescription" => Input::get("qdesc"),
+ "maxRunTime" => Input::get("qmaxruntime"),
+ "maxNodes" => Input::get("qmaxnodes"),
+ "maxProcessors" => Input::get("qmaxprocessors"),
+ "maxJobsInQueue" => Input::get("qmaxjobsinqueue"),
+ "maxMemory" => Input::get("qmaxmemoryinqueue")
+ );
+
+ $storageResourceDescription = SRUtilities::get_storage_resource(Input::get("crId"));
+ $storageResourceDescription->batchQueues[] = CRUtilities::createQueueObject($queue);
+ $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
+ //var_dump( $computeResource); exit;
+ $tabName = "#tab-queues";
+ } else if (Input::get("cr-edit") == "delete-queue") {
+ CRUtilities::deleteQueue(Input::get("crId"), Input::get("queueName"));
+ $tabName = "#tab-queues";
+ } else if (Input::get("cr-edit") == "fileSystems") {
+ $computeDescription = CRUtilities::get_compute_resource(Input::get("crId"));
+ $computeDescription->fileSystems = array_filter(Input::get("fileSystems"), "trim");
+ $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
+
+ $tabName = "#tab-filesystem";
+ } else if (Input::get("cr-edit") == "jsp" || Input::get("cr-edit") == "edit-jsp") {
+ $update = false;
+ if (Input::get("cr-edit") == "edit-jsp")
+ $update = true;
+
+ $jobSubmissionInterface = CRUtilities::create_or_update_JSIObject(Input::all(), $update);
+
+ $tabName = "#tab-jobSubmission";
+ } else if (Input::get("cr-edit") == "jsi-priority") {
+ $inputs = Input::all();
+ $computeDescription = CRUtilities::get_compute_resource(Input::get("crId"));
+ foreach ($computeDescription->jobSubmissionInterfaces as $index => $jsi) {
+ foreach ($inputs["jsi-id"] as $idIndex => $jsiId) {
+ if ($jsiId == $jsi->jobSubmissionInterfaceId) {
+ $computeDescription->jobSubmissionInterfaces[$index]->priorityOrder = $inputs["jsi-priority"][$idIndex];
+ break;
+ }
+ }
+ }
+ $computeResource = CRUtilities::register_or_update_compute_resource($computeDescription, true);
+
+ return 1; //currently done by ajax.
+ } else
+ */
+ if (Input::get("cr-edit") == "dmp" || Input::get("cr-edit") == "edit-dmi") /* Add / Modify a Data Movement Interface */ {
+ $update = false;
+ if (Input::get("cr-edit") == "edit-dmi")
+ $update = true;
+ $dataMovementInterface = SRUtilities::create_or_update_DMIObject(Input::all(), $update);
+
+ $tabName = "#tab-dataMovement";
+ } else if (Input::get("cr-edit") == "dmi-priority") {
+ $inputs = Input::all();
+ $storageDescription = CRUtilities::get_storage_resource(Input::get("srId"));
+ foreach ($storageDescription->dataMovementInterfaces as $index => $dmi) {
+ foreach ($inputs["dmi-id"] as $idIndex => $dmiId) {
+ if ($dmiId == $dmi->dataMovementInterfaceId) {
+ $storageDescription->dataMovementInterfaces[$index]->priorityOrder = $inputs["dmi-priority"][$idIndex];
+ break;
+ }
+ }
+ }
+ $storageResource = CRUtilities::register_or_update_storage_resource($storageDescription, true);
+
+ return 1; //currently done by ajax.
+ }
+
+ return Redirect::to("se/edit?srId=" . Input::get("srId") . $tabName);
+ }
+
+ public function viewView()
+ {
+ $data = CRUtilities::getEditCRData();
+ $computeResourceId = "";
+ if (Input::has("crId"))
+ $computeResourceId = Input::get("crId");
+ else if (Session::has("computeResource")) {
+ $computeResource = Session::get("computeResource");
+ $computeResourceId = $computeResource->computeResourceId;
+ }
+
+ if ($computeResourceId != "") {
+ $computeResource = CRUtilities::get_compute_resource($computeResourceId);
+ $jobSubmissionInterfaces = array();
+ $dataMovementInterfaces = array();
+ $addedJSP = array();
+ $addedDMI = array();
+ //var_dump( $computeResource->jobSubmissionInterfaces); exit;
+ if (count($computeResource->jobSubmissionInterfaces)) {
+ foreach ($computeResource->jobSubmissionInterfaces as $JSI) {
+ $jobSubmissionInterfaces[] = CRUtilities::getJobSubmissionDetails($JSI->jobSubmissionInterfaceId, $JSI->jobSubmissionProtocol);
+ $addedJSP[] = $JSI->jobSubmissionProtocol;
+ }
+ }
+ //var_dump( CRUtilities::getJobSubmissionDetails( $data["computeResource"]->jobSubmissionInterfaces[0]->jobSubmissionInterfaceId, 1) ); exit;
+ if (count($computeResource->dataMovementInterfaces)) {
+ foreach ($computeResource->dataMovementInterfaces as $DMI) {
+ $dataMovementInterfaces[] = CRUtilities::getDataMovementDetails($DMI->dataMovementInterfaceId, $DMI->dataMovementProtocol);
+ $addedDMI[] = $DMI->dataMovementProtocol;
+ }
+ }
+
+ $data["computeResource"] = $computeResource;
+ $data["jobSubmissionInterfaces"] = $jobSubmissionInterfaces;
+ $data["dataMovementInterfaces"] = $dataMovementInterfaces;
+ $data["addedJSP"] = $addedJSP;
+ $data["addedDMI"] = $addedDMI;
+ //var_dump($data["jobSubmissionInterfaces"]); exit;
+ return View::make("resource/view", $data);
+ } else
+ return View::make("resource/browse")->with("login-alert", "Unable to retrieve this Compute Resource. Please report this error to devs.");
+
+ }
+
+ public function deleteActions()
+ {
+ $this->beforeFilter('verifyeditadmin');
+ $result = SRUtilities::deleteActions(Input::all());
+ /*
+ if (Input::has("jsiId")) {
+ return Redirect::to("cr/edit?crId=" . Input::get("crId") . "#tab-jobSubmission")
+ ->with("message", "Job Submission Interface was deleted successfully");
+ }
+ */
+ if (Input::has("dmiId")) {
+ return Redirect::to("sr/edit?crId=" . Input::get("crId") . "#tab-dataMovement")
+ ->with("message", "Data Movement Protocol was deleted successfully");
+ } elseif (Input::has("del-srId")) {
+ return Redirect::to("sr/browse")->with("message", "The Compute Resource has been successfully deleted.");
+ } else
+ return $result;
+ }
+
+ public function browseView()
+ {
+ $data = SRUtilities::getBrowseSRData(false);
+ $allSRs = $data["srObjects"];
+
+ Session::put("admin-nav", "cr-browse");
+ return View::make("storage-resource/browse", array(
+ "allSRs" => $allSRs
+ ));
+
+ }
+}
+
+?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/libraries/DSUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/DSUtilities.php b/app/libraries/DSUtilities.php
deleted file mode 100644
index aff29a1..0000000
--- a/app/libraries/DSUtilities.php
+++ /dev/null
@@ -1,600 +0,0 @@
-<?php
-
-
-//Airavata classes - loaded from app/libraries/Airavata
-//Compute Resource classes
-use Airavata\Model\AppCatalog\ComputeResource\BatchQueue;
-use Airavata\Model\AppCatalog\ComputeResource\ComputeResourceDescription;
-use Airavata\Model\AppCatalog\ComputeResource\DataMovementProtocol;
-use Airavata\Model\AppCatalog\ComputeResource\FileSystems;
-use Airavata\Model\AppCatalog\ComputeResource\GridFTPDataMovement;
-use Airavata\Model\AppCatalog\ComputeResource\JobManagerCommand;
-use Airavata\Model\AppCatalog\ComputeResource\JobSubmissionProtocol;
-use Airavata\Model\AppCatalog\ComputeResource\LOCALDataMovement;
-use Airavata\Model\AppCatalog\ComputeResource\LOCALSubmission;
-use Airavata\Model\AppCatalog\ComputeResource\MonitorMode;
-use Airavata\Model\AppCatalog\ComputeResource\ResourceJobManager;
-use Airavata\Model\AppCatalog\ComputeResource\ResourceJobManagerType;
-use Airavata\Model\AppCatalog\ComputeResource\SCPDataMovement;
-use Airavata\Model\AppCatalog\ComputeResource\SecurityProtocol;
-use Airavata\Model\AppCatalog\ComputeResource\SSHJobSubmission;
-use Airavata\Model\AppCatalog\ComputeResource\UnicoreDataMovement;
-use Airavata\Model\AppCatalog\ComputeResource\UnicoreJobSubmission;
-use Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference;
-use Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile;
-
-//Gateway Classes
-
-
-class DSUtilities
-{
- /**
- * Basic utility functions
- */
-
-//define('ROOT_DIR', __DIR__);
-
- /**
- * Define configuration constants
- */
- public static function register_or_update_compute_resource($computeDescription, $update = false)
- {
- if ($update) {
- $computeResourceId = $computeDescription->computeResourceId;
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $computeResourceId)) {
- Cache::forget('CR-' . $computeResourceId);
- }
- }
-
- if (Airavata::updateComputeResource(Session::get('authz-token'), $computeResourceId, $computeDescription)) {
- $computeResource = Airavata::getComputeResource(Session::get('authz-token'), $computeResourceId);
- return $computeResource;
- } else
- print_r("Something went wrong while updating!");
- exit;
- } else {
- /*
- $fileSystems = new FileSystems();
- foreach( $fileSystems as $fileSystem)
- $computeDescription["fileSystems"][$fileSystem] = "";
- */
- $cd = new ComputeResourceDescription($computeDescription);
- $computeResourceId = Airavata::registerComputeResource(Session::get('authz-token'), $cd);
- }
-
- $computeResource = Airavata::getComputeResource(Session::get('authz-token'), $computeResourceId);
- return $computeResource;
-
- }
-
- /*
- * Getting data for Compute resource inputs
- */
-
- public static function getEditCRData()
- {
- $files = new FileSystems();
- $jsp = new JobSubmissionProtocol();
- $rjmt = new ResourceJobManagerType();
- $sp = new SecurityProtocol();
- $dmp = new DataMovementProtocol();
- $jmc = new JobManagerCommand();
- $mm = new MonitorMode();
- return array(
- "fileSystemsObject" => $files,
- "fileSystems" => $files::$__names,
- "jobSubmissionProtocolsObject" => $jsp,
- "jobSubmissionProtocols" => $jsp::$__names,
- "resourceJobManagerTypesObject" => $rjmt,
- "resourceJobManagerTypes" => $rjmt::$__names,
- "securityProtocolsObject" => $sp,
- "securityProtocols" => $sp::$__names,
- "dataMovementProtocolsObject" => $dmp,
- "dataMovementProtocols" => $dmp::$__names,
- "jobManagerCommands" => $jmc::$__names,
- "monitorModes" => $mm::$__names
- );
- }
-
-
- public static function createQueueObject($queue)
- {
- $queueObject = new BatchQueue($queue);
- return $queueObject;
- }
-
- public static function deleteQueue($computeResourceId, $queueName)
- {
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $computeResourceId)) {
- Cache::forget('CR-' . $computeResourceId);
- }
- }
- Airavata::deleteBatchQueue(Session::get('authz-token'), $computeResourceId, $queueName);
- }
-
-
- /*
- * Creating Job Submission Interface.
- */
-
- public static function create_or_update_JSIObject($inputs, $update = false)
- {
-
- $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
-
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $inputs["crId"])) {
- Cache::forget('CR-' . $inputs["crId"]);
- }
- }
-
- $jsiId = null;
- if (isset($inputs["jsiId"]))
- $jsiId = $inputs["jsiId"];
-
- if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::LOCAL) {
-
- //print_r( $jsiObject->resourceJobManager->resourceJobManagerId);
- $resourceManager = new ResourceJobManager(array(
- "resourceJobManagerType" => $inputs["resourceJobManagerType"],
- "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
- "jobManagerBinPath" => $inputs["jobManagerBinPath"],
- "jobManagerCommands" => $inputs["jobManagerCommands"]
- ));
-
- //$rmId = $jsiObject->resourceJobManager->resourceJobManagerId;
- //$rm = $airavataclient->updateResourceJobManager($rmId, $resourceManager);
- //print_r( $rm); exit;
- $localJobSubmission = new LOCALSubmission(array(
- "resourceJobManager" => $resourceManager
- )
- );
-
- if ($update) //update Local JSP
- {
- $jsiObject = Airavata::getLocalJobSubmission(Session::get('authz-token'), $jsiId);
- $localSub = Airavata::updateResourceJobManager(Session::get('authz-token'), $jsiObject->resourceJobManager->resourceJobManagerId, $resourceManager);
- //$localSub = $airavataclient->updateLocalSubmissionDetails( $jsiId, $localJobSubmission);
- } else // create Local JSP
- {
- $localSub = Airavata::addLocalSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $localJobSubmission);
- return $localSub;
- }
-
- } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::SSH) {
- $resourceManager = new ResourceJobManager(array(
- "resourceJobManagerType" => $inputs["resourceJobManagerType"],
- "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
- "jobManagerBinPath" => $inputs["jobManagerBinPath"],
- "jobManagerCommands" => $inputs["jobManagerCommands"]
- ));
- $sshJobSubmission = new SSHJobSubmission(array
- (
- "securityProtocol" => intval($inputs["securityProtocol"]),
- "resourceJobManager" => $resourceManager,
- "alternativeSSHHostName" => $inputs["alternativeSSHHostName"],
- "sshPort" => intval($inputs["sshPort"]),
- "monitorMode" => MonitorMode::JOB_EMAIL_NOTIFICATION_MONITOR
- )
- );
- //var_dump( $sshJobSubmission); exit;
- if ($update) //update Local JSP
- {
- $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
-
- //first update resource job manager
- $rmjId = $jsiObject->resourceJobManager->resourceJobManagerId;
- Airavata::updateResourceJobManager(Session::get('authz-token'), $rmjId, $resourceManager);
- $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
-
- $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
- $jsiObject->alternativeSSHHostName = $inputs["alternativeSSHHostName"];
- $jsiObject->sshPort = intval($inputs["sshPort"]);
- $jsiObject->monitorMode = intval($inputs["monitorMode"]);
- $jsiObject->resourceJobManager = Airavata::getresourceJobManager(Session::get('authz-token'), $rmjId);
- //var_dump( $jsiObject); exit;
- //add updated resource job manager to ssh job submission object.
- //$sshJobSubmission->resourceJobManager->resourceJobManagerId = $rmjId;
- $localSub = Airavata::updateSSHJobSubmissionDetails(Session::get('authz-token'), $jsiId, $jsiObject);
- } else {
- $sshSub = Airavata::addSSHJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $sshJobSubmission);
- }
- return;
- } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::SSH_FORK) {
- $resourceManager = new ResourceJobManager(array(
- "resourceJobManagerType" => $inputs["resourceJobManagerType"],
- "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
- "jobManagerBinPath" => $inputs["jobManagerBinPath"],
- "jobManagerCommands" => $inputs["jobManagerCommands"]
- ));
- $sshJobSubmission = new SSHJobSubmission(array
- (
- "securityProtocol" => intval($inputs["securityProtocol"]),
- "resourceJobManager" => $resourceManager,
- "alternativeSSHHostName" => $inputs["alternativeSSHHostName"],
- "sshPort" => intval($inputs["sshPort"]),
- "monitorMode" => MonitorMode::FORK
- )
- );
- //var_dump( $sshJobSubmission); exit;
- if ($update) //update Local JSP
- {
- $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
-
- //first update resource job manager
- $rmjId = $jsiObject->resourceJobManager->resourceJobManagerId;
- Airavata::updateResourceJobManager(Session::get('authz-token'), $rmjId, $resourceManager);
- $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
-
- $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
- $jsiObject->alternativeSSHHostName = $inputs["alternativeSSHHostName"];
- $jsiObject->sshPort = intval($inputs["sshPort"]);
- $jsiObject->monitorMode = intval($inputs["monitorMode"]);
- $jsiObject->resourceJobManager = Airavata::getresourceJobManager(Session::get('authz-token'), $rmjId);
- //var_dump( $jsiObject); exit;
- //add updated resource job manager to ssh job submission object.
- //$sshJobSubmission->resourceJobManager->resourceJobManagerId = $rmjId;
- $localSub = Airavata::updateSSHJobSubmissionDetails(Session::get('authz-token'), $jsiId, $jsiObject);
- } else {
- $sshSub = Airavata::addSSHForkJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $sshJobSubmission);
- }
- return;
- } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::UNICORE) {
- $unicoreJobSubmission = new UnicoreJobSubmission(array
- (
- "securityProtocol" => intval($inputs["securityProtocol"]),
- "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
- )
- );
- if ($update) {
- $jsiObject = Airavata::getUnicoreJobSubmission(Session::get('authz-token'), $jsiId);
- $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
- $jsiObject->unicoreEndPointURL = $inputs["unicoreEndPointURL"];
-
- $unicoreSub = Airavata::updateUnicoreJobSubmissionDetails(Session::get('authz-token'), $jsiId, $jsiObject);
- } else {
- $unicoreSub = Airavata::addUNICOREJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $unicoreJobSubmission);
- }
- } else /* Globus does not work currently */ {
- print_r("Whoops! We haven't coded for this Job Submission Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
- }
- }
-
- /*
- * Creating Data Movement Interface Object.
- */
- public static function create_or_update_DMIObject($inputs, $update = false)
- {
-
- $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
-
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $inputs["crId"])) {
- Cache::forget('CR-' . $inputs["crId"]);
- }
- }
-
- if ($inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) /* LOCAL */ {
- $localDataMovement = new LOCALDataMovement();
- $localdmp = Airavata::addLocalDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $localDataMovement);
-
- if ($localdmp)
- print_r("The Local Data Movement has been added. Edit UI for the Local Data Movement Interface is yet to be made.
- Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
- } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::SCP) /* SCP */ {
- //var_dump( $inputs); exit;
- $scpDataMovement = new SCPDataMovement(array(
- "securityProtocol" => intval($inputs["securityProtocol"]),
- "alternativeSCPHostName" => $inputs["alternativeSSHHostName"],
- "sshPort" => intval($inputs["sshPort"])
- )
-
- );
-
- if ($update)
- $scpdmp = Airavata::updateSCPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $scpDataMovement);
- else
- $scpdmp = Airavata::addSCPDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $scpDataMovement);
- } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::GridFTP) /* GridFTP */ {
- $gridFTPDataMovement = new GridFTPDataMovement(array(
- "securityProtocol" => $inputs["securityProtocol"],
- "gridFTPEndPoints" => $inputs["gridFTPEndPoints"]
- ));
- if ($update)
- $gridftpdmp = Airavata::updateGridFTPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $gridFTPDataMovement);
- else
- $gridftpdmp = Airavata::addGridFTPDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $gridFTPDataMovement);
- } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::UNICORE_STORAGE_SERVICE) /* Unicore Storage Service */ {
- $unicoreDataMovement = new UnicoreDataMovement(array
- (
- "securityProtocol" => intval($inputs["securityProtocol"]),
- "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
- )
- );
- if ($update)
- $unicoredmp = Airavata::updateUnicoreDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $unicoreDataMovement);
- else
- $unicoredmp = Airavata::addUnicoreDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $unicoreDataMovement);
- } else /* other data movement protocols */ {
- print_r("Whoops! We haven't coded for this Data Movement Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
- }
- }
-
- public static function getAllDSObjects($onlyName = false)
- {
- $dsNames = Airavata::getAllStorageResourceNames(Session::get('authz-token'));
- if ($onlyName)
- return $dsNames;
- else {
- $dsObjects = array();
- foreach ($dsNames as $id => $dsName) {
- array_push($dsObjects, Airavata::getStorageResource(Session::get('authz-token'), $id));
- }
- return $dsObjects;
- }
-
- }
-
- public static function getBrowseDSData($onlyNames)
- { /*
- $appDeployments = Airavata::getAllApplicationDeployments(Session::get('authz-token'),
- Session::get("gateway_id"));
- */
- return array('crObjects' => DSUtilities::getAllDSObjects($onlyNames));
- }
-
- public static function getJobSubmissionDetails($jobSubmissionInterfaceId, $jsp)
- {
- //jsp = job submission protocol type
- if ($jsp == JobSubmissionProtocol::LOCAL)
- return Airavata::getLocalJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
- else if ($jsp == JobSubmissionProtocol::SSH || $jsp == JobSubmissionProtocol::SSH_FORK)
- return Airavata::getSSHJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
- else if ($jsp == JobSubmissionProtocol::UNICORE)
- return Airavata::getUnicoreJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
- else if ($jsp == JobSubmissionProtocol::CLOUD)
- return Airavata::getCloudJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
-
- //globus get function not present ??
- }
-
- public static function getDataMovementDetails($dataMovementInterfaceId, $dmi)
- {
- //jsp = job submission protocol type
- if ($dmi == DataMovementProtocol::LOCAL)
- return Airavata::getLocalDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
- else if ($dmi == DataMovementProtocol::SCP)
- return Airavata::getSCPDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
- else if ($dmi == DataMovementProtocol::GridFTP)
- return Airavata::getGridFTPDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
- else if ($dmi == DataMovementProtocol::UNICORE_STORAGE_SERVICE)
- return Airavata::getUnicoreDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
- /*
- else if( $dmi == JobSubmissionProtocol::CLOUD)
- return $airavataclient->getCloudJobSubmission( $dataMovementInterfaceId);
- */
-
- //globus get function not present ??
- }
-
- public static function deleteActions($inputs)
- {
- if (isset($inputs["crId"])) {
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $inputs["crId"])) {
- Cache::forget('CR-' . $inputs["crId"]);
- }
- }
- } elseif (isset($inputs["del-crId"])) {
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $inputs["del-crId"])) {
- Cache::forget('CR-' . $inputs["del-crId"]);
- }
- }
- }
-
- if (isset($inputs["jsiId"]))
- if (Airavata::deleteJobSubmissionInterface(Session::get('authz-token'), $inputs["crId"], $inputs["jsiId"]))
- return 1;
- else
- return 0;
- else if (isset($inputs["dmiId"]))
- if (Airavata::deleteDataMovementInterface(Session::get('authz-token'), $inputs["crId"], $inputs["dmiId"]))
- return 1;
- else
- return 0;
- elseif (isset($inputs["del-crId"]))
- if (Airavata::deleteComputeResource(Session::get('authz-token'), $inputs["del-crId"]))
- return 1;
- else
- return 0;
- }
-
- public static function create_or_update_gateway_profile($inputs, $update = false)
- {
-
- $computeResourcePreferences = array();
- if (isset($input["crPreferences"]))
- $computeResourcePreferences = $input["crPreferences"];
-
- $gatewayProfile = new GatewayResourceProfile(array(
- "gatewayName" => $inputs["gatewayName"],
- "gatewayDescription" => $inputs["gatewayDescription"],
- "computeResourcePreferences" => $computeResourcePreferences
- )
- );
-
- if ($update) {
- $gatewayProfile = new GatewayResourceProfile(array(
- "gatewayName" => $inputs["gatewayName"],
- "gatewayDescription" => $inputs["gatewayDescription"]
- )
- );
- $gatewayProfileId = Airavata::updateGatewayResourceProfile(Session::get('authz-token'), $inputs["edit-gpId"], $gatewayProfile);
- } else
- $gatewayProfileId = Airavata::registerGatewayResourceProfile(Session::get('authz-token'), $gatewayProfile);
- }
-
- public static function getAllGatewayProfilesData()
- {
-
- if (Session::has("scigap_admin"))
- $gateways = Airavata::getAllGateways(Session::get('authz-token'));
- else {
- $gateways[0] = Airavata::getGateway(Session::get('authz-token'), Session::get("gateway_id"));
- }
-
- $gatewayProfiles = Airavata::getAllGatewayResourceProfiles(Session::get('authz-token'));
- //var_dump( $gatewayProfiles); exit;
- //$gatewayProfileIds = array("GatewayTest3_57726e98-313f-4e7c-87a5-18e69928afb5", "GatewayTest4_4fd9fb28-4ced-4149-bdbd-1f276077dad8");
- foreach ($gateways as $key => $gw) {
- $gateways[$key]->profile = array();
- foreach ((array)$gatewayProfiles as $index => $gp) {
-
- if ($gw->gatewayId == $gp->gatewayID) {
- foreach ((array)$gp->computeResourcePreferences as $i => $crp) {
- $gatewayProfiles[$index]->computeResourcePreferences[$i]->crDetails = Airavata::getComputeResource(Session::get('authz-token'), $crp->computeResourceId);
- }
- $gateways[$key]->profile = $gatewayProfiles[$index];
- }
- }
- }
- //var_dump( $gatewayProfiles[0]->computeResourcePreferences[0]->crDetails); exit;
-
- return $gateways;
- }
-
- public static function updateGatewayProfile( $data){
- $gatewayResourceProfile = Airavata::getGatewayResourceProfile( Session::get('authz-token'), $data["gateway_id"]);
- $gatewayResourceProfile->credentialStoreToken = $data["cst"];
- return Airavata::updateGatewayResourceProfile( Session::get('authz-token'), $data["gateway_id"], $gatewayResourceProfile);
- }
-
- public static function add_or_update_CRP($inputs)
- {
- $computeResourcePreferences = new computeResourcePreference($inputs);
-
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $inputs["computeResourceId"])) {
- Cache::forget('CR-' . $inputs["computeResourceId"]);
- }
- }
-
- //var_dump( $inputs); exit;
- return Airavata::addGatewayComputeResourcePreference(Session::get('authz-token'), $inputs["gatewayId"], $inputs["computeResourceId"], $computeResourcePreferences);
-
- }
-
- public static function deleteGP($gpId)
- {
- return Airavata::deleteGatewayResourceProfile(Session::get('authz-token'), $gpId);
- }
-
- public static function deleteCR($inputs)
- {
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- $id = $inputs["rem-crId"];
- if (Cache::has('CR-' . $id)) {
- Cache::forget('CR-' . $id);
- }
- }
-
- return Airavata::deleteGatewayComputeResourcePreference(Session::get('authz-token'), $inputs["gpId"], $inputs["rem-crId"]);
- }
-
- /**
- * Get the ComputeResourceDescription with the given ID
- * @param $id
- * @return null
- */
- public static function get_compute_resource($id)
- {
- $computeResource = null;
-
- try {
- if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
- if (Cache::has('CR-' . $id)) {
- return Cache::get('CR-' . $id);
- } else {
- $computeResource = Airavata::getComputeResource(Session::get('authz-token'), $id);
- Cache::put('CR-' . $id, $computeResource, Config::get('pga_config.airavata')['app-catalog-cache-duration']);
- return $computeResource;
- }
- } else {
- return $computeResource = Airavata::getComputeResource(Session::get('authz-token'), $id);
- }
-
- } catch (InvalidRequestException $ire) {
- CommonUtilities::print_error_message('<p>There was a problem getting the compute resource.
- Please try again later or submit a bug report using the link in the Help menu.</p>' .
- '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
- } catch (AiravataClientException $ace) {
- CommonUtilities::print_error_message('<p>There was a problem getting the compute resource.
- Please try again later or submit a bug report using the link in the Help menu.</p>' .
- '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
- } catch (AiravataSystemException $ase) {
- CommonUtilities::print_error_message('<p>There was a problem getting the compute resource.
- Please try again later or submit a bug report using the link in the Help menu.</p>' .
- '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
- }
- }
-
-
- /**
- * Create a select input and populate it with compute resources
- * available for the given application ID
- * @param $applicationId
- * @param $resourceHostId
- */
- public static function create_compute_resources_select($applicationId, $resourceHostId)
- {
- return CRUtilities::get_available_app_interface_compute_resources($applicationId);
- }
-
- /**
- * Get a list of compute resources available for the given application ID
- * @param $id
- * @return null
- */
- public static function get_available_app_interface_compute_resources($id)
- {
- $computeResources = null;
-
- try {
- $computeResources = Airavata::getAvailableAppInterfaceComputeResources(Session::get('authz-token'), $id);
- } catch (InvalidRequestException $ire) {
- CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
- Please try again later or submit a bug report using the link in the Help menu.</p>' .
- '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
- } catch (AiravataClientException $ace) {
- CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
- Please try again later or submit a bug report using the link in the Help menu.</p>' .
- '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
- } catch (AiravataSystemException $ase) {
- CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
- Please try again later or submit a bug report using the link in the Help menu.</p>' .
- '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
- }
-
- return $computeResources;
- }
-
- /**
- * Get a list of all Data Storages available
- * @param null
- * @return
- **/
-
- public static function getAllDataStoragePreferences( $gateways){
- $dspArray = array();
- foreach( $gateways as $gateway){
- $dspArray[] = Airavata::getAllGatewayDataStoragePreferences( Session::get('authz-token'), $gateway->gatewayId);
- }
- return $dspArray;
- }
-
-}
-
-?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/libraries/SRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/SRUtilities.php b/app/libraries/SRUtilities.php
new file mode 100644
index 0000000..491eccf
--- /dev/null
+++ b/app/libraries/SRUtilities.php
@@ -0,0 +1,564 @@
+<?php
+
+
+//Airavata classes - loaded from app/libraries/Airavata
+//Compute Resource classes
+use Airavata\Model\AppCatalog\ComputeResource\DataMovementProtocol;
+use Airavata\Model\AppCatalog\StorageResource\StorageResourceDescription;
+use Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference;
+use Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile;
+
+//Gateway Classes
+
+
+class SRUtilities
+{
+ /**
+ * Basic utility functions
+ */
+
+//define('ROOT_DIR', __DIR__);
+
+ /**
+ * Define configuration constants
+ */
+ public static function register_or_update_storage_resource($storageResourceDesc, $update = false)
+ {
+ if ($update) {
+ $storageResourceId = $storageDescription->storageResourceId;
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('CR-' . $computeResourceId)) {
+ Cache::forget('CR-' . $computeResourceId);
+ }
+ }
+
+ if (Airavata::updateComputeResource(Session::get('authz-token'), $computeResourceId, $computeDescription)) {
+ $computeResource = Airavata::getComputeResource(Session::get('authz-token'), $computeResourceId);
+ return $computeResource;
+ } else
+ print_r("Something went wrong while updating!");
+ exit;
+ } else {
+ $sr = new StorageResourceDescription( $storageResourceDesc);
+ $storageResourceId = Airavata::registerStorageResource(Session::get('authz-token'), $sr);
+ }
+ $storageResource = Airavata::getStorageResource(Session::get('authz-token'), $storageResourceId);
+ return $storageResource;
+
+ }
+
+ /*
+ * Getting data for Compute resource inputs
+ */
+
+ public static function getEditSRData()
+ {
+ $dmp = new DataMovementProtocol();
+ return array(
+ "dataMovementProtocolsObject" => $dmp,
+ "dataMovementProtocols" => $dmp::$__names
+ );
+ }
+
+
+ /*
+ public static function createQueueObject($queue)
+ {
+ $queueObject = new BatchQueue($queue);
+ return $queueObject;
+ }
+
+ public static function deleteQueue($computeResourceId, $queueName)
+ {
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('CR-' . $computeResourceId)) {
+ Cache::forget('CR-' . $computeResourceId);
+ }
+ }
+ Airavata::deleteBatchQueue(Session::get('authz-token'), $computeResourceId, $queueName);
+ }
+
+ public static function create_or_update_JSIObject($inputs, $update = false)
+ {
+
+ $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
+
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('CR-' . $inputs["crId"])) {
+ Cache::forget('CR-' . $inputs["crId"]);
+ }
+ }
+
+ $jsiId = null;
+ if (isset($inputs["jsiId"]))
+ $jsiId = $inputs["jsiId"];
+
+ if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::LOCAL) {
+
+ //print_r( $jsiObject->resourceJobManager->resourceJobManagerId);
+ $resourceManager = new ResourceJobManager(array(
+ "resourceJobManagerType" => $inputs["resourceJobManagerType"],
+ "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
+ "jobManagerBinPath" => $inputs["jobManagerBinPath"],
+ "jobManagerCommands" => $inputs["jobManagerCommands"]
+ ));
+
+ //$rmId = $jsiObject->resourceJobManager->resourceJobManagerId;
+ //$rm = $airavataclient->updateResourceJobManager($rmId, $resourceManager);
+ //print_r( $rm); exit;
+ $localJobSubmission = new LOCALSubmission(array(
+ "resourceJobManager" => $resourceManager
+ )
+ );
+
+ if ($update) //update Local JSP
+ {
+ $jsiObject = Airavata::getLocalJobSubmission(Session::get('authz-token'), $jsiId);
+ $localSub = Airavata::updateResourceJobManager(Session::get('authz-token'), $jsiObject->resourceJobManager->resourceJobManagerId, $resourceManager);
+ //$localSub = $airavataclient->updateLocalSubmissionDetails( $jsiId, $localJobSubmission);
+ } else // create Local JSP
+ {
+ $localSub = Airavata::addLocalSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $localJobSubmission);
+ return $localSub;
+ }
+
+ } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::SSH) {
+ $resourceManager = new ResourceJobManager(array(
+ "resourceJobManagerType" => $inputs["resourceJobManagerType"],
+ "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
+ "jobManagerBinPath" => $inputs["jobManagerBinPath"],
+ "jobManagerCommands" => $inputs["jobManagerCommands"]
+ ));
+ $sshJobSubmission = new SSHJobSubmission(array
+ (
+ "securityProtocol" => intval($inputs["securityProtocol"]),
+ "resourceJobManager" => $resourceManager,
+ "alternativeSSHHostName" => $inputs["alternativeSSHHostName"],
+ "sshPort" => intval($inputs["sshPort"]),
+ "monitorMode" => MonitorMode::JOB_EMAIL_NOTIFICATION_MONITOR
+ )
+ );
+ //var_dump( $sshJobSubmission); exit;
+ if ($update) //update Local JSP
+ {
+ $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
+
+ //first update resource job manager
+ $rmjId = $jsiObject->resourceJobManager->resourceJobManagerId;
+ Airavata::updateResourceJobManager(Session::get('authz-token'), $rmjId, $resourceManager);
+ $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
+
+ $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
+ $jsiObject->alternativeSSHHostName = $inputs["alternativeSSHHostName"];
+ $jsiObject->sshPort = intval($inputs["sshPort"]);
+ $jsiObject->monitorMode = intval($inputs["monitorMode"]);
+ $jsiObject->resourceJobManager = Airavata::getresourceJobManager(Session::get('authz-token'), $rmjId);
+ //var_dump( $jsiObject); exit;
+ //add updated resource job manager to ssh job submission object.
+ //$sshJobSubmission->resourceJobManager->resourceJobManagerId = $rmjId;
+ $localSub = Airavata::updateSSHJobSubmissionDetails(Session::get('authz-token'), $jsiId, $jsiObject);
+ } else {
+ $sshSub = Airavata::addSSHJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $sshJobSubmission);
+ }
+ return;
+ } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::SSH_FORK) {
+ $resourceManager = new ResourceJobManager(array(
+ "resourceJobManagerType" => $inputs["resourceJobManagerType"],
+ "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
+ "jobManagerBinPath" => $inputs["jobManagerBinPath"],
+ "jobManagerCommands" => $inputs["jobManagerCommands"]
+ ));
+ $sshJobSubmission = new SSHJobSubmission(array
+ (
+ "securityProtocol" => intval($inputs["securityProtocol"]),
+ "resourceJobManager" => $resourceManager,
+ "alternativeSSHHostName" => $inputs["alternativeSSHHostName"],
+ "sshPort" => intval($inputs["sshPort"]),
+ "monitorMode" => MonitorMode::FORK
+ )
+ );
+ //var_dump( $sshJobSubmission); exit;
+ if ($update) //update Local JSP
+ {
+ $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
+
+ //first update resource job manager
+ $rmjId = $jsiObject->resourceJobManager->resourceJobManagerId;
+ Airavata::updateResourceJobManager(Session::get('authz-token'), $rmjId, $resourceManager);
+ $jsiObject = Airavata::getSSHJobSubmission(Session::get('authz-token'), $jsiId);
+
+ $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
+ $jsiObject->alternativeSSHHostName = $inputs["alternativeSSHHostName"];
+ $jsiObject->sshPort = intval($inputs["sshPort"]);
+ $jsiObject->monitorMode = intval($inputs["monitorMode"]);
+ $jsiObject->resourceJobManager = Airavata::getresourceJobManager(Session::get('authz-token'), $rmjId);
+ //var_dump( $jsiObject); exit;
+ //add updated resource job manager to ssh job submission object.
+ //$sshJobSubmission->resourceJobManager->resourceJobManagerId = $rmjId;
+ $localSub = Airavata::updateSSHJobSubmissionDetails(Session::get('authz-token'), $jsiId, $jsiObject);
+ } else {
+ $sshSub = Airavata::addSSHForkJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $sshJobSubmission);
+ }
+ return;
+ } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::UNICORE) {
+ $unicoreJobSubmission = new UnicoreJobSubmission(array
+ (
+ "securityProtocol" => intval($inputs["securityProtocol"]),
+ "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
+ )
+ );
+ if ($update) {
+ $jsiObject = Airavata::getUnicoreJobSubmission(Session::get('authz-token'), $jsiId);
+ $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
+ $jsiObject->unicoreEndPointURL = $inputs["unicoreEndPointURL"];
+
+ $unicoreSub = Airavata::updateUnicoreJobSubmissionDetails(Session::get('authz-token'), $jsiId, $jsiObject);
+ } else {
+ $unicoreSub = Airavata::addUNICOREJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $unicoreJobSubmission);
+ }
+ } else {
+ print_r("Whoops! We haven't coded for this Job Submission Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
+ }
+ }
+ */
+
+ /*
+ * Creating Data Movement Interface Object.
+ */
+ public static function create_or_update_DMIObject($inputs, $update = false)
+ {
+
+ $computeResource = SRUtilities::get_compute_resource($inputs["srId"]);
+
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('SR-' . $inputs["srId"])) {
+ Cache::forget('SR-' . $inputs["srId"]);
+ }
+ }
+
+ if ($inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) /* LOCAL */ {
+ $localDataMovement = new LOCALDataMovement();
+ $localdmp = Airavata::addLocalDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $localDataMovement);
+
+ if ($localdmp)
+ print_r("The Local Data Movement has been added. Edit UI for the Local Data Movement Interface is yet to be made.
+ Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
+ } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::SCP) /* SCP */ {
+ //var_dump( $inputs); exit;
+ $scpDataMovement = new SCPDataMovement(array(
+ "securityProtocol" => intval($inputs["securityProtocol"]),
+ "alternativeSCPHostName" => $inputs["alternativeSSHHostName"],
+ "sshPort" => intval($inputs["sshPort"])
+ )
+
+ );
+
+ if ($update)
+ $scpdmp = Airavata::updateSCPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $scpDataMovement);
+ else
+ $scpdmp = Airavata::addSCPDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $scpDataMovement);
+ } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::GridFTP) /* GridFTP */ {
+ $gridFTPDataMovement = new GridFTPDataMovement(array(
+ "securityProtocol" => $inputs["securityProtocol"],
+ "gridFTPEndPoints" => $inputs["gridFTPEndPoints"]
+ ));
+ if ($update)
+ $gridftpdmp = Airavata::updateGridFTPDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $gridFTPDataMovement);
+ else
+ $gridftpdmp = Airavata::addGridFTPDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $gridFTPDataMovement);
+ } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::UNICORE_STORAGE_SERVICE) /* Unicore Storage Service */ {
+ $unicoreDataMovement = new UnicoreDataMovement(array
+ (
+ "securityProtocol" => intval($inputs["securityProtocol"]),
+ "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
+ )
+ );
+ if ($update)
+ $unicoredmp = Airavata::updateUnicoreDataMovementDetails(Session::get('authz-token'), $inputs["dmiId"], $unicoreDataMovement);
+ else
+ $unicoredmp = Airavata::addUnicoreDataMovementDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $unicoreDataMovement);
+ } else /* other data movement protocols */ {
+ print_r("Whoops! We haven't coded for this Data Movement Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
+ }
+ }
+
+ public static function getAllSRObjects($onlyName = false)
+ {
+ $srNames = Airavata::getAllStorageResourceNames(Session::get('authz-token'));
+
+ if ($onlyName)
+ return $srNames;
+ else {
+ $srObjects = array();
+ foreach ($srNames as $id => $srName) {
+ array_push($srObjects, Airavata::getStorageResource(Session::get('authz-token'), $id));
+ }
+ return $srObjects;
+ }
+
+ }
+
+ public static function getBrowseSRData($onlyNames)
+ { /*
+ $appDeployments = Airavata::getAllApplicationDeployments(Session::get('authz-token'),
+ Session::get("gateway_id"));
+ */
+ return array('srObjects' => SRUtilities::getAllSRObjects($onlyNames) );
+ }
+
+ public static function getJobSubmissionDetails($jobSubmissionInterfaceId, $jsp)
+ {
+ //jsp = job submission protocol type
+ if ($jsp == JobSubmissionProtocol::LOCAL)
+ return Airavata::getLocalJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
+ else if ($jsp == JobSubmissionProtocol::SSH || $jsp == JobSubmissionProtocol::SSH_FORK)
+ return Airavata::getSSHJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
+ else if ($jsp == JobSubmissionProtocol::UNICORE)
+ return Airavata::getUnicoreJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
+ else if ($jsp == JobSubmissionProtocol::CLOUD)
+ return Airavata::getCloudJobSubmission(Session::get('authz-token'), $jobSubmissionInterfaceId);
+
+ //globus get function not present ??
+ }
+
+ public static function getDataMovementDetails($dataMovementInterfaceId, $dmi)
+ {
+ //jsp = job submission protocol type
+ if ($dmi == DataMovementProtocol::LOCAL)
+ return Airavata::getLocalDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
+ else if ($dmi == DataMovementProtocol::SCP)
+ return Airavata::getSCPDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
+ else if ($dmi == DataMovementProtocol::GridFTP)
+ return Airavata::getGridFTPDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
+ else if ($dmi == DataMovementProtocol::UNICORE_STORAGE_SERVICE)
+ return Airavata::getUnicoreDataMovement(Session::get('authz-token'), $dataMovementInterfaceId);
+ /*
+ else if( $dmi == JobSubmissionProtocol::CLOUD)
+ return $airavataclient->getCloudJobSubmission( $dataMovementInterfaceId);
+ */
+
+ //globus get function not present ??
+ }
+
+ public static function deleteActions($inputs)
+ {
+ if (isset($inputs["crId"])) {
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('CR-' . $inputs["crId"])) {
+ Cache::forget('CR-' . $inputs["crId"]);
+ }
+ }
+ } elseif (isset($inputs["del-crId"])) {
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('CR-' . $inputs["del-crId"])) {
+ Cache::forget('CR-' . $inputs["del-crId"]);
+ }
+ }
+ }
+
+ if (isset($inputs["jsiId"]))
+ if (Airavata::deleteJobSubmissionInterface(Session::get('authz-token'), $inputs["crId"], $inputs["jsiId"]))
+ return 1;
+ else
+ return 0;
+ else if (isset($inputs["dmiId"]))
+ if (Airavata::deleteDataMovementInterface(Session::get('authz-token'), $inputs["crId"], $inputs["dmiId"]))
+ return 1;
+ else
+ return 0;
+ elseif (isset($inputs["del-crId"]))
+ if (Airavata::deleteComputeResource(Session::get('authz-token'), $inputs["del-crId"]))
+ return 1;
+ else
+ return 0;
+ }
+
+ public static function create_or_update_gateway_profile($inputs, $update = false)
+ {
+
+ $computeResourcePreferences = array();
+ if (isset($input["crPreferences"]))
+ $computeResourcePreferences = $input["crPreferences"];
+
+ $gatewayProfile = new GatewayResourceProfile(array(
+ "gatewayName" => $inputs["gatewayName"],
+ "gatewayDescription" => $inputs["gatewayDescription"],
+ "computeResourcePreferences" => $computeResourcePreferences
+ )
+ );
+
+ if ($update) {
+ $gatewayProfile = new GatewayResourceProfile(array(
+ "gatewayName" => $inputs["gatewayName"],
+ "gatewayDescription" => $inputs["gatewayDescription"]
+ )
+ );
+ $gatewayProfileId = Airavata::updateGatewayResourceProfile(Session::get('authz-token'), $inputs["edit-gpId"], $gatewayProfile);
+ } else
+ $gatewayProfileId = Airavata::registerGatewayResourceProfile(Session::get('authz-token'), $gatewayProfile);
+ }
+
+ public static function getAllGatewayProfilesData()
+ {
+
+ if (Session::has("scigap_admin"))
+ $gateways = Airavata::getAllGateways(Session::get('authz-token'));
+ else {
+ $gateways[0] = Airavata::getGateway(Session::get('authz-token'), Session::get("gateway_id"));
+ }
+
+ $gatewayProfiles = Airavata::getAllGatewayResourceProfiles(Session::get('authz-token'));
+ //var_dump( $gatewayProfiles); exit;
+ //$gatewayProfileIds = array("GatewayTest3_57726e98-313f-4e7c-87a5-18e69928afb5", "GatewayTest4_4fd9fb28-4ced-4149-bdbd-1f276077dad8");
+ foreach ($gateways as $key => $gw) {
+ $gateways[$key]->profile = array();
+ foreach ((array)$gatewayProfiles as $index => $gp) {
+
+ if ($gw->gatewayId == $gp->gatewayID) {
+ foreach ((array)$gp->computeResourcePreferences as $i => $crp) {
+ $gatewayProfiles[$index]->computeResourcePreferences[$i]->crDetails = Airavata::getComputeResource(Session::get('authz-token'), $crp->computeResourceId);
+ }
+ $gateways[$key]->profile = $gatewayProfiles[$index];
+ }
+ }
+ }
+ //var_dump( $gatewayProfiles[0]->computeResourcePreferences[0]->crDetails); exit;
+
+ return $gateways;
+ }
+
+ public static function updateGatewayProfile( $data){
+ $gatewayResourceProfile = Airavata::getGatewayResourceProfile( Session::get('authz-token'), $data["gateway_id"]);
+ $gatewayResourceProfile->credentialStoreToken = $data["cst"];
+ return Airavata::updateGatewayResourceProfile( Session::get('authz-token'), $data["gateway_id"], $gatewayResourceProfile);
+ }
+
+ public static function add_or_update_CRP($inputs)
+ {
+ $computeResourcePreferences = new computeResourcePreference($inputs);
+
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('CR-' . $inputs["computeResourceId"])) {
+ Cache::forget('CR-' . $inputs["computeResourceId"]);
+ }
+ }
+
+ //var_dump( $inputs); exit;
+ return Airavata::addGatewayComputeResourcePreference(Session::get('authz-token'), $inputs["gatewayId"], $inputs["computeResourceId"], $computeResourcePreferences);
+
+ }
+
+ public static function deleteGP($gpId)
+ {
+ return Airavata::deleteGatewayResourceProfile(Session::get('authz-token'), $gpId);
+ }
+
+ public static function deleteCR($inputs)
+ {
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ $id = $inputs["rem-crId"];
+ if (Cache::has('CR-' . $id)) {
+ Cache::forget('CR-' . $id);
+ }
+ }
+
+ return Airavata::deleteGatewayComputeResourcePreference(Session::get('authz-token'), $inputs["gpId"], $inputs["rem-crId"]);
+ }
+
+ /**
+ * Get the ComputeResourceDescription with the given ID
+ * @param $id
+ * @return null
+ */
+ public static function get_storage_resource($id)
+ {
+ $computeResource = null;
+ try {
+ /*
+ if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+ if (Cache::has('CR-' . $id)) {
+ return Cache::get('CR-' . $id);
+ } else {
+ $computeResource = Airavata::getComputeResource(Session::get('authz-token'), $id);
+ Cache::put('CR-' . $id, $computeResource, Config::get('pga_config.airavata')['app-catalog-cache-duration']);
+ return $computeResource;
+ }
+ } else {
+ */
+ return Airavata::getStorageResource(Session::get('authz-token'), $id);
+ /*
+ }
+ */
+
+ } catch (InvalidRequestException $ire) {
+ CommonUtilities::print_error_message('<p>There was a problem getting the storage resource.
+ Please try again later or submit a bug report using the link in the Help menu.</p>' .
+ '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+ } catch (AiravataClientException $ace) {
+ CommonUtilities::print_error_message('<p>There was a problem getting the storage resource.
+ Please try again later or submit a bug report using the link in the Help menu.</p>' .
+ '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+ } catch (AiravataSystemException $ase) {
+ CommonUtilities::print_error_message('<p>There was a problem getting the storage resource.
+ Please try again later or submit a bug report using the link in the Help menu.</p>' .
+ '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+ }
+ }
+
+
+ /**
+ * Create a select input and populate it with compute resources
+ * available for the given application ID
+ * @param $applicationId
+ * @param $resourceHostId
+ */
+ public static function create_compute_resources_select($applicationId, $resourceHostId)
+ {
+ return CRUtilities::get_available_app_interface_compute_resources($applicationId);
+ }
+
+ /**
+ * Get a list of compute resources available for the given application ID
+ * @param $id
+ * @return null
+ */
+ public static function get_available_app_interface_compute_resources($id)
+ {
+ $computeResources = null;
+
+ try {
+ $computeResources = Airavata::getAvailableAppInterfaceComputeResources(Session::get('authz-token'), $id);
+ } catch (InvalidRequestException $ire) {
+ CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
+ Please try again later or submit a bug report using the link in the Help menu.</p>' .
+ '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+ } catch (AiravataClientException $ace) {
+ CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
+ Please try again later or submit a bug report using the link in the Help menu.</p>' .
+ '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+ } catch (AiravataSystemException $ase) {
+ CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
+ Please try again later or submit a bug report using the link in the Help menu.</p>' .
+ '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+ }
+
+ return $computeResources;
+ }
+
+ /**
+ * Get a list of all Data Storages available
+ * @param null
+ * @return
+ **/
+
+ public static function getAllDataStoragePreferences( $gateways){
+ $srpArray = array();
+ foreach( $gateways as $gateway){
+ $srpArray[] = Airavata::getAllGatewayDataStoragePreferences( Session::get('authz-token'), $gateway->gatewayId);
+ }
+ return $srpArray;
+ }
+
+}
+
+?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/libraries/Wsis/Wsis.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Wsis.php b/app/libraries/Wsis/Wsis.php
index 57693b5..69c0e2f 100755
--- a/app/libraries/Wsis/Wsis.php
+++ b/app/libraries/Wsis/Wsis.php
@@ -94,10 +94,8 @@ class Wsis {
try {
$this->userStoreManager = new UserStoreManager($service_url, $parameters);
$this->tenantManager = new TenantManager($service_url, $parameters);
- /*
$this->userProfileManager = new UserProfileManager($service_url, $parameters);
$this->userInfoRecoveryManager = new UserInformationRecoveryManager($service_url, $parameters);
- */
$this->oauthManger = new OAuthManager(Config::get('pga_config.wsis')['service-url'], $verify_peer, $cafile_path);
} catch (Exception $ex) {
throw new Exception("Unable to instantiate WSO2 IS client", 0, $ex);
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 59bdf38..41f06ff 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -122,27 +122,27 @@ Route::post("cr/delete-cr", "ComputeResourceController@deleteActions");
* Data Storage Resources Routes
*/
-Route::get("ds/create", function () {
- return Redirect::to("cr/create/step1");
+Route::get("sr/create", function () {
+ return Redirect::to("sr/create/step1");
});
-Route::get("ds/create", "DatastorageController@createView");
+Route::get("sr/create", "StorageResourceController@createView");
-Route::post("ds/create", "DatastorageController@createSubmit");
+Route::post("sr/create", "StorageResourceController@createSubmit");
-Route::get("ds/edit", "DatastorageController@editView");
+Route::get("sr/edit", "StorageResourceController@editView");
-Route::post("ds/edit", "DatastorageController@editSubmit");
+Route::post("sr/edit", "StorageResourceController@editSubmit");
-Route::get("ds/view", "DatastorageController@viewView");
+Route::get("sr/view", "StorageResourceController@viewView");
-Route::get("ds/browse", "DatastorageController@browseView");
+Route::get("sr/browse", "StorageResourceController@browseView");
-Route::post("ds/delete-jsi", "DatastorageController@deleteActions");
+Route::post("sr/delete-jsi", "StorageResourceController@deleteActions");
-Route::post("ds/delete-dmi", "DatastorageController@deleteActions");
+Route::post("sr/delete-dmi", "StorageResourceController@deleteActions");
-Route::post("ds/delete-cr", "DatastorageController@deleteActions");
+Route::post("sr/delete-cr", "StorageResourceController@deleteActions");
/*
* Application Catalog Routes
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cce42251/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index e3cf0a7..482e678 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -94,7 +94,7 @@
<div class="row well">
- <h3>Manage Computing and Data Storage Services and Preferences for your Gateway</h3>
+ <h3>Manage Computing and Storage Resouces and Preferences for your Gateway</h3>
<a href="{{URL::to('/')}}/cr/browse">
<div class=" col-md-4 well">
@@ -118,13 +118,13 @@
</div>
</a>
- <a href="{{URL::to('/')}}/ds/browse">
+ <a href="{{URL::to('/')}}/sr/browse">
<div class=" col-md-4 well">
<div class="col-md-12">
<span class="glyphicon glyphicon-folder-open console-icon"></span>
</div>
<div class="col-md-12">
- <h4>Browse Data Storage Resources</h4>
+ <h4>Browse Storage Resources</h4>
</div>
</div>
</a>