class ProjectsMetricDescriptors extends Resource (View source)

The "metricDescriptors" collection of methods.

Typical usage is:

 $monitoringService = new Google\Service\Monitoring(...);
 $metricDescriptors = $monitoringService->projects_metricDescriptors;

Methods

create(string $name, MetricDescriptor $postBody, array $optParams = [])

Creates a new metric descriptor. The creation is executed asynchronously.

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

Deletes a metric descriptor. Only user-created custom metrics (https://cloud.google.com/monitoring/custom-metrics) can be deleted.

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

Gets a single metric descriptor. (metricDescriptors.get)

listProjectsMetricDescriptors(string $name, array $optParams = [])

Lists metric descriptors that match a filter.

Details

MetricDescriptor create(string $name, MetricDescriptor $postBody, array $optParams = [])

Creates a new metric descriptor. The creation is executed asynchronously.

User-created metric descriptors define custom metrics (https://cloud.google.com/monitoring/custom-metrics). The metric descriptor is updated if it already exists, except that metric labels are never removed. (metricDescriptors.create)

Parameters

string $name

Required. The project (https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: 4 projects/PROJECT_ID_OR_NUMBER

MetricDescriptor $postBody
array $optParams

Optional parameters.

Return Value

MetricDescriptor

Exceptions

Exception

MonitoringEmpty delete(string $name, array $optParams = [])

Deletes a metric descriptor. Only user-created custom metrics (https://cloud.google.com/monitoring/custom-metrics) can be deleted.

(metricDescriptors.delete)

Parameters

string $name

Required. The metric descriptor on which to execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] An example of [METRIC_ID] is: "custom.googleapis.com/my_test_metric".

array $optParams

Optional parameters.

Return Value

MonitoringEmpty

Exceptions

Exception

MetricDescriptor get(string $name, array $optParams = [])

Gets a single metric descriptor. (metricDescriptors.get)

Parameters

string $name

Required. The metric descriptor on which to execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] An example value of [METRIC_ID] is "compute.googleapis.com/instance/disk/read_bytes_count".

array $optParams

Optional parameters.

Return Value

MetricDescriptor

Exceptions

Exception

ListMetricDescriptorsResponse listProjectsMetricDescriptors(string $name, array $optParams = [])

Lists metric descriptors that match a filter.

(metricDescriptors.listProjectsMetricDescriptors)

Parameters

string $name

Required. The project (https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]

array $optParams

Optional parameters.

Return Value

ListMetricDescriptorsResponse

Exceptions

Exception