Skip to content

Commit

Permalink
[Threat Hunting Investigations] Use OpenAPI types in more timeline ro…
Browse files Browse the repository at this point in the history
…utes (elastic#189977)

## Summary

Fixes: elastic/security-team#10133

Migrates some timeline routes to use the newly generated OpenAPI types.
The changes mostly affect pinned event and note routes to keep the
changes small. Routes that actually accept and return timeline objects
will come in a next step.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
3 people authored Sep 24, 2024
1 parent 80f938e commit caad894
Show file tree
Hide file tree
Showing 45 changed files with 675 additions and 560 deletions.
135 changes: 87 additions & 48 deletions oas_docs/output/kibana.serverless.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15090,7 +15090,8 @@ paths:
type: string
required:
- noteId
- type: object
- nullable: true
type: object
properties:
noteIds:
items:
Expand Down Expand Up @@ -15121,19 +15122,18 @@ paths:
parameters:
- in: query
name: documentIds
required: true
schema:
$ref: '#/components/schemas/Security_Solution_Timeline_API_DocumentIds'
- in: query
name: page
schema:
nullable: true
type: number
type: string
- in: query
name: perPage
schema:
nullable: true
type: number
type: string
- in: query
name: search
schema:
Expand All @@ -15156,6 +15156,13 @@ paths:
type: string
responses:
'200':
content:
application/json; Elastic-Api-Version=2023-10-31:
schema:
oneOf:
- $ref: >-
#/components/schemas/Security_Solution_Timeline_API_GetNotesResult
- type: object
description: Indicates the requested notes were returned.
summary: Get notes
tags:
Expand Down Expand Up @@ -15205,19 +15212,8 @@ paths:
type: object
properties:
persistNote:
type: object
properties:
code:
type: number
message:
type: string
note:
$ref: >-
#/components/schemas/Security_Solution_Timeline_API_Note
required:
- code
- message
- note
$ref: >-
#/components/schemas/Security_Solution_Timeline_API_ResponseNote
required:
- persistNote
required:
Expand Down Expand Up @@ -15589,15 +15585,8 @@ paths:
type: object
properties:
persistPinnedEventOnTimeline:
allOf:
- $ref: >-
#/components/schemas/Security_Solution_Timeline_API_PinnedEvent
- type: object
properties:
code:
type: number
message:
type: string
$ref: >-
#/components/schemas/Security_Solution_Timeline_API_PersistPinnedEventResponse
required:
- persistPinnedEventOnTimeline
required:
Expand Down Expand Up @@ -32400,15 +32389,36 @@ components:
nullable: true
type: string
timelineId:
type: string
updated:
nullable: true
type: number
updatedBy:
nullable: true
type: string
required:
- timelineId
Security_Solution_Timeline_API_BarePinnedEvent:
type: object
properties:
created:
nullable: true
type: number
createdBy:
nullable: true
type: string
eventId:
type: string
timelineId:
type: string
updated:
nullable: true
type: number
updatedBy:
nullable: true
type: string
required:
- eventId
- timelineId
Security_Solution_Timeline_API_ColumnHeaderResult:
type: object
Expand Down Expand Up @@ -32584,6 +32594,18 @@ components:
type: string
script:
type: string
Security_Solution_Timeline_API_GetNotesResult:
type: object
properties:
notes:
items:
$ref: '#/components/schemas/Security_Solution_Timeline_API_Note'
type: array
totalCount:
type: number
required:
- totalCount
- notes
Security_Solution_Timeline_API_ImportTimelineResult:
type: object
properties:
Expand Down Expand Up @@ -32644,34 +32666,38 @@ components:
type: string
version:
type: string
required:
- noteId
- version
Security_Solution_Timeline_API_PersistPinnedEventResponse:
oneOf:
- allOf:
- $ref: '#/components/schemas/Security_Solution_Timeline_API_PinnedEvent'
- $ref: >-
#/components/schemas/Security_Solution_Timeline_API_PinnedEventBaseResponseBody
- nullable: true
type: object
Security_Solution_Timeline_API_PinnedEvent:
allOf:
- $ref: '#/components/schemas/Security_Solution_Timeline_API_BarePinnedEvent'
- type: object
properties:
pinnedEventId:
type: string
version:
type: string
required:
- pinnedEventId
- version
Security_Solution_Timeline_API_PinnedEventBaseResponseBody:
type: object
properties:
created:
nullable: true
type: number
createdBy:
nullable: true
type: string
eventId:
type: string
pinnedEventId:
type: string
timelineId:
type: string
updated:
nullable: true
code:
type: number
updatedBy:
nullable: true
type: string
version:
message:
type: string
required:
- eventId
- pinnedEventId
- timelineId
- version
- code
Security_Solution_Timeline_API_QueryMatchResult:
type: object
properties:
Expand Down Expand Up @@ -32716,6 +32742,19 @@ components:
type: object
readable:
type: boolean
Security_Solution_Timeline_API_ResponseNote:
type: object
properties:
code:
type: number
message:
type: string
note:
$ref: '#/components/schemas/Security_Solution_Timeline_API_Note'
required:
- code
- message
- note
Security_Solution_Timeline_API_RowRendererId:
enum:
- alert
Expand Down
Loading

0 comments on commit caad894

Please sign in to comment.