Skip to content

Commit 1e20134

Browse files
committed
Added aggregation query param
1 parent 66216f9 commit 1e20134

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/Metric/v1/Gnocchi/Api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public function getResourceMetricMeasures(): array
121121
'metric' => $this->params->idUrl('metric'),
122122
'type' => $this->params->resourceType(),
123123
'granularity' => $this->params->granularity(),
124+
'aggregation' => $this->params->aggregation(),
124125
],
125126
];
126127
}

src/Metric/v1/Gnocchi/Params.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,16 @@ public function granularity()
5858
{
5959
return [
6060
'location' => self::QUERY,
61-
'type' => self::STRING,
61+
'type' => self::STRING_TYPE,
6262
'description' => 'Specify the granularity to retrieve, rather than all the granularities available',
6363
];
6464
}
65+
66+
public function aggregation()
67+
{
68+
return [
69+
'location' => self::QUERY,
70+
'type' => self::STRING_TYPE
71+
];
72+
}
6573
}

src/Metric/v1/Gnocchi/Service.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ public function listResources(array $options = []): \Generator
2828
return $this->model(Resource::class)->enumerate($this->api->getResources(), $options);
2929
}
3030

31-
public function getResource(array $options = []): Resource
31+
/**
32+
* @param array $options
33+
*
34+
* @return \OpenStack\Metric\v1\Gnocchi\Models\Resource
35+
*/
36+
public function getResource(array $options = []): \OpenStack\Metric\v1\Gnocchi\Models\Resource
3237
{
3338
$this->injectGenericType($options);
3439

@@ -40,6 +45,8 @@ public function getResource(array $options = []): Resource
4045

4146
public function searchResources(array $options = []): \Generator
4247
{
48+
$this->injectGenericType($options);
49+
4350
/**
4451
* $options['criteria'] must send as STRING
4552
* This will check input $options and perform json_encode if needed.

0 commit comments

Comments
 (0)