@@ -11,43 +11,43 @@ |
||
11 | 11 | private $containerId; |
12 | 12 | private $statusCache; |
13 | 13 | |
14 | - public function __construct(KeyManager $km, string $id) { |
|
14 | + public function __construct (KeyManager $km, string $id) { |
|
15 | 15 | parent::__construct($km); |
16 | 16 | $this->containerId = $id; |
17 | 17 | $this->UpdateStatus(); |
18 | 18 | } |
19 | 19 | |
20 | - private function UpdateStatus() { |
|
20 | + private function UpdateStatus () { |
|
21 | 21 | $request = Request::get("https://api.csfcloud.com/container/" . urlencode($this->containerId) . "?key=" . urlencode($this->keymanager->GetServerKey()))->expectsText()->send(); |
22 | 22 | $this->statusCache = json_decode($request->body, true); |
23 | 23 | } |
24 | 24 | |
25 | - public function GetConfiguration() : array { |
|
25 | + public function GetConfiguration () : array { |
|
26 | 26 | return $this->statusCache["configuration"]; |
27 | 27 | } |
28 | 28 | |
29 | - public function SetConfiguration(array $cnf) { |
|
29 | + public function SetConfiguration (array $cnf) { |
|
30 | 30 | $this->statusCache["configuration"] = $cnf; |
31 | 31 | } |
32 | 32 | |
33 | - public function UpdateChanges() { |
|
33 | + public function UpdateChanges () { |
|
34 | 34 | Request::put("https://api.csfcloud.com/container/" . urlencode($this->containerId) . "?key=" . urlencode($this->keymanager->GetServerKey())) |
35 | 35 | ->sendsJson()->body(json_encode($this->statusCache["configuration"]))->send(); |
36 | 36 | } |
37 | 37 | |
38 | - public function GetContainerName() : string { |
|
38 | + public function GetContainerName () : string { |
|
39 | 39 | return $this->statusCache["configuration"]["name"]; |
40 | 40 | } |
41 | 41 | |
42 | - public function SetContainerName(string $newname) { |
|
42 | + public function SetContainerName (string $newname) { |
|
43 | 43 | $this->statusCache["configuration"]["name"] = $newname; |
44 | 44 | } |
45 | 45 | |
46 | - public function IsRunning() : boolean { |
|
46 | + public function IsRunning () : boolean { |
|
47 | 47 | return $this->statusCache["running"]; |
48 | 48 | } |
49 | 49 | |
50 | - public function GetLastLogId() : ?string { |
|
50 | + public function GetLastLogId () : ?string { |
|
51 | 51 | return $this->statusCache["last_log"]; |
52 | 52 | } |
53 | 53 |