(::Google::Cloud::Monitoring::V3::AlertPolicy) — Required. The requested alerting policy. You should omit the name field
in this policy. The name will be returned in the new policy, including a
new [ALERT_POLICY_ID] value.
value (::Google::Cloud::Monitoring::V3::AlertPolicy) — Required. The requested alerting policy. You should omit the name field
in this policy. The name will be returned in the new policy, including a
new [ALERT_POLICY_ID] value.
Returns
(::Google::Cloud::Monitoring::V3::AlertPolicy) — Required. The requested alerting policy. You should omit the name field
in this policy. The name will be returned in the new policy, including a
new [ALERT_POLICY_ID] value.
#name
defname()->::String
Returns
(::String) — Required. The
project in 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.
#name=
defname=(value)->::String
Parameter
value (::String) — Required. The
project in 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
(::String) — Required. The
project in 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.
[[["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,["# Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest (v1.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.6.1 (latest)](/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [1.6.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.6.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [1.5.1](/ruby/docs/reference/google-cloud-monitoring-v3/1.5.1/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [1.4.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.4.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [1.3.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.3.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [1.2.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.2.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [1.1.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.1.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [1.0.1](/ruby/docs/reference/google-cloud-monitoring-v3/1.0.1/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.18.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.18.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.17.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.17.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.16.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.16.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.15.2](/ruby/docs/reference/google-cloud-monitoring-v3/0.15.2/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.14.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.14.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.13.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.13.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.12.1](/ruby/docs/reference/google-cloud-monitoring-v3/0.12.1/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.11.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.11.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.10.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.10.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.9.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.9.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.8.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.8.0/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest)\n- [0.7.1](/ruby/docs/reference/google-cloud-monitoring-v3/0.7.1/Google-Cloud-Monitoring-V3-CreateAlertPolicyRequest) \nReference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest.\n\nThe protocol for the `CreateAlertPolicy` request. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #alert_policy\n\n def alert_policy() -\u003e ::Google::Cloud::Monitoring::V3::AlertPolicy\n\n**Returns**\n\n- ([::Google::Cloud::Monitoring::V3::AlertPolicy](./Google-Cloud-Monitoring-V3-AlertPolicy)) --- Required. The requested alerting policy. You should omit the `name` field in this policy. The name will be returned in the new policy, including a new `[ALERT_POLICY_ID]` value.\n\n### #alert_policy=\n\n def alert_policy=(value) -\u003e ::Google::Cloud::Monitoring::V3::AlertPolicy\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Monitoring::V3::AlertPolicy](./Google-Cloud-Monitoring-V3-AlertPolicy)) --- Required. The requested alerting policy. You should omit the `name` field in this policy. The name will be returned in the new policy, including a new `[ALERT_POLICY_ID]` value. \n**Returns**\n\n- ([::Google::Cloud::Monitoring::V3::AlertPolicy](./Google-Cloud-Monitoring-V3-AlertPolicy)) --- Required. The requested alerting policy. You should omit the `name` field in this policy. The name will be returned in the new policy, including a new `[ALERT_POLICY_ID]` value.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which to create the alerting policy. The format is:\n\n\n projects/[PROJECT_ID_OR_NUMBER]\n\n Note that this field names the parent container in which the alerting\n policy will be written, not the name of the created policy. \\|name\\| must be\n a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will\n return. The alerting policy that is returned will have a name that contains\n a normalized representation of this name as a prefix but adds a suffix of\n the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the\n container.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which to create the alerting policy. The format is:\n\n\n projects/[PROJECT_ID_OR_NUMBER]\n\n Note that this field names the parent container in which the alerting\n policy will be written, not the name of the created policy. \\|name\\| must be\n a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will\n return. The alerting policy that is returned will have a name that contains\n a normalized representation of this name as a prefix but adds a suffix of\n the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the\ncontainer. \n**Returns**\n\n- (::String) --- Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which to create the alerting policy. The format is:\n\n\n projects/[PROJECT_ID_OR_NUMBER]\n\n Note that this field names the parent container in which the alerting\n policy will be written, not the name of the created policy. \\|name\\| must be\n a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will\n return. The alerting policy that is returned will have a name that contains\n a normalized representation of this name as a prefix but adds a suffix of\n the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the\n container."]]