Skip to content

Commit 8067b72

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 205a1084 of spec repo
1 parent b6a9209 commit 8067b72

File tree

6 files changed

+73
-10
lines changed

6 files changed

+73
-10
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": "2023-09-21 17:08:30.788788",
8-
"spec_repo_commit": "bcba1c72"
7+
"regenerated": "2023-09-21 19:19:19.755619",
8+
"spec_repo_commit": "205a1084"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-09-21 17:08:30.805515",
13-
"spec_repo_commit": "bcba1c72"
12+
"regenerated": "2023-09-21 19:19:19.769231",
13+
"spec_repo_commit": "205a1084"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5388,6 +5388,13 @@ components:
53885388
GCPSTSServiceAccountAttributes:
53895389
description: Attributes associated with your service account.
53905390
properties:
5391+
account_tags:
5392+
description: Tags to be associated with GCP resources and metrics from your
5393+
account
5394+
items:
5395+
description: Account Level Tag
5396+
type: string
5397+
type: array
53915398
automute:
53925399
description: Silence monitors for expected GCE instance shutdowns.
53935400
type: boolean

examples/v2/gcp-integration/CreateGCPSTSAccount.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const params: v2.GCPIntegrationApiCreateGCPSTSAccountRequest = {
1111
body: {
1212
data: {
1313
attributes: {
14+
accountTags: [],
1415
clientEmail: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
1516
hostFilters: [],
1617
},
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Create a new entry for your service account with account_tags returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.GCPIntegrationApi(configuration);
9+
10+
const params: v2.GCPIntegrationApiCreateGCPSTSAccountRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
accountTags: ["lorem", "ipsum"],
15+
clientEmail: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
16+
hostFilters: [],
17+
},
18+
type: "gcp_service_account",
19+
},
20+
},
21+
};
22+
23+
apiInstance
24+
.createGCPSTSAccount(params)
25+
.then((data: v2.GCPSTSServiceAccountResponse) => {
26+
console.log(
27+
"API called successfully. Returned data: " + JSON.stringify(data)
28+
);
29+
})
30+
.catch((error: any) => console.error(error));

features/v2/gcp_integration.feature

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,43 @@ 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": {"client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
37+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "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": {"client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
44+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
4545
When the request is sent
4646
Then the response status is 409 Conflict
4747

48-
@skip-validation @team:DataDog/gcp-integrations
48+
@team:DataDog/gcp-integrations
4949
Scenario: Create a new entry for your service account returns "OK" response
5050
Given new "CreateGCPSTSAccount" request
51-
And body with value {"data": {"attributes": {"client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
51+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
5252
When the request is sent
5353
Then the response status is 201 OK
5454
And the response "data.type" is equal to "gcp_service_account"
5555
And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com"
5656

57+
@skip @team:DataDog/gcp-integrations
58+
Scenario: Create a new entry for your service account with account_tags returns "OK" response
59+
Given new "CreateGCPSTSAccount" request
60+
And body with value {"data": {"attributes": {"account_tags": ["lorem", "ipsum"], "client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
61+
When the request is sent
62+
Then the response status is 201 OK
63+
And the response "data.type" is equal to "gcp_service_account"
64+
And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com"
65+
And the response "data.attributes.account_tags" is equal to ["lorem", "ipsum"]
66+
67+
@team:DataDog/gcp-integrations
68+
Scenario: Create a new entry for your service account with bad account_tags returns "Bad Request" response
69+
Given new "CreateGCPSTSAccount" request
70+
And body with value {"data": {"attributes": {"account_tags": "BAD", "client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}}
71+
When the request is sent
72+
Then the response status is 400 Bad Request
73+
5774
@generated @skip @team:DataDog/gcp-integrations
5875
Scenario: Delete an STS enabled GCP Account returns "Bad Request" response
5976
Given new "DeleteGCPSTSAccount" request
@@ -93,15 +110,15 @@ Feature: GCP Integration
93110
Scenario: Update STS Service Account returns "Bad Request" response
94111
Given new "UpdateGCPSTSAccount" request
95112
And request contains "account_id" parameter from "REPLACE.ME"
96-
And body with value {"data": {"attributes": {"client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
113+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
97114
When the request is sent
98115
Then the response status is 400 Bad Request
99116

100117
@generated @skip @team:DataDog/gcp-integrations
101118
Scenario: Update STS Service Account returns "Not Found" response
102119
Given new "UpdateGCPSTSAccount" request
103120
And request contains "account_id" parameter from "REPLACE.ME"
104-
And body with value {"data": {"attributes": {"client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
121+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": []}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
105122
When the request is sent
106123
Then the response status is 404 Not Found
107124

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1010
* Attributes associated with your service account.
1111
*/
1212
export class GCPSTSServiceAccountAttributes {
13+
/**
14+
* Tags to be associated with GCP resources and metrics from your account
15+
*/
16+
"accountTags"?: Array<string>;
1317
/**
1418
* Silence monitors for expected GCE instance shutdowns.
1519
*/
@@ -36,6 +40,10 @@ export class GCPSTSServiceAccountAttributes {
3640
* @ignore
3741
*/
3842
static readonly attributeTypeMap: AttributeTypeMap = {
43+
accountTags: {
44+
baseName: "account_tags",
45+
type: "Array<string>",
46+
},
3947
automute: {
4048
baseName: "automute",
4149
type: "boolean",

0 commit comments

Comments
 (0)