Skip to content

Commit 64b9e41

Browse files
committed
Networking SecurityGroups Ext: add filterName
1 parent 76c8387 commit 64b9e41

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ public function getSecurityGroups()
2424
return [
2525
'method' => 'GET',
2626
'path' => $this->pathPrefix.'/security-groups',
27-
'params' => [],
27+
'params' => [
28+
'tenantId' => $this->params->queryTenantId(),
29+
'name' => $this->params->filterName(),
30+
],
2831
];
2932
}
3033

src/Networking/v2/Extensions/SecurityGroups/Params.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,13 @@ public function tenantIdJson()
8989
'description' => 'The UUID of the tenant who owns the security group rule. Only administrative users can specify a tenant UUID other than their own.',
9090
];
9191
}
92+
93+
public function filterName(): array
94+
{
95+
return [
96+
'description' => sprintf('Filter the list result by the human-readable name of the resource'),
97+
'type' => self::STRING_TYPE,
98+
'location' => self::QUERY,
99+
];
100+
}
92101
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ private function securityGroupRule(array $info = []): SecurityGroupRule
2222
}
2323

2424
/**
25+
* @param array $options
26+
*
2527
* @return \Generator
2628
*/
27-
public function listSecurityGroups(): \Generator
29+
public function listSecurityGroups(array $options = []): \Generator
2830
{
29-
return $this->securityGroup()->enumerate($this->api->getSecurityGroups());
31+
return $this->securityGroup()->enumerate($this->api->getSecurityGroups(), $options);
3032
}
3133

3234
/**

0 commit comments

Comments
 (0)