Skip to content

Commit

Permalink
Add support for mute findings endpoint (#1469)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec committed Jun 5, 2023
1 parent d69a4e6 commit a5824d4
Show file tree
Hide file tree
Showing 24 changed files with 1,129 additions and 23 deletions.
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.4",
"regenerated": "2023-06-05 14:46:50.084688",
"spec_repo_commit": "060dc917"
"regenerated": "2023-06-05 15:08:59.861687",
"spec_repo_commit": "2638a894"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-05 14:46:50.097095",
"spec_repo_commit": "060dc917"
"regenerated": "2023-06-05 15:08:59.874012",
"spec_repo_commit": "2638a894"
}
}
}
264 changes: 256 additions & 8 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3674,7 +3674,7 @@ components:
type: array
type: object
Finding:
description: A single finding without message and resource configuration.
description: A single finding without the message and resource configuration.
properties:
attributes:
$ref: '#/components/schemas/FindingAttributes'
Expand Down Expand Up @@ -3732,16 +3732,16 @@ components:
properties:
description:
description: Additional information about the reason why this finding is
muted.
muted or unmuted.
example: To be resolved later
type: string
expiration_date:
description: The end of the mute period.
description: The expiration date of the mute or unmute action (Unix ms).
example: 1778721573794
format: int64
type: integer
muted:
description: Whether this finding is muted.
description: Whether this finding is muted or unmuted.
example: true
type: boolean
reason:
Expand All @@ -3752,23 +3752,29 @@ components:
format: int64
type: integer
uuid:
description: The ID of the user who muted this finding.
description: The ID of the user who muted or unmuted this finding.
example: e51c9744-d158-11ec-ad23-da7ad0900002
type: string
type: object
FindingMuteReason:
description: The reason why this finding is muted.
description: The reason why this finding is muted or unmuted.
enum:
- ACCEPTED_RISK
- PENDING_FIX
- FALSE_POSITIVE
- ACCEPTED_RISK
- NO_PENDING_FIX
- HUMAN_ERROR
- NO_LONGER_ACCEPTED_RISK
- OTHER
example: ACCEPTED_RISK
type: string
x-enum-varnames:
- ACCEPTED_RISK
- PENDING_FIX
- FALSE_POSITIVE
- ACCEPTED_RISK
- NO_PENDING_FIX
- HUMAN_ERROR
- NO_LONGER_ACCEPTED_RISK
- OTHER
FindingResource:
description: The resource name of this finding.
Expand Down Expand Up @@ -3831,6 +3837,34 @@ components:
type: string
x-enum-varnames:
- FINDING
FindingsErrorItem:
description: API error response body
properties:
detail:
description: A human-readable explanation specific to this occurrence of
the error.
example: attribute "muted" is required
type: string
status:
description: Status code of the response.
example: '400'
type: string
title:
description: Short human-readable summary of the error.
example: Bad Request
type: string
type: object
FindingsErrorResponse:
description: API error response.
properties:
errors:
description: A list of errors.
items:
$ref: '#/components/schemas/FindingsErrorItem'
type: array
required:
- errors
type: object
FormulaLimit:
description: Message for specifying limits to the number of values returned
by a query.
Expand Down Expand Up @@ -8471,6 +8505,139 @@ components:
description: The monitor type.
type: string
type: object
MuteFindingRequest:
description: The new mute finding request.
properties:
data:
$ref: '#/components/schemas/MuteFindingRequestData'
required:
- data
type: object
MuteFindingRequestAttributes:
additionalProperties: false
description: The mute properties to be updated.
properties:
mute:
$ref: '#/components/schemas/MuteFindingRequestProperties'
required:
- mute
type: object
MuteFindingRequestData:
description: Data object containing the new mute properties of the finding.
properties:
attributes:
$ref: '#/components/schemas/MuteFindingRequestAttributes'
id:
$ref: '#/components/schemas/FindingID'
type:
$ref: '#/components/schemas/FindingType'
required:
- id
- type
- attributes
type: object
MuteFindingRequestProperties:
additionalProperties: false
description: Object containing the new mute properties of the finding.
properties:
description:
description: Additional information about the reason why this finding is
muted or unmuted. This field has a maximum limit of 280 characters.
example: To be resolved later
type: string
expiration_date:
description: 'The expiration date of the mute or unmute action (Unix ms).
It must be set to a value greater than the current timestamp.

If this field is not provided, the finding will be muted or unmuted indefinitely,
which is equivalent to setting the expiration date to 9999999999999.

'
example: 1778721573794
format: int64
type: integer
muted:
description: Whether this finding is muted or unmuted.
example: true
type: boolean
reason:
$ref: '#/components/schemas/FindingMuteReason'
required:
- muted
- reason
type: object
MuteFindingResponse:
description: The expected response schema.
properties:
data:
$ref: '#/components/schemas/MuteFindingResponseData'
required:
- data
type: object
MuteFindingResponseAttributes:
description: The JSON:API attributes of the finding.
properties:
evaluation:
$ref: '#/components/schemas/FindingEvaluation'
evaluation_changed_at:
$ref: '#/components/schemas/FindingEvaluationChangedAt'
mute:
$ref: '#/components/schemas/MuteFindingResponseProperties'
resource:
$ref: '#/components/schemas/FindingResource'
resource_discovery_date:
$ref: '#/components/schemas/FindingResourceDiscoveryDate'
resource_type:
$ref: '#/components/schemas/FindingResourceType'
rule:
$ref: '#/components/schemas/FindingRule'
status:
$ref: '#/components/schemas/FindingStatus'
tags:
$ref: '#/components/schemas/FindingTags'
type: object
MuteFindingResponseData:
description: Data object containing the updated finding.
properties:
attributes:
$ref: '#/components/schemas/MuteFindingResponseAttributes'
id:
$ref: '#/components/schemas/FindingID'
type:
$ref: '#/components/schemas/FindingType'
type: object
MuteFindingResponseProperties:
additionalProperties: false
description: Information about the mute status of this finding.
properties:
description:
description: 'Additional information about the reason why this finding is
muted or unmuted.

This attribute will not be included in the response if the description
is not provided in the request body.

'
example: To be resolved later
type: string
expiration_date:
description: 'The expiration date of the mute or unmute action.

If the expiration date is not provided in the request body, this attribute
will not be included in the response and the finding will be muted or
unmuted indefinitely.

'
example: 1778721573794
format: int64
type: integer
muted:
description: Whether this finding is muted or unmuted.
example: true
type: boolean
reason:
$ref: '#/components/schemas/FindingMuteReason'
type: object
NullableRelationshipToUser:
description: Relationship to user.
properties:
Expand Down Expand Up @@ -19954,6 +20121,87 @@ paths:
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
patch:
description: 'Mute or unmute a specific finding.

The API returns the updated finding object when the request is successful.'
operationId: UpdateFinding
parameters:
- description: The ID of the finding.
in: path
name: finding_id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MuteFindingRequest'
description: 'To mute or unmute a finding, the request body should include
at least two attributes: `muted` and `reason`. The allowed reasons depend
on whether the finding is being muted or unmuted:

- To mute a finding: `PENDING_FIX`, `FALSE_POSITIVE`, `ACCEPTED_RISK`, `OTHER`.

- To unmute a finding : `NO_PENDING_FIX`, `HUMAN_ERROR`, `NO_LONGER_ACCEPTED_RISK`,
`OTHER`.

'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/MuteFindingResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Bad Request: The server cannot process the request due to
invalid syntax in the request.'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Not Found: The requested finding cannot be found.'
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Resource Conflict: The finding has already been muted or unmuted
within the last 60 seconds.'
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Invalid Request: The server understands the request syntax
but cannot process it due to invalid data.'
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Too many requests: The rate limit set by the API has been
exceeded.'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- security_monitoring_findings_write
summary: Mute or unmute a finding
tags:
- Security Monitoring
x-codegen-request-body-name: body
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/processes:
get:
description: Get all processes for your organization.
Expand Down
Loading

0 comments on commit a5824d4

Please sign in to comment.