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

support force delete consumer quota override #5753

Merged
merged 1 commit into from
Mar 2, 2022
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
4 changes: 2 additions & 2 deletions mmv1/products/serviceusage/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ objects:
create_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/adminOverrides/{{name}}?force={{force}}
update_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/adminOverrides/{{name}}
update_verb: :PATCH
delete_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/adminOverrides/{{name}}
delete_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/adminOverrides/{{name}}?force={{force}}
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Getting Started': 'https://cloud.google.com/service-usage/docs/manage-quota#create_consumer_quota_override'
Expand Down Expand Up @@ -123,7 +123,7 @@ objects:
create_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}?force={{force}}
update_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}?force={{force}}
update_verb: :PATCH
delete_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}
delete_url: projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}?force={{force}}
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Getting Started': 'https://cloud.google.com/service-usage/docs/getting-started'
Expand Down
8 changes: 8 additions & 0 deletions mmv1/products/serviceusage/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ overrides: !ruby/object:Overrides::ResourceOverrides
project_id: "quota"
test_env_vars:
org_id: :ORG_ID
- !ruby/object:Provider::Terraform::Examples
name: "consumer_quota_override_custom_dimension"
primary_resource_id: "override"
min_version: 'beta'
vars:
project_id: "quota"
test_env_vars:
org_id: :ORG_ID
id_format: "projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}"
import_format: [ "services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}", "projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}" ]
skip_sweeper: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resource "google_project" "my_project" {
provider = google-beta
name = "tf-test-project"
project_id = "<%= ctx[:vars]['project_id'] %>"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
}

resource "google_service_usage_consumer_quota_override" "override" {
provider = google-beta
project = google_project.my_project.project_id
service = "libraryagent.googleapis.com"
metric = urlencode("libraryagent.googleapis.com/borrows")
limit = urlencode("/author/project")
override_value = "1"
force = true
dimensions = {
author = "larry"
}
}