LXD PHP Client Documentation v0.0.1
Class Lxd Endpoints

Networks

Methods
  • __construct(array $config, variable $curl)  :  void
    Class construct
  • all()  :  array
    List of all networks.
  • info(string $name)  :  array
    Show information on a network.
  • create(string $name, string $description, array $config, string $type, bool $managed)  :  array
    Create new network.
  • rename(string $name, string $newName)  :  array
    Rename network.
  • replace(string $name, string $description, array $config, string $type, bool $managed)  :  array
    Replace network.
  • update(string $name, string $description, array $config, string $type, bool $managed)  :  array
    Update network.
  • remove(string $name)  :  array
    Remove network.
  • delete(string $name)  :  array
    Delete network - alias of remove.
Methods Details
  • public function __construct(array $config, variable $curl)
    Class construct
  • public function all()
    List of all networks.
    $lxd->networks->all();
  • public function info(string $name)
    Show information on a network.
    $lxd->networks->info('network-name');
  • public function create(string $name, string $description, array $config, string $type, bool $managed)
    Create new network.
    $lxd->networks->create( 'network-name', 'My Network', [ 'ipv4.address' => '192.168.1.1/8', 'ipv4.nat' => 'true', 'ipv6.address' => '2001:470:b368:4242::1/64', 'ipv6.nat' => 'true' ], 'bridge', true );
  • public function rename(string $name, string $newName)
    Rename network.
    $lxd->networks->remove('network-name', 'new-network-name');
  • public function replace(string $name, string $description, array $config, string $type, bool $managed)
    Replace network.
    $lxd->networks->replace( 'network-name', 'My Network', [ 'ipv4.address' => '192.168.1.1/8', 'ipv4.nat' => 'true', 'ipv6.address' => '2001:470:b368:4242::1/64', 'ipv6.nat' => 'true' ], 'bridge', true );
  • public function update(string $name, string $description, array $config, string $type, bool $managed)
    Update network.
    $lxd->networks->update( 'network-name', 'My Network', [ 'ipv4.address' => '192.168.1.1/8', 'ipv4.nat' => 'true', 'ipv6.address' => '2001:470:b368:4242::1/64', 'ipv6.nat' => 'true' ], 'bridge', true );
  • public function remove(string $name)
    Remove network.
    $lxd->networks->remove('network-name');
  • public function delete(string $name)
    Delete network - alias of remove.
    $lxd->networks->delete('network-name');