Esempio n. 1
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>';
 }