istic-openstack/server/Test/create_network.php
2016-03-21 06:47:01 +01:00

31 lines
744 B
PHP
Executable file

<?php
ini_set('display_errors', 1);
date_default_timezone_set("Europe/Paris");
require 'vendor/autoload.php';
$options = Array();
$options["user"] = Array("name"=>"admin", "password"=>"ae5or6cn", "domain"=>["id"=>"Default"]);
$options["scope"] = Array("project"=>Array("name"=>"admin", "domain"=>["id"=>"Default"]));
$options["authUrl"] = "http://148.60.11.31:5000/v3";
$openstack = new OpenStack\OpenStack($options);
$networking = $openstack->networkingV2(["region"=>"RegionOne"]);
$ln = $networking->listNetworks();
$op = array(
'networks' =>
array(
'name' => 'TestOthmane',
'shared' => true,
'adminStateUp' => true,
));
$array = $networking->createNetworks($op);