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 is_cspm_enabled field in GCP integrations #996

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.4",
"regenerated": "2023-01-27 19:05:30.354710",
"spec_repo_commit": "e546294e"
"regenerated": "2023-02-01 09:26:44.732299",
"spec_repo_commit": "a0ca58a8"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-01-27 19:05:30.367411",
"spec_repo_commit": "e546294e"
"regenerated": "2023-02-01 09:26:44.744151",
"spec_repo_commit": "a0ca58a8"
}
}
}
6 changes: 6 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2838,6 +2838,12 @@ components:
Only hosts that match one of the defined tags are imported into Datadog.'
example: key:value,filter:example
type: string
is_cspm_enabled:
default: false
description: When enabled, Datadog performs configuration checks across
your Google Cloud environment by continuously scanning every resource.
example: true
type: boolean
private_key:
description: Your private key name found in your JSON service account key.
example: private_key
Expand Down
1 change: 1 addition & 0 deletions examples/v1/gcp-integration/CreateGCPIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const params: v1.GCPIntegrationApiCreateGCPIntegrationRequest = {
"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
errors: ["*"],
hostFilters: "key:value,filter:example",
isCspmEnabled: true,
privateKey: "private_key",
privateKeyId: "123456789abcdefghi123456789abcdefghijklm",
projectId: "datadog-apitest",
Expand Down
1 change: 1 addition & 0 deletions examples/v1/gcp-integration/DeleteGCPIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const params: v1.GCPIntegrationApiDeleteGCPIntegrationRequest = {
"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
errors: ["*"],
hostFilters: "key:value,filter:example",
isCspmEnabled: true,
privateKey: "private_key",
privateKeyId: "123456789abcdefghi123456789abcdefghijklm",
projectId: "datadog-apitest",
Expand Down
1 change: 1 addition & 0 deletions examples/v1/gcp-integration/UpdateGCPIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const params: v1.GCPIntegrationApiUpdateGCPIntegrationRequest = {
"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
errors: ["*"],
hostFilters: "key:value,filter:example",
isCspmEnabled: true,
privateKey: "private_key",
privateKeyId: "123456789abcdefghi123456789abcdefghijklm",
projectId: "datadog-apitest",
Expand Down
12 changes: 6 additions & 6 deletions features/v1/gcp_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ Feature: GCP Integration
@generated @skip @team:DataDog/cloud-integrations
Scenario: Create a GCP integration returns "Bad Request" response
Given new "CreateGCPIntegration" request
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
Scenario: Create a GCP integration returns "OK" response
Given new "CreateGCPIntegration" request
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-integrations
Scenario: Delete a GCP integration returns "Bad Request" response
Given new "DeleteGCPIntegration" request
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
Scenario: Delete a GCP integration returns "OK" response
Given new "DeleteGCPIntegration" request
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 200 OK

Expand All @@ -53,13 +53,13 @@ Feature: GCP Integration
@generated @skip @team:DataDog/cloud-integrations
Scenario: Update a GCP integration returns "Bad Request" response
Given new "UpdateGCPIntegration" request
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
Scenario: Update a GCP integration returns "OK" response
Given new "UpdateGCPIntegration" request
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
And body with value {"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": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"}
When the request is sent
Then the response status is 200 OK
8 changes: 8 additions & 0 deletions packages/datadog-api-client-v1/models/GCPAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class GCPAccount {
* Only hosts that match one of the defined tags are imported into Datadog.
*/
"hostFilters"?: string;
/**
* When enabled, Datadog performs configuration checks across your Google Cloud environment by continuously scanning every resource.
*/
"isCspmEnabled"?: boolean;
/**
* Your private key name found in your JSON service account key.
*/
Expand Down Expand Up @@ -106,6 +110,10 @@ export class GCPAccount {
baseName: "host_filters",
type: "string",
},
isCspmEnabled: {
baseName: "is_cspm_enabled",
type: "boolean",
},
privateKey: {
baseName: "private_key",
type: "string",
Expand Down