forked from php-opencloud/openstack
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathParamsTrait.php
More file actions
130 lines (116 loc) · 3.9 KB
/
ParamsTrait.php
File metadata and controls
130 lines (116 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
declare(strict_types=1);
namespace OpenStack\Networking\v2\Extensions\Layer3;
/**
* @internal
*/
trait ParamsTrait
{
public function descriptionJson(): array
{
return [
'type' => self::STRING_TYPE,
'description' => 'The description of the floating IP.',
'sentAs' => 'description',
];
}
public function floatingNetworkIdJson(): array
{
return [
'type' => self::STRING_TYPE,
'description' => 'The UUID of the network associated with the floating IP.',
'sentAs' => 'floating_network_id',
'required' => true,
];
}
public function fixedIpAddressJson(): array
{
return [
'type' => self::STRING_TYPE,
'description' => 'The fixed IP address that is associated with the floating IP. To associate the floating IP with a fixed IP at creation time, you must specify the identifier of the internal port. If an internal port has multiple associated IP addresses, the service chooses the first IP address unless you explicitly define a fixed IP address in the fixed_ip_address parameter.',
'sentAs' => 'fixed_ip_address',
];
}
public function floatingIpAddressJson(): array
{
return [
'type' => self::STRING_TYPE,
'description' => 'The floating IP address.',
'sentAs' => 'floating_ip_address',
];
}
public function subnetIdJson(): array
{
return [
'type' => self::STRING_TYPE,
'description' => 'The UUID of the subnet of the floating Network associated with the floating IP.',
'sentAs' => 'subnet',
];
}
public function portIdJson(): array
{
return [
'type' => self::STRING_TYPE,
'description' => 'The UUID of the port.',
'sentAs' => 'port_id',
];
}
public function enableSnatJson(): array
{
return [
'type' => self::BOOL_TYPE,
'description' => 'Enable Source NAT (SNAT) attribute, a part of ext-gw-mode extension. When a gateway is attached to a router using an L3 extension, Network Address Translation (NAT) is enabled for traffic generated by subnets attached to the router.',
'location' => self::JSON,
'sentAs' => 'enable_snat',
];
}
public function ipJson(): array
{
return [
'type' => self::STRING_TYPE,
];
}
public function externalFixedIpsJson(): array
{
return [
'type' => self::ARRAY_TYPE,
'location' => self::JSON,
'sentAs' => 'external_fixed_ips',
'items' => [
'type' => self::OBJECT_TYPE,
'properties' => [
'subnetId' => $this->subnetId(),
'ip' => $this->ipJson(),
],
],
];
}
public function externalGatewayInfo(): array
{
return [
'type' => self::OBJECT_TYPE,
'sentAs' => 'external_gateway_info',
'properties' => [
'networkId' => $this->networkId(),
'enableSnat' => $this->enableSnatJson(),
'fixedIps' => $this->externalFixedIpsJson(),
],
];
}
public function distributedJson(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::JSON,
'description' => 'If true, indicates a distributed router.',
];
}
public function haJson(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::JSON,
'description' => 'If true, indicates a highly-available router.',
];
}
}