Skip to content

Commit

Permalink
Added Subject Field to Alert Policy Monitoring Resource (GoogleCloudP…
Browse files Browse the repository at this point in the history
…latform#9360)

* Added Alert Policy resource field for subject line.

* Added test for Alert Policy field.

* Included subject in one_of lists.

* Included subject in one_of lists.
  • Loading branch information
haustenirving authored and jialei-chen committed Nov 29, 2023
1 parent 8e4d2de commit 8d80bdb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mmv1/products/monitoring/AlertPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ properties:
at_least_one_of:
- documentation.0.content
- documentation.0.mime_type
- documentation.0.subject
description: |
The text of the documentation, interpreted according to mimeType.
The content may not exceed 8,192 Unicode characters and may not
Expand All @@ -981,7 +982,19 @@ properties:
at_least_one_of:
- documentation.0.content
- documentation.0.mime_type
- documentation.0.subject
default_value: text/markdown
description: |
The format of the content field. Presently, only the value
"text/markdown" is supported.
- !ruby/object:Api::Type::String
name: subject
at_least_one_of:
- documentation.0.content
- documentation.0.mime_type
- documentation.0.subject
description: |
The subject line of the notification. The subject line may not
exceed 10,240 bytes. In notifications generated by this policy the contents
of the subject line after variable expansion will be truncated to 255 bytes
or shorter at the latest UTF-8 character boundary.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ resource "google_monitoring_alert_policy" "full" {
documentation {
content = "test content"
mime_type = "text/markdown"
subject = "test subject"
}
}
`, alertName, conditionName1, conditionName2)
Expand Down Expand Up @@ -350,6 +351,7 @@ resource "google_monitoring_alert_policy" "mql" {
documentation {
content = "test content"
mime_type = "text/markdown"
subject = "test subject"
}
}
`, alertName, conditionName)
Expand Down Expand Up @@ -383,6 +385,7 @@ resource "google_monitoring_alert_policy" "log" {
documentation {
content = "test content"
mime_type = "text/markdown"
subject = "test subject"
}
}
`, alertName, conditionName)
Expand Down Expand Up @@ -441,6 +444,7 @@ resource "google_monitoring_alert_policy" "promql" {
documentation {
content = "test content"
mime_type = "text/markdown"
subject = "test subject"
}
}
`, alertName, conditionName)
Expand Down

0 comments on commit 8d80bdb

Please sign in to comment.