Skip to content

Commit 506dc62

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add metric_namespace_configs to GCP v2 API (#1894)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 3a1bfd5 commit 506dc62

File tree

7 files changed

+102
-8
lines changed

7 files changed

+102
-8
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-11-05 21:07:10.843952",
8-
"spec_repo_commit": "6c0fa1b6"
7+
"regenerated": "2024-11-05 22:28:18.403817",
8+
"spec_repo_commit": "2db17c21"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-11-05 21:07:10.862374",
13-
"spec_repo_commit": "6c0fa1b6"
12+
"regenerated": "2024-11-05 22:28:18.425193",
13+
"spec_repo_commit": "2db17c21"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9623,6 +9623,20 @@ components:
96239623
nullable: true
96249624
type: array
96259625
type: object
9626+
GCPMetricNamespaceConfig:
9627+
description: Configuration for a GCP metric namespace.
9628+
properties:
9629+
disabled:
9630+
default: false
9631+
description: When disabled, Datadog does not collect metrics that are related
9632+
to this GCP metric namespace.
9633+
example: true
9634+
type: boolean
9635+
id:
9636+
description: The id of the GCP metric namespace.
9637+
example: aiplatform
9638+
type: string
9639+
type: object
96269640
GCPSTSDelegateAccount:
96279641
description: Datadog principal service account info.
96289642
properties:
@@ -9725,6 +9739,14 @@ components:
97259739
account.'
97269740
example: true
97279741
type: boolean
9742+
metric_namespace_configs:
9743+
description: Configurations for GCP metric namespaces.
9744+
example:
9745+
- disabled: true
9746+
id: aiplatform
9747+
items:
9748+
$ref: '#/components/schemas/GCPMetricNamespaceConfig'
9749+
type: array
97289750
resource_collection_enabled:
97299751
description: When enabled, Datadog scans for all resources in your GCP environment.
97309752
type: boolean

features/v2/gcp_integration.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ Feature: GCP Integration
3434
@generated @skip @team:DataDog/gcp-integrations
3535
Scenario: Create a new entry for your service account returns "Bad Request" response
3636
Given new "CreateGCPSTSAccount" request
37-
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"}}
37+
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"}}
3838
When the request is sent
3939
Then the response status is 400 Bad Request
4040

4141
@generated @skip @team:DataDog/gcp-integrations
4242
Scenario: Create a new entry for your service account returns "Conflict" response
4343
Given new "CreateGCPSTSAccount" request
44-
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"}}
44+
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"}}
4545
When the request is sent
4646
Then the response status is 409 Conflict
4747

@@ -151,15 +151,15 @@ Feature: GCP Integration
151151
Scenario: Update STS Service Account returns "Bad Request" response
152152
Given new "UpdateGCPSTSAccount" request
153153
And request contains "account_id" parameter from "REPLACE.ME"
154-
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"}}
154+
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"}}
155155
When the request is sent
156156
Then the response status is 400 Bad Request
157157

158158
@generated @skip @team:DataDog/gcp-integrations
159159
Scenario: Update STS Service Account returns "Not Found" response
160160
Given new "UpdateGCPSTSAccount" request
161161
And request contains "account_id" parameter from "REPLACE.ME"
162-
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"}}
162+
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"}}
163163
When the request is sent
164164
Then the response status is 404 Not Found
165165

packages/datadog-api-client-v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,7 @@ export { FullAPIKey } from "./models/FullAPIKey";
11101110
export { FullAPIKeyAttributes } from "./models/FullAPIKeyAttributes";
11111111
export { FullApplicationKey } from "./models/FullApplicationKey";
11121112
export { FullApplicationKeyAttributes } from "./models/FullApplicationKeyAttributes";
1113+
export { GCPMetricNamespaceConfig } from "./models/GCPMetricNamespaceConfig";
11131114
export { GCPServiceAccountMeta } from "./models/GCPServiceAccountMeta";
11141115
export { GCPServiceAccountType } from "./models/GCPServiceAccountType";
11151116
export { GCPSTSDelegateAccount } from "./models/GCPSTSDelegateAccount";
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* Configuration for a GCP metric namespace.
11+
*/
12+
export class GCPMetricNamespaceConfig {
13+
/**
14+
* When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.
15+
*/
16+
"disabled"?: boolean;
17+
/**
18+
* The id of the GCP metric namespace.
19+
*/
20+
"id"?: string;
21+
22+
/**
23+
* A container for additional, undeclared properties.
24+
* This is a holder for any undeclared properties as specified with
25+
* the 'additionalProperties' keyword in the OAS document.
26+
*/
27+
"additionalProperties"?: { [key: string]: any };
28+
29+
/**
30+
* @ignore
31+
*/
32+
"_unparsed"?: boolean;
33+
34+
/**
35+
* @ignore
36+
*/
37+
static readonly attributeTypeMap: AttributeTypeMap = {
38+
disabled: {
39+
baseName: "disabled",
40+
type: "boolean",
41+
},
42+
id: {
43+
baseName: "id",
44+
type: "string",
45+
},
46+
additionalProperties: {
47+
baseName: "additionalProperties",
48+
type: "any",
49+
},
50+
};
51+
52+
/**
53+
* @ignore
54+
*/
55+
static getAttributeTypeMap(): AttributeTypeMap {
56+
return GCPMetricNamespaceConfig.attributeTypeMap;
57+
}
58+
59+
public constructor() {}
60+
}

packages/datadog-api-client-v2/models/GCPSTSServiceAccountAttributes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* This product includes software developed at Datadog (https://www.datadoghq.com/).
44
* Copyright 2020-Present Datadog, Inc.
55
*/
6+
import { GCPMetricNamespaceConfig } from "./GCPMetricNamespaceConfig";
67

78
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
89

@@ -43,6 +44,10 @@ export class GCPSTSServiceAccountAttributes {
4344
* When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.
4445
*/
4546
"isSecurityCommandCenterEnabled"?: boolean;
47+
/**
48+
* Configurations for GCP metric namespaces.
49+
*/
50+
"metricNamespaceConfigs"?: Array<GCPMetricNamespaceConfig>;
4651
/**
4752
* When enabled, Datadog scans for all resources in your GCP environment.
4853
*/
@@ -96,6 +101,10 @@ export class GCPSTSServiceAccountAttributes {
96101
baseName: "is_security_command_center_enabled",
97102
type: "boolean",
98103
},
104+
metricNamespaceConfigs: {
105+
baseName: "metric_namespace_configs",
106+
type: "Array<GCPMetricNamespaceConfig>",
107+
},
99108
resourceCollectionEnabled: {
100109
baseName: "resource_collection_enabled",
101110
type: "boolean",

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ import { FullAPIKey } from "./FullAPIKey";
423423
import { FullAPIKeyAttributes } from "./FullAPIKeyAttributes";
424424
import { FullApplicationKey } from "./FullApplicationKey";
425425
import { FullApplicationKeyAttributes } from "./FullApplicationKeyAttributes";
426+
import { GCPMetricNamespaceConfig } from "./GCPMetricNamespaceConfig";
426427
import { GCPSTSDelegateAccount } from "./GCPSTSDelegateAccount";
427428
import { GCPSTSDelegateAccountAttributes } from "./GCPSTSDelegateAccountAttributes";
428429
import { GCPSTSDelegateAccountResponse } from "./GCPSTSDelegateAccountResponse";
@@ -2429,6 +2430,7 @@ const typeMap: { [index: string]: any } = {
24292430
FullAPIKeyAttributes: FullAPIKeyAttributes,
24302431
FullApplicationKey: FullApplicationKey,
24312432
FullApplicationKeyAttributes: FullApplicationKeyAttributes,
2433+
GCPMetricNamespaceConfig: GCPMetricNamespaceConfig,
24322434
GCPSTSDelegateAccount: GCPSTSDelegateAccount,
24332435
GCPSTSDelegateAccountAttributes: GCPSTSDelegateAccountAttributes,
24342436
GCPSTSDelegateAccountResponse: GCPSTSDelegateAccountResponse,

0 commit comments

Comments
 (0)