Skip to content

Commit 01308be

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8427eee of spec repo
1 parent aceea98 commit 01308be

File tree

205 files changed

+3101
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+3101
-201
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,20 @@ components:
11791179
required: true
11801180
schema:
11811181
type: string
1182+
SecurityMonitoringTerraformResourceId:
1183+
description: The ID of the security monitoring resource to export.
1184+
in: path
1185+
name: resource_id
1186+
required: true
1187+
schema:
1188+
type: string
1189+
SecurityMonitoringTerraformResourceType:
1190+
description: The type of security monitoring resource to export.
1191+
in: path
1192+
name: resource_type
1193+
required: true
1194+
schema:
1195+
$ref: "#/components/schemas/SecurityMonitoringTerraformResourceType"
11821196
SensitiveDataScannerGroupID:
11831197
description: The ID of a group of rules.
11841198
in: path
@@ -61531,6 +61545,134 @@ components:
6153161545
$ref: "#/components/schemas/SecurityMonitoringSuppression"
6153261546
type: array
6153361547
type: object
61548+
SecurityMonitoringTerraformBulkExportAttributes:
61549+
description: Attributes for the bulk export request.
61550+
properties:
61551+
resource_ids:
61552+
description: The list of resource IDs to export. Maximum 1000 items.
61553+
example:
61554+
- ""
61555+
items:
61556+
description: The ID of the resource to export.
61557+
type: string
61558+
maxItems: 1000
61559+
type: array
61560+
required:
61561+
- resource_ids
61562+
type: object
61563+
SecurityMonitoringTerraformBulkExportData:
61564+
description: The bulk export request data object.
61565+
properties:
61566+
attributes:
61567+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportAttributes"
61568+
type:
61569+
description: The JSON:API type. Always `bulk_export_resources`.
61570+
example: bulk_export_resources
61571+
type: string
61572+
required:
61573+
- type
61574+
- attributes
61575+
type: object
61576+
SecurityMonitoringTerraformBulkExportRequest:
61577+
description: Request body for bulk exporting security monitoring resources to Terraform.
61578+
properties:
61579+
data:
61580+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportData"
61581+
required:
61582+
- data
61583+
type: object
61584+
SecurityMonitoringTerraformConvertAttributes:
61585+
description: Attributes for the convert request.
61586+
properties:
61587+
resource_json:
61588+
additionalProperties: {}
61589+
description: The resource attributes as a JSON object, matching the structure returned by the corresponding Datadog API (for example, the attributes of a suppression rule).
61590+
example:
61591+
enabled: true
61592+
name: Custom suppression
61593+
rule_query: type:log_detection source:cloudtrail
61594+
suppression_query: env:staging status:low
61595+
type: object
61596+
required:
61597+
- resource_json
61598+
type: object
61599+
SecurityMonitoringTerraformConvertData:
61600+
description: The convert request data object.
61601+
properties:
61602+
attributes:
61603+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertAttributes"
61604+
id:
61605+
description: The ID of the resource being converted.
61606+
example: abc-123
61607+
type: string
61608+
type:
61609+
description: The JSON:API type. Always `convert_resource`.
61610+
example: convert_resource
61611+
type: string
61612+
required:
61613+
- type
61614+
- id
61615+
- attributes
61616+
type: object
61617+
SecurityMonitoringTerraformConvertRequest:
61618+
description: Request body for converting a security monitoring resource JSON to Terraform.
61619+
properties:
61620+
data:
61621+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertData"
61622+
required:
61623+
- data
61624+
type: object
61625+
SecurityMonitoringTerraformExportAttributes:
61626+
description: Attributes of the Terraform export response.
61627+
properties:
61628+
output:
61629+
description: The Terraform configuration for the resource.
61630+
type: string
61631+
resource_id:
61632+
description: The ID of the exported resource.
61633+
example: abc-123
61634+
type: string
61635+
type_name:
61636+
description: The Terraform resource type name.
61637+
example: datadog_security_monitoring_suppression
61638+
type: string
61639+
required:
61640+
- type_name
61641+
- resource_id
61642+
type: object
61643+
SecurityMonitoringTerraformExportData:
61644+
description: The Terraform export data object.
61645+
properties:
61646+
attributes:
61647+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportAttributes"
61648+
id:
61649+
description: The resource identifier composed of the Terraform type name and the resource ID separated by `|`.
61650+
example: datadog_security_monitoring_suppression|abc-123
61651+
type: string
61652+
type:
61653+
description: The JSON:API type. Always `format_resource`.
61654+
example: format_resource
61655+
type: string
61656+
required:
61657+
- type
61658+
- id
61659+
- attributes
61660+
type: object
61661+
SecurityMonitoringTerraformExportResponse:
61662+
description: Response containing the Terraform configuration for a security monitoring resource.
61663+
properties:
61664+
data:
61665+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportData"
61666+
type: object
61667+
SecurityMonitoringTerraformResourceType:
61668+
description: The type of security monitoring resource to export to Terraform.
61669+
enum:
61670+
- suppressions
61671+
- critical_assets
61672+
type: string
61673+
x-enum-varnames:
61674+
- SUPPRESSIONS
61675+
- CRITICAL_ASSETS
6153461676
SecurityMonitoringThirdPartyRootQuery:
6153561677
description: A query to be combined with the third party case query.
6153661678
properties:
@@ -108072,6 +108214,135 @@ paths:
108072108214
permissions:
108073108215
- security_monitoring_rules_read
108074108216
- security_monitoring_signals_read
108217+
/api/v2/security_monitoring/terraform/{resource_type}/bulk:
108218+
post:
108219+
description: |-
108220+
Export multiple security monitoring resources to Terraform, packaged as a zip archive.
108221+
The `resource_type` path parameter specifies the type of resources to export
108222+
and must be one of `suppressions` or `critical_assets`.
108223+
A maximum of 1000 resources can be exported in a single request.
108224+
operationId: BulkExportSecurityMonitoringTerraformResources
108225+
parameters:
108226+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
108227+
requestBody:
108228+
content:
108229+
application/json:
108230+
schema:
108231+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportRequest"
108232+
description: The resource IDs to export.
108233+
required: true
108234+
responses:
108235+
"200":
108236+
content:
108237+
application/zip:
108238+
schema:
108239+
format: binary
108240+
type: string
108241+
description: OK
108242+
"400":
108243+
$ref: "#/components/responses/BadRequestResponse"
108244+
"403":
108245+
$ref: "#/components/responses/NotAuthorizedResponse"
108246+
"404":
108247+
$ref: "#/components/responses/NotFoundResponse"
108248+
"429":
108249+
$ref: "#/components/responses/TooManyRequestsResponse"
108250+
security:
108251+
- apiKeyAuth: []
108252+
appKeyAuth: []
108253+
- AuthZ:
108254+
- security_monitoring_suppressions_read
108255+
summary: Export security monitoring resources to Terraform
108256+
tags:
108257+
- Security Monitoring
108258+
x-codegen-request-body-name: body
108259+
"x-permission":
108260+
operator: OR
108261+
permissions:
108262+
- security_monitoring_suppressions_read
108263+
- security_monitoring_rules_read
108264+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
108265+
/api/v2/security_monitoring/terraform/{resource_type}/convert:
108266+
post:
108267+
description: |-
108268+
Convert a security monitoring resource that doesn't (yet) exist from JSON to Terraform.
108269+
The `resource_type` path parameter specifies the type of resource to convert
108270+
and must be one of `suppressions` or `critical_assets`.
108271+
operationId: ConvertSecurityMonitoringTerraformResource
108272+
parameters:
108273+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
108274+
requestBody:
108275+
content:
108276+
application/json:
108277+
schema:
108278+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertRequest"
108279+
description: The resource JSON to convert.
108280+
required: true
108281+
responses:
108282+
"200":
108283+
content:
108284+
application/json:
108285+
schema:
108286+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportResponse"
108287+
description: OK
108288+
"400":
108289+
$ref: "#/components/responses/BadRequestResponse"
108290+
"403":
108291+
$ref: "#/components/responses/NotAuthorizedResponse"
108292+
"429":
108293+
$ref: "#/components/responses/TooManyRequestsResponse"
108294+
security:
108295+
- apiKeyAuth: []
108296+
appKeyAuth: []
108297+
- AuthZ:
108298+
- security_monitoring_suppressions_read
108299+
summary: Convert security monitoring resource to Terraform
108300+
tags:
108301+
- Security Monitoring
108302+
x-codegen-request-body-name: body
108303+
"x-permission":
108304+
operator: OR
108305+
permissions:
108306+
- security_monitoring_suppressions_read
108307+
- security_monitoring_rules_read
108308+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
108309+
/api/v2/security_monitoring/terraform/{resource_type}/{resource_id}:
108310+
get:
108311+
description: |-
108312+
Export a security monitoring resource to a Terraform configuration.
108313+
The `resource_type` path parameter specifies the type of resource to export
108314+
and must be one of `suppressions` or `critical_assets`.
108315+
operationId: ExportSecurityMonitoringTerraformResource
108316+
parameters:
108317+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
108318+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceId"
108319+
responses:
108320+
"200":
108321+
content:
108322+
application/json:
108323+
schema:
108324+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportResponse"
108325+
description: OK
108326+
"403":
108327+
$ref: "#/components/responses/NotAuthorizedResponse"
108328+
"404":
108329+
$ref: "#/components/responses/NotFoundResponse"
108330+
"429":
108331+
$ref: "#/components/responses/TooManyRequestsResponse"
108332+
security:
108333+
- apiKeyAuth: []
108334+
appKeyAuth: []
108335+
- AuthZ:
108336+
- security_monitoring_suppressions_read
108337+
summary: Export security monitoring resource to Terraform
108338+
tags:
108339+
- Security Monitoring
108340+
"x-permission":
108341+
operator: OR
108342+
permissions:
108343+
- security_monitoring_suppressions_read
108344+
- security_monitoring_rules_read
108345+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
108075108346
/api/v2/sensitive-data-scanner/config:
108076108347
get:
108077108348
description: List all the Scanning groups in your organization.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Export security monitoring resources to Terraform returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformBulkExportAttributes;
7+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformBulkExportData;
8+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformBulkExportRequest;
9+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformResourceType;
10+
import java.io.File;
11+
import java.util.Collections;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
defaultClient.setUnstableOperationEnabled(
17+
"v2.bulkExportSecurityMonitoringTerraformResources", true);
18+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
19+
20+
// there is a valid "suppression" in the system
21+
String SUPPRESSION_DATA_ID = System.getenv("SUPPRESSION_DATA_ID");
22+
23+
SecurityMonitoringTerraformBulkExportRequest body =
24+
new SecurityMonitoringTerraformBulkExportRequest()
25+
.data(
26+
new SecurityMonitoringTerraformBulkExportData()
27+
.attributes(
28+
new SecurityMonitoringTerraformBulkExportAttributes()
29+
.resourceIds(Collections.singletonList(SUPPRESSION_DATA_ID)))
30+
.type("bulk_export_resources"));
31+
32+
try {
33+
File result =
34+
apiInstance.bulkExportSecurityMonitoringTerraformResources(
35+
SecurityMonitoringTerraformResourceType.SUPPRESSIONS, body);
36+
System.out.println(result);
37+
} catch (ApiException e) {
38+
System.err.println(
39+
"Exception when calling"
40+
+ " SecurityMonitoringApi#bulkExportSecurityMonitoringTerraformResources");
41+
System.err.println("Status code: " + e.getCode());
42+
System.err.println("Reason: " + e.getResponseBody());
43+
System.err.println("Response headers: " + e.getResponseHeaders());
44+
e.printStackTrace();
45+
}
46+
}
47+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Convert security monitoring resource to Terraform returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformConvertAttributes;
7+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformConvertData;
8+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformConvertRequest;
9+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformExportResponse;
10+
import com.datadog.api.client.v2.model.SecurityMonitoringTerraformResourceType;
11+
import java.util.Map;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
defaultClient.setUnstableOperationEnabled(
17+
"v2.convertSecurityMonitoringTerraformResource", true);
18+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
19+
20+
SecurityMonitoringTerraformConvertRequest body =
21+
new SecurityMonitoringTerraformConvertRequest()
22+
.data(
23+
new SecurityMonitoringTerraformConvertData()
24+
.type("convert_resource")
25+
.id("abc-123")
26+
.attributes(
27+
new SecurityMonitoringTerraformConvertAttributes()
28+
.resourceJson(
29+
Map.ofEntries(
30+
Map.entry("enabled", "True"),
31+
Map.entry("name", "Example-Security-Monitoring"),
32+
Map.entry("rule_query", "source:cloudtrail"),
33+
Map.entry("suppression_query", "env:test")))));
34+
35+
try {
36+
SecurityMonitoringTerraformExportResponse result =
37+
apiInstance.convertSecurityMonitoringTerraformResource(
38+
SecurityMonitoringTerraformResourceType.SUPPRESSIONS, body);
39+
System.out.println(result);
40+
} catch (ApiException e) {
41+
System.err.println(
42+
"Exception when calling"
43+
+ " SecurityMonitoringApi#convertSecurityMonitoringTerraformResource");
44+
System.err.println("Status code: " + e.getCode());
45+
System.err.println("Reason: " + e.getResponseBody());
46+
System.err.println("Response headers: " + e.getResponseHeaders());
47+
e.printStackTrace();
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)