2017 © Pedro Peláez
 

library lxd

Control LXD through RPC

image

plinker/lxd

Control LXD through RPC

  • Saturday, June 16, 2018
  • by lcherone
  • Repository
  • 1 Watchers
  • 0 Stars
  • 310 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 30 Versions
  • 621 % Grown

The README.md

PlinkerRPC - LXD

Build Status StyleCI Scrutinizer Code Quality Code Coverage Packagist Version Packagist Downloads, (*1)

Control LXD through RPC which uses the local instance of LXD and lxc query to manage local or remote LXD servers., (*2)

Install

Require this package with composer using the following command:, (*3)

``` bash $ composer require plinker/lxd, (*4)


## Setup The webserver user must be able to execute `lxc` commands, so add the user to sudoers file under `User privilege specification`:

User privilege specification

root ALL=(ALL:ALL) ALL www-data ALL=(ALL:ALL) NOPASSWD: /usr/bin/lxc, (*5)


Also add www-data to lxd group:#

sudo usermod --append --groups lxd www-data, (*6)


## Client Creating a client instance is done as follows: <?php require 'vendor/autoload.php'; /** * Initialize plinker client. * * @param string $server - URL to server listener. * @param string $config - server secret, and/or a additional component data */ $client = new \Plinker\Core\Client( 'http://example.com/server.php', [ 'secret' => 'a secret password' ] ); // or using global function $client = plinker_client('http://example.com/server.php', 'a secret password'); ## Basic Usage Essentially you can do any LXD operation with the single `$client->lxd->query()` method, or you can use the [helper methods](https://plinker-rpc.github.io/lxd/) which cover all the LXD endpoints. **Parameters & Call** | Parameter | Type | Description | Default | | ---------- | ------------- | ------------- | ------------- | | remote | string | LXD remote and endpoint | local | | rest method | string | e.g GET, POST, DELETE, PUT, PATCH | GET | | payload | object \| json string | Rest json payload | | | mutator | function | Pre-resolve mutation function | |

$client->lxd->query('remote:/1.0', 'GET', []);, (*7)


## Full Documentation To view the complete docs for this component including all methods see: [https://plinker-rpc.github.io/lxd/](https://plinker-rpc.github.io/lxd/) ## Methods Once setup, you call the class though its namespace to its method, see docs for further details. ## List Containers List containers on remote. **Parameters & Call** | Parameter | Type | Description | Default | | ---------- | ------------- | ------------- | ------------- | | remote | string | LXD remote | local | | mutator | function | Mutation function | | ``` javascript $client->lxd->containers->list('local', function ($result) { return str_replace('/1.0/containers/', '', $result); });

Response text Array ( [0] => my-container ), (*8)

Testing

There are no tests setup for this component., (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Security

If you discover any security related issues, please contact me via https://cherone.co.uk instead of using the issue tracker., (*11)

Credits

Development Encouragement

If you use this project and make money from it or want to show your appreciation, please feel free to make a donation https://www.paypal.me/lcherone, thanks., (*12)

Sponsors

Get your company or name listed throughout the documentation and on each github repository, contact me at https://cherone.co.uk for further details., (*13)

License

The MIT License (MIT). Please see License File for more information., (*14)

See the organisations page for additional components., (*15)

The Versions

16/06 2018

dev-master

9999999-dev http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

16/06 2018

v0.0.29

0.0.29.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

15/06 2018

v0.0.28

0.0.28.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

13/06 2018

v0.0.27

0.0.27.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

04/06 2018

v0.0.26

0.0.26.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

04/06 2018

v0.0.25

0.0.25.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

02/06 2018

v0.0.24

0.0.24.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

02/06 2018

v0.0.23

0.0.23.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

02/06 2018

v0.0.22

0.0.22.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

31/05 2018

v0.0.21

0.0.21.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

24/05 2018

v0.0.20

0.0.20.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

24/05 2018

v0.0.19

0.0.19.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

23/05 2018

v0.0.18

0.0.18.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

22/05 2018

v0.0.17

0.0.17.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

22/05 2018

v0.0.16

0.0.16.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

21/05 2018

v0.0.15

0.0.15.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

21/05 2018

v0.0.14

0.0.14.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

21/05 2018

v0.0.13

0.0.13.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

15/05 2018

v0.0.12

0.0.12.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

15/05 2018

v0.0.11

0.0.11.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.10

0.0.10.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.9

0.0.9.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.8

0.0.8.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.7

0.0.7.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.6

0.0.6.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.5

0.0.5.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.4

0.0.4.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.3

0.0.3.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.2

0.0.2.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

rpc containers lxd plinker

14/05 2018

v0.0.1

0.0.1.0 http://github.com/plinker-rpc/lxd

Control LXD through RPC

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

rpc containers lxd plinker