1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace OpenStack\Networking\v2\Models; |
4
|
|
|
|
5
|
|
|
use OpenStack\Common\Resource\Alias; |
6
|
|
|
use OpenStack\Common\Resource\Creatable; |
7
|
|
|
use OpenStack\Common\Resource\Deletable; |
8
|
|
|
use OpenStack\Common\Resource\OperatorResource; |
9
|
|
|
use OpenStack\Common\Resource\Retrievable; |
10
|
|
|
use OpenStack\Common\Resource\Updateable; |
11
|
|
|
use OpenStack\Networking\v2\Api; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Represents a Neutron v2 LoadBalancer Health Monitor |
15
|
|
|
* |
16
|
|
|
* @property Api $api |
17
|
|
|
*/ |
18
|
|
|
class LoadBalancerHealthMonitor extends OperatorResource implements Creatable, Retrievable, Updateable, Deletable |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @var string |
22
|
|
|
*/ |
23
|
|
|
public $id; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
public $tenantId; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
public $type; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var integer |
37
|
|
|
*/ |
38
|
|
|
public $delay; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var integer |
42
|
|
|
*/ |
43
|
|
|
public $timeout; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var integer |
47
|
|
|
*/ |
48
|
|
|
public $maxRetries; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var string |
52
|
|
|
*/ |
53
|
|
|
public $httpMethod; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string |
57
|
|
|
*/ |
58
|
|
|
public $urlPath; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
public $expectedCodes; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var boolean |
67
|
|
|
*/ |
68
|
|
|
public $adminStateUp; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var string |
72
|
|
|
*/ |
73
|
|
|
public $poolId; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @var LoadBalancerPool[] |
77
|
|
|
*/ |
78
|
|
|
public $pools; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @var string |
82
|
|
|
*/ |
83
|
|
|
public $operatingStatus; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var string |
87
|
|
|
*/ |
88
|
|
|
public $provisioningStatus; |
89
|
|
|
|
90
|
|
|
protected $resourcesKey = 'healthmonitors'; |
91
|
|
|
protected $resourceKey = 'healthmonitor'; |
92
|
|
|
|
93
|
|
|
protected $aliases = [ |
94
|
|
|
'tenant_id' => 'tenantId', |
95
|
|
|
'admin_state_up' => 'adminStateUp', |
96
|
|
|
'max_retries' => 'maxRetries', |
97
|
|
|
'http_method' => 'httpMethod', |
98
|
|
|
'url_path' => 'urlPath', |
99
|
|
|
'expected_codes' => 'expectedCodes', |
100
|
|
|
'pool_id' => 'poolId', |
101
|
|
|
'operating_status' => 'operatingStatus', |
102
|
|
|
'provisioning_status' => 'provisioningStatus', |
103
|
|
|
]; |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @inheritdoc |
107
|
|
|
*/ |
108
|
|
|
protected function getAliases(): array |
109
|
|
|
{ |
110
|
|
|
return parent::getAliases() + [ |
111
|
|
|
'pools' => new Alias('pools', LoadBalancerPool::class, true) |
112
|
|
|
]; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* {@inheritDoc} |
117
|
|
|
*/ |
118
|
|
|
public function create(array $userOptions): Creatable |
119
|
|
|
{ |
120
|
|
|
$response = $this->execute($this->api->postLoadBalancerHealthMonitor(), $userOptions); |
121
|
|
|
return $this->populateFromResponse($response); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* {@inheritDoc} |
126
|
|
|
*/ |
127
|
|
|
public function retrieve() |
128
|
|
|
{ |
129
|
|
|
$response = $this->execute($this->api->getLoadBalancerHealthMonitor(), ['id' => (string)$this->id]); |
130
|
|
|
$this->populateFromResponse($response); |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* {@inheritDoc} |
135
|
|
|
*/ |
136
|
|
|
public function update() |
137
|
|
|
{ |
138
|
|
|
$response = $this->executeWithState($this->api->putLoadBalancerHealthMonitor()); |
139
|
|
|
$this->populateFromResponse($response); |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* {@inheritDoc} |
144
|
|
|
*/ |
145
|
|
|
public function delete() |
146
|
|
|
{ |
147
|
|
|
$this->executeWithState($this->api->deleteLoadBalancerHealthMonitor()); |
148
|
|
|
} |
149
|
|
|
} |
150
|
|
|
|