Skip to content

Commit 0def503

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e09f496 of spec repo
1 parent c71af55 commit 0def503

24 files changed

Lines changed: 2906 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,20 @@ components:
13881388
required: true
13891389
schema:
13901390
type: string
1391+
SecurityMonitoringTerraformResourceId:
1392+
description: The ID of the security monitoring resource to export.
1393+
in: path
1394+
name: resource_id
1395+
required: true
1396+
schema:
1397+
type: string
1398+
SecurityMonitoringTerraformResourceType:
1399+
description: The type of security monitoring resource to export.
1400+
in: path
1401+
name: resource_type
1402+
required: true
1403+
schema:
1404+
$ref: "#/components/schemas/SecurityMonitoringTerraformResourceType"
13911405
SensitiveDataScannerGroupID:
13921406
description: The ID of a group of rules.
13931407
in: path
@@ -64476,6 +64490,134 @@ components:
6447664490
$ref: "#/components/schemas/SecurityMonitoringSuppression"
6447764491
type: array
6447864492
type: object
64493+
SecurityMonitoringTerraformBulkExportAttributes:
64494+
description: Attributes for the bulk export request.
64495+
properties:
64496+
resource_ids:
64497+
description: The list of resource IDs to export. Maximum 1000 items.
64498+
example:
64499+
- ""
64500+
items:
64501+
description: The ID of the resource to export.
64502+
type: string
64503+
maxItems: 1000
64504+
type: array
64505+
required:
64506+
- resource_ids
64507+
type: object
64508+
SecurityMonitoringTerraformBulkExportData:
64509+
description: The bulk export request data object.
64510+
properties:
64511+
attributes:
64512+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportAttributes"
64513+
type:
64514+
description: The JSON:API type. Always `bulk_export_resources`.
64515+
example: bulk_export_resources
64516+
type: string
64517+
required:
64518+
- type
64519+
- attributes
64520+
type: object
64521+
SecurityMonitoringTerraformBulkExportRequest:
64522+
description: Request body for bulk exporting security monitoring resources to Terraform.
64523+
properties:
64524+
data:
64525+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportData"
64526+
required:
64527+
- data
64528+
type: object
64529+
SecurityMonitoringTerraformConvertAttributes:
64530+
description: Attributes for the convert request.
64531+
properties:
64532+
resource_json:
64533+
additionalProperties: {}
64534+
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).
64535+
example:
64536+
enabled: true
64537+
name: Custom suppression
64538+
rule_query: type:log_detection source:cloudtrail
64539+
suppression_query: env:staging status:low
64540+
type: object
64541+
required:
64542+
- resource_json
64543+
type: object
64544+
SecurityMonitoringTerraformConvertData:
64545+
description: The convert request data object.
64546+
properties:
64547+
attributes:
64548+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertAttributes"
64549+
id:
64550+
description: The ID of the resource being converted.
64551+
example: abc-123
64552+
type: string
64553+
type:
64554+
description: The JSON:API type. Always `convert_resource`.
64555+
example: convert_resource
64556+
type: string
64557+
required:
64558+
- type
64559+
- id
64560+
- attributes
64561+
type: object
64562+
SecurityMonitoringTerraformConvertRequest:
64563+
description: Request body for converting a security monitoring resource JSON to Terraform.
64564+
properties:
64565+
data:
64566+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertData"
64567+
required:
64568+
- data
64569+
type: object
64570+
SecurityMonitoringTerraformExportAttributes:
64571+
description: Attributes of the Terraform export response.
64572+
properties:
64573+
output:
64574+
description: The Terraform configuration for the resource.
64575+
type: string
64576+
resource_id:
64577+
description: The ID of the exported resource.
64578+
example: abc-123
64579+
type: string
64580+
type_name:
64581+
description: The Terraform resource type name.
64582+
example: datadog_security_monitoring_suppression
64583+
type: string
64584+
required:
64585+
- type_name
64586+
- resource_id
64587+
type: object
64588+
SecurityMonitoringTerraformExportData:
64589+
description: The Terraform export data object.
64590+
properties:
64591+
attributes:
64592+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportAttributes"
64593+
id:
64594+
description: The resource identifier composed of the Terraform type name and the resource ID separated by `|`.
64595+
example: datadog_security_monitoring_suppression|abc-123
64596+
type: string
64597+
type:
64598+
description: The JSON:API type. Always `format_resource`.
64599+
example: format_resource
64600+
type: string
64601+
required:
64602+
- type
64603+
- id
64604+
- attributes
64605+
type: object
64606+
SecurityMonitoringTerraformExportResponse:
64607+
description: Response containing the Terraform configuration for a security monitoring resource.
64608+
properties:
64609+
data:
64610+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportData"
64611+
type: object
64612+
SecurityMonitoringTerraformResourceType:
64613+
description: The type of security monitoring resource to export to Terraform.
64614+
enum:
64615+
- suppressions
64616+
- critical_assets
64617+
type: string
64618+
x-enum-varnames:
64619+
- SUPPRESSIONS
64620+
- CRITICAL_ASSETS
6447964621
SecurityMonitoringThirdPartyRootQuery:
6448064622
description: A query to be combined with the third party case query.
6448164623
properties:
@@ -113751,6 +113893,141 @@ paths:
113751113893
permissions:
113752113894
- security_monitoring_rules_read
113753113895
- security_monitoring_signals_read
113896+
/api/v2/security_monitoring/terraform/{resource_type}/bulk:
113897+
post:
113898+
description: |-
113899+
Export multiple security monitoring resources to Terraform, packaged as a zip archive.
113900+
The `resource_type` path parameter specifies the type of resources to export
113901+
and must be one of `suppressions` or `critical_assets`.
113902+
A maximum of 1000 resources can be exported in a single request.
113903+
operationId: BulkExportSecurityMonitoringTerraformResources
113904+
parameters:
113905+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
113906+
requestBody:
113907+
content:
113908+
application/json:
113909+
schema:
113910+
$ref: "#/components/schemas/SecurityMonitoringTerraformBulkExportRequest"
113911+
description: The resource IDs to export.
113912+
required: true
113913+
responses:
113914+
"200":
113915+
content:
113916+
application/zip:
113917+
schema:
113918+
format: binary
113919+
type: string
113920+
description: OK
113921+
"400":
113922+
$ref: "#/components/responses/BadRequestResponse"
113923+
"403":
113924+
$ref: "#/components/responses/NotAuthorizedResponse"
113925+
"404":
113926+
$ref: "#/components/responses/NotFoundResponse"
113927+
"429":
113928+
$ref: "#/components/responses/TooManyRequestsResponse"
113929+
security:
113930+
- apiKeyAuth: []
113931+
appKeyAuth: []
113932+
- AuthZ:
113933+
- security_monitoring_suppressions_read
113934+
- AuthZ:
113935+
- security_monitoring_rules_read
113936+
summary: Export security monitoring resources to Terraform
113937+
tags:
113938+
- Security Monitoring
113939+
x-codegen-request-body-name: body
113940+
"x-permission":
113941+
operator: OR
113942+
permissions:
113943+
- security_monitoring_suppressions_read
113944+
- security_monitoring_rules_read
113945+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
113946+
/api/v2/security_monitoring/terraform/{resource_type}/convert:
113947+
post:
113948+
description: |-
113949+
Convert a security monitoring resource that doesn't (yet) exist from JSON to Terraform.
113950+
The `resource_type` path parameter specifies the type of resource to convert
113951+
and must be one of `suppressions` or `critical_assets`.
113952+
operationId: ConvertSecurityMonitoringTerraformResource
113953+
parameters:
113954+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
113955+
requestBody:
113956+
content:
113957+
application/json:
113958+
schema:
113959+
$ref: "#/components/schemas/SecurityMonitoringTerraformConvertRequest"
113960+
description: The resource JSON to convert.
113961+
required: true
113962+
responses:
113963+
"200":
113964+
content:
113965+
application/json:
113966+
schema:
113967+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportResponse"
113968+
description: OK
113969+
"400":
113970+
$ref: "#/components/responses/BadRequestResponse"
113971+
"403":
113972+
$ref: "#/components/responses/NotAuthorizedResponse"
113973+
"429":
113974+
$ref: "#/components/responses/TooManyRequestsResponse"
113975+
security:
113976+
- apiKeyAuth: []
113977+
appKeyAuth: []
113978+
- AuthZ:
113979+
- security_monitoring_suppressions_read
113980+
- AuthZ:
113981+
- security_monitoring_rules_read
113982+
summary: Convert security monitoring resource to Terraform
113983+
tags:
113984+
- Security Monitoring
113985+
x-codegen-request-body-name: body
113986+
"x-permission":
113987+
operator: OR
113988+
permissions:
113989+
- security_monitoring_suppressions_read
113990+
- security_monitoring_rules_read
113991+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
113992+
/api/v2/security_monitoring/terraform/{resource_type}/{resource_id}:
113993+
get:
113994+
description: |-
113995+
Export a security monitoring resource to a Terraform configuration.
113996+
The `resource_type` path parameter specifies the type of resource to export
113997+
and must be one of `suppressions` or `critical_assets`.
113998+
operationId: ExportSecurityMonitoringTerraformResource
113999+
parameters:
114000+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType"
114001+
- $ref: "#/components/parameters/SecurityMonitoringTerraformResourceId"
114002+
responses:
114003+
"200":
114004+
content:
114005+
application/json:
114006+
schema:
114007+
$ref: "#/components/schemas/SecurityMonitoringTerraformExportResponse"
114008+
description: OK
114009+
"403":
114010+
$ref: "#/components/responses/NotAuthorizedResponse"
114011+
"404":
114012+
$ref: "#/components/responses/NotFoundResponse"
114013+
"429":
114014+
$ref: "#/components/responses/TooManyRequestsResponse"
114015+
security:
114016+
- apiKeyAuth: []
114017+
appKeyAuth: []
114018+
- AuthZ:
114019+
- security_monitoring_suppressions_read
114020+
- AuthZ:
114021+
- security_monitoring_rules_read
114022+
summary: Export security monitoring resource to Terraform
114023+
tags:
114024+
- Security Monitoring
114025+
"x-permission":
114026+
operator: OR
114027+
permissions:
114028+
- security_monitoring_suppressions_read
114029+
- security_monitoring_rules_read
114030+
x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)."
113754114031
/api/v2/sensitive-data-scanner/config:
113755114032
get:
113756114033
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)