Esempio n. 1
0
 /**
  * Returns all the Accounts for logged in user.
  *
  * @return View
  */
 public function getIndex()
 {
     $ec2 = new EC2InstancePrices();
     //$ec2->get_ec2_ondemand_instances_prices('us-east-1', 'm1.small', 'linux')
     return View::make('site/aws/index', array('ec2Data' => $ec2->getEc2Data()));
 }
Esempio n. 2
0
 public static function getDataOrganized($params)
 {
     //Array ( [config] => Array ( [currency] => USD [unit] => perhr ) [regions] =>
     //Array ( [0] => Array ( [region] => us-east-1 [instanceTypes]
     //=> Array ( [0] => Array ( [type] => m1.small [os] => linux [price] => 0.06 ) ) ) ) )
     $data = EC2InstancePrices::OnDemand($params);
     $input = json_decode($params);
     $instanceType = $data['regions'][0]['instanceTypes'];
     $obj = json_decode(json_encode($data));
     $image = self::getImage($input->instanceAmi);
     return '<h5> Cost Details</h5><div class="table-responsive">  <table class="table table-bordered"> ' . ' <thead> ' . '<th>Ondemand</th>' . '<th>Region</th> ' . '<th>Instance Type</th>' . '<th>OS Flavor</th>' . '<th>Price</th>' . '</thead>' . '<tr>' . '<td align="center"><span class="glyphicon glyphicon-ok"></span></td>' . '<td><span class="glyphicon glyphicon-flag"></span>' . $obj->regions[0]->region . '</td>' . '<td>' . $input->instanceType . '</td>' . '<td>' . $image . '</td>' . '<td>' . self::getPrice($data) . '</td>' . '</tr>' . '</table></div>';
 }
Esempio n. 3
0
 public function getPrices()
 {
     $cloudProvider = Input::get('cloudProvider');
     $param = new stdClass();
     $param->region = Input::get('region');
     $param->instanceType = Input::get('instanceType');
     $ondemand = EC2InstancePrices::OnDemand2($param);
     echo json_encode($ondemand);
     //echo json_encode(EC2InstancePrices::On)
 }
Esempio n. 4
0
 public static function Reserved2($param)
 {
     $ec2 = new EC2InstancePrices();
     return $ec2->get_ec2_reserved_instances_prices($param->instanceRegion, $param->instanceType, 'linux');
 }