chg: [openapi:event_report] Added content for event-reports

pull/9631/head
Sami Mokaddem 2024-03-19 10:53:52 +01:00
parent 3022d51a06
commit 88cf4919b0
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 306 additions and 1 deletions

View File

@ -128,6 +128,9 @@ tags:
description: "MISP Taxonomies is a set of common classification libraries to tag, classify and organise information. Taxonomy allows to express the same vocabulary among a distributed set of users and organisations."
externalDocs:
url: https://www.circl.lu/doc/misp/taxonomy/#taxonomies
- name: Event Report
description: "Event reports can contain text under the markdown format and are stored inside an event. They can be used to describe events or processes in a readable way."
paths:
/attributes/restSearch:
@ -322,6 +325,121 @@ paths:
default:
$ref: "#/components/responses/ApiErrorResponse"
/eventReports/view/{eventReportId}:
get:
summary: "Get event report by ID"
operationId: viewEventReport
tags:
- Event Report
parameters:
- $ref: "#/components/parameters/eventReportIdParameter"
responses:
"200":
$ref: "#/components/responses/EventReportResponse"
"403":
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
default:
$ref: "#/components/responses/ApiErrorResponse"
/eventReports/add/{eventId}:
post:
summary: "Add Event Report"
operationId: addEventReport
tags:
- Event Report
parameters:
- $ref: "#/components/parameters/eventIdParameter"
requestBody:
$ref: "#/components/requestBodies/AddEventReportRequest"
responses:
"200":
$ref: "#/components/responses/EventReportResponse"
"403":
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
default:
$ref: "#/components/responses/ApiErrorResponse"
/eventReports/edit/{eventReportId}:
post:
summary: "Edit Event Report"
operationId: editEventReport
tags:
- Event Report
parameters:
- $ref: "#/components/parameters/eventReportIdParameter"
responses:
"200":
$ref: "#/components/responses/EventReportResponse"
"403":
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
default:
$ref: "#/components/responses/ApiErrorResponse"
/eventReports/delete/{eventReportId}/{hardDelete}:
post:
summary: "Delete Event Report"
operationId: deleteEventReport
tags:
- Event Report
parameters:
- $ref: "#/components/parameters/eventReportIdParameter"
- $ref: "#/components/parameters/hardDeleteParameterNotRequired"
responses:
"200":
$ref: "#/components/responses/DeleteEventReportResponse"
"403":
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
default:
$ref: "#/components/responses/ApiErrorResponse"
/eventReports/restore/{eventReportId}:
post:
summary: "Restore Event Report"
operationId: restoreEventReport
tags:
- Event Report
parameters:
- $ref: "#/components/parameters/eventReportIdParameter"
responses:
"200":
$ref: "#/components/responses/RestoreEventReportResponse"
"403":
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
default:
$ref: "#/components/responses/ApiErrorResponse"
/eventReports/index:
get:
summary: "Get event reports"
operationId: indexEventReport
tags:
- Event Report
responses:
"200":
$ref: "#/components/responses/EventReportListResponse"
"403":
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
default:
$ref: "#/components/responses/ApiErrorResponse"
/eventReports/importReportFromUrl/{eventId}:
post:
summary: "Import Report From URL"
operationId: importFromURLEventReport
tags:
- Event Report
parameters:
- $ref: "#/components/parameters/eventIdParameter"
requestBody:
$ref: "#/components/requestBodies/ImportFromURLEventReportRequest"
responses:
"200":
$ref: "#/components/responses/EventReportImportFromUrlResponse"
"403":
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
default:
$ref: "#/components/responses/ApiErrorResponse"
/events/restSearch:
post:
summary: "[restSearch] Get a filtered and paginated list of events"
@ -3128,8 +3246,47 @@ components:
items:
$ref: "#/components/schemas/EventTag"
EventReport: # TODO: describe
EventReportId:
type: string
pattern: '^\d+$'
maxLength: 10
example: "12345"
EventReportName:
type: string
maxLength: 65535
example: "Report of the incident"
EventReportValue:
type: string
EventReport:
allOf:
- type: object
properties:
id:
$ref: "#/components/schemas/EventReportId"
- $ref: "#/components/schemas/EventReportNoId"
EventReportNoId:
type: object
properties:
uuid:
$ref: "#/components/schemas/UUID"
event_id:
$ref: "#/components/schemas/EventId"
name:
$ref: "#/components/schemas/EventReportName"
content:
$ref: "#/components/schemas/EventReportValue"
distribution:
$ref: "#/components/schemas/DistributionLevelId"
sharing_group_id:
$ref: "#/components/schemas/SharingGroupId"
timestamp:
$ref: "#/components/schemas/NullableTimestamp"
deleted:
$ref: "#/components/schemas/SoftDeletedFlag"
EventNoId:
type: object
@ -6209,6 +6366,17 @@ components:
- "0"
- "1"
hardDeleteParameterNotRequired:
name: hardDelete
in: path
description: "`1` for hard delete the entity, `0` for soft deletion."
required: false
schema:
type: string
enum:
- "0"
- "1"
objectTemplateIdParameter:
name: objectTemplateId
in: path
@ -6253,6 +6421,16 @@ components:
schema:
$ref: "#/components/schemas/TaxonomyId"
eventReportIdParameter:
name: eventReportId
in: path
description: "UUID or numeric ID of the event report"
required: true
schema:
oneOf:
- $ref: "#/components/schemas/EventReportId"
- $ref: "#/components/schemas/UUID"
securitySchemes:
ApiKeyAuth:
type: apiKey
@ -7052,6 +7230,24 @@ components:
- $ref: "#/components/schemas/TagNumbericalValueOverrideUserSetting"
- $ref: "#/components/schemas/EventIndexHideColumnsUserSetting"
AddEventReportRequest:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EventReportNoId"
ImportFromURLEventReportRequest:
required: true
content:
application/json:
schema:
type: object
properties:
url:
type: string
example: "https://domain.example/blogpost/123.pdf"
responses:
AttributeResponse:
description: "An attribute"
@ -7206,6 +7402,93 @@ components:
nullable: true
example: "Event was not deleted."
DeleteEventReportResponse:
description: "Delete event report response"
content:
application/json:
schema:
type: object
properties:
saved:
description: "`true` if the event was succesfully deleted, `false` if it failed"
type: boolean
success:
description: "`true` if the event was succesfully deleted, `false` if it failed"
nullable: true
type: boolean
name:
type: string
example: "Event report 1 soft deleted."
message:
type: string
example: "Event Report 1 could not be soft deleted. Reasons: Errors"
url:
type: string
example: "/eventReport/delete/1"
errors:
description: "Only present if an error occurred when deleting the event"
type: string
nullable: true
example: "Event Report was not deleted."
RestoreEventReportResponse:
description: "Restore Event Report response"
content:
application/json:
schema:
type: object
properties:
saved:
description: "`true` if the event was succesfully deleted, `false` if it failed"
type: boolean
success:
description: "`true` if the event was succesfully deleted, `false` if it failed"
nullable: true
type: boolean
name:
type: string
example: "Event report 1 restored."
message:
type: string
example: "Event Report 1 could not be restored. Reasons: Errors"
url:
type: string
example: "/eventReport/restore/1"
errors:
description: "Only present if an error occurred when deleting the event"
type: string
nullable: true
example: "Event Report was not restored."
EventReportImportFromUrlResponse:
description: "Import from URL Event Report response"
content:
application/json:
schema:
type: object
properties:
saved:
description: "`true` if the event report was succesfully created, `false` if it failed"
type: boolean
success:
description: "`true` if the event report was succesfully created, `false` if it failed"
nullable: true
type: boolean
name:
type: string
example: "Event report imported"
message:
type: string
example: "Report downloaded and created"
url:
type: string
example: "/eventReport/importReportFromUrl/1"
errors:
description: "Only present if an error occurred when deleting the event"
type: string
nullable: true
example: "Could not fetch report from URL. Fetcher module not enabled or could not download the page"
AddEventTagResponse:
description: "Add event tag response"
content:
@ -7332,6 +7615,28 @@ components:
type: string
example: "/events/unpublish/1"
EventReportResponse:
description: "An Event Report"
content:
application/json:
schema:
type: object
properties:
EventReport:
$ref: "#/components/schemas/EventReport"
EventReportListResponse:
description: "Get a list of Event Report"
content:
application/json:
schema:
type: array
items:
type: object
properties:
EventReport:
$ref: "#/components/schemas/EventReport"
GalaxyListResponse:
description: "A list of galaxies"
content: