Skip to content

Commit ddeb90e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3460759 of spec repo
1 parent b323d97 commit ddeb90e

30 files changed

Lines changed: 2178 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 437 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Assign or un-assign Jira issues to security findings returns "Accepted" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.assignIntegrationIssues"] = true;
9+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
10+
11+
const params: v2.SecurityMonitoringApiAssignIntegrationIssuesRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
action: "assign",
16+
assignment: {
17+
jira: {
18+
"https://jira.example.com/browse/SEC-123": [
19+
"MDBjMzdhYzgyNGZkZGJiZmY0OGNmYjNiMWQ2ODY0YmR-OTc0YjMzNjM1Y2UyODA2YTEyNWQxYmNkZjhmODllNzg=",
20+
],
21+
},
22+
},
23+
type: "findings",
24+
},
25+
id: "some_id",
26+
type: "issue_assignment",
27+
},
28+
},
29+
};
30+
31+
apiInstance
32+
.assignIntegrationIssues(params)
33+
.then((data: any) => {
34+
console.log(
35+
"API called successfully. Returned data: " + JSON.stringify(data)
36+
);
37+
})
38+
.catch((error: any) => console.error(error));
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* Create Jira issues for security findings returns "Accepted" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createJiraIssue"] = true;
9+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
10+
11+
const params: v2.SecurityMonitoringApiCreateJiraIssueRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
accountId: "f7ccdf99-0e22-4378-bdf9-03fde5379fea",
16+
fields: undefined,
17+
issueType: "story",
18+
issuetypeId: "1235",
19+
mode: "single",
20+
projectId: "1234",
21+
projectKey: "SEC",
22+
},
23+
id: "ID",
24+
meta: {
25+
findings: [
26+
{
27+
description: "Description",
28+
ids: [
29+
{
30+
discovered: 123213123,
31+
id: "afa-afa-hze",
32+
resource: "Resource",
33+
tags: "akjasd:asdsad",
34+
},
35+
],
36+
impacted: 1,
37+
references: "",
38+
remediation: "Remediation",
39+
severity: "critical",
40+
title: "Title",
41+
type: "ciem",
42+
},
43+
],
44+
vulnerabilities: [
45+
{
46+
description: "Description",
47+
ids: [
48+
{
49+
discovered: 123213123,
50+
id: "afa-afa-hze",
51+
resource: "Resource",
52+
tags: "akjasd:asdsad",
53+
},
54+
],
55+
impacted: 1,
56+
references: "",
57+
remediation: "Remediation",
58+
severity: "critical",
59+
title: "Title",
60+
type: "ciem",
61+
},
62+
],
63+
},
64+
type: "jira_issue",
65+
},
66+
},
67+
};
68+
69+
apiInstance
70+
.createJiraIssue(params)
71+
.then((data: any) => {
72+
console.log(
73+
"API called successfully. Returned data: " + JSON.stringify(data)
74+
);
75+
})
76+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get Jira issue metadata returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getJiraIssueMetadata"] = true;
9+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
10+
11+
const params: v2.SecurityMonitoringApiGetJiraIssueMetadataRequest = {
12+
url: "url",
13+
};
14+
15+
apiInstance
16+
.getJiraIssueMetadata(params)
17+
.then((data: v2.JiraIssuesMetadataResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3861,6 +3861,20 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
38613861
},
38623862
"operationResponseType": "DeleteCustomFrameworkResponse",
38633863
},
3864+
"v2.AssignIntegrationIssues": {
3865+
"body": {
3866+
"type": "IntegrationAssignmentRequest",
3867+
"format": "",
3868+
},
3869+
"operationResponseType": "{}",
3870+
},
3871+
"v2.CreateJiraIssue": {
3872+
"body": {
3873+
"type": "JiraIssueRequest",
3874+
"format": "",
3875+
},
3876+
"operationResponseType": "{}",
3877+
},
38643878
"v2.GetResourceEvaluationFilters": {
38653879
"cloudProvider": {
38663880
"type": "string",
@@ -4022,6 +4036,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
40224036
},
40234037
"operationResponseType": "FindingCaseResponse",
40244038
},
4039+
"v2.GetJiraIssueMetadata": {
4040+
"url": {
4041+
"type": "string",
4042+
"format": "",
4043+
},
4044+
"operationResponseType": "JiraIssuesMetadataResponse",
4045+
},
40254046
"v2.SearchSecurityFindings": {
40264047
"body": {
40274048
"type": "SecurityFindingsSearchRequest",

features/v2/security_monitoring.feature

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,30 @@ Feature: Security Monitoring
2525
When the request is sent
2626
Then the response status is 404 Not Found
2727

28+
@generated @skip @team:DataDog/k9-investigation
29+
Scenario: Assign or un-assign Jira issues to security findings returns "Accepted" response
30+
Given operation "AssignIntegrationIssues" enabled
31+
And new "AssignIntegrationIssues" request
32+
And body with value {"data": {"attributes": {"action": "assign", "assignment": {"jira": {"https://jira.example.com/browse/SEC-123": ["MDBjMzdhYzgyNGZkZGJiZmY0OGNmYjNiMWQ2ODY0YmR-OTc0YjMzNjM1Y2UyODA2YTEyNWQxYmNkZjhmODllNzg="]}}, "type": "findings"}, "id": "some_id", "type": "issue_assignment"}}
33+
When the request is sent
34+
Then the response status is 202 Accepted
35+
36+
@generated @skip @team:DataDog/k9-investigation
37+
Scenario: Assign or un-assign Jira issues to security findings returns "Bad Request" response
38+
Given operation "AssignIntegrationIssues" enabled
39+
And new "AssignIntegrationIssues" request
40+
And body with value {"data": {"attributes": {"action": "assign", "assignment": {"jira": {"https://jira.example.com/browse/SEC-123": ["MDBjMzdhYzgyNGZkZGJiZmY0OGNmYjNiMWQ2ODY0YmR-OTc0YjMzNjM1Y2UyODA2YTEyNWQxYmNkZjhmODllNzg="]}}, "type": "findings"}, "id": "some_id", "type": "issue_assignment"}}
41+
When the request is sent
42+
Then the response status is 400 Bad Request
43+
44+
@generated @skip @team:DataDog/k9-investigation
45+
Scenario: Assign or un-assign Jira issues to security findings returns "Not Found" response
46+
Given operation "AssignIntegrationIssues" enabled
47+
And new "AssignIntegrationIssues" request
48+
And body with value {"data": {"attributes": {"action": "assign", "assignment": {"jira": {"https://jira.example.com/browse/SEC-123": ["MDBjMzdhYzgyNGZkZGJiZmY0OGNmYjNiMWQ2ODY0YmR-OTc0YjMzNjM1Y2UyODA2YTEyNWQxYmNkZjhmODllNzg="]}}, "type": "findings"}, "id": "some_id", "type": "issue_assignment"}}
49+
When the request is sent
50+
Then the response status is 404 Not Found
51+
2852
@team:DataDog/k9-investigation
2953
Scenario: Attach security finding to a Jira issue returns "OK" response
3054
Given new "AttachJiraIssue" request
@@ -330,6 +354,14 @@ Feature: Security Monitoring
330354
And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING"
331355
And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED"
332356

357+
@generated @skip @team:DataDog/k9-investigation
358+
Scenario: Create Jira issues for security findings returns "Accepted" response
359+
Given operation "CreateJiraIssue" enabled
360+
And new "CreateJiraIssue" request
361+
And body with value {"data": {"attributes": {"account_id": "f7ccdf99-0e22-4378-bdf9-03fde5379fea", "fields": null, "issue_type": "story", "issuetype_id": "1235", "mode": "single", "project_id": "1234", "project_key": "SEC"}, "id": "ID", "meta": {"findings": [{"description": "Description", "ids": [{"discovered": 123213123, "id": "afa-afa-hze", "resource": "Resource", "tags": "akjasd:asdsad"}], "impacted": 1, "references": "", "remediation": "Remediation", "severity": "critical", "title": "Title", "type": "ciem"}], "vulnerabilities": [{"description": "Description", "ids": [{"discovered": 123213123, "id": "afa-afa-hze", "resource": "Resource", "tags": "akjasd:asdsad"}], "impacted": 1, "references": "", "remediation": "Remediation", "severity": "critical", "title": "Title", "type": "ciem"}]}, "type": "jira_issue"}}
362+
When the request is sent
363+
Then the response status is 202 Accepted
364+
333365
@team:DataDog/k9-investigation
334366
Scenario: Create Jira issues for security findings returns "Bad Request" response
335367
Given new "CreateJiraIssues" request
@@ -887,6 +919,30 @@ Feature: Security Monitoring
887919
When the request is sent
888920
Then the response status is 404 Not Found
889921

922+
@generated @skip @team:DataDog/k9-investigation
923+
Scenario: Get Jira issue metadata returns "Bad Request" response
924+
Given operation "GetJiraIssueMetadata" enabled
925+
And new "GetJiraIssueMetadata" request
926+
And request contains "url" parameter from "REPLACE.ME"
927+
When the request is sent
928+
Then the response status is 400 Bad Request
929+
930+
@generated @skip @team:DataDog/k9-investigation
931+
Scenario: Get Jira issue metadata returns "Not Found" response
932+
Given operation "GetJiraIssueMetadata" enabled
933+
And new "GetJiraIssueMetadata" request
934+
And request contains "url" parameter from "REPLACE.ME"
935+
When the request is sent
936+
Then the response status is 404 Not Found
937+
938+
@generated @skip @team:DataDog/k9-investigation
939+
Scenario: Get Jira issue metadata returns "OK" response
940+
Given operation "GetJiraIssueMetadata" enabled
941+
And new "GetJiraIssueMetadata" request
942+
And request contains "url" parameter from "REPLACE.ME"
943+
When the request is sent
944+
Then the response status is 200 OK
945+
890946
@generated @skip @team:DataDog/k9-cloud-vm
891947
Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
892948
Given new "GetSBOM" request

features/v2/undo.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,22 @@
999999
"type": "idempotent"
10001000
}
10011001
},
1002+
"AssignIntegrationIssues": {
1003+
"tag": "Security Monitoring",
1004+
"undo": {
1005+
"operationId": "TODO",
1006+
"parameters": [],
1007+
"type": "unsafe"
1008+
}
1009+
},
1010+
"CreateJiraIssue": {
1011+
"tag": "Security Monitoring",
1012+
"undo": {
1013+
"operationId": "TODO",
1014+
"parameters": [],
1015+
"type": "unsafe"
1016+
}
1017+
},
10021018
"GetResourceEvaluationFilters": {
10031019
"tag": "Security Monitoring",
10041020
"undo": {
@@ -4286,6 +4302,12 @@
42864302
"type": "unsafe"
42874303
}
42884304
},
4305+
"GetJiraIssueMetadata": {
4306+
"tag": "Security Monitoring",
4307+
"undo": {
4308+
"type": "safe"
4309+
}
4310+
},
42894311
"SearchSecurityFindings": {
42904312
"tag": "Security Monitoring",
42914313
"undo": {

packages/datadog-api-client-common/configuration.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,15 @@ export function createConfiguration(
242242
"v2.listAPIs": false,
243243
"v2.updateOpenAPI": false,
244244
"v2.activateContentPack": false,
245+
"v2.assignIntegrationIssues": false,
245246
"v2.cancelThreatHuntingJob": false,
246247
"v2.convertJobResultToSignal": false,
248+
"v2.createJiraIssue": false,
247249
"v2.deactivateContentPack": false,
248250
"v2.deleteThreatHuntingJob": false,
249251
"v2.getContentPacksStates": false,
250252
"v2.getFinding": false,
253+
"v2.getJiraIssueMetadata": false,
251254
"v2.getRuleVersionHistory": false,
252255
"v2.getSecretsRules": false,
253256
"v2.getSecurityMonitoringHistsignal": false,

0 commit comments

Comments
 (0)