Skip to content

Commit 4b3e0bb

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix CreateGCPSTSAccount return code and update tests (#1194)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 6f82a2a commit 4b3e0bb

File tree

14 files changed

+414
-29
lines changed

14 files changed

+414
-29
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.4",
7-
"regenerated": "2023-06-15 13:05:00.168325",
8-
"spec_repo_commit": "174763df"
7+
"regenerated": "2023-06-15 13:52:12.792888",
8+
"spec_repo_commit": "cd68c9b8"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-06-15 13:05:00.181487",
13-
"spec_repo_commit": "174763df"
12+
"regenerated": "2023-06-15 13:52:12.810917",
13+
"spec_repo_commit": "cd68c9b8"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17988,7 +17988,7 @@ paths:
1798817988
$ref: '#/components/schemas/GCPSTSServiceAccountCreateRequest'
1798917989
required: true
1799017990
responses:
17991-
'201':
17991+
'200':
1799217992
content:
1799317993
application/json:
1799417994
schema:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2023-06-14T15:44:49.306Z"
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"log": {
3+
"_recordingName": "GCP Integration/Create a new entry for your service account returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "45c047d45f039544e8c931d0d2d72f87",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 143,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 576,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"client_email\":\"[email protected]\",\"host_filters\":[]},\"type\":\"gcp_service_account\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/integration/gcp/accounts"
39+
},
40+
"response": {
41+
"bodySize": 229,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 229,
45+
"text": "{\"data\":{\"type\":\"gcp_service_account\",\"attributes\":{\"automute\":false,\"client_email\":\"[email protected]\",\"host_filters\":[],\"is_cspm_enabled\":false},\"id\":\"c86125c9-ee6d-46ba-997a-23006cfd1575\"}}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 658,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2023-06-14T15:44:49.317Z",
61+
"time": 201
62+
},
63+
{
64+
"_id": "f0b7b4c86a6dc33cb630eaf2b67b1569",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "*/*"
75+
}
76+
],
77+
"headersSize": 549,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v2/integration/gcp/accounts/c86125c9-ee6d-46ba-997a-23006cfd1575"
82+
},
83+
"response": {
84+
"bodySize": 0,
85+
"content": {
86+
"mimeType": "text/html; charset=utf-8",
87+
"size": 0
88+
},
89+
"cookies": [],
90+
"headers": [
91+
{
92+
"name": "content-type",
93+
"value": "text/html; charset=utf-8"
94+
}
95+
],
96+
"headersSize": 645,
97+
"httpVersion": "HTTP/1.1",
98+
"redirectURL": "",
99+
"status": 204,
100+
"statusText": "No Content"
101+
},
102+
"startedDateTime": "2023-06-14T15:44:49.533Z",
103+
"time": 133
104+
}
105+
],
106+
"pages": [],
107+
"version": "1.2"
108+
}
109+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2023-05-18T15:03:23.705Z"
1+
"2023-06-14T15:52:33.117Z"

cassettes/v2/GCP-Integration_2417533655/List-all-GCP-STS-enabled-service-accounts-returns-OK-response_883583427/recording.har

Lines changed: 101 additions & 6 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2023-06-14T16:04:56.302Z"
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"log": {
3+
"_recordingName": "GCP Integration/Update STS Service Account returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "edf64f412ed34016f3f16170b07610f5",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 118,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 578,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"client_email\":\"[email protected]\",\"host_filters\":[]},\"type\":\"gcp_service_account\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/integration/gcp/accounts"
39+
},
40+
"response": {
41+
"bodySize": 204,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 204,
45+
"text": "{\"data\":{\"type\":\"gcp_service_account\",\"attributes\":{\"is_cspm_enabled\":false,\"host_filters\":[],\"automute\":false,\"client_email\":\"[email protected]\"},\"id\":\"fa9bd370-fe91-498b-8d02-a25baecc5a60\"}}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 657,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2023-06-14T16:04:56.313Z",
61+
"time": 202
62+
},
63+
{
64+
"_id": "0901d4b581ea817ba05c3c29f6f38677",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 171,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
},
76+
{
77+
"_fromType": "array",
78+
"name": "content-type",
79+
"value": "application/json"
80+
}
81+
],
82+
"headersSize": 616,
83+
"httpVersion": "HTTP/1.1",
84+
"method": "PATCH",
85+
"postData": {
86+
"mimeType": "application/json",
87+
"params": [],
88+
"text": "{\"data\":{\"attributes\":{\"client_email\":\"[email protected]\",\"host_filters\":[\"foo:bar\"]},\"id\":\"fa9bd370-fe91-498b-8d02-a25baecc5a60\",\"type\":\"gcp_service_account\"}}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v2/integration/gcp/accounts/fa9bd370-fe91-498b-8d02-a25baecc5a60"
92+
},
93+
"response": {
94+
"bodySize": 213,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 213,
98+
"text": "{\"data\":{\"type\":\"gcp_service_account\",\"attributes\":{\"automute\":false,\"client_email\":\"[email protected]\",\"host_filters\":[\"foo:bar\"],\"is_cspm_enabled\":false},\"id\":\"fa9bd370-fe91-498b-8d02-a25baecc5a60\"}}\n"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 657,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 201,
111+
"statusText": "Created"
112+
},
113+
"startedDateTime": "2023-06-14T16:04:56.530Z",
114+
"time": 155
115+
},
116+
{
117+
"_id": "ae59fc4dca790b1e48b19505ec3f3cab",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 0,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "*/*"
128+
}
129+
],
130+
"headersSize": 551,
131+
"httpVersion": "HTTP/1.1",
132+
"method": "DELETE",
133+
"queryString": [],
134+
"url": "https://api.datadoghq.com/api/v2/integration/gcp/accounts/fa9bd370-fe91-498b-8d02-a25baecc5a60"
135+
},
136+
"response": {
137+
"bodySize": 0,
138+
"content": {
139+
"mimeType": "text/html; charset=utf-8",
140+
"size": 0
141+
},
142+
"cookies": [],
143+
"headers": [
144+
{
145+
"name": "content-type",
146+
"value": "text/html; charset=utf-8"
147+
}
148+
],
149+
"headersSize": 644,
150+
"httpVersion": "HTTP/1.1",
151+
"redirectURL": "",
152+
"status": 204,
153+
"statusText": "No Content"
154+
},
155+
"startedDateTime": "2023-06-14T16:04:56.697Z",
156+
"time": 147
157+
}
158+
],
159+
"pages": [],
160+
"version": "1.2"
161+
}
162+
}

examples/v2/gcp-integration/CreateGCPSTSAccount.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const params: v2.GCPIntegrationApiCreateGCPSTSAccountRequest = {
1111
body: {
1212
data: {
1313
attributes: {
14-
clientEmail:
15-
14+
clientEmail: "[email protected]",
1615
hostFilters: [],
1716
},
1817
type: "gcp_service_account",

examples/v2/gcp-integration/UpdateGCPSTSAccount.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@ import { client, v2 } from "@datadog/datadog-api-client";
77
const configuration = client.createConfiguration();
88
const apiInstance = new v2.GCPIntegrationApi(configuration);
99

10+
// there is a valid "gcp_sts_account" in the system
11+
const GCP_STS_ACCOUNT_DATA_ID = process.env.GCP_STS_ACCOUNT_DATA_ID as string;
12+
1013
const params: v2.GCPIntegrationApiUpdateGCPSTSAccountRequest = {
1114
body: {
1215
data: {
1316
attributes: {
14-
clientEmail:
15-
16-
hostFilters: [],
17+
clientEmail: "[email protected]",
18+
hostFilters: ["foo:bar"],
1719
},
18-
id: "d291291f-12c2-22g4-j290-123456678897",
20+
id: GCP_STS_ACCOUNT_DATA_ID,
1921
type: "gcp_service_account",
2022
},
2123
},
22-
accountId: "account_id",
24+
accountId: GCP_STS_ACCOUNT_DATA_ID,
2325
};
2426

2527
apiInstance

0 commit comments

Comments
 (0)