Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move AlertPolicy labels to user_labels and make them a map #1685

Merged
merged 4 commits into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions products/monitoring/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,14 @@ objects:
entries in this field is
`projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
name: 'labels'
rileykarson marked this conversation as resolved.
Show resolved Hide resolved
description: 'User-supplied key/value data to be used for organizing AlertPolicy objects.'
item_type: Api::Type::String
- !ruby/object:Api::Type::KeyValuePairs
name: userLabels
description: |
This field is intended to be used for organizing and identifying the AlertPolicy
objects.The field can contain up to 64 entries. Each key and value is limited
to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
can contain only lowercase letters, numerals, underscores, and dashes. Keys
must begin with a letter.
- !ruby/object:Api::Type::NestedObject
name: documentation
description: |
Expand Down
1 change: 1 addition & 0 deletions products/monitoring/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
post_create: templates/terraform/post_create/set_computed_name.erb
extra_schema_entry: templates/terraform/extra_schema_entry/alert_policy.erb
Group: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{name}}"
import_format: ["{{name}}"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ resource "google_monitoring_alert_policy" "<%= ctx[:primary_resource_id] %>" {
}
}
}

user_labels = {
foo = "bar"
}
}
22 changes: 22 additions & 0 deletions templates/terraform/extra_schema_entry/alert_policy.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<%# The license inside this block applies to this file.
# Copyright 2018 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
"labels": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Deprecated: "labels is removed as it was never used. See user_labels for the correct field",
},