-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathParams.php
More file actions
744 lines (668 loc) · 23.6 KB
/
Params.php
File metadata and controls
744 lines (668 loc) · 23.6 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
<?php
declare(strict_types=1);
namespace OpenStack\Networking\v2;
use OpenStack\Common\Api\AbstractParams;
use OpenStack\Networking\v2\Extensions\Layer3\ParamsTrait as Layer3;
use OpenStack\Networking\v2\Extensions\SecurityGroups\ParamsTrait as SecurityGroups;
class Params extends AbstractParams
{
use Layer3;
use SecurityGroups;
/**
* Returns information about description parameter.
*/
public function descriptionJson(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
];
}
/**
* Returns information about name parameter.
*/
public function nameJson(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
];
}
public function urlId($type): array
{
return array_merge(parent::id($type), [
'required' => true,
'location' => self::URL,
]);
}
public function shared(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::JSON,
'description' => 'Indicates whether this network is shared across all tenants',
];
}
public function adminStateUp(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::JSON,
'sentAs' => 'admin_state_up',
'description' => 'The administrative state of the network',
];
}
public function portSecurityEnabled(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::JSON,
'sentAs' => 'port_security_enabled',
'description' => 'The port security status. A valid value is enabled (true) or disabled (false). If port security is enabled for the port, security
group rules and anti-spoofing rules are applied to the traffic on the port. If disabled, no such rules are applied.',
];
}
public function networkId(): array
{
return [
'type' => self::STRING_TYPE,
'required' => true,
'sentAs' => 'network_id',
'description' => 'The ID of the attached network',
];
}
public function ipVersion(): array
{
return [
'type' => self::INT_TYPE,
'required' => true,
'sentAs' => 'ip_version',
'description' => 'The IP version, which is 4 or 6',
];
}
public function cidr(): array
{
return [
'type' => self::STRING_TYPE,
'required' => true,
'sentAs' => 'cidr',
'description' => 'The CIDR',
];
}
public function tenantId(): array
{
return [
'type' => self::STRING_TYPE,
'sentAs' => 'tenant_id',
'description' => 'The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own. You cannot change this value through authorization policies',
];
}
public function projectId(): array
{
return [
'type' => self::STRING_TYPE,
'sentAs' => 'project_id',
'location' => self::QUERY,
'description' => 'The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own. You cannot change this value through authorization policies',
];
}
public function gatewayIp(): array
{
return [
'type' => self::STRING_TYPE,
'sentAs' => 'gateway_ip',
'description' => 'The gateway IP address',
];
}
public function enableDhcp(): array
{
return [
'type' => self::BOOL_TYPE,
'sentAs' => 'enable_dhcp',
'description' => 'Set to true if DHCP is enabled and false if DHCP is disabled.',
];
}
public function dnsNameservers(): array
{
return [
'type' => self::ARRAY_TYPE,
'sentAs' => 'dns_nameservers',
'description' => 'A list of DNS name servers for the subnet.',
'items' => [
'type' => self::STRING_TYPE,
'description' => 'The nameserver',
],
];
}
public function allocationPools(): array
{
return [
'type' => self::ARRAY_TYPE,
'sentAs' => 'allocation_pools',
'items' => [
'type' => self::OBJECT_TYPE,
'properties' => [
'start' => [
'type' => self::STRING_TYPE,
'description' => 'The start address for the allocation pools',
],
'end' => [
'type' => self::STRING_TYPE,
'description' => 'The end address for the allocation pools',
],
],
],
'description' => 'The start and end addresses for the allocation pools',
];
}
public function hostRoutes(): array
{
return [
'type' => self::ARRAY_TYPE,
'sentAs' => 'host_routes',
'items' => [
'type' => self::OBJECT_TYPE,
'properties' => [
'destination' => [
'type' => self::STRING_TYPE,
'description' => 'Destination for static route',
],
'nexthop' => [
'type' => self::STRING_TYPE,
'description' => 'Nexthop for the destination',
],
],
],
'description' => 'A list of host route dictionaries for the subnet',
];
}
public function statusQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'description' => 'Allows filtering by port status.',
'enum' => ['ACTIVE', 'DOWN'],
];
}
public function displayNameQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'display_name',
'description' => 'Allows filtering by port name.',
];
}
public function adminStateQuery(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::QUERY,
'sentAs' => 'admin_state',
'description' => 'Allows filtering by admin state.',
];
}
public function networkIdQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'network_id',
'description' => 'Allows filtering by network ID.',
];
}
public function tenantIdQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'tenant_id',
'description' => 'Allows filtering by tenant ID.',
];
}
public function deviceOwnerQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'device_owner',
'description' => 'Allows filtering by device owner.',
];
}
public function macAddrQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'mac_address',
'description' => 'Allows filtering by MAC address.',
];
}
public function portIdQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'port_id',
'description' => 'Allows filtering by port UUID.',
];
}
public function secGroupsQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'security_groups',
'description' => 'Allows filtering by device owner. Format should be a comma-delimeted list.',
];
}
public function deviceIdQuery(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => 'device_id',
'description' => 'The UUID of the device that uses this port. For example, a virtual server.',
];
}
public function macAddr(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'mac_address',
'description' => 'The MAC address. If you specify an address that is not valid, a Bad Request (400) status code is returned. If you do not specify a MAC address, OpenStack Networking tries to allocate one. If a failure occurs, a Service Unavailable (503) response code is returned.',
];
}
public function fixedIps(): array
{
return [
'type' => self::ARRAY_TYPE,
'location' => self::JSON,
'sentAs' => 'fixed_ips',
'description' => 'The IP addresses for the port. If you would like to assign multiple IP addresses for the
port, specify multiple entries in this field. Each entry consists of IP address (ipAddress)
and the subnet ID from which the IP address is assigned (subnetId)',
'items' => [
'type' => self::OBJECT_TYPE,
'properties' => [
'ipAddress' => [
'type' => self::STRING_TYPE,
'sentAs' => 'ip_address',
'description' => 'If you specify only an IP address, OpenStack Networking tries to allocate the IP address if the address is a valid IP for any of the subnets on the specified network.',
],
'subnetId' => [
'type' => self::STRING_TYPE,
'sentAs' => 'subnet_id',
'description' => 'Subnet id. If you specify only a subnet ID, OpenStack Networking allocates an available IP from that subnet to the port.',
],
],
],
];
}
public function subnetId(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'subnet_id',
'description' => 'If you specify only a subnet UUID, OpenStack Networking allocates an available IP from that subnet to the port. If you specify both a subnet UUID and an IP address, OpenStack Networking tries to allocate the address to the port.',
];
}
public function ipAddress(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'ip_address',
'description' => 'If you specify both a subnet UUID and an IP address, OpenStack Networking tries to allocate the address to the port.',
];
}
public function secGroupIds(): array
{
return [
'type' => self::ARRAY_TYPE,
'location' => self::JSON,
'sentAs' => 'security_groups',
'items' => [
'type' => self::STRING_TYPE,
'description' => 'The UUID of the security group',
],
];
}
public function allowedAddrPairs(): array
{
return [
'type' => self::ARRAY_TYPE,
'location' => self::JSON,
'sentAs' => 'allowed_address_pairs',
'description' => 'Address pairs extend the port attribute to enable you to specify arbitrary mac_address/ip_address(cidr) pairs that are allowed to pass through a port regardless of the subnet associated with the network.',
'items' => [
'type' => self::OBJECT_TYPE,
'description' => 'A MAC addr/IP addr pair',
'properties' => [
'ipAddress' => [
'sentAs' => 'ip_address',
'type' => self::STRING_TYPE,
'location' => self::JSON,
],
'macAddress' => [
'sentAs' => 'mac_address',
'type' => self::STRING_TYPE,
'location' => self::JSON,
],
],
],
];
}
public function deviceOwner(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'device_owner',
'description' => 'The UUID of the entity that uses this port. For example, a DHCP agent.',
];
}
public function qosPolicy(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'qos_policy_id',
'description' => 'QoS policy associated with the port.',
];
}
public function deviceId(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'device_id',
'description' => 'The UUID of the device that uses this port. For example, a virtual server.',
];
}
public function queryName(): array
{
return $this->queryFilter('name');
}
public function queryTenantId(): array
{
return $this->queryFilter('tenant_id');
}
public function queryStatus(): array
{
return $this->queryFilter('status');
}
private function queryFilter($field): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
'sentAs' => $field,
'description' => 'The Neutron API supports filtering based on all top level attributes of a resource.
Filters are applicable to all list requests.',
];
}
public function routerAccessibleJson(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::JSON,
'sentAs' => 'router:external',
'description' => 'Indicates whether this network is externally accessible.',
];
}
public function queryRouterExternal(): array
{
return [
'type' => self::BOOL_TYPE,
'location' => self::QUERY,
'sentAs' => 'router:external',
];
}
protected function quotaLimit(string $sentAs, string $description): array
{
return [
'type' => self::INT_TYPE,
'location' => self::JSON,
'sentAs' => $sentAs,
'description' => $description,
];
}
public function quotaLimitFloatingIp(): array
{
return $this->quotaLimit('floatingip', 'The number of floating IP addresses allowed for each project. A value of -1 means no limit.');
}
public function quotaLimitNetwork(): array
{
return $this->quotaLimit('network', 'The number of networks allowed for each project. A value of -1 means no limit.');
}
public function quotaLimitPort(): array
{
return $this->quotaLimit('port', 'The number of ports allowed for each project. A value of -1 means no limit.');
}
public function quotaLimitRbacPolicy(): array
{
return $this->quotaLimit('rbac_policy', 'The number of role-based access control (RBAC) policies for each project. A value of -1 means no limit.');
}
public function quotaLimitRouter(): array
{
return $this->quotaLimit('router', 'The number of routers allowed for each project. A value of -1 means no limit.');
}
public function quotaLimitSecurityGroup(): array
{
return $this->quotaLimit('security_group', 'The number of security groups allowed for each project. A value of -1 means no limit.');
}
public function quotaLimitSecurityGroupRule(): array
{
return $this->quotaLimit('security_group_rule', 'The number of security group rules allowed for each project. A value of -1 means no limit.');
}
public function quotaLimitSubnet(): array
{
return $this->quotaLimit('subnet', 'The number of subnets allowed for each project. A value of -1 means no limit.');
}
public function quotaLimitSubnetPool(): array
{
return $this->quotaLimit('subnetpool', 'The number of subnet pools allowed for each project. A value of -1 means no limit.');
}
public function vipSubnetId(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'vip_subnet_id',
'description' => 'The network on which to allocate the load balancer\'s vip address.',
];
}
public function vipAddress(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'vip_address',
'description' => 'The address to assign the load balancer\'s vip address to.',
];
}
public function provider(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'description' => 'The name of a valid provider to provision the load balancer.',
];
}
public function connectionLimit(): array
{
return [
'type' => self::INT_TYPE,
'location' => self::JSON,
'sentAs' => 'connection_limit',
'description' => 'The number of connections allowed by this listener.',
];
}
public function loadbalancerId(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'loadbalancer_id',
'description' => 'The ID of a load balancer.',
];
}
public function loadbalancerIdUrl(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::URL,
'description' => 'The ID of a load balancer.',
];
}
public function protocol(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'description' => 'The protocol the frontend will be listening for. (TCP, HTTP, HTTPS)',
];
}
public function protocolPort(): array
{
return [
'type' => self::INT_TYPE,
'location' => self::JSON,
'sentAs' => 'protocol_port',
'description' => 'The port in which the frontend will be listening. (1-65535)',
];
}
public function lbAlgorithm(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'lb_algorithm',
'description' => 'The load balancing algorithm to distribute traffic to the pool\'s members. (ROUND_ROBIN|LEAST_CONNECTIONS|SOURCE_IP)',
];
}
public function listenerId(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'listener_id',
'description' => 'The listener in which this pool will become the default pool. There can only be one default pool for a listener.',
];
}
public function sessionPersistence(): array
{
return [
'type' => self::OBJECT_TYPE,
'location' => self::JSON,
'sentAs' => 'session_persistence',
'description' => 'The default value for this is an empty dictionary.',
];
}
public function address(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'address',
'description' => 'The IP Address of the member to receive traffic from the load balancer.',
];
}
public function poolId(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::URL,
'description' => 'The ID of the load balancer pool.',
];
}
public function poolIdJson(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'pool_id',
'description' => 'The ID of the load balancer pool.',
];
}
public function weight(): array
{
return [
'type' => self::INT_TYPE,
'location' => self::JSON,
'description' => 'The default value for this attribute will be 1.',
];
}
public function delay(): array
{
return [
'type' => self::INT_TYPE,
'location' => self::JSON,
'description' => 'The interval in seconds between health checks.',
];
}
public function timeout(): array
{
return [
'type' => self::INT_TYPE,
'location' => self::JSON,
'description' => 'The time in seconds that a health check times out.',
];
}
public function maxRetries(): array
{
return [
'type' => self::INT_TYPE,
'location' => self::JSON,
'sentAs' => 'max_retries',
'description' => 'Number of failed health checks before marked as OFFLINE.',
];
}
public function httpMethod(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'http_method',
'description' => 'The default value for this attribute is GET.',
];
}
public function urlPath(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'url_path',
'description' => 'The default value is "/"',
];
}
public function expectedCodes(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'sentAs' => 'expected_codes',
'description' => 'The expected http status codes to get from a successful health check. Defaults to 200. (comma separated)',
];
}
public function type(): array
{
return [
'type' => self::STRING_TYPE,
'location' => self::JSON,
'description' => 'The type of health monitor. Must be one of TCP, HTTP, HTTPS',
];
}
public function tenantIdJson(): array
{
return [
'type' => self::STRING_TYPE,
'description' => 'The UUID of the tenant. Only administrative users can specify a tenant UUID other than their own.',
'sentAs' => 'tenant_id',
];
}
}