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

Mark num_finite_buckets required for cloud logging metric bucket_options #15680

Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .changelog/8780.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:breaking-change
logging: made `growth_factor`, `num_finite_buckets`, and `scale` required for `google_logging_metric`
```
42 changes: 18 additions & 24 deletions google/services/logging/resource_logging_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,19 @@ the lower bound. Each bucket represents a constant relative uncertainty on a spe
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"growth_factor": {
Type: schema.TypeFloat,
Optional: true,
Description: `Must be greater than 1.`,
AtLeastOneOf: []string{"bucket_options.0.exponential_buckets.0.num_finite_buckets", "bucket_options.0.exponential_buckets.0.growth_factor", "bucket_options.0.exponential_buckets.0.scale"},
Type: schema.TypeFloat,
Required: true,
Description: `Must be greater than 1.`,
},
"num_finite_buckets": {
Type: schema.TypeInt,
Optional: true,
Description: `Must be greater than 0.`,
AtLeastOneOf: []string{"bucket_options.0.exponential_buckets.0.num_finite_buckets", "bucket_options.0.exponential_buckets.0.growth_factor", "bucket_options.0.exponential_buckets.0.scale"},
Type: schema.TypeInt,
Required: true,
Description: `Must be greater than 0.`,
},
"scale": {
Type: schema.TypeFloat,
Optional: true,
Description: `Must be greater than 0.`,
AtLeastOneOf: []string{"bucket_options.0.exponential_buckets.0.num_finite_buckets", "bucket_options.0.exponential_buckets.0.growth_factor", "bucket_options.0.exponential_buckets.0.scale"},
Type: schema.TypeFloat,
Required: true,
Description: `Must be greater than 0.`,
},
},
},
Expand All @@ -135,22 +132,19 @@ Each bucket represents a constant absolute uncertainty on the specific value in
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"num_finite_buckets": {
Type: schema.TypeInt,
Optional: true,
Description: `Must be greater than 0.`,
AtLeastOneOf: []string{"bucket_options.0.linear_buckets.0.num_finite_buckets", "bucket_options.0.linear_buckets.0.width", "bucket_options.0.linear_buckets.0.offset"},
Type: schema.TypeInt,
Required: true,
Description: `Must be greater than 0.`,
},
"offset": {
Type: schema.TypeFloat,
Optional: true,
Description: `Lower bound of the first bucket.`,
AtLeastOneOf: []string{"bucket_options.0.linear_buckets.0.num_finite_buckets", "bucket_options.0.linear_buckets.0.width", "bucket_options.0.linear_buckets.0.offset"},
Type: schema.TypeFloat,
Required: true,
Description: `Lower bound of the first bucket.`,
},
"width": {
Type: schema.TypeFloat,
Optional: true,
Description: `Must be greater than 0.`,
AtLeastOneOf: []string{"bucket_options.0.linear_buckets.0.num_finite_buckets", "bucket_options.0.linear_buckets.0.width", "bucket_options.0.linear_buckets.0.offset"},
Type: schema.TypeFloat,
Required: true,
Description: `Must be greater than 0.`,
},
},
},
Expand Down
12 changes: 6 additions & 6 deletions website/docs/r/logging_metric.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -300,29 +300,29 @@ The following arguments are supported:
<a name="nested_linear_buckets"></a>The `linear_buckets` block supports:

* `num_finite_buckets` -
(Optional)
(Required)
Must be greater than 0.

* `width` -
(Optional)
(Required)
Must be greater than 0.

* `offset` -
(Optional)
(Required)
Lower bound of the first bucket.

<a name="nested_exponential_buckets"></a>The `exponential_buckets` block supports:

* `num_finite_buckets` -
(Optional)
(Required)
Must be greater than 0.

* `growth_factor` -
(Optional)
(Required)
Must be greater than 1.

* `scale` -
(Optional)
(Required)
Must be greater than 0.

<a name="nested_explicit_buckets"></a>The `explicit_buckets` block supports:
Expand Down