File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function getFlavors(): array
42
42
43
43
public function getFlavorsDetail (): array
44
44
{
45
- $ op = $ this ->getAll ();
45
+ $ op = $ this ->getFlavors ();
46
46
$ op ['path ' ] .= '/detail ' ;
47
47
return $ op ;
48
48
}
@@ -103,7 +103,7 @@ public function getImages(): array
103
103
104
104
public function getImagesDetail (): array
105
105
{
106
- $ op = $ this ->getAll ();
106
+ $ op = $ this ->getImages ();
107
107
$ op ['path ' ] .= '/detail ' ;
108
108
return $ op ;
109
109
}
Original file line number Diff line number Diff line change @@ -70,14 +70,16 @@ public function getServer(array $options = []): Server
70
70
/**
71
71
* List flavors.
72
72
*
73
- * @param array $options {@see \OpenStack\Compute\v2\Api::getFlavors}
74
- * @param callable $mapFn A callable function that will be invoked on every iteration of the list.
73
+ * @param array $options {@see \OpenStack\Compute\v2\Api::getFlavors}
74
+ * @param callable $mapFn A callable function that will be invoked on every iteration of the list.
75
+ * @param bool $detailed Set to true to fetch flavors' details.
75
76
*
76
77
* @return \Generator
77
78
*/
78
- public function listFlavors (array $ options = [], callable $ mapFn = null ): \Generator
79
+ public function listFlavors (array $ options = [], callable $ mapFn = null , bool $ detailed = false ): \Generator
79
80
{
80
- return $ this ->model (Flavor::class)->enumerate ($ this ->api ->getFlavors (), $ options , $ mapFn );
81
+ $ def = $ detailed === true ? $ this ->api ->getFlavorsDetail () : $ this ->api ->getFlavors ();
82
+ return $ this ->model (Flavor::class)->enumerate ($ def , $ options , $ mapFn );
81
83
}
82
84
83
85
/**
You can’t perform that action at this time.
0 commit comments