Skip to content

Commit b2b7844

Browse files
authored
Merge pull request #4 from nocworx/feature/MAD-15954-openstack-test
MAD-15954 - Openstack test updates
2 parents f9e918a + a207327 commit b2b7844

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

src/Compute/v2/Service.php

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Service extends AbstractService
2828
* Create a new server resource. This operation will provision a new virtual machine on a host chosen by your
2929
* service API.
3030
*
31-
* @param array $options {@see \OpenStack\Compute\v2\Api::postServer}
31+
* @param array $options {@see Api::postServer}
3232
*/
3333
public function createServer(array $options): Server
3434
{
@@ -40,7 +40,7 @@ public function createServer(array $options): Server
4040
*
4141
* @param bool $detailed Determines whether detailed information will be returned. If FALSE is specified, only
4242
* the ID, name and links attributes are returned, saving bandwidth.
43-
* @param array $options {@see \OpenStack\Compute\v2\Api::getServers}
43+
* @param array $options {@see Api::getServers}
4444
* @param callable|null $mapFn a callable function that will be invoked on every iteration of the list
4545
*
4646
* @return \Generator<mixed, \OpenStack\Compute\v2\Models\Server>
@@ -73,7 +73,7 @@ public function getServer(array $options = []): Server
7373
/**
7474
* List flavors.
7575
*
76-
* @param array $options {@see \OpenStack\Compute\v2\Api::getFlavors}
76+
* @param array $options {@see Api::getFlavors}
7777
* @param callable|null $mapFn a callable function that will be invoked on every iteration of the list
7878
* @param bool $detailed set to true to fetch flavors' details
7979
*
@@ -105,7 +105,7 @@ public function getFlavor(array $options = []): Flavor
105105
/**
106106
* Create a new flavor resource.
107107
*
108-
* @param array $options {@see \OpenStack\Compute\v2\Api::postFlavors}
108+
* @param array $options {@see Api::postFlavors}
109109
*/
110110
public function createFlavor(array $options = []): Flavor
111111
{
@@ -115,7 +115,7 @@ public function createFlavor(array $options = []): Flavor
115115
/**
116116
* List images.
117117
*
118-
* @param array $options {@see \OpenStack\Compute\v2\Api::getImages}
118+
* @param array $options {@see Api::getImages}
119119
* @param callable|null $mapFn a callable function that will be invoked on every iteration of the list
120120
*
121121
* @return \Generator<mixed, \OpenStack\Compute\v2\Models\Image>
@@ -144,7 +144,7 @@ public function getImage(array $options = []): Image
144144
/**
145145
* List key pairs.
146146
*
147-
* @param array $options {@see \OpenStack\Compute\v2\Api::getKeyPairs}
147+
* @param array $options {@see Api::getKeyPairs}
148148
* @param callable|null $mapFn a callable function that will be invoked on every iteration of the list
149149
*
150150
* @return \Generator<mixed, \OpenStack\Compute\v2\Models\Keypair>
@@ -154,6 +154,18 @@ public function listKeypairs(array $options = [], ?callable $mapFn = null): \Gen
154154
return $this->model(Keypair::class)->enumerate($this->api->getKeypairs(), $options, $mapFn);
155155
}
156156

157+
/**
158+
* List host aggregates.
159+
*
160+
* @param array $options {@see Api::getAggregates}
161+
* @param callable|null $mapFn A callable function that will be invoked on every iteration of the list.
162+
*
163+
* @return \Generator
164+
*/
165+
public function listAggregates(array $options = [], callable $mapFn = null): \Generator
166+
{
167+
return $this->model(Aggregate::class)->enumerate($this->api->getAggregates(), $options, $mapFn);
168+
}
157169
/**
158170
* Create or import keypair.
159171
*/
@@ -200,7 +212,7 @@ public function getHypervisorStatistics(): HypervisorStatistic
200212
*
201213
* @param bool $detailed Determines whether detailed information will be returned. If FALSE is specified, only
202214
* the ID, name and links attributes are returned, saving bandwidth.
203-
* @param array $options {@see \OpenStack\Compute\v2\Api::getHypervisors}
215+
* @param array $options {@see Api::getHypervisors}
204216
* @param callable|null $mapFn a callable function that will be invoked on every iteration of the list
205217
*
206218
* @return \Generator<mixed, \OpenStack\Compute\v2\Models\Hypervisor>
@@ -225,7 +237,7 @@ public function getHypervisor(array $options = []): Hypervisor
225237
/**
226238
* List hosts.
227239
*
228-
* @param array $options {@see \OpenStack\Compute\v2\Api::getHosts}
240+
* @param array $options {@see Api::getHosts}
229241
* @param callable|null $mapFn a callable function that will be invoked on every iteration of the list
230242
*
231243
* @return \Generator<mixed, \OpenStack\Compute\v2\Models\Host>
@@ -256,7 +268,7 @@ public function getHost(array $options = []): Host
256268
/**
257269
* List AZs.
258270
*
259-
* @param array $options {@see \OpenStack\Compute\v2\Api::getAvailabilityZones}
271+
* @param array $options {@see Api::getAvailabilityZones}
260272
* @param callable|null $mapFn a callable function that will be invoked on every iteration of the list
261273
*
262274
* @return \Generator<mixed, \OpenStack\Compute\v2\Models\AvailabilityZone>
@@ -276,4 +288,5 @@ public function getQuotaSet(string $tenantId, bool $detailed = false): QuotaSet
276288

277289
return $quotaSet;
278290
}
291+
279292
}

0 commit comments

Comments
 (0)