-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metric_namespace_configs to GCP v2 API (#1894)
Co-authored-by: ci.datadog-api-spec <[email protected]>
- Loading branch information
1 parent
3a1bfd5
commit 506dc62
Showing
7 changed files
with
102 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,14 +34,14 @@ Feature: GCP Integration | |
@generated @skip @team:DataDog/gcp-integrations | ||
Scenario: Create a new entry for your service account returns "Bad Request" response | ||
Given new "CreateGCPSTSAccount" request | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "type": "gcp_service_account"}} | ||
When the request is sent | ||
Then the response status is 400 Bad Request | ||
|
||
@generated @skip @team:DataDog/gcp-integrations | ||
Scenario: Create a new entry for your service account returns "Conflict" response | ||
Given new "CreateGCPSTSAccount" request | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "type": "gcp_service_account"}} | ||
When the request is sent | ||
Then the response status is 409 Conflict | ||
|
||
|
@@ -151,15 +151,15 @@ Feature: GCP Integration | |
Scenario: Update STS Service Account returns "Bad Request" response | ||
Given new "UpdateGCPSTSAccount" request | ||
And request contains "account_id" parameter from "REPLACE.ME" | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} | ||
When the request is sent | ||
Then the response status is 400 Bad Request | ||
|
||
@generated @skip @team:DataDog/gcp-integrations | ||
Scenario: Update STS Service Account returns "Not Found" response | ||
Given new "UpdateGCPSTSAccount" request | ||
And request contains "account_id" parameter from "REPLACE.ME" | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} | ||
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} | ||
When the request is sent | ||
Then the response status is 404 Not Found | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
packages/datadog-api-client-v2/models/GCPMetricNamespaceConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2020-Present Datadog, Inc. | ||
*/ | ||
|
||
import { AttributeTypeMap } from "../../datadog-api-client-common/util"; | ||
|
||
/** | ||
* Configuration for a GCP metric namespace. | ||
*/ | ||
export class GCPMetricNamespaceConfig { | ||
/** | ||
* When disabled, Datadog does not collect metrics that are related to this GCP metric namespace. | ||
*/ | ||
"disabled"?: boolean; | ||
/** | ||
* The id of the GCP metric namespace. | ||
*/ | ||
"id"?: string; | ||
|
||
/** | ||
* A container for additional, undeclared properties. | ||
* This is a holder for any undeclared properties as specified with | ||
* the 'additionalProperties' keyword in the OAS document. | ||
*/ | ||
"additionalProperties"?: { [key: string]: any }; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
"_unparsed"?: boolean; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
static readonly attributeTypeMap: AttributeTypeMap = { | ||
disabled: { | ||
baseName: "disabled", | ||
type: "boolean", | ||
}, | ||
id: { | ||
baseName: "id", | ||
type: "string", | ||
}, | ||
additionalProperties: { | ||
baseName: "additionalProperties", | ||
type: "any", | ||
}, | ||
}; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
static getAttributeTypeMap(): AttributeTypeMap { | ||
return GCPMetricNamespaceConfig.attributeTypeMap; | ||
} | ||
|
||
public constructor() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters