'createdByUserId', 'started_at' => 'startedAt', 'display_name' => 'displayName', 'revision_end' => 'revisionEnd', 'user_id' => 'userId', 'created_by_project_id' => 'createdByProjectId', 'image_ref' => 'imageRef', 'flavor_id' => 'flavorId', 'server_group' => 'serverGroup', 'original_resource_id' => 'originalResourceId', 'revision_start' => 'revisionStart', 'project_id' => 'projectId', 'ended_at' => 'endedAt', ]; public function retrieve() { $response = $this->execute($this->api->getResource(), ['type' => $this->type, 'id' => $this->id]); $this->populateFromResponse($response); } public function getMetric(string $metric): Metric { $response = $this->execute( $this->api->getResourceMetric(), [ 'resourceId' => $this->id, 'metric' => $metric, 'type' => $this->type, ] ); $metric = $this->model(Metric::class)->populateFromResponse($response); return $metric; } /** * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResourceMetricMeasures} */ public function getMetricMeasures(array $options = []): array { $options = array_merge( $options, [ 'resourceId' => $this->id, 'type' => $this->type, ] ); $response = $this->execute($this->api->getResourceMetricMeasures(), $options); return Utils::jsonDecode($response); } /** * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResourceMetrics} */ public function listResourceMetrics(array $options = []): \Generator { $options['resourceId'] = $this->id; return $this->model(Metric::class)->enumerate($this->api->getResourceMetrics(), $options); } }