Skip to content

Commit 2185d14

Browse files
author
Jamie Hannaford
committed
Merge pull request #58 from haphan/master
[rfr] Allows to filter routers and subnets by name and tenant
2 parents 9908a43 + 9c671e2 commit 2185d14

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/Networking/v2/Api.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ public function getSubnets(): array
118118
return [
119119
'method' => 'GET',
120120
'path' => $this->pathPrefix . '/subnets',
121-
'params' => [],
121+
'params' => [
122+
'name' => $this->params->queryName(),
123+
'tenantId' => $this->params->queryTenantId()
124+
],
122125
];
123126
}
124127

src/Networking/v2/Extensions/Layer3/Api.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ public function getRouters(): array
9999
return [
100100
'method' => 'GET',
101101
'path' => $this->pathPrefix . '/routers',
102-
'params' => [],
102+
'params' => [
103+
'name' => $this->params->queryName(),
104+
'tenantId' => $this->params->queryTenantId()
105+
],
103106
];
104107
}
105108

src/Networking/v2/Extensions/Layer3/Service.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ public function getRouter($id): Router
6666
}
6767

6868
/**
69+
* @param array $options
70+
*
6971
* @return \Generator
7072
*/
71-
public function listRouters(): \Generator
73+
public function listRouters(array $options = []): \Generator
7274
{
73-
return $this->router()->enumerate($this->api->getRouters());
75+
return $this->router()->enumerate($this->api->getRouters(), $options);
7476
}
7577
}

0 commit comments

Comments
 (0)