1 | <?php |
||
9 | class Server extends Factory |
||
10 | { |
||
11 | /** |
||
12 | * Constructor - receive server adapter, adapter api authentication and http client details. |
||
13 | * Initialise the http client and make it available for use by the server adapter. |
||
14 | * |
||
15 | * @param ServerAdapterInterface $adapter |
||
16 | * @param HttpClientInterface $client |
||
17 | */ |
||
18 | public function __construct(ServerAdapterInterface $adapter, HttpClientInterface $client = null) |
||
22 | |||
23 | /** |
||
24 | * List details for an indexed server, or all servers if id is null. |
||
25 | * |
||
26 | * @param integer $id |
||
27 | * @return GuzzleResponse | array of GuzzleResponse objects |
||
28 | */ |
||
29 | public function read($id = null) |
||
33 | |||
34 | /** |
||
35 | * Create a new server based on parameters received. |
||
36 | * |
||
37 | * @param array $params |
||
38 | * @return array |
||
39 | */ |
||
40 | public function create($params) |
||
44 | |||
45 | /** |
||
46 | * Delete the server corresponding to the given id. |
||
47 | * |
||
48 | * @param integer $id |
||
49 | * @return integer |
||
50 | */ |
||
51 | public function delete($id) |
||
55 | |||
56 | /** |
||
57 | * List available server images. |
||
58 | * |
||
59 | * @param array $params list of qualifiers to filter the response |
||
60 | * @return array |
||
61 | */ |
||
62 | public function images($params = []) |
||
66 | } |
||
67 |