コード例 #1
0
 /**
  * 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>');
     }
 }
コード例 #2
0
public static function getAllGatewayProfilesData(){

    if( Session::has("scigap_admin") )
        $gateways = Airavata::getAllGateways();
    else
    {
        $gateways[0] = Airavata::getGateway( Session::get("gateway_id") );
    }

    $gatewayProfiles = Airavata::getAllGatewayComputeResources();
    //$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( $crp->computeResourceId);
                }
                $gateways[$key]->profile = $gatewayProfiles[$index];
            }
        }
    }
    //var_dump( $gatewayProfiles[0]->computeResourcePreferences[0]->crDetails); exit;
    
    return $gateways;
}
コード例 #3
0
public static function getQueueDatafromResourceId( $crId){
    $resourceObject = Airavata::getComputeResource( $crId);
    return $resourceObject->batchQueues;
}