File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ public function getNetworks(): array
33
33
return [
34
34
'method ' => 'GET ' ,
35
35
'path ' => $ this ->pathPrefix . '/networks ' ,
36
- 'params ' => [],
36
+ 'params ' => [
37
+ 'name ' => $ this ->params ->queryName (),
38
+ 'tenantId ' => $ this ->params ->queryTenantId (),
39
+ 'status ' => $ this ->params ->queryStatus (),
40
+ ],
37
41
];
38
42
}
39
43
Original file line number Diff line number Diff line change @@ -340,4 +340,30 @@ public function deviceId(): array
340
340
'description ' => 'The UUID of the device that uses this port. For example, a virtual server. ' ,
341
341
];
342
342
}
343
+
344
+ public function queryName (): array
345
+ {
346
+ return $ this ->queryFilter ('name ' );
347
+ }
348
+
349
+ public function queryTenantId (): array
350
+ {
351
+ return $ this ->queryFilter ('tenant_id ' );
352
+ }
353
+
354
+ public function queryStatus (): array
355
+ {
356
+ return $ this ->queryFilter ('status ' );
357
+ }
358
+
359
+ private function queryFilter ($ field ): array
360
+ {
361
+ return [
362
+ 'type ' => self ::STRING_TYPE ,
363
+ 'location ' => self ::QUERY ,
364
+ 'sentAs ' => $ field ,
365
+ 'description ' => 'The Neutron API supports filtering based on all top level attributes of a resource.
366
+ Filters are applicable to all list requests. ' ,
367
+ ];
368
+ }
343
369
}
You can’t perform that action at this time.
0 commit comments