1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
// --------------------------------------------------------------------- |
4
|
|
|
// |
5
|
|
|
// Copyright (C) 2018-2024 Artem Rodygin |
6
|
|
|
// |
7
|
|
|
// You should have received a copy of the MIT License along with |
8
|
|
|
// this file. If not, see <https://opensource.org/licenses/MIT>. |
9
|
|
|
// |
10
|
|
|
// --------------------------------------------------------------------- |
11
|
|
|
|
12
|
|
|
namespace Linode\Longview; |
13
|
|
|
|
14
|
|
|
use Linode\Entity; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* A LongviewClient is a single monitor set up to track statistics about one of your |
18
|
|
|
* servers. |
19
|
|
|
* |
20
|
|
|
* @property int $id This Client's unique ID. |
21
|
|
|
* @property string $label This Client's unique label. This is for display purposes only. |
22
|
|
|
* @property string $api_key The API key for this Client, used when configuring the Longview Client application |
23
|
|
|
* on your Linode. |
24
|
|
|
* @property string $install_code The install code for this Client, used when configuring the Longview Client |
25
|
|
|
* application on your Linode. |
26
|
|
|
* @property string $created When this Longview Client was created. |
27
|
|
|
* @property string $updated When this Longview Client was last updated. |
28
|
|
|
* @property LongviewApps $apps The apps this Client is monitoring on your Linode. This is configured when you |
29
|
|
|
* install the Longview Client application, and is present here for information |
30
|
|
|
* purposes only. |
31
|
|
|
*/ |
32
|
|
|
class LongviewClient extends Entity |
33
|
|
|
{ |
34
|
|
|
// Available fields. |
35
|
|
|
public const FIELD_ID = 'id'; |
36
|
|
|
public const FIELD_LABEL = 'label'; |
37
|
|
|
public const FIELD_API_KEY = 'api_key'; |
38
|
|
|
public const FIELD_INSTALL_CODE = 'install_code'; |
39
|
|
|
public const FIELD_CREATED = 'created'; |
40
|
|
|
public const FIELD_UPDATED = 'updated'; |
41
|
|
|
public const FIELD_APPS = 'apps'; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @codeCoverageIgnore This method was autogenerated. |
45
|
|
|
*/ |
46
|
|
|
public function __get(string $name): mixed |
47
|
|
|
{ |
48
|
|
|
return match ($name) { |
49
|
|
|
self::FIELD_APPS => new LongviewApps($this->client, $this->data[$name]), |
50
|
|
|
default => parent::__get($name), |
51
|
|
|
}; |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|