Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vbarth/update custom framework #2655

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-14 15:59:05.257063",
"spec_repo_commit": "0457044b"
"regenerated": "2025-01-14 20:10:47.979598",
"spec_repo_commit": "89d2bdc8"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-14 15:59:05.292969",
"spec_repo_commit": "0457044b"
"regenerated": "2025-01-14 20:10:47.994294",
"spec_repo_commit": "89d2bdc8"
}
}
}
159 changes: 159 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,20 @@ components:
required: false
schema:
$ref: '#/components/schemas/RelationType'
FrameworkHandle:
description: The framework handle
in: path
name: handle
required: true
schema:
type: string
FrameworkVersion:
description: The framework version
in: path
name: version
required: true
schema:
type: string
GCPSTSServiceAccountID:
description: Your GCP STS enabled service account's unique ID.
in: path
Expand Down Expand Up @@ -7145,6 +7159,10 @@ components:
type: string
x-enum-varnames:
- APPDEFINITIONS
CreateCustomFrameworkRequest:
$ref: '#/components/schemas/FrameworkData'
description: Create a custom framework.
type: object
CreateDataDeletionRequestBody:
description: Object needed to create a data deletion request.
properties:
Expand Down Expand Up @@ -11936,6 +11954,72 @@ components:
order:
$ref: '#/components/schemas/QuerySortOrder'
type: object
FrameworkControl:
description: Framework Control.
properties:
name:
description: Control Name.
example: ''
type: string
rule_ids:
description: Rule IDs.
example:
- ''
items:
type: string
type: array
required:
- name
- rule_ids
type: object
FrameworkData:
description: Framework Data.
properties:
description:
description: Framework Description
type: string
handle:
description: Framework Handle
example: ''
type: string
icon_url:
description: Framework Icon URL
type: string
name:
description: Framework Name
example: ''
type: string
requirements:
description: Framework Requirements
items:
$ref: '#/components/schemas/FrameworkRequirement'
type: array
version:
description: Framework Version
example: ''
type: string
required:
- handle
- version
- name
- requirements
type: object
FrameworkRequirement:
description: Framework Requirement.
properties:
controls:
description: Requirement Controls.
items:
$ref: '#/components/schemas/FrameworkControl'
type: array
name:
description: Requirement Name.
example: ''
type: string
required:
- name
- controls
type: object
FullAPIKey:
description: Datadog API key.
properties:
Expand Down Expand Up @@ -28953,6 +29037,10 @@ components:
deployment:
$ref: '#/components/schemas/DeploymentRelationship'
type: object
UpdateCustomFrameworkRequest:
$ref: '#/components/schemas/FrameworkData'
description: Update a custom framework.
type: object
UpdateOpenAPIResponse:
description: Response for `UpdateOpenAPI`.
properties:
Expand Down Expand Up @@ -33028,6 +33116,77 @@ paths:
operator: OR
permissions:
- ci_visibility_read
/api/v2/cloud_security_management/custom_frameworks:
post:
description: Create a custom framework.
operationId: CreateCustomFramework
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCustomFrameworkRequest'
required: true
responses:
'200':
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
'500':
$ref: '#/components/responses/BadRequestResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- security_monitoring_rules_read
- security_monitoring_rules_write
summary: Create a custom framework
tags:
- Security Monitoring
x-codegen-request-body-name: body
x-permission:
operator: AND
permissions:
- security_monitoring_rules_read
- security_monitoring_rules_write
/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}:
put:
description: Update a custom framework.
operationId: UpdateCustomFramework
parameters:
- $ref: '#/components/parameters/FrameworkHandle'
- $ref: '#/components/parameters/FrameworkVersion'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCustomFrameworkRequest'
required: true
responses:
'200':
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
'500':
$ref: '#/components/responses/BadRequestResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- security_monitoring_rules_read
- security_monitoring_rules_write
summary: Update a custom framework
tags:
- Security Monitoring
x-codegen-request-body-name: body
x-permission:
operator: AND
permissions:
- security_monitoring_rules_read
- security_monitoring_rules_write
/api/v2/container_images:
get:
description: Get all Container Images for your organization.
Expand Down
41 changes: 41 additions & 0 deletions examples/v2/security-monitoring/CreateCustomFramework.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Create a custom framework returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
import com.datadog.api.client.v2.model.CreateCustomFrameworkRequest;
import com.datadog.api.client.v2.model.FrameworkControl;
import com.datadog.api.client.v2.model.FrameworkRequirement;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);

CreateCustomFrameworkRequest body =
new CreateCustomFrameworkRequest()
.handle("")
.name("")
.requirements(
Collections.singletonList(
new FrameworkRequirement()
.controls(
Collections.singletonList(
new FrameworkControl()
.name("")
.ruleIds(Collections.singletonList(""))))
.name("")))
.version("");

try {
apiInstance.createCustomFramework(body);
} catch (ApiException e) {
System.err.println("Exception when calling SecurityMonitoringApi#createCustomFramework");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
41 changes: 41 additions & 0 deletions examples/v2/security-monitoring/UpdateCustomFramework.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Update a custom framework returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
import com.datadog.api.client.v2.model.FrameworkControl;
import com.datadog.api.client.v2.model.FrameworkRequirement;
import com.datadog.api.client.v2.model.UpdateCustomFrameworkRequest;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);

UpdateCustomFrameworkRequest body =
new UpdateCustomFrameworkRequest()
.handle("")
.name("")
.requirements(
Collections.singletonList(
new FrameworkRequirement()
.controls(
Collections.singletonList(
new FrameworkControl()
.name("")
.ruleIds(Collections.singletonList(""))))
.name("")))
.version("");

try {
apiInstance.updateCustomFramework("handle", "version", body);
} catch (ApiException e) {
System.err.println("Exception when calling SecurityMonitoringApi#updateCustomFramework");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
22 changes: 11 additions & 11 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,17 @@ public class ApiClient {
put("v2.getApp", false);
put("v2.listApps", false);
put("v2.updateApp", false);
put("v2.cancelHistoricalJob", false);
put("v2.convertJobResultToSignal", false);
put("v2.deleteHistoricalJob", false);
put("v2.getFinding", false);
put("v2.getHistoricalJob", false);
put("v2.listFindings", false);
put("v2.listHistoricalJobs", false);
put("v2.listVulnerabilities", false);
put("v2.listVulnerableAssets", false);
put("v2.muteFindings", false);
put("v2.runHistoricalJob", false);
put("v2.getActiveBillingDimensions", false);
put("v2.getBillingDimensionMapping", false);
put("v2.getMonthlyCostAttribution", false);
Expand Down Expand Up @@ -419,17 +430,6 @@ public class ApiClient {
put("v2.listAWSNamespaces", false);
put("v2.updateAWSAccount", false);
put("v2.listAWSLogsServices", false);
put("v2.cancelHistoricalJob", false);
put("v2.convertJobResultToSignal", false);
put("v2.deleteHistoricalJob", false);
put("v2.getFinding", false);
put("v2.getHistoricalJob", false);
put("v2.listFindings", false);
put("v2.listHistoricalJobs", false);
put("v2.listVulnerabilities", false);
put("v2.listVulnerableAssets", false);
put("v2.muteFindings", false);
put("v2.runHistoricalJob", false);
put("v2.createScorecardOutcomesBatch", false);
put("v2.createScorecardRule", false);
put("v2.deleteScorecardRule", false);
Expand Down
Loading
Loading