|
102 | 102 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleBulkDeletePayload; |
103 | 103 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleBulkDeleteResponse; |
104 | 104 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleBulkExportPayload; |
| 105 | +import com.datadog.api.client.v2.model.SecurityMonitoringRuleConvertBulkPayload; |
105 | 106 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleConvertPayload; |
106 | 107 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleConvertResponse; |
107 | 108 | import com.datadog.api.client.v2.model.SecurityMonitoringRuleCreatePayload; |
@@ -803,6 +804,148 @@ public CompletableFuture<ApiResponse<FindingCaseResponse>> attachJiraIssueWithHt |
803 | 804 | new GenericType<SecurityMonitoringDatasetDependenciesResponse>() {}); |
804 | 805 | } |
805 | 806 |
|
| 807 | + /** |
| 808 | + * Bulk convert rules to Terraform. |
| 809 | + * |
| 810 | + * <p>See {@link #bulkConvertExistingSecurityMonitoringRulesWithHttpInfo}. |
| 811 | + * |
| 812 | + * @param body (required) |
| 813 | + * @return File |
| 814 | + * @throws ApiException if fails to make API call |
| 815 | + */ |
| 816 | + public File bulkConvertExistingSecurityMonitoringRules( |
| 817 | + SecurityMonitoringRuleConvertBulkPayload body) throws ApiException { |
| 818 | + return bulkConvertExistingSecurityMonitoringRulesWithHttpInfo(body).getData(); |
| 819 | + } |
| 820 | + |
| 821 | + /** |
| 822 | + * Bulk convert rules to Terraform. |
| 823 | + * |
| 824 | + * <p>See {@link #bulkConvertExistingSecurityMonitoringRulesWithHttpInfoAsync}. |
| 825 | + * |
| 826 | + * @param body (required) |
| 827 | + * @return CompletableFuture<File> |
| 828 | + */ |
| 829 | + public CompletableFuture<File> bulkConvertExistingSecurityMonitoringRulesAsync( |
| 830 | + SecurityMonitoringRuleConvertBulkPayload body) { |
| 831 | + return bulkConvertExistingSecurityMonitoringRulesWithHttpInfoAsync(body) |
| 832 | + .thenApply( |
| 833 | + response -> { |
| 834 | + return response.getData(); |
| 835 | + }); |
| 836 | + } |
| 837 | + |
| 838 | + /** |
| 839 | + * Convert a list of existing security monitoring rules to Terraform for the Datadog provider |
| 840 | + * resource <code>datadog_security_monitoring_rule</code>. Returns a ZIP archive containing one |
| 841 | + * Terraform file per rule. You can convert rules for the following types: - App and API |
| 842 | + * Protection - Cloud SIEM (log detection and signal correlation) - Workload Protection |
| 843 | + * |
| 844 | + * @param body (required) |
| 845 | + * @return ApiResponse<File> |
| 846 | + * @throws ApiException if fails to make API call |
| 847 | + * @http.response.details |
| 848 | + * <table border="1"> |
| 849 | + * <caption>Response details</caption> |
| 850 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 851 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 852 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 853 | + * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> |
| 854 | + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> |
| 855 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 856 | + * </table> |
| 857 | + */ |
| 858 | + public ApiResponse<File> bulkConvertExistingSecurityMonitoringRulesWithHttpInfo( |
| 859 | + SecurityMonitoringRuleConvertBulkPayload body) throws ApiException { |
| 860 | + Object localVarPostBody = body; |
| 861 | + |
| 862 | + // verify the required parameter 'body' is set |
| 863 | + if (body == null) { |
| 864 | + throw new ApiException( |
| 865 | + 400, |
| 866 | + "Missing the required parameter 'body' when calling" |
| 867 | + + " bulkConvertExistingSecurityMonitoringRules"); |
| 868 | + } |
| 869 | + // create path and map variables |
| 870 | + String localVarPath = "/api/v2/security_monitoring/rules/convert/bulk"; |
| 871 | + |
| 872 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 873 | + |
| 874 | + Invocation.Builder builder = |
| 875 | + apiClient.createBuilder( |
| 876 | + "v2.SecurityMonitoringApi.bulkConvertExistingSecurityMonitoringRules", |
| 877 | + localVarPath, |
| 878 | + new ArrayList<Pair>(), |
| 879 | + localVarHeaderParams, |
| 880 | + new HashMap<String, String>(), |
| 881 | + new String[] {"application/zip", "application/json"}, |
| 882 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 883 | + return apiClient.invokeAPI( |
| 884 | + "POST", |
| 885 | + builder, |
| 886 | + localVarHeaderParams, |
| 887 | + new String[] {"application/json"}, |
| 888 | + localVarPostBody, |
| 889 | + new HashMap<String, Object>(), |
| 890 | + false, |
| 891 | + new GenericType<File>() {}); |
| 892 | + } |
| 893 | + |
| 894 | + /** |
| 895 | + * Bulk convert rules to Terraform. |
| 896 | + * |
| 897 | + * <p>See {@link #bulkConvertExistingSecurityMonitoringRulesWithHttpInfo}. |
| 898 | + * |
| 899 | + * @param body (required) |
| 900 | + * @return CompletableFuture<ApiResponse<File>> |
| 901 | + */ |
| 902 | + public CompletableFuture<ApiResponse<File>> |
| 903 | + bulkConvertExistingSecurityMonitoringRulesWithHttpInfoAsync( |
| 904 | + SecurityMonitoringRuleConvertBulkPayload body) { |
| 905 | + Object localVarPostBody = body; |
| 906 | + |
| 907 | + // verify the required parameter 'body' is set |
| 908 | + if (body == null) { |
| 909 | + CompletableFuture<ApiResponse<File>> result = new CompletableFuture<>(); |
| 910 | + result.completeExceptionally( |
| 911 | + new ApiException( |
| 912 | + 400, |
| 913 | + "Missing the required parameter 'body' when calling" |
| 914 | + + " bulkConvertExistingSecurityMonitoringRules")); |
| 915 | + return result; |
| 916 | + } |
| 917 | + // create path and map variables |
| 918 | + String localVarPath = "/api/v2/security_monitoring/rules/convert/bulk"; |
| 919 | + |
| 920 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 921 | + |
| 922 | + Invocation.Builder builder; |
| 923 | + try { |
| 924 | + builder = |
| 925 | + apiClient.createBuilder( |
| 926 | + "v2.SecurityMonitoringApi.bulkConvertExistingSecurityMonitoringRules", |
| 927 | + localVarPath, |
| 928 | + new ArrayList<Pair>(), |
| 929 | + localVarHeaderParams, |
| 930 | + new HashMap<String, String>(), |
| 931 | + new String[] {"application/zip", "application/json"}, |
| 932 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 933 | + } catch (ApiException ex) { |
| 934 | + CompletableFuture<ApiResponse<File>> result = new CompletableFuture<>(); |
| 935 | + result.completeExceptionally(ex); |
| 936 | + return result; |
| 937 | + } |
| 938 | + return apiClient.invokeAPIAsync( |
| 939 | + "POST", |
| 940 | + builder, |
| 941 | + localVarHeaderParams, |
| 942 | + new String[] {"application/json"}, |
| 943 | + localVarPostBody, |
| 944 | + new HashMap<String, Object>(), |
| 945 | + false, |
| 946 | + new GenericType<File>() {}); |
| 947 | + } |
| 948 | + |
806 | 949 | /** |
807 | 950 | * Bulk subscribe to sample log generation. |
808 | 951 | * |
|
0 commit comments