Skip to content
New issue

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

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

Already on GitHub? # to your account

Add CreateCustomFramework and UpdateCustomFramework endpoints #2356

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-15 18:03:11.180859",
"spec_repo_commit": "e54847a1"
"regenerated": "2025-01-16 16:29:00.243268",
"spec_repo_commit": "b3d1b873"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-15 18:03:11.196723",
"spec_repo_commit": "e54847a1"
"regenerated": "2025-01-16 16:29:00.257838",
"spec_repo_commit": "b3d1b873"
}
}
}
165 changes: 165 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
@@ -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
@@ -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:
@@ -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:
@@ -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:
@@ -33028,6 +33116,83 @@ 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
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
/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
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
/api/v2/container_images:
get:
description: Get all Container Images for your organization.
28 changes: 28 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
@@ -2727,6 +2727,13 @@ datadog\_api\_client.v2.model.create\_app\_response\_data\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.create\_custom\_framework\_request module
-----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.create_custom_framework_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.create\_data\_deletion\_request\_body module
--------------------------------------------------------------------------

@@ -4883,6 +4890,20 @@ datadog\_api\_client.v2.model.formula\_limit module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.framework\_control module
-------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.framework_control
:members:
:show-inheritance:

datadog\_api\_client.v2.model.framework\_requirement module
-----------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.framework_requirement
:members:
:show-inheritance:

datadog\_api\_client.v2.model.full\_api\_key module
---------------------------------------------------

@@ -12744,6 +12765,13 @@ datadog\_api\_client.v2.model.update\_app\_response\_relationship module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.update\_custom\_framework\_request module
-----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.update_custom_framework_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.update\_open\_api\_response module
----------------------------------------------------------------

34 changes: 34 additions & 0 deletions examples/v2/security-monitoring/CreateCustomFramework.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Create a custom framework returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
from datadog_api_client.v2.model.create_custom_framework_request import CreateCustomFrameworkRequest
from datadog_api_client.v2.model.framework_control import FrameworkControl
from datadog_api_client.v2.model.framework_requirement import FrameworkRequirement

body = CreateCustomFrameworkRequest(
handle="",
name="",
requirements=[
FrameworkRequirement(
controls=[
FrameworkControl(
name="",
rule_ids=[
"",
],
),
],
name="",
),
],
version="",
)

configuration = Configuration()
configuration.unstable_operations["create_custom_framework"] = True
with ApiClient(configuration) as api_client:
api_instance = SecurityMonitoringApi(api_client)
api_instance.create_custom_framework(body=body)
34 changes: 34 additions & 0 deletions examples/v2/security-monitoring/UpdateCustomFramework.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Update a custom framework returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
from datadog_api_client.v2.model.framework_control import FrameworkControl
from datadog_api_client.v2.model.framework_requirement import FrameworkRequirement
from datadog_api_client.v2.model.update_custom_framework_request import UpdateCustomFrameworkRequest

body = UpdateCustomFrameworkRequest(
handle="",
name="",
requirements=[
FrameworkRequirement(
controls=[
FrameworkControl(
name="",
rule_ids=[
"",
],
),
],
name="",
),
],
version="",
)

configuration = Configuration()
configuration.unstable_operations["update_custom_framework"] = True
with ApiClient(configuration) as api_client:
api_instance = SecurityMonitoringApi(api_client)
api_instance.update_custom_framework(handle="handle", version="version", body=body)
24 changes: 13 additions & 11 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
@@ -249,6 +249,19 @@ def __init__(
"v2.get_app": False,
"v2.list_apps": False,
"v2.update_app": False,
"v2.cancel_historical_job": False,
"v2.convert_job_result_to_signal": False,
"v2.create_custom_framework": False,
"v2.delete_historical_job": False,
"v2.get_finding": False,
"v2.get_historical_job": False,
"v2.list_findings": False,
"v2.list_historical_jobs": False,
"v2.list_vulnerabilities": False,
"v2.list_vulnerable_assets": False,
"v2.mute_findings": False,
"v2.run_historical_job": False,
"v2.update_custom_framework": False,
"v2.get_active_billing_dimensions": False,
"v2.get_billing_dimension_mapping": False,
"v2.get_monthly_cost_attribution": False,
@@ -288,17 +301,6 @@ def __init__(
"v2.list_aws_namespaces": False,
"v2.update_aws_account": False,
"v2.list_aws_logs_services": False,
"v2.cancel_historical_job": False,
"v2.convert_job_result_to_signal": False,
"v2.delete_historical_job": False,
"v2.get_finding": False,
"v2.get_historical_job": False,
"v2.list_findings": False,
"v2.list_historical_jobs": False,
"v2.list_vulnerabilities": False,
"v2.list_vulnerable_assets": False,
"v2.mute_findings": False,
"v2.run_historical_job": False,
"v2.create_scorecard_outcomes_batch": False,
"v2.create_scorecard_rule": False,
"v2.delete_scorecard_rule": False,
Loading
Loading