Method: metricDefinitions.create

Full name: projects.locations.instances.metricDefinitions.create

Creates a new MetricDefinition. The metric definition will be in an enabled state by default.

HTTP request

POST https://{endpoint}/v1alpha/{parent}/metricDefinitions

Where {endpoint} is one of the supported service endpoints.

Path parameters

Parameters
parent

string

Required. The parent resource where this MetricDefinition will be created. Format: projects/{project}/locations/{location}/instances/{instance}

Query parameters

Parameters
metricDefinitionId

string

Required. The ID to use for the MetricDefinition, which will become the final part of the MetricDefinition's resource name.

This ID can be at most 63 characters long, must begin with a letter, and may only contain lowercase alphanumeric characters and underscores, i.e. it must match a regular expression of [a-z][_a-z0-9]{0,61}[a-z0-9]. Only Google-defined MetricDefinitions may begin with "google_".

Request body

The request body contains an instance of MetricDefinition.

Response body

If successful, the response body contains a newly created instance of MetricDefinition.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/chronicle
  • https://www.googleapis.com/auth/chronicle.readonly

For more information, see the Authentication Overview.