1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace OpenStack\Networking\v2\Extensions\Layer3\Models; |
4
|
|
|
|
5
|
|
|
use OpenCloud\Common\Resource\OperatorResource; |
6
|
|
|
use OpenCloud\Common\Resource\Creatable; |
7
|
|
|
use OpenCloud\Common\Resource\Deletable; |
8
|
|
|
use OpenCloud\Common\Resource\Listable; |
9
|
|
|
use OpenCloud\Common\Resource\Retrievable; |
10
|
|
|
use OpenCloud\Common\Resource\Updateable; |
11
|
|
|
use OpenStack\Networking\v2\Extensions\Layer3\Api; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @property Api $api |
15
|
|
|
*/ |
16
|
|
|
class FloatingIp extends OperatorResource implements Listable, Creatable, Retrievable, Updateable, Deletable |
|
|
|
|
17
|
|
|
{ |
18
|
|
|
/** @var string */ |
19
|
|
|
public $id; |
20
|
|
|
|
21
|
|
|
/** @var string */ |
22
|
|
|
public $status; |
23
|
|
|
|
24
|
|
|
/** @var string */ |
25
|
|
|
public $floatingNetworkId; |
26
|
|
|
|
27
|
|
|
/** @var string */ |
28
|
|
|
public $routerId; |
29
|
|
|
|
30
|
|
|
/** @var string */ |
31
|
|
|
public $fixedIpAddress; |
32
|
|
|
|
33
|
|
|
/** @var string */ |
34
|
|
|
public $floatingIpAddress; |
35
|
|
|
|
36
|
|
|
/** @var string */ |
37
|
|
|
public $tenantId; |
38
|
|
|
|
39
|
|
|
/** @var string */ |
40
|
|
|
public $portId; |
41
|
|
|
|
42
|
|
|
protected $aliases = [ |
43
|
|
|
"floating_network_id" => 'floatingNetworkId', |
44
|
|
|
"router_id" => 'routerId', |
45
|
|
|
"fixed_ip_address" => 'fixedIpAddress', |
46
|
|
|
"floating_ip_address" => 'floatingIpAddress', |
47
|
|
|
"tenant_id" => 'tenantId', |
48
|
|
|
"port_id" => 'portId', |
49
|
|
|
]; |
50
|
|
|
|
51
|
|
|
protected $resourceKey = 'floatingip'; |
52
|
|
|
protected $resourcesKey = 'floatingips'; |
53
|
|
|
|
54
|
|
|
public function create(array $userOptions): Creatable |
55
|
|
|
{ |
56
|
|
|
$response = $this->execute($this->api->postFloatingIps(), $userOptions); |
57
|
|
|
return $this->populateFromResponse($response); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function update() |
61
|
|
|
{ |
62
|
|
|
$response = $this->executeWithState($this->api->putFloatingIp()); |
63
|
|
|
$this->populateFromResponse($response); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function delete() |
67
|
|
|
{ |
68
|
|
|
$this->executeWithState($this->api->deleteFloatingIp()); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function retrieve() |
72
|
|
|
{ |
73
|
|
|
$this->executeWithState($this->api->getFloatingIp()); |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|