forked from php-opencloud/openstack
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApiTrait.php
More file actions
175 lines (161 loc) · 5.43 KB
/
Copy pathApiTrait.php
File metadata and controls
175 lines (161 loc) · 5.43 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
declare(strict_types=1);
namespace OpenStack\Networking\v2\Extensions\Layer3;
/**
* @property \OpenStack\Networking\v2\Params $params
* @property string $pathPrefix
*
* @internal
*/
trait ApiTrait
{
public function postFloatingIps(): array
{
return [
'method' => 'POST',
'path' => $this->pathPrefix.'/floatingips',
'jsonKey' => 'floatingip',
'params' => [
'tenantId' => $this->params->tenantIdJson(),
'description' => $this->notRequired($this->params->descriptionJson()),
'floatingNetworkId' => $this->params->floatingNetworkIdJson(),
'subnetId' => $this->notRequired($this->params->subnetIdJson()),
'fixedIpAddress' => $this->params->fixedIpAddressJson(),
'floatingIpAddress' => $this->params->floatingIpAddressJson(),
'portId' => $this->params->portIdJson(),
],
];
}
public function getFloatingIps(): array
{
return [
'method' => 'GET',
'path' => $this->pathPrefix.'/floatingips',
'params' => [
'tenantId' => $this->params->queryTenantId(),
],
];
}
public function putFloatingIp(): array
{
return [
'method' => 'PUT',
'path' => $this->pathPrefix.'/floatingips/{id}',
'jsonKey' => 'floatingip',
'params' => [
'id' => $this->params->idPath(),
'description' => $this->notRequired($this->params->descriptionJson()),
'floatingNetworkId' => $this->notRequired($this->params->floatingNetworkIdJson()),
'fixedIpAddress' => $this->params->fixedIpAddressJson(),
'floatingIpAddress' => $this->params->floatingIpAddressJson(),
'portId' => $this->params->portIdJson(),
],
];
}
public function getFloatingIp(): array
{
return [
'method' => 'GET',
'path' => $this->pathPrefix.'/floatingips/{id}',
'params' => [
'id' => $this->params->idPath(),
'portId' => $this->params->portIdJson(),
],
];
}
public function deleteFloatingIp(): array
{
return [
'method' => 'DELETE',
'path' => $this->pathPrefix.'/floatingips/{id}',
'params' => [
'id' => $this->params->idPath(),
],
];
}
public function postRouters(): array
{
return [
'method' => 'POST',
'path' => $this->pathPrefix.'/routers',
'jsonKey' => 'router',
'params' => [
'name' => $this->params->nameJson(),
'externalGatewayInfo' => $this->params->externalGatewayInfo(),
'adminStateUp' => $this->params->adminStateUp(),
'tenantId' => $this->params->tenantId(),
'distributed' => $this->params->distributedJson(),
'ha' => $this->params->haJson(),
],
];
}
public function getRouters(): array
{
return [
'method' => 'GET',
'path' => $this->pathPrefix.'/routers',
'params' => [
'name' => $this->params->queryName(),
'tenantId' => $this->params->queryTenantId(),
],
];
}
public function putRouter(): array
{
return [
'method' => 'PUT',
'path' => $this->pathPrefix.'/routers/{id}',
'jsonKey' => 'router',
'params' => [
'id' => $this->params->idPath(),
'name' => $this->params->nameJson(),
'externalGatewayInfo' => $this->params->externalGatewayInfo(),
'adminStateUp' => $this->params->adminStateUp(),
],
];
}
public function getRouter(): array
{
return [
'method' => 'GET',
'path' => $this->pathPrefix.'/routers/{id}',
'params' => [
'id' => $this->params->idPath(),
],
];
}
public function deleteRouter(): array
{
return [
'method' => 'DELETE',
'path' => $this->pathPrefix.'/routers/{id}',
'params' => [
'id' => $this->params->idPath(),
],
];
}
public function putAddInterface(): array
{
return [
'method' => 'PUT',
'path' => $this->pathPrefix.'/routers/{id}/add_router_interface',
'params' => [
'id' => $this->params->idPath(),
'subnetId' => $this->params->subnetId(),
'portId' => $this->params->portIdJson(),
],
];
}
public function putRemoveInterface(): array
{
return [
'method' => 'PUT',
'path' => $this->pathPrefix.'/routers/{id}/remove_router_interface',
'params' => [
'id' => $this->params->idPath(),
'subnetId' => $this->params->subnetId(),
'portId' => $this->params->portIdJson(),
],
];
}
}