Reference documentation and code samples for the Stackdriver Monitoring V3 Client class CreateAlertPolicyRequest.
The protocol for theCreateAlertPolicyrequest.
Generated from protobuf messagegoogle.monitoring.v3.CreateAlertPolicyRequest
Namespace
Google \ Cloud \ Monitoring \ V3
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Required. Theprojectin which to create the alerting policy. The format is: projects/[PROJECT_ID_OR_NUMBER] Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. |name| must be a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form/alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container.
Required. The requested alerting policy. You should omit thenamefield in this policy. The name will be returned in the new policy, including a new[ALERT_POLICY_ID]value.
getName
Required. Theprojectin which
to create the alerting policy. The format is:
projects/[PROJECT_ID_OR_NUMBER]
Note that this field names the parent container in which the alerting
policy will be written, not the name of the created policy. |name| must be
a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will
return. The alerting policy that is returned will have a name that contains
a normalized representation of this name as a prefix but adds a suffix of
the form/alertPolicies/[ALERT_POLICY_ID], identifying the policy in the
container.
Returns
Type
Description
string
setName
Required. Theprojectin which
to create the alerting policy. The format is:
projects/[PROJECT_ID_OR_NUMBER]
Note that this field names the parent container in which the alerting
policy will be written, not the name of the created policy. |name| must be
a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will
return. The alerting policy that is returned will have a name that contains
a normalized representation of this name as a prefix but adds a suffix of
the form/alertPolicies/[ALERT_POLICY_ID], identifying the policy in the
container.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAlertPolicy
Required. The requested alerting policy. You should omit thenamefield
in this policy. The name will be returned in the new policy, including a
new[ALERT_POLICY_ID]value.
Required. The requested alerting policy. You should omit thenamefield
in this policy. The name will be returned in the new policy, including a
new[ALERT_POLICY_ID]value.
Required. Theprojectin which
to create the alerting policy. The format is:
projects/[PROJECT_ID_OR_NUMBER]
Note that this field names the parent container in which the alerting
policy will be written, not the name of the created policy. |name| must be
a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will
return. The alerting policy that is returned will have a name that contains
a normalized representation of this name as a prefix but adds a suffix of
the form/alertPolicies/[ALERT_POLICY_ID], identifying the policy in the
container.
Required. The requested alerting policy. You should omit thenamefield
in this policy. The name will be returned in the new policy, including a
new[ALERT_POLICY_ID]value.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Monitoring V3 Client - Class CreateAlertPolicyRequest (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-monitoring/latest/V3.CreateAlertPolicyRequest)\n- [2.1.1](/php/docs/reference/cloud-monitoring/2.1.1/V3.CreateAlertPolicyRequest)\n- [2.0.1](/php/docs/reference/cloud-monitoring/2.0.1/V3.CreateAlertPolicyRequest)\n- [1.12.1](/php/docs/reference/cloud-monitoring/1.12.1/V3.CreateAlertPolicyRequest)\n- [1.11.1](/php/docs/reference/cloud-monitoring/1.11.1/V3.CreateAlertPolicyRequest)\n- [1.10.3](/php/docs/reference/cloud-monitoring/1.10.3/V3.CreateAlertPolicyRequest)\n- [1.9.0](/php/docs/reference/cloud-monitoring/1.9.0/V3.CreateAlertPolicyRequest)\n- [1.8.0](/php/docs/reference/cloud-monitoring/1.8.0/V3.CreateAlertPolicyRequest)\n- [1.7.1](/php/docs/reference/cloud-monitoring/1.7.1/V3.CreateAlertPolicyRequest)\n- [1.6.0](/php/docs/reference/cloud-monitoring/1.6.0/V3.CreateAlertPolicyRequest)\n- [1.5.1](/php/docs/reference/cloud-monitoring/1.5.1/V3.CreateAlertPolicyRequest)\n- [1.4.0](/php/docs/reference/cloud-monitoring/1.4.0/V3.CreateAlertPolicyRequest)\n- [1.3.2](/php/docs/reference/cloud-monitoring/1.3.2/V3.CreateAlertPolicyRequest)\n- [1.2.2](/php/docs/reference/cloud-monitoring/1.2.2/V3.CreateAlertPolicyRequest) \nReference documentation and code samples for the Stackdriver Monitoring V3 Client class CreateAlertPolicyRequest.\n\nThe protocol for the `CreateAlertPolicy` request.\n\nGenerated from protobuf message `google.monitoring.v3.CreateAlertPolicyRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Monitoring \\\\ V3\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nRequired. The\n[project](https://cloud.google.com/monitoring/api/v3#project_name) in which\nto create the alerting policy. The format is:\nprojects/\\[PROJECT_ID_OR_NUMBER\\]\nNote that this field names the parent container in which the alerting\npolicy will be written, not the name of the created policy. \\|name\\| must be\na host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will\nreturn. The alerting policy that is returned will have a name that contains\na normalized representation of this name as a prefix but adds a suffix of\nthe form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the\ncontainer.\n\n### setName\n\nRequired. The\n[project](https://cloud.google.com/monitoring/api/v3#project_name) in which\nto create the alerting policy. The format is:\nprojects/\\[PROJECT_ID_OR_NUMBER\\]\nNote that this field names the parent container in which the alerting\npolicy will be written, not the name of the created policy. \\|name\\| must be\na host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will\nreturn. The alerting policy that is returned will have a name that contains\na normalized representation of this name as a prefix but adds a suffix of\nthe form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the\ncontainer.\n\n### getAlertPolicy\n\nRequired. The requested alerting policy. You should omit the `name` field\nin this policy. The name will be returned in the new policy, including a\nnew `[ALERT_POLICY_ID]` value.\n\n### hasAlertPolicy\n\n### clearAlertPolicy\n\n### setAlertPolicy\n\nRequired. The requested alerting policy. You should omit the `name` field\nin this policy. The name will be returned in the new policy, including a\nnew `[ALERT_POLICY_ID]` value.\n\n### static::build"]]