Skip to content

Commit a5824d4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add support for mute findings endpoint (#1469)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d69a4e6 commit a5824d4

24 files changed

+1129
-23
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2023-06-05 14:46:50.084688",
8-
"spec_repo_commit": "060dc917"
7+
"regenerated": "2023-06-05 15:08:59.861687",
8+
"spec_repo_commit": "2638a894"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-06-05 14:46:50.097095",
13-
"spec_repo_commit": "060dc917"
12+
"regenerated": "2023-06-05 15:08:59.874012",
13+
"spec_repo_commit": "2638a894"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 256 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,7 +3674,7 @@ components:
36743674
type: array
36753675
type: object
36763676
Finding:
3677-
description: A single finding without message and resource configuration.
3677+
description: A single finding without the message and resource configuration.
36783678
properties:
36793679
attributes:
36803680
$ref: '#/components/schemas/FindingAttributes'
@@ -3732,16 +3732,16 @@ components:
37323732
properties:
37333733
description:
37343734
description: Additional information about the reason why this finding is
3735-
muted.
3735+
muted or unmuted.
37363736
example: To be resolved later
37373737
type: string
37383738
expiration_date:
3739-
description: The end of the mute period.
3739+
description: The expiration date of the mute or unmute action (Unix ms).
37403740
example: 1778721573794
37413741
format: int64
37423742
type: integer
37433743
muted:
3744-
description: Whether this finding is muted.
3744+
description: Whether this finding is muted or unmuted.
37453745
example: true
37463746
type: boolean
37473747
reason:
@@ -3752,23 +3752,29 @@ components:
37523752
format: int64
37533753
type: integer
37543754
uuid:
3755-
description: The ID of the user who muted this finding.
3755+
description: The ID of the user who muted or unmuted this finding.
37563756
example: e51c9744-d158-11ec-ad23-da7ad0900002
37573757
type: string
37583758
type: object
37593759
FindingMuteReason:
3760-
description: The reason why this finding is muted.
3760+
description: The reason why this finding is muted or unmuted.
37613761
enum:
3762-
- ACCEPTED_RISK
37633762
- PENDING_FIX
37643763
- FALSE_POSITIVE
3764+
- ACCEPTED_RISK
3765+
- NO_PENDING_FIX
3766+
- HUMAN_ERROR
3767+
- NO_LONGER_ACCEPTED_RISK
37653768
- OTHER
37663769
example: ACCEPTED_RISK
37673770
type: string
37683771
x-enum-varnames:
3769-
- ACCEPTED_RISK
37703772
- PENDING_FIX
37713773
- FALSE_POSITIVE
3774+
- ACCEPTED_RISK
3775+
- NO_PENDING_FIX
3776+
- HUMAN_ERROR
3777+
- NO_LONGER_ACCEPTED_RISK
37723778
- OTHER
37733779
FindingResource:
37743780
description: The resource name of this finding.
@@ -3831,6 +3837,34 @@ components:
38313837
type: string
38323838
x-enum-varnames:
38333839
- FINDING
3840+
FindingsErrorItem:
3841+
description: API error response body
3842+
properties:
3843+
detail:
3844+
description: A human-readable explanation specific to this occurrence of
3845+
the error.
3846+
example: attribute "muted" is required
3847+
type: string
3848+
status:
3849+
description: Status code of the response.
3850+
example: '400'
3851+
type: string
3852+
title:
3853+
description: Short human-readable summary of the error.
3854+
example: Bad Request
3855+
type: string
3856+
type: object
3857+
FindingsErrorResponse:
3858+
description: API error response.
3859+
properties:
3860+
errors:
3861+
description: A list of errors.
3862+
items:
3863+
$ref: '#/components/schemas/FindingsErrorItem'
3864+
type: array
3865+
required:
3866+
- errors
3867+
type: object
38343868
FormulaLimit:
38353869
description: Message for specifying limits to the number of values returned
38363870
by a query.
@@ -8471,6 +8505,139 @@ components:
84718505
description: The monitor type.
84728506
type: string
84738507
type: object
8508+
MuteFindingRequest:
8509+
description: The new mute finding request.
8510+
properties:
8511+
data:
8512+
$ref: '#/components/schemas/MuteFindingRequestData'
8513+
required:
8514+
- data
8515+
type: object
8516+
MuteFindingRequestAttributes:
8517+
additionalProperties: false
8518+
description: The mute properties to be updated.
8519+
properties:
8520+
mute:
8521+
$ref: '#/components/schemas/MuteFindingRequestProperties'
8522+
required:
8523+
- mute
8524+
type: object
8525+
MuteFindingRequestData:
8526+
description: Data object containing the new mute properties of the finding.
8527+
properties:
8528+
attributes:
8529+
$ref: '#/components/schemas/MuteFindingRequestAttributes'
8530+
id:
8531+
$ref: '#/components/schemas/FindingID'
8532+
type:
8533+
$ref: '#/components/schemas/FindingType'
8534+
required:
8535+
- id
8536+
- type
8537+
- attributes
8538+
type: object
8539+
MuteFindingRequestProperties:
8540+
additionalProperties: false
8541+
description: Object containing the new mute properties of the finding.
8542+
properties:
8543+
description:
8544+
description: Additional information about the reason why this finding is
8545+
muted or unmuted. This field has a maximum limit of 280 characters.
8546+
example: To be resolved later
8547+
type: string
8548+
expiration_date:
8549+
description: 'The expiration date of the mute or unmute action (Unix ms).
8550+
It must be set to a value greater than the current timestamp.
8551+
8552+
If this field is not provided, the finding will be muted or unmuted indefinitely,
8553+
which is equivalent to setting the expiration date to 9999999999999.
8554+
8555+
'
8556+
example: 1778721573794
8557+
format: int64
8558+
type: integer
8559+
muted:
8560+
description: Whether this finding is muted or unmuted.
8561+
example: true
8562+
type: boolean
8563+
reason:
8564+
$ref: '#/components/schemas/FindingMuteReason'
8565+
required:
8566+
- muted
8567+
- reason
8568+
type: object
8569+
MuteFindingResponse:
8570+
description: The expected response schema.
8571+
properties:
8572+
data:
8573+
$ref: '#/components/schemas/MuteFindingResponseData'
8574+
required:
8575+
- data
8576+
type: object
8577+
MuteFindingResponseAttributes:
8578+
description: The JSON:API attributes of the finding.
8579+
properties:
8580+
evaluation:
8581+
$ref: '#/components/schemas/FindingEvaluation'
8582+
evaluation_changed_at:
8583+
$ref: '#/components/schemas/FindingEvaluationChangedAt'
8584+
mute:
8585+
$ref: '#/components/schemas/MuteFindingResponseProperties'
8586+
resource:
8587+
$ref: '#/components/schemas/FindingResource'
8588+
resource_discovery_date:
8589+
$ref: '#/components/schemas/FindingResourceDiscoveryDate'
8590+
resource_type:
8591+
$ref: '#/components/schemas/FindingResourceType'
8592+
rule:
8593+
$ref: '#/components/schemas/FindingRule'
8594+
status:
8595+
$ref: '#/components/schemas/FindingStatus'
8596+
tags:
8597+
$ref: '#/components/schemas/FindingTags'
8598+
type: object
8599+
MuteFindingResponseData:
8600+
description: Data object containing the updated finding.
8601+
properties:
8602+
attributes:
8603+
$ref: '#/components/schemas/MuteFindingResponseAttributes'
8604+
id:
8605+
$ref: '#/components/schemas/FindingID'
8606+
type:
8607+
$ref: '#/components/schemas/FindingType'
8608+
type: object
8609+
MuteFindingResponseProperties:
8610+
additionalProperties: false
8611+
description: Information about the mute status of this finding.
8612+
properties:
8613+
description:
8614+
description: 'Additional information about the reason why this finding is
8615+
muted or unmuted.
8616+
8617+
This attribute will not be included in the response if the description
8618+
is not provided in the request body.
8619+
8620+
'
8621+
example: To be resolved later
8622+
type: string
8623+
expiration_date:
8624+
description: 'The expiration date of the mute or unmute action.
8625+
8626+
If the expiration date is not provided in the request body, this attribute
8627+
will not be included in the response and the finding will be muted or
8628+
unmuted indefinitely.
8629+
8630+
'
8631+
example: 1778721573794
8632+
format: int64
8633+
type: integer
8634+
muted:
8635+
description: Whether this finding is muted or unmuted.
8636+
example: true
8637+
type: boolean
8638+
reason:
8639+
$ref: '#/components/schemas/FindingMuteReason'
8640+
type: object
84748641
NullableRelationshipToUser:
84758642
description: Relationship to user.
84768643
properties:
@@ -19954,6 +20121,87 @@ paths:
1995420121
x-unstable: '**Note**: This endpoint is in public beta.
1995520122

1995620123
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
20124+
patch:
20125+
description: 'Mute or unmute a specific finding.
20126+
20127+
The API returns the updated finding object when the request is successful.'
20128+
operationId: UpdateFinding
20129+
parameters:
20130+
- description: The ID of the finding.
20131+
in: path
20132+
name: finding_id
20133+
required: true
20134+
schema:
20135+
type: string
20136+
requestBody:
20137+
content:
20138+
application/json:
20139+
schema:
20140+
$ref: '#/components/schemas/MuteFindingRequest'
20141+
description: 'To mute or unmute a finding, the request body should include
20142+
at least two attributes: `muted` and `reason`. The allowed reasons depend
20143+
on whether the finding is being muted or unmuted:
20144+
20145+
- To mute a finding: `PENDING_FIX`, `FALSE_POSITIVE`, `ACCEPTED_RISK`, `OTHER`.
20146+
20147+
- To unmute a finding : `NO_PENDING_FIX`, `HUMAN_ERROR`, `NO_LONGER_ACCEPTED_RISK`,
20148+
`OTHER`.
20149+
20150+
'
20151+
required: true
20152+
responses:
20153+
'200':
20154+
content:
20155+
application/json:
20156+
schema:
20157+
$ref: '#/components/schemas/MuteFindingResponse'
20158+
description: OK
20159+
'400':
20160+
content:
20161+
application/json:
20162+
schema:
20163+
$ref: '#/components/schemas/FindingsErrorResponse'
20164+
description: 'Bad Request: The server cannot process the request due to
20165+
invalid syntax in the request.'
20166+
'404':
20167+
content:
20168+
application/json:
20169+
schema:
20170+
$ref: '#/components/schemas/FindingsErrorResponse'
20171+
description: 'Not Found: The requested finding cannot be found.'
20172+
'409':
20173+
content:
20174+
application/json:
20175+
schema:
20176+
$ref: '#/components/schemas/FindingsErrorResponse'
20177+
description: 'Resource Conflict: The finding has already been muted or unmuted
20178+
within the last 60 seconds.'
20179+
'422':
20180+
content:
20181+
application/json:
20182+
schema:
20183+
$ref: '#/components/schemas/FindingsErrorResponse'
20184+
description: 'Invalid Request: The server understands the request syntax
20185+
but cannot process it due to invalid data.'
20186+
'429':
20187+
content:
20188+
application/json:
20189+
schema:
20190+
$ref: '#/components/schemas/FindingsErrorResponse'
20191+
description: 'Too many requests: The rate limit set by the API has been
20192+
exceeded.'
20193+
security:
20194+
- apiKeyAuth: []
20195+
appKeyAuth: []
20196+
- AuthZ:
20197+
- security_monitoring_findings_write
20198+
summary: Mute or unmute a finding
20199+
tags:
20200+
- Security Monitoring
20201+
x-codegen-request-body-name: body
20202+
x-unstable: '**Note**: This endpoint is in public beta.
20203+
20204+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
1995720205
/api/v2/processes:
1995820206
get:
1995920207
description: Get all processes for your organization.

0 commit comments

Comments
 (0)