list_images and images_details
This commit is contained in:
parent
83fd3eb19d
commit
325362a386
2 changed files with 35 additions and 17 deletions
|
@ -16,7 +16,6 @@ $openstack = new OpenStack\OpenStack($options);
|
|||
// Since usernames will not be unique across an entire OpenStack installation,
|
||||
// when authenticating with them you must also provide your domain ID. You do
|
||||
// not have to do this if you authenticate with a user ID.
|
||||
|
||||
/*$token = $identity->generateToken([
|
||||
'user' => [
|
||||
'name' => 'admin',
|
||||
|
@ -28,20 +27,33 @@ $openstack = new OpenStack\OpenStack($options);
|
|||
]);
|
||||
*/
|
||||
//$compute = $openstack->computeV2(["region" => "RegionOne"]);
|
||||
|
||||
//$image= $openstack->imagesV2(["region" => "RegionOne"]);
|
||||
//var_dump($compute->client);
|
||||
//$servers = $compute->listServers(true);
|
||||
|
||||
// Initialisation Image()
|
||||
$optImage = Array();
|
||||
$optImage["region"] = "RegionOne";
|
||||
$image = new Image($openstack, $optImage);
|
||||
|
||||
|
||||
//Liste des images
|
||||
$images = $image->list_images();
|
||||
|
||||
//var_dump($compute->client);
|
||||
//$servers = $compute->listServers(true);
|
||||
echo "Images présentes :";
|
||||
echo "</br>";
|
||||
|
||||
foreach($images as $i){
|
||||
//echo $server->id." !!! ";
|
||||
echo $i->name;
|
||||
if($i->name == "TinyCore"){
|
||||
$id_image = $i->id;
|
||||
}
|
||||
echo "</br>";
|
||||
}
|
||||
echo "</br>";
|
||||
|
||||
|
||||
// Détails Image
|
||||
$details = $image->image_details($id_image);
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue