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

Add cloud run filter to GCP v1 and v2 spec #1705

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-15 17:39:50.157283",
"spec_repo_commit": "45fd84e5"
"regenerated": "2024-02-16 18:02:54.553421",
"spec_repo_commit": "dc02d0d0"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-15 17:39:50.172445",
"spec_repo_commit": "45fd84e5"
"regenerated": "2024-02-16 18:02:54.571669",
"spec_repo_commit": "dc02d0d0"
}
}
}
12 changes: 12 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3207,6 +3207,18 @@ components:
key.'
example: https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
type: string
cloud_run_revision_filters:
description: 'Limit the Cloud Run revisions that are pulled into Datadog
by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
type: string
type: array
errors:
description: An array of errors.
example:
Expand Down
12 changes: 12 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7388,6 +7388,18 @@ components:
description: Your service account email address.
example: [email protected]
type: string
cloud_run_revision_filters:
description: 'List of filters to limit the Cloud Run revisions that are
pulled into Datadog by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
type: string
type: array
host_filters:
description: Your Host Filters.
items:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-12-20T13:18:07.717Z
2024-01-31T21:16:03.254Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-01-31T21:16:03.829Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-01-31T21:16:04.924Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-01-31T21:16:05.705Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/v1/gcp-integration/CreateGCPIntegration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
client_id: "163662907116366290710",
client_x509_cert_url: "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
host_filters: "key:value,filter:example",
cloud_run_revision_filters: [
"dr:dre",
],
is_cspm_enabled: true,
is_security_command_center_enabled: true,
private_key: "private_key",
Expand Down
25 changes: 25 additions & 0 deletions examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Update a GCP integration cloud run revision filters returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::GCPIntegrationAPI.new

body = DatadogAPIClient::V1::GCPAccount.new({
auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
auth_uri: "https://accounts.google.com/o/oauth2/auth",
client_email: "[email protected]",
client_id: "163662907116366290710",
client_x509_cert_url: "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
host_filters: "key:value,filter:example",
cloud_run_revision_filters: [
"merp:derp",
],
is_cspm_enabled: true,
is_security_command_center_enabled: true,
private_key: "private_key",
private_key_id: "123456789abcdefghi123456789abcdefghijklm",
project_id: "datadog-apitest",
resource_collection_enabled: true,
token_uri: "https://accounts.google.com/o/oauth2/token",
type: "service_account",
})
p api_instance.update_gcp_integration(body)
18 changes: 18 additions & 0 deletions examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Create a new entry for your service account with cloud run revision filters enabled returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::GCPIntegrationAPI.new

body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
data: DatadogAPIClient::V2::GCPSTSServiceAccountData.new({
attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
cloud_run_revision_filters: [
"meh:bleh",
],
client_email: "[email protected]",
host_filters: [],
}),
type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
}),
})
p api_instance.create_gcpsts_account(body)
21 changes: 21 additions & 0 deletions examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Update STS Service Account returns "OK" response with cloud run revision filters

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::GCPIntegrationAPI.new

# there is a valid "gcp_sts_account" in the system
GCP_STS_ACCOUNT_DATA_ID = ENV["GCP_STS_ACCOUNT_DATA_ID"]

body = DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequest.new({
data: DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequestData.new({
attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
client_email: "[email protected]",
cloud_run_revision_filters: [
"merp:derp",
],
}),
id: GCP_STS_ACCOUNT_DATA_ID,
type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
}),
})
p api_instance.update_gcpsts_account(GCP_STS_ACCOUNT_DATA_ID, body)
Loading
Loading