class ProjectsMetrics extends Resource (View source)

The "metrics" collection of methods.

Typical usage is:

 $loggingService = new Google\Service\Logging(...);
 $metrics = $loggingService->projects_metrics;

Methods

create(string $parent, LogMetric $postBody, array $optParams = [])

Creates a logs-based metric. (metrics.create)

delete(string $metricName, array $optParams = [])

Deletes a logs-based metric. (metrics.delete)

get(string $metricName, array $optParams = [])

Gets a logs-based metric. (metrics.get)

listProjectsMetrics(string $parent, array $optParams = [])

Lists logs-based metrics. (metrics.listProjectsMetrics)

update(string $metricName, LogMetric $postBody, array $optParams = [])

Creates or updates a logs-based metric. (metrics.update)

Details

LogMetric create(string $parent, LogMetric $postBody, array $optParams = [])

Creates a logs-based metric. (metrics.create)

Parameters

string $parent

Required. The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The new metric must be provided in the request.

LogMetric $postBody
array $optParams

Optional parameters.

Return Value

LogMetric

Exceptions

Exception

LoggingEmpty delete(string $metricName, array $optParams = [])

Deletes a logs-based metric. (metrics.delete)

Parameters

string $metricName

Required. The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]"

array $optParams

Optional parameters.

Return Value

LoggingEmpty

Exceptions

Exception

LogMetric get(string $metricName, array $optParams = [])

Gets a logs-based metric. (metrics.get)

Parameters

string $metricName

Required. The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]"

array $optParams

Optional parameters.

Return Value

LogMetric

Exceptions

Exception

ListLogMetricsResponse listProjectsMetrics(string $parent, array $optParams = [])

Lists logs-based metrics. (metrics.listProjectsMetrics)

Parameters

string $parent

Required. The name of the project containing the metrics: "projects/[PROJECT_ID]"

array $optParams

Optional parameters.

Return Value

ListLogMetricsResponse

Exceptions

Exception

LogMetric update(string $metricName, LogMetric $postBody, array $optParams = [])

Creates or updates a logs-based metric. (metrics.update)

Parameters

string $metricName

Required. The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.

LogMetric $postBody
array $optParams

Optional parameters.

Return Value

LogMetric

Exceptions

Exception