openapi: 3.0.1 info: title: Canopsis Community API description: This is a Canopsis Community API. version: 4.0.0 license: name: GNU AGPLv3 url: https://www.gnu.org/licenses/agpl-3.0.html servers: - url: /api/v4 paths: /account/me: get: tags: - account summary: Get account description: Get account. operationId: account-get responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/account.User' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - account summary: Update account description: Update account. operationId: account-update requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/account.EditRequest' required: true responses: '200': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/account.User' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /active-broadcast-message: get: tags: - broadcast-messages summary: Get all active broadcast-message description: Get all active broadcast-message. operationId: broadcast-messages-get-active responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/broadcastmessage.Response' security: - { } /alarm-counters: get: tags: - alarms summary: Count alarms description: | Get counts of alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-get-counts parameters: - name: filters[] in: query style: form explode: true schema: type: array items: type: string - name: category in: query schema: type: string - name: tag in: query schema: type: string - name: correlation in: query schema: type: boolean - name: instruction_filter_type in: query description: |- Possible instruction filter type values. * `0` - No instructions. * `1` - No instructions or not in progress. * `2` - Has instructions. schema: type: integer enum: - 0 - 1 - 2 - name: instruction_ids[] in: query schema: type: array items: type: string - name: instruction_statuses[] in: query description: |- Possible instruction filter type values. * `0` - No instructions. * `1` - No instructions or not in progress. * `2` - Has instructions. schema: type: array items: type: integer enum: - 0 - 1 - 2 - name: instruction_type in: query description: |- Possible instruction type values. * `0` - Manual. * `1` - Auto. schema: type: integer enum: - 0 - 1 - name: opened in: query schema: type: boolean - name: time_field in: query schema: type: string - name: tstart in: query schema: type: integer - name: tstop in: query schema: type: integer - name: alarm_pattern in: query schema: type: string - name: entity_pattern in: query schema: type: string - name: pbehavior_pattern in: query schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarm.Count' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /alarm-display-names: get: tags: - alarm-display-names summary: Find alarm display names description: | Get paginated alarm display names. - PERMISSIONS: `api_alarm_read` operationId: alarm-find-alarm-display-names parameters: - name: opened in: query schema: type: boolean - in: query name: alarm_pattern schema: type: string example: "[[{\"field\":\"v.component\",\"cond\":{\"type\":\"eq\",\"value\":\"cps_component\"}}]]" - in: query name: entity_pattern schema: type: string example: "[[{\"field\":\"name\",\"cond\":{\"type\":\"eq\",\"value\":\"cps_resource\"}}]]" - in: query name: pbehavior_pattern schema: type: string example: "[[{\"field\":\"pbehavior_info.type\",\"cond\":{\"type\":\"eq\",\"value\":\"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}}]]" - in: query name: sort description: sort query schema: type: string enum: - asc - desc - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarm.DisplayNameData' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /alarm-export: post: tags: - alarms summary: Start export alarms description: | Start export alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-export-start requestBody: description: request content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarm.ExportRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarm.ExportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /alarm-export/{id}: get: tags: - alarms summary: Get status of export alarms description: | Get status of export alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-export-get parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarm.ExportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarm-export/{id}/download: get: tags: - alarms summary: Get result of export alarms description: | Get result of export alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-export-download parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: text/csv: schema: type: string format: binary '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarm-details: post: tags: - alarms summary: Get alarms' details description: | Get paginated list of alarms' steps and children. - PERMISSIONS: `api_alarm_read` operationId: alarms-details-get requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarm.DetailsRequest' examples: get: summary: Get details description: Get details of alarms value: [ { "_id": "293d7b83-e622-40d9-95ef-86b06eda3746", "with_instructions": true, "with_declare_tickets": true, "opened": true, "steps": { "page": 1, "limit": 10, "reversed": true }, "children": { "page": 1, "limit": 10, "sort_by": "v.resource", "sort": "asc", "multi_sort": [] } }, { "_id": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "opened": true, "steps": { "page": 2 } } ] required: true responses: '207': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarm.DetailsResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /alarm-links/{id}: get: tags: - alarms summary: Get alarms' links description: | Get alarms' links. - PERMISSIONS: `api_alarm_read` operationId: alarms-links-get parameters: - $ref: '#/components/parameters/id' - name: ids[] description: alarm ids in: query style: form explode: true schema: type: array items: type: string responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/link.Link' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarm-tag-labels: get: tags: - alarm-tag-labels summary: Get labels of alarm tags description: | Get paginated list of labels of alarm tags. - PERMISSIONS: `api_alarm_tag:read` operationId: alarm-tag-labels-get parameters: - name: ids[] in: query style: form explode: true schema: type: array items: type: string - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.LabelResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /alarm-tags: get: tags: - alarm-tags summary: Get alarm tags description: | Get paginated list of alarm tags. - PERMISSIONS: `api_alarm_tag:read` operationId: alarm-tags-get parameters: - name: values[] in: query style: form explode: true schema: type: array items: type: string - $ref: '#/components/parameters/withFlags' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - alarm-tags summary: Create an internal alarm tag description: | Create an internal alarm tag. - PERMISSIONS: `api_alarm_tag:create` operationId: alarm-tags-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.CreateRequest' examples: create: summary: Create a tag description: Create a tag value: { "value": "cloud", "color": "#AABBCC", "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /alarm-tags/{id}: get: tags: - alarm-tags summary: Get an alarm tag by id description: | Get an alarm tag by id. - PERMISSIONS: `api_alarm_tag:read` operationId: alarm-tags-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - alarm-tags summary: Update an alarm tag by id description: | Update an alarm tag by id. - PERMISSIONS: `api_alarm_tag:update` operationId: alarm-tags-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.UpdateRequest' examples: internal: summary: Update an internal tag description: Update an internal tag value: { "color": "#AABBCC", "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } external: summary: Update an external tag description: Update an external tag value: { "color": "#AABBCC" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - alarm-tags summary: Delete an alarm tag by id description: | Delete an alarm tag by id. - PERMISSIONS: `api_alarm_tag:delete` operationId: alarm-tags-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarm-tag-pattern-fields: get: tags: - alarm-tags summary: Get pattern fields for alarm tags description: | Get pattern fields for alarm tags. - PERMISSIONS: `api_alarm_tag:read` operationId: alarm-tags-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /alarms: get: tags: - alarms summary: Find all alarms description: | Get paginated list of alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-find-all parameters: - name: active_columns[] in: query style: form explode: true schema: type: array items: type: string - name: filters[] in: query style: form explode: true schema: type: array items: type: string - name: category in: query schema: type: string - name: tag in: query schema: type: string - name: correlation in: query schema: type: boolean - name: instruction_filter_type in: query description: |- Possible instruction filter type values. * `0` - No instructions. * `1` - No instructions or not in progress. * `2` - Has instructions. schema: type: integer enum: - 0 - 1 - 2 - name: instruction_ids[] in: query schema: type: array items: type: string - name: instruction_statuses[] in: query description: |- Possible instruction filter type values. * `0` - No instructions. * `1` - No instructions or not in progress. * `2` - Has instructions. schema: type: array items: type: integer enum: - 0 - 1 - 2 - name: instruction_type in: query description: |- Possible instruction type values. * `0` - Manual. * `1` - Auto. schema: type: integer enum: - 0 - 1 - name: opened in: query schema: type: boolean - name: time_field in: query schema: type: string - name: tstart in: query schema: type: integer - name: tstop in: query schema: type: integer - in: query name: alarm_pattern schema: type: string example: "[[{\"field\":\"v.component\",\"cond\":{\"type\":\"eq\",\"value\":\"cps_component\"}}]]" - in: query name: entity_pattern schema: type: string example: "[[{\"field\":\"name\",\"cond\":{\"type\":\"eq\",\"value\":\"cps_resource\"}}]]" - in: query name: pbehavior_pattern schema: type: string example: "[[{\"field\":\"pbehavior_info.type\",\"cond\":{\"type\":\"eq\",\"value\":\"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}}]]" - name: with_links in: query description: Links are retrieved from external service so use carefully with big limit. schema: type: boolean - name: with_instructions in: query description: show assigned instructions and execution flags schema: type: boolean - name: with_declare_tickets in: query description: show assigned declare ticket rules schema: type: boolean - name: only_bookmarks in: query description: show bookmarked alarms schema: type: boolean - name: with_dependencies in: query description: count connected services depends_count and impacts_count schema: type: boolean - name: with_tag_colors in: query description: retrieve tag colors schema: type: boolean - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query schema: type: string - name: multi_sort[] in: query style: form explode: true schema: type: array items: type: string example: t,asc - name: query_log in: query description: show query log schema: type: boolean responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarm.Alarm' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /alarms/{id}: get: tags: - alarms summary: Get alarm by id description: | Get alarm by id. - PERMISSIONS: `api_alarm_read` operationId: alarms-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarm.Alarm' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/ack: put: tags: - alarms summary: Ack alarm description: | Ack alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-ack parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.AckRequest' examples: ack: summary: Ack description: Ack an alarm. value: { "comment": "Lorem ipsum dolor sit amet" } ack_resources: summary: Ack with resources description: Ack an alarm of a component and all alarms of related resources. value: { "ack_resources": true, "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/ackremove: put: tags: - alarms summary: Remove ack alarm description: | Remove ack alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-ackremove parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.Request' examples: ackremove: summary: Remove ack description: Remove ack from an alarm. value: { "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/assocticket: put: tags: - alarms summary: Assoc ticket alarm description: | Assoc ticket alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-assocticket parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.AssocTicketRequest' examples: assocticket: summary: Associate ticket description: Associate ticket with an alarm. value: { "ticket": "ENV-116", "url": "https://jira.local/ENV-116", "system_name": "Jira", "data": { "priority": "high", "tag": "env" }, "comment": "Lorem ipsum dolor sit amet" } assocticket_resources: summary: Associate ticket with resources description: Associate ticket with an alarm of a component and all alarms of related resources. value: { "ticket_resources": true, "ticket": "ENV-116", "url": "https://jira.local/ENV-116", "system_name": "Jira", "data": { "priority": "high", "tag": "env" }, "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/ticketremove: put: tags: - alarms summary: Remove alarm ticket description: | Remove alarm ticket. - PERMISSIONS: `api_alarm_update` operationId: alarms-ticketremove parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.TicketRemoveRequest' examples: ticketremove: summary: Remove ticket description: Remove ticket from an alarm. value: { "ticket": "ENV-116", "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/bookmark: put: tags: - alarms summary: Add bookmark to an alarm description: | Add bookmark to an alarm. - PERMISSIONS: `api_alarm_update` operationId: add-alarm-bookmark parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - alarms summary: Remove bookmark from an alarm description: | Remove bookmark from an alarm. - PERMISSIONS: `api_alarm_update` operationId: remove-alarm-bookmark parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/cancel: put: tags: - alarms summary: Cancel alarm description: | Cancel alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-cancel parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.Request' examples: cancel: summary: Cancel description: Cancel an alarm. value: { "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/changestate: put: tags: - alarms summary: Change state alarm description: | Change state alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-changestate parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.ChangeStateRequest' examples: changestate: summary: Change state description: Change a state of an alarm. value: { "state": 3, "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/comment: put: tags: - alarms summary: Comment alarm description: | Comment alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-comment parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.CommentRequest' examples: comment: summary: Comment description: Comment an alarm. value: { "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/snooze: put: tags: - alarms summary: Snooze alarm description: | Snooze alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-snooze parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.SnoozeRequest' examples: snooze: summary: Snooze description: Snooze an alarm. value: { "duration": { "value": 15, "unit": "m" }, "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /alarms/{id}/uncancel: put: tags: - alarms summary: Uncancel alarm description: | Uncancel alarm. - PERMISSIONS: `api_alarm_update` operationId: alarms-uncancel parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.Request' examples: uncancel: summary: Uncancel description: Uncancel an alarm. value: { "comment": "Lorem ipsum dolor sit amet" } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /app-info: get: tags: - internal summary: Get application information description: Get application information. operationId: internal-get-app-info responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/appinfo.AppInfoResponse' security: - { } /associativetable: get: tags: - associativetables summary: Get associativetable by name description: | Get associativetable by name. - PERMISSIONS: `api_associative_table:read` operationId: associativetables-get-by-name parameters: - name: name in: query description: associativetable name required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/associativetable.AssociativeTable' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - associativetables summary: Create/update associativetable description: | Create/update associativetable. - PERMISSIONS: `api_associative_table:update` operationId: associativetables-update requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/associativetable.AssociativeTable' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/associativetable.AssociativeTable' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - associativetables summary: Delete associativetable by name description: | Delete associativetable by name. - PERMISSIONS: `api_associative_table:delete` operationId: associativetables-delete-by-name parameters: - name: name in: query description: associativetable name required: true schema: type: string responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /broadcast-message: get: tags: - broadcast-messages summary: Find all broadcast-message description: | Get paginated list of broadcast-message. - PERMISSIONS: `api_broadcast_message:read` operationId: broadcast-messages-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/broadcastmessage.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - broadcast-messages summary: Create broadcast-message description: | Create broadcast-message. - PERMISSIONS: `api_broadcast_message:create` operationId: broadcast-messages-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/broadcastmessage.CreateRequest' required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/broadcastmessage.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /broadcast-message/{id}: get: tags: - broadcast-messages summary: Get broadcast-message by id description: | Get broadcast-message by id. - PERMISSIONS: `api_broadcast_message:read` operationId: broadcast-messages-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/broadcastmessage.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - broadcast-messages summary: Update broadcast-message by id description: | Update broadcast-message by id. - PERMISSIONS: `api_broadcast_message:update` operationId: broadcast-messages-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/broadcastmessage.UpdateRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/broadcastmessage.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - broadcast-messages summary: Delete broadcast-message by id description: | Delete broadcast-message by id. - PERMISSIONS: `api_broadcast_message:delete` operationId: broadcast-messages-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /broadcast-message/{id}/read: put: tags: - broadcast-messages summary: Read broadcast message by id description: | Read broadcast message by id. operationId: broadcast-messages-read-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /bulk/alarm-tags: delete: tags: - alarm-tags summary: Bulk delete alarm tags description: | Bulk delete alarm tags. - PERMISSIONS: `api_alarm_tag:delete` operationId: alarm-tags-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete tags value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmtag.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/alarms/ack: put: tags: - alarms summary: Ack alarms description: | Ack alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-ack requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkAckRequestItem' examples: ack: summary: Ack description: Ack alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "ack_resources": true, "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkAckRequestItem' /bulk/alarms/ackremove: put: tags: - alarms summary: Remove ack alarms description: | Remove ack alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-ackremove requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkRequestItem' examples: ackremove: summary: Remove ack description: Remove ack from alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkRequestItem' /bulk/alarms/assocticket: put: tags: - alarms summary: Assoc ticket alarms description: | Assoc ticket alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-assocticket requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkAssocTicketRequestItem' examples: assocticket: summary: Associate ticket description: Associate tickets with alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "ticket": "ENV-116", "url": "https://jira.local/ENV-116", "system_name": "Jira", "data": { "priority": "high", "tag": "env" }, "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "ticket_resources": true, "ticket": "ENV-117", "url": "https://jira.local/ENV-117", "system_name": "Jira", "data": { "priority": "low", "tag": "env" }, "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkAssocTicketRequestItem' /bulk/alarms/ticketremove: put: tags: - alarms summary: Remove alarm tickets description: | Remove alarm tickets. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-ticketremove requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkTicketRemoveRequestItem' examples: ticketremove: summary: Remove ticket description: Remove tickets from alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "ticket": "ENV-116", "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "ticket": "ENV-117", "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkTicketRemoveRequestItem' /bulk/alarms/cancel: put: tags: - alarms summary: Cancel alarms description: | Cancel alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-cancel requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkRequestItem' examples: cancel: summary: Cancel description: Cancel alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkRequestItem' /bulk/alarms/changestate: put: tags: - alarms summary: Change state alarms description: | Change state alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-changestate requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkChangeStateRequestItem' examples: changestate: summary: Change state description: Change state of alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "state": 3, "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "state": 2, "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkChangeStateRequestItem' /bulk/alarms/comment: put: tags: - alarms summary: Comment alarms description: | Comment alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-comment requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkCommentRequestItem' examples: comment: summary: Comment description: Comment alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkCommentRequestItem' /bulk/alarms/snooze: put: tags: - alarms summary: Snooze alarms description: | Snooze alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-snooze requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkSnoozeRequestItem' examples: snooze: summary: Snooze description: Snooze alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "duration": { "value": 15, "unit": "m" }, "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "duration": { "value": 30, "unit": "s" }, "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkSnoozeRequestItem' /bulk/alarms/uncancel: put: tags: - alarms summary: Uncancel alarms description: | Uncancel alarms. - PERMISSIONS: `api_alarm_update` operationId: alarms-bulk-uncancel requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkRequestItem' examples: uncancel: summary: Uncancel description: Uncancel alarms. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "comment": "Lorem ipsum dolor sit amet" }, { "_id": "4fb64340-dd69-4775-8334-b7cbd1dc1156", "comment": "Lorem ipsum dolor sit amet" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/alarmaction.BulkRequestItem' /bulk/color-themes: delete: tags: - color-themes summary: Bulk delete color themes description: | Bulk delete color themes. - PERMISSIONS: `api_color_theme:delete` operationId: colorthemes-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/colortheme.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete color themes value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/colortheme.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/comment-templates: delete: tags: - comment-templates summary: Bulk delete comment templates description: | Bulk delete comment templates. - PERMISSIONS: `api_comment_template:delete` operationId: comment-templates-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete comment templates value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /bulk/connector-pbehaviors: post: tags: - pbehaviors summary: Bulk create connector pbehaviors description: | Bulk create connector pbehaviors. - PERMISSIONS: `api_pbehavior:create` operationId: connector-pbehaviors-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkConnectorCreateRequestItem' examples: create: summary: Create description: Create connector pbehaviors value: [ { "entities": [ "cps_resource/cps_component" ], "origin": "centreon", "name": "Downtime", "tstart": 1650855600, "tstop": 1650891600, "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "comment": "Downtime by centreon" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkConnectorCreateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - pbehaviors summary: Bulk delete connector pbehaviors description: | Bulk delete connector pbehaviors. - PERMISSIONS: `api_pbehavior:delete` operationId: connector-pbehaviors-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkConnectorDeleteRequestItem' examples: delete: summary: Delete description: Delete entity pbehaviors value: [ { "entities": [ "cps_resource/cps_component" ], "origin": "centreon", "tstart": 1650855600, "tstop": 1650891600, "comment": "Downtime by centreon" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkConnectorDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' put: tags: - pbehaviors summary: Bulk create and delete connector pbehaviors description: | Bulk create and delete connector pbehaviors. - PERMISSIONS: `api_pbehavior:create`, `api_pbehavior:delete` operationId: connector-pbehaviors-bulk-edit requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkConnectorEditRequestItem' examples: create: summary: Create and delete description: Create and delete connector pbehaviors value: [ { "action": "create", "entities": [ "cps_resource1/cps_component1" ], "origin": "centreon", "name": "Downtime", "tstart": 1650855600, "tstop": 1650891600, "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "comment": "Downtime by centreon" }, { "action": "delete", "entities": [ "cps_resource2/cps_component2" ], "origin": "centreon", "tstart": 1650855600, "tstop": 1650891600, "comment": "Downtime by centreon" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkConnectorEditRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/entities/disable: put: tags: - entities summary: Bulk disable entities description: | Bulk disable entities. - PERMISSIONS: `api_entity:update` operationId: entitybasics-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entity.BulkToggleRequestItem' examples: update: summary: Disable description: Disable entities. value: [ { "_id": "cps_resource/cps_component" }, { "_id": "293d7b83-e622-40d9-95ef-86b06eda3746" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/entity.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/entities/enable: put: tags: - entities summary: Bulk enable entities description: | Bulk enable entities. - PERMISSIONS: `api_entity:update` operationId: entitybasics-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entity.BulkToggleRequestItem' examples: update: summary: Enable description: Enable entities. value: [ { "_id": "csp_resource/cps_component" }, { "_id": "293d7b83-e622-40d9-95ef-86b06eda3746" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/entity.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/entity-infos-properties: delete: tags: - entityinfosproperties summary: Bulk delete entity infos properties description: | Bulk delete entity infos properties. - PERMISSIONS: `api_entity_infos_property:delete` operationId: entityinfosproperties-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete entity infos properties value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/entityservices: put: tags: - entityservices summary: Bulk update entityservices description: | Bulk update entityservices. - PERMISSIONS: `api_entityservice:update` operationId: entityservices-bulk-update requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityservice.BulkUpdateRequestItem' examples: update: summary: Update description: Update services. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "name": "Group 1", "output_template": "All: {{.All}} Alarms: {{.Alarms}} Acknowledged: {{.Acknowledged}} NotAcknowledged: {{.NotAcknowledged}} StateCritical: {{.State.Critical}} StateMajor: {{.State.Major}} StateMinor: {{.State.Minor}} StateInfo: {{.State.Info}} Maintenance: {{index .PbehaviorCounters \"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}} Pause: {{index .PbehaviorCounters \"0b6f6266-59ed-4350-8786-85a3ebdf45b8\"}} Inactive: {{index .PbehaviorCounters \"e37d7772-6964-4293-a7ff-9e9b3fa26332\"}}", "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "impact_level": 2, "enabled": true, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "sli_avail_state": 1, "infos": [ { "name": "group", "description": "Group id", "value": "g1" } ] } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/entityservice.BulkUpdateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - entityservices summary: Bulk create entityservices description: | Bulk create entityservices. - PERMISSIONS: `api_entityservice:create` operationId: entityservices-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityservice.CreateRequest' examples: create: summary: Create description: Create services. value: [ { "name": "Group 1", "output_template": "All: {{.All}} Alarms: {{.Alarms}} Acknowledged: {{.Acknowledged}} NotAcknowledged: {{.NotAcknowledged}} StateCritical: {{.State.Critical}} StateMajor: {{.State.Major}} StateMinor: {{.State.Minor}} StateInfo: {{.State.Info}} Maintenance: {{index .PbehaviorCounters \"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}} Pause: {{index .PbehaviorCounters \"0b6f6266-59ed-4350-8786-85a3ebdf45b8\"}} Inactive: {{index .PbehaviorCounters \"e37d7772-6964-4293-a7ff-9e9b3fa26332\"}}", "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "impact_level": 2, "enabled": true, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "sli_avail_state": 1, "infos": [ { "name": "group", "description": "Group id", "value": "g1" } ] } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/entityservice.CreateRequest' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - entityservices summary: Bulk delete entityservices description: | Bulk delete entityservices. - PERMISSIONS: `api_entityservice:delete` operationId: entityservices-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityservice.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete services. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/entityservice.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/eventfilters: put: tags: - eventfilters summary: Bulk update eventfilters description: | Bulk update eventfilters. - PERMISSIONS: `api_entityservice:update` operationId: eventfilters-bulk-update requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkUpdateRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkUpdateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - eventfilters summary: Bulk create eventfilters description: | Bulk create eventfilters. - PERMISSIONS: `api_eventfilter:create` operationId: eventfilters-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.CreateRequest' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.CreateRequest' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - eventfilters summary: Bulk delete eventfilters description: | Bulk delete eventfilters. - PERMISSIONS: `api_eventfilter:delete` operationId: eventfilters-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/eventfilters/enable: put: tags: - eventfilters summary: Bulk enable eventfilters description: | Bulk enable eventfilters. - PERMISSIONS: `api_eventfilter:update` operationId: eventfilters-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/eventfilters/disable: put: tags: - eventfilters summary: Bulk disable eventfilters description: | Bulk disable eventfilters. - PERMISSIONS: `api_eventfilter:update` operationId: eventfilters-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/flapping-rules: delete: tags: - flappingrules summary: Bulk delete flapping rules description: | Bulk delete flapping rules. - PERMISSIONS: `api_flapping_rule:delete` operationId: flappingrules-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/flapping-rules/enable: put: tags: - flappingrules summary: Bulk enable flapping rules description: | Bulk enable flapping rules. - PERMISSIONS: `api_flapping_rule:update` operationId: flappingrules-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/flapping-rules/disable: put: tags: - flappingrules summary: Bulk disable flapping rules description: | Bulk disable flapping rules. - PERMISSIONS: `api_flapping_rule:update` operationId: flappingrules-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/resolve-rules: delete: tags: - resolverules summary: Bulk delete resolve rules description: | Bulk delete resolve rules. - PERMISSIONS: `api_resolve_rule:delete` operationId: resolverules-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/resolverule.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/resolverule.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/resolve-rules/enable: put: tags: - resolverules summary: Bulk enable resolve rules description: | Bulk enable resolve rules. - PERMISSIONS: `api_resolve_rule:update` operationId: resolverules-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/resolverule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/resolverule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/resolve-rules/disable: put: tags: - resolverules summary: Bulk disable resolve rules description: | Bulk disable resolve rules. - PERMISSIONS: `api_resolve_rule:update` operationId: resolverules-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/resolverule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/resolverule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/external-data-tables/{table}/data: delete: tags: - externaldata summary: Bulk delete rows from external data table description: | Bulk delete rows from external data table. - PERMISSIONS: `api_external_data_table:update` operationId: externaldatarows-bulk-delete parameters: - name: table in: path description: external data table id required: true schema: type: string requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete rows value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/idle-rules: put: tags: - idlerules summary: Bulk update idlerules description: | Bulk update idlerules. - PERMISSIONS: `api_eventfilter:update` operationId: idlerules-bulk-update requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkUpdateRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkUpdateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - idlerules summary: Bulk create idlerules description: | Bulk create idlerules. - PERMISSIONS: `api_idlerule:create` operationId: idlerules-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/idlerule.CreateRequest' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/idlerule.CreateRequest' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - idlerules summary: Bulk delete idlerules description: | Bulk delete idlerules. - PERMISSIONS: `api_idlerule:delete` operationId: idlerules-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkDeleteRequestItem' examples: delete: summary: Bulk delete idle rules value: [ {"_id": "idle-rule-1"}, {"_id": "idle-rule-2"} ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/idle-rules/enable: put: tags: - idlerules summary: Bulk enable idlerules description: | Bulk enable idlerules. - PERMISSIONS: `api_idlerule:update` operationId: idlerules-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/idle-rules/disable: put: tags: - idlerules summary: Bulk disable idlerules description: | Bulk disable idlerules. - PERMISSIONS: `api_idlerule:update` operationId: idlerules-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/idlerule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/link-rules: delete: tags: - linkrules summary: Bulk delete link rules description: | Bulk delete link rules. - PERMISSIONS: `api_link_rule:delete` operationId: linkrules-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/linkrule.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete link rules value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/linkrule.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/link-rules/enable: put: tags: - linkrules summary: Bulk enable link rules description: | Bulk enable link rules. - PERMISSIONS: `api_link_rule:update` operationId: linkrules-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/linkrule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/linkrule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/link-rules/disable: put: tags: - linkrules summary: Bulk disable link rules description: | Bulk disable link rules. - PERMISSIONS: `api_link_rule:update` operationId: linkrules-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/linkrule.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/linkrule.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/playlists: delete: tags: - playlists summary: Bulk delete playlists description: | Bulk delete playlists. - PERMISSIONS: `api_playlist:delete` operationId: playlists-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/playlist.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/playlist.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/playlists/enable: put: tags: - playlists summary: Bulk enable playlists description: | Bulk enable playlists. - PERMISSIONS: `api_playlist:update` operationId: playlists-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/playlist.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/playlist.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/playlists/disable: put: tags: - playlists summary: Bulk disable playlists description: | Bulk disable playlists. - PERMISSIONS: `api_playlist:update` operationId: playlists-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/playlist.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/playlist.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/patterns: delete: tags: - saved-patterns summary: Bulk delete patterns description: | Bulk delete patterns. - PERMISSIONS (for corporate patterns): `api_corporate_pattern` operationId: saved-patterns-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pattern.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete patterns value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pattern.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehaviors: put: tags: - pbehaviors summary: Bulk update pbehaviors description: | Bulk update pbehaviors. - PERMISSIONS: `api_pbehavior:update` operationId: pbehaviors-bulk-update requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkUpdateRequestItem' examples: update: summary: Update description: Update pbehaviors value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "name": "Active period", "enabled": true, "tstart": 1650855600, "tstop": 1650891600, "rrule": "FREQ=DAILY", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "exdates": [ { "begin": 1651460400, "end": 1651496400, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" } ], "exceptions": [ "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" ] } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkUpdateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - pbehaviors summary: Bulk create pbehaviors description: | Bulk create pbehaviors. - PERMISSIONS: `api_pbehavior:create` operationId: pbehaviors-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.CreateRequest' examples: create: summary: Create description: Create pbehaviors value: [ { "name": "Active period", "enabled": true, "tstart": 1650855600, "tstop": 1650891600, "rrule": "FREQ=DAILY", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "exdates": [ { "begin": 1651460400, "end": 1651496400, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" } ], "exceptions": [ "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" ] } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.CreateRequest' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - pbehaviors summary: Bulk delete pbehaviors description: | Bulk delete pbehaviors. - PERMISSIONS: `api_pbehavior:delete` operationId: pbehaviors-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete pbehaviors value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehaviors/disable: put: tags: - pbehaviors summary: Bulk disable pbehaviors description: | Bulk disable pbehaviors. - PERMISSIONS: `api_pbehavior:update` operationId: pbehaviors-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkToggleRequestItem' examples: update: summary: Disable description: Disable pbehaviors. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" }, { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e102" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehaviors/enable: put: tags: - pbehaviors summary: Bulk enable pbehaviors description: | Bulk enable pbehaviors. - PERMISSIONS: `api_pbehavior:update` operationId: pbehaviors-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkToggleRequestItem' examples: update: summary: Enable description: Enable pbehaviors. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" }, { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e102" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/entity-pbehaviors: post: tags: - pbehaviors summary: Bulk create entity pbehaviors description: | Bulk create entity pbehaviors. - PERMISSIONS: `api_pbehavior:create` operationId: entity-pbehaviors-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkEntityCreateRequestItem' examples: create: summary: Create description: Create entity pbehaviors value: [ { "entity": "cps_resource/cps_component", "origin": "centreon", "name": "Downtime", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "comment": "Downtime by centreon" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkEntityCreateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - pbehaviors summary: Bulk delete entity pbehaviors description: | Bulk delete entity pbehaviors. - PERMISSIONS: `api_pbehavior:delete` operationId: entity-pbehaviors-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkEntityDeleteRequestItem' examples: delete: summary: Delete description: Delete entity pbehaviors value: [ { "entity": "cps_resource/cps_component", "origin": "centreon" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.BulkEntityDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/role-permissions: put: tags: - roles summary: Bulk update role permissions description: | Bulk update role permissions. - PERMISSIONS: `api_acl:update` operationId: roles-bulk-update-permissions requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/role.BulkUpdatePermissionsRequestItem' examples: update: summary: Update roles. description: Update roles. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "permissions": { "api_alarm_read": [ ], "api_entity": [ "read" ] } }, { "_id": "3b46e648-f7c0-4c94-8167-30e78728706e", "permissions": { "53010391-8f34-4e00-a493-0264431eddd6": [ "read" ], "f8d6373b-15f0-42a0-9cbe-25249343e5a7": [ ] } } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/role.BulkUpdatePermissionsRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/roles: delete: tags: - roles summary: Bulk delete roles description: | Bulk delete roles. - PERMISSIONS: `api_acl:delete` operationId: roles-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/role.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete roles. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/role.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/scenarios: put: tags: - scenarios summary: Bulk update scenarios description: | Bulk update scenarios. - PERMISSIONS: `api_action:update` operationId: scenarios-bulk-update requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkUpdateRequestItem' examples: update: summary: Update description: Update scenarios. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "name": "Scenario with acknowledge action", "comment": "The scenario acknowledges an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "ack", "parameters": { "output": "The alarm is acknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkUpdateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - scenarios summary: Bulk create scenarios description: | Bulk create scenarios. - PERMISSIONS: `api_action:create` operationId: scenarios-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/scenario.CreateRequest' examples: create: summary: Create description: Create scenarios. value: [ { "name": "Scenario with acknowledge action", "comment": "The scenario acknowledges an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "ack", "parameters": { "output": "The alarm is acknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/scenario.CreateRequest' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - scenarios summary: Bulk delete scenarios description: | Bulk delete scenarios. - PERMISSIONS: `api_action:delete` operationId: scenarios-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkDeleteRequestItem' examples: delete: summary: Delete description: Delete scenarios. value: [ { "_id": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" } ] required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/scenarios/enable: put: tags: - scenarios summary: Bulk enable scenarios description: | Bulk enable scenarios. - PERMISSIONS: `api_action:update` operationId: scenarios-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/scenarios/disable: put: tags: - scenarios summary: Bulk disable scenarios description: | Bulk disable scenarios. - PERMISSIONS: `api_action:update` operationId: scenarios-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/scenario.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/users: put: tags: - users summary: Bulk update users description: | Bulk update users. - PERMISSIONS: `api_acl:update` operationId: users-bulk-update requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/user.BulkUpdateRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/user.BulkUpdateRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - users summary: Bulk create users description: | Bulk create users. - PERMISSIONS: `api_acl:create` operationId: users-bulk-create requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/user.CreateRequest' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/user.CreateRequest' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' patch: tags: - users summary: Bulk patch users description: | Bulk patch users. - PERMISSIONS: `api_acl:update` operationId: users-bulk-patch requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/user.BulkPatchRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/user.BulkPatchRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - users summary: Bulk delete users description: | Bulk delete users. - PERMISSIONS: `api_acl:delete` operationId: users-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/user.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/user.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/users/enable: put: tags: - users summary: Bulk enable users description: | Bulk enable users. - PERMISSIONS: `api_acl:update` operationId: users-bulk-enable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/user.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/user.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/users/disable: put: tags: - users summary: Bulk disable users description: | Bulk disable users. - PERMISSIONS: `api_acl:update` operationId: users-bulk-disable requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/user.BulkToggleRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/user.BulkToggleRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /color-themes: get: tags: - color-themes summary: Find all color theme description: | Get paginated list of color theme. - PERMISSIONS: `api_color_theme:read` operationId: color-themes-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/colortheme.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - color-themes summary: Create color theme description: | Create color theme. - PERMISSIONS: `api_color_theme:create` operationId: color-themes-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/colortheme.EditRequest' examples: create: summary: Create a color theme description: Create a color theme value: { "name": "test_1", "font_color": 2, "colors": { "main": { "primary": "#AAAAAA", "secondary": "#AAAAAA", "accent": "#AAAAAA", "error": "#AAAAAA", "info": "#AAAAAA", "success": "#AAAAAA", "warning": "#AAAAAA", "background": "#AAAAAA", "active_color": "#AAAAAA", "error_background": "#AAAAAA", "warning_background": "#AAAAAA", "info_background": "#AAAAAA", "success_background": "#AAAAAA" }, "table": { "background": "#AAAAAA", "row_color": "#AAAAAA", "shift_row": false, "shift_row_color": "#AAAAAA", "hover_row": true, "hover_row_color": "#AAAAAA" }, "state": { "ok": "#AAAAAA", "minor": "#AAAAAA", "major": "#AAAAAA", "critical": "#AAAAAA" } } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/colortheme.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /color-themes/{id}: get: tags: - color-themes summary: Get color theme by id description: | Get color theme by id. - PERMISSIONS: `api_color_theme:read` operationId: color-themes-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/colortheme.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - color-themes summary: Update color theme by id description: | Update color theme by id. - PERMISSIONS: `api_color_theme:update` operationId: color-themes-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/colortheme.EditRequest' examples: update: summary: Update a color theme description: Update a color theme value: { "name": "test_1_updated", "font_color": 2, "colors": { "main": { "primary": "#FFFFFF", "secondary": "#FFFFFF", "accent": "#FFFFFF", "error": "#FFFFFF", "info": "#FFFFFF", "success": "#FFFFFF", "warning": "#FFFFFF", "background": "#FFFFFF", "active_color": "#AAAAAA", "error_background": "#AAAAAA", "warning_background": "#AAAAAA", "info_background": "#AAAAAA", "success_background": "#AAAAAA" }, "table": { "background": "#FFFFFF", "row_color": "#FFFFFF", "shift_row": false, "shift_row_color": "#FFFFFF", "hover_row": false, "hover_row_color": "#FFFFFF" }, "state": { "ok": "#FFFFFF", "minor": "#FFFFFF", "major": "#FFFFFF", "critical": "#FFFFFF" } } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/colortheme.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - color-themes summary: Delete color theme by id description: | Delete color theme by id. - PERMISSIONS: `api_color_theme:delete` operationId: color-themes-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /comment-templates: get: tags: - comment-templates summary: Find all comment templates description: | Get paginated list of comment templates. - PERMISSIONS: `api_comment_template:read` operationId: comment-templates-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - name: ids[] description: comment templates ids in: query style: form explode: true schema: type: array items: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - comment-templates summary: Create comment template description: | Create comment template. - PERMISSIONS: `api_comment_template:create` operationId: comment-templates-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.EditRequest' examples: create: summary: Create a comment template description: Create a comment template value: { "name": "canopsis-comment-template", "fields": [ { "name": "field1", "required": true }, { "name": "field2", "required": false } ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /comment-templates/{id}: get: tags: - comment-templates summary: Get comment template by id description: | Get comment template by id. - PERMISSIONS: `api_comment_template:read` operationId: comment-templates-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - comment-templates summary: Update comment template by id description: | Update comment template by id. - PERMISSIONS: `api_comment_template:update` operationId: comment-templates-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.EditRequest' examples: update: summary: Update a comment template description: Update a comment template value: { "name": "canopsis-comment-template", "fields": [ { "name": "field1", "required": true }, { "name": "field2", "required": false } ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/commenttemplate.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - comment-templates summary: Delete comment template by id description: | Delete comment template by id. - PERMISSIONS: `api_comment_template:delete` operationId: comment-templates-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /component-alarms: get: tags: - alarms summary: Find opened alarms of component's resource description: | Get paginated list of alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-find-component-alarms parameters: - name: _id in: query description: component id required: true schema: type: string - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/sort' - name: sort_by in: query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarm.Alarm' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /contextgraph-import: put: tags: - contextgraph-import summary: Create new import task description: | Create new import task. - PERMISSIONS: `api_contextgraph:create` operationId: contextgraph-import-create-new-import parameters: - name: source in: query description: source required: true schema: type: string requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/importcontextgraph.EntityConfiguration' examples: basic: summary: Basic description: Import basic entities value: [ { "name": "cps_component", "type": "component", "impact_level": 1, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "infos": { "group": { "description": "Group id", "value": "g1" } }, "action": "set", "enabled": true }, { "name": "cps_resource_1", "component": "cps_component", "type": "resource", "impact_level": 1, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "infos": { "group": { "description": "Group id", "value": "g1" } }, "action": "set", "enabled": true }, { "name": "cps_resource_2", "component": "cps_component", "type": "resource", "action": "delete" }, { "name": "cps_resource_3", "component": "cps_component", "type": "resource", "action": "enable" }, { "name": "cps_resource_4", "component": "cps_component", "type": "resource", "action": "disable" } ] service: summary: Service description: Import services value: [ { "name": "cps_service_1", "output_template": "All: {{.All}} Alarms: {{.Alarms}} Acknowledged: {{.Acknowledged}} NotAcknowledged: {{.NotAcknowledged}} StateCritical: {{.State.Critical}} StateMajor: {{.State.Major}} StateMinor: {{.State.Minor}} StateInfo: {{.State.Info}} Maintenance: {{index .PbehaviorCounters \"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}} Pause: {{index .PbehaviorCounters \"0b6f6266-59ed-4350-8786-85a3ebdf45b8\"}} Inactive: {{index .PbehaviorCounters \"e37d7772-6964-4293-a7ff-9e9b3fa26332\"}}", "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "type": "service", "impact_level": 2, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "infos": { "group": { "description": "Group id", "value": "g1" } }, "action": "set", "enabled": true }, { "name": "cps_service_2", "type": "service", "action": "delete" }, { "name": "cps_service_3", "type": "service", "action": "enable" }, { "name": "cps_service_4", "type": "service", "action": "disable" } ] required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/contextgraph.ImportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /contextgraph-import-partial: put: tags: - contextgraph-import summary: Create new import partial task description: | Create new import partial task. - PERMISSIONS: `api_contextgraph:create` operationId: contextgraph-import-create-new-import-partial parameters: - name: source in: query description: source required: true schema: type: string requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/importcontextgraph.EntityConfiguration' examples: basic: summary: Basic description: Import basic entities value: [ { "name": "cps_component", "type": "component", "impact_level": 1, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "infos": { "group": { "description": "Group id", "value": "g1" } }, "action": "set", "enabled": true }, { "name": "cps_resource_1", "component": "cps_component", "type": "resource", "impact_level": 1, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "infos": { "group": { "description": "Group id", "value": "g1" } }, "action": "set", "enabled": true }, { "name": "cps_resource_2", "component": "cps_component", "type": "resource", "action": "delete" }, { "name": "cps_resource_3", "component": "cps_component", "type": "resource", "action": "enable" }, { "name": "cps_resource_4", "component": "cps_component", "type": "resource", "action": "disable" } ] service: summary: Service description: Import services value: [ { "name": "cps_service_1", "output_template": "All: {{.All}} Alarms: {{.Alarms}} Acknowledged: {{.Acknowledged}} NotAcknowledged: {{.NotAcknowledged}} StateCritical: {{.State.Critical}} StateMajor: {{.State.Major}} StateMinor: {{.State.Minor}} StateInfo: {{.State.Info}} Maintenance: {{index .PbehaviorCounters \"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}} Pause: {{index .PbehaviorCounters \"0b6f6266-59ed-4350-8786-85a3ebdf45b8\"}} Inactive: {{index .PbehaviorCounters \"e37d7772-6964-4293-a7ff-9e9b3fa26332\"}}", "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "type": "service", "impact_level": 2, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "infos": { "group": { "description": "Group id", "value": "g1" } }, "action": "set", "enabled": true }, { "name": "cps_service_2", "type": "service", "action": "delete" }, { "name": "cps_service_3", "type": "service", "action": "enable" }, { "name": "cps_service_4", "type": "service", "action": "disable" } ] required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/contextgraph.ImportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /contextgraph-import-status/{id}: get: tags: - contextgraph-import summary: Get import status by id description: | Get import status by id. - PERMISSIONS: `api_contextgraph:read` operationId: contextgraph-import-get-status-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/contextgraph.ImportJob' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /data-storage: get: tags: - datastorage summary: Get conf description: | Get conf. - PERMISSIONS: `api_datastorage_read` operationId: datastorage-get responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/datastorage.DataStorage' put: tags: - datastorage summary: Update conf description: | Update conf. - PERMISSIONS: `api_datastorage_update` operationId: datastorage-update requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/datastorage.Config' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/datastorage.DataStorage' /entities: get: tags: - entities summary: Find entities description: | Get paginated list of entities. - PERMISSIONS: `api_entity:read` operationId: entities-find-all parameters: - name: active_columns[] in: query style: form explode: true schema: type: array items: type: string - name: category in: query schema: type: string - name: filters[] in: query style: form explode: true schema: type: array items: type: string - $ref: '#/components/parameters/search_pattern' - name: entity_pattern in: query schema: type: string example: '[[{"field":"name","cond":{"type":"eq","value":"cps_name"}}]]' - name: negative_entity_pattern in: query schema: type: string example: '[[{"field":"name","cond":{"type":"eq","value":"cps_name"}}]]' - name: pbehavior_pattern in: query schema: type: string example: '[[{"field":"pbehavior_info.id","cond":{"type":"eq","value":"df17b079-03fb-4a4f-a19d-14d9c0c3563b"}}]]' - name: no_events in: query schema: type: boolean - name: type[] in: query style: form explode: true schema: type: array items: type: string - $ref: '#/components/parameters/ids' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' - name: paginate in: query schema: type: boolean - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - $ref: '#/components/parameters/withFlags' - name: perf_data[] in: query style: form explode: true schema: type: array items: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entity.Entity' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entities/archive-disabled: post: tags: - entities summary: Archive disabled entities description: | Archive disabled entities. - PERMISSIONS: `api_entity:delete` operationId: entities-archive-disabled requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.ArchiveDisabledRequest' responses: '202': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entities/archive-unlinked: post: tags: - entities summary: Archive unlinked entities description: | Archive unlinked entities. - PERMISSIONS: `api_entity:delete` operationId: entities-archive-unlinked requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.ArchiveUnlinkedRequest' responses: '202': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entities/check-state-setting: post: tags: - entities summary: Check state setting description: | Check if there is matched state setting rule. - PERMISSIONS: `api_state_settings:read` operationId: entities-check-state-setting requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.CheckStateSettingRequest' examples: create: summary: Check state setting description: Check state setting. value: { "name": "cps_service_1", "type": "service", "infos": [ { "description": "Custom name infos", "name": "custom_name", "value": "service_1" } ], "impact_level": 1 } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.StateSettingResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entities/clean-archived: post: tags: - entities summary: Clean archived entities description: | Clean archived entities. - PERMISSIONS: `api_entity:delete` operationId: entities-clean-archived responses: '202': description: OK /entities/context-graph: get: tags: - entities summary: Get context graph by id description: | Get context graph by id. - PERMISSIONS: `api_entity:read` operationId: entities-get-context-graph parameters: - name: _id in: query required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entity.ContextGraphResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entities/pbehavior-calendar: get: tags: - pbehaviors summary: Find pbehaviors by entity id description: | Get list of pbehaviors' timespans. - PERMISSIONS: `api_entity:read` `api_pbehavior:read` operationId: pbehaviors-calendar-by-entity-id parameters: - name: _id in: query description: Entity id required: true schema: type: string - name: from in: query required: true schema: type: integer - name: to in: query required: true schema: type: integer responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.CalendarResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entities/pbehaviors: get: tags: - pbehaviors summary: Find pbehaviors by entity id description: | Get list of pbehaviors. - PERMISSIONS: `api_entity:read` `api_pbehavior:read` operationId: pbehaviors-find-by-entity-id parameters: - name: _id in: query description: Entity id required: true schema: type: string - $ref: '#/components/parameters/withFlags' responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entities/state-setting: get: tags: - entities summary: Get state setting by entity id description: | Get if there is matched state setting rule. - PERMISSIONS: `api_state_settings:read` operationId: entities-get-state-setting parameters: - name: _id in: query required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.StateSettingResponse' /entity-categories: get: tags: - entity-categories summary: Find entity categories description: | Get paginated list of entity categories. - PERMISSIONS: `api_entitycategory:read` operationId: entity-categories-find-all parameters: - $ref: '#/components/parameters/ids' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entitycategory.Category' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - entity-categories summary: Create entity category description: | Create entity category. - PERMISSIONS: `api_entitycategory:create` operationId: entity-categories-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycategory.EditRequest' examples: create: summary: Create description: Create a category. value: { "name": "Backend" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycategory.Category' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entity-categories/{id}: get: tags: - entity-categories summary: Get entity category by id description: | Get entity category by id. - PERMISSIONS: `api_entitycategory:read` operationId: entity-categories-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycategory.Category' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - entity-categories summary: Update entity category by id description: | Update entity category by id. - PERMISSIONS: `api_entitycategory:update` operationId: entity-categories-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycategory.EditRequest' examples: update: summary: Update description: Update a category. value: { "name": "Backend" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycategory.Category' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - entity-categories summary: Delete entity category by id description: | Delete entity category by id. - PERMISSIONS: `api_entitycategory:delete` operationId: entity-categories-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entity-comments: get: tags: - entity-comments summary: Find entity comments description: | Get paginated list of entity comments. - PERMISSIONS: `api_entity:read` operationId: entity-comments-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - name: entity required: true in: query description: entity ID schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entitycomment.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - entity-comments summary: Create entity comment description: | Create entity comment. - PERMISSIONS: `api_entitycomment` operationId: entity-comments-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycomment.Request' examples: create: summary: Create description: Create a comment. value: { "entity": "5f5b3b3b-1b3b-4b3b-9b3b-3b3b3b3b3b3b/1f3a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "message": "This is a comment" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycomment.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entity-comments/{id}: put: tags: - entity-comments summary: Update entity comment by id description: | Update entity last comment by id. - PERMISSIONS: `api_entitycomment` operationId: entity-comments-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycomment.UpdateRequest' examples: update: summary: Update description: Update a comment. value: { "entity": "5f5b3b3b-1b3b-4b3b-9b3b-3b3b3b3b3b3b/1f3a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "message": "This is a comment" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitycomment.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entity-export: post: tags: - entities summary: Start export entities description: | Start export entities. - PERMISSIONS: `api_entity:read` operationId: entities-export-start requestBody: description: request content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.ExportRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.ExportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entity-export/{id}: get: tags: - entities summary: Get status of export entities description: | Get status of export entities. - PERMISSIONS: `api_entity:read` operationId: entities-export-get parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entity.ExportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entity-export/{id}/download: get: tags: - entities summary: Get result of export entities description: | Get result of export entities. - PERMISSIONS: `api_entity:read` operationId: entities-export-download parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: text/csv: schema: type: string format: binary '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entity-infos-dictionary/keys: get: tags: - entity-infos-dictionary summary: Find entity infos keys description: | Get paginated list of entity info keys. - PERMISSIONS: `api_entity:read` operationId: entity-infos-dictionary-list-keys parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityinfodictionary.Result' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entity-infos-dictionary/values: get: tags: - entity-infos-dictionary summary: Find entity infos values description: | Get paginated list of entity info values. - PERMISSIONS: `api_entity:read` operationId: entity-infos-dictionary-list-values parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - name: key in: query description: infos key name schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityinfodictionary.Result' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entity-infos-properties: get: tags: - entityinfosproperties summary: Find all entity infos properties description: | Get paginated list of entity infos properties. - PERMISSIONS: `api_entity_infos_property:read` operationId: entityinfosproperties-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort by query schema: type: string enum: - key - alias - type - name: type in: query description: type query schema: type: string enum: - string - number - boolean - string_array - timestamp responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - entityinfosproperties summary: Create entity infos property description: | Create entity infos property. - PERMISSIONS: `api_entity_infos_property:create` operationId: entityinfosproperties-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.CreateRequest' examples: create: summary: Create an entity infos property description: Create an entity infos property value: { "name": "canopsis-entity-info-key", "description": "canopsis-entity-info-description", "alias": "canopsis-entity-info-alias", "type": 3 } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entity-infos-properties/{id}: get: tags: - entityinfosproperties summary: Get entity info property by id description: | Get entity info property by id. - PERMISSIONS: `api_entity_infos_property:read` operationId: entityinfosproperties-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - entityinfosproperties summary: Update entity info property by id description: | Update entity info property by id. - PERMISSIONS: `api_entity_infos_property:update` operationId: entityinfosproperties-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.UpdateRequest' examples: create: summary: Update an entity infos property description: Update an entity infos property value: { "name": "canopsis-entity-info-key", "description": "canopsis-entity-info-description", "alias": "canopsis-entity-info-alias", "type": 3 } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityinfosproperty.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - entityinfosproperties summary: Delete entity info property by id description: | Delete entity info property by id. - PERMISSIONS: `api_entity_infos_property:delete` operationId: entityinfosproperties-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entitybasics: get: tags: - entitybasics summary: Get entity by id description: | Get entity by id. - PERMISSIONS: `api_entity:read` operationId: entitybasics-get-by-id parameters: - name: _id in: query description: Entity id required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitybasic.Entity' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - entitybasics summary: Update entity by id description: | Update entity by id. - PERMISSIONS: `api_entity:update` operationId: entitybasics-update-by-id parameters: - name: _id in: query description: Entity id required: true schema: type: string requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitybasic.EditRequest' examples: resource: summary: Resource description: Update a resource. value: { "description": "Important resource", "enabled": true, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "impact_level": 3, "sli_avail_state": 1, "infos": [ { "name": "group", "description": "Group id", "value": "g1" } ] } component: summary: Component description: Update a component. value: { "description": "Important component", "enabled": true, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "impact_level": 3, "sli_avail_state": 1, "infos": [ { "name": "group", "description": "Group id", "value": "g1" } ] } connector: summary: Connector description: Update a connector. value: { "description": "Important connector", "enabled": true, "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "impact_level": 3, "sli_avail_state": 1, "infos": [ { "name": "group", "description": "Group id", "value": "g1" } ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entitybasic.Entity' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - entitybasics summary: Delete entity by id description: | Delete entity by id. - PERMISSIONS: `api_entity:delete` operationId: entitybasics-delete-by-id parameters: - name: _id in: query description: Entity id required: true schema: type: string responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entityservice-dependencies: get: tags: - entityservices summary: Get entity service's dependencies by id description: | Get entity service's dependencies by id. - PERMISSIONS: `api_entityservice:read` operationId: entityservices-get-dependencies-by-id parameters: - name: id in: query description: entity service id required: true schema: type: string - name: category in: query required: false schema: type: string - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/search_pattern' - $ref: '#/components/parameters/withFlags' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string - name: define_state in: query description: show dependencies defining the state of the entity schema: type: boolean responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityservice.ContextGraphEntity' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entityservice-impacts: get: tags: - entityservices summary: Get entity's impacted services by id description: | Get entity's impacted services by id. - PERMISSIONS: `api_entityservice:read` operationId: entityservices-get-impacts-by-id parameters: - name: id in: query description: entity id required: true schema: type: string - name: category in: query required: false schema: type: string - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/withFlags' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityservice.ContextGraphEntity' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entityservice-alarms/{id}: get: tags: - alarms summary: Find opened alarms of service's dependencies description: | Get paginated list of alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-find-service-alarms parameters: - $ref: '#/components/parameters/id' - name: search in: query required: false schema: type: string - name: category in: query required: false schema: type: string - name: with_category in: query required: false schema: type: boolean - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarm.Alarm' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entityservices: post: tags: - entityservices summary: Create entity service description: | Create entity service. - PERMISSIONS: `api_entityservice:create` operationId: entityservices-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityservice.CreateRequest' examples: create: summary: Create description: Create a service. value: { "name": "Group 1", "output_template": "All: {{.All}} Alarms: {{.Alarms}} Acknowledged: {{.Acknowledged}} NotAcknowledged: {{.NotAcknowledged}} StateCritical: {{.State.Critical}} StateMajor: {{.State.Major}} StateMinor: {{.State.Minor}} StateInfo: {{.State.Info}} Maintenance: {{index .PbehaviorCounters \"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}} Pause: {{index .PbehaviorCounters \"0b6f6266-59ed-4350-8786-85a3ebdf45b8\"}} Inactive: {{index .PbehaviorCounters \"e37d7772-6964-4293-a7ff-9e9b3fa26332\"}}", "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "impact_level": 2, "enabled": true, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "sli_avail_state": 1, "infos": [ { "name": "group", "description": "Group id", "value": "g1" } ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityservice.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entityservices/{id}: get: tags: - entityservices summary: Get entity service by id description: | Get entity service by id. - PERMISSIONS: `api_entityservice:read` operationId: entityservices-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityservice.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - entityservices summary: Update entity service by id description: | Update entity service by id. - PERMISSIONS: `api_entityservice:update` operationId: entityservices-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityservice.UpdateRequest' examples: update: summary: Update description: Update a service. value: { "name": "Group 1", "output_template": "All: {{.All}} Alarms: {{.Alarms}} Acknowledged: {{.Acknowledged}} NotAcknowledged: {{.NotAcknowledged}} StateCritical: {{.State.Critical}} StateMajor: {{.State.Major}} StateMinor: {{.State.Minor}} StateInfo: {{.State.Info}} Maintenance: {{index .PbehaviorCounters \"df17b079-03fb-4a4f-a19d-14d9c0c3563b\"}} Pause: {{index .PbehaviorCounters \"0b6f6266-59ed-4350-8786-85a3ebdf45b8\"}} Inactive: {{index .PbehaviorCounters \"e37d7772-6964-4293-a7ff-9e9b3fa26332\"}}", "category": "d73a4b2a-1927-49d5-bdc3-ae1559ebc7e7", "impact_level": 2, "enabled": true, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "sli_avail_state": 1, "infos": [ { "name": "group", "description": "Group id", "value": "g1" } ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityservice.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - entityservices summary: Delete entity service by id description: | Delete entity service by id. - PERMISSIONS: `api_entityservice:delete` operationId: entityservices-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entityservice-template-vars: get: tags: - entityservices summary: Get available template variables for entity services description: | Get available template variables for entity services. - PERMISSIONS: `api_entityservice:read` operationId: entityservice-tpl-vars responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityservice.TemplateVarsResponse' /entityservice-template-validate: post: tags: - entityservices summary: Validate entity service templates description: | Validate entity service templates. - PERMISSIONS: `api_entityservice:read` operationId: entityservice-tpl-validate requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityservice.TemplateRequest' examples: validate: summary: Validate service description: Validate service value: { "rule": { "output_template": "All: {{ .All }}\nActive: {{ .Active }}\nDepedencies: {{ .Depends }}\nOK: {{ .State.Ok }}\nMinor: {{ .State.Minor }}\nMajor: {{ .State.Major }}\nCritical: {{ .State.Critical }}\nAcknowledged: {{ .Acknowledged }}\nNotAcknowledged: {{ .NotAcknowledged }}\nUnderPbehavior: {{ .UnderPbehavior }}\nAcknowledgedUnderPbh: {{ .AcknowledgedUnderPbh }}", "name": "Some service", "enabled": true, "impact_level": 1, "sli_avail_state": 0, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ] } } required: true responses: '200': description: OK content: application/json: schema: type: object additionalProperties: $ref: 'schemas_swagger.yaml#/definitions/template.ValidateResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /entityservice-pattern-fields: get: tags: - entityservices summary: Get pattern fields for entity services description: | Get pattern fields for entity services. - PERMISSIONS: `api_entityservice:read` operationId: entityservices-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /entity-downstreams: get: tags: - entityupstream summary: Get entity's downstreams by id description: | Get entity's downstreams by id. - PERMISSIONS: `api_entity:read` operationId: entityupstream-get-downstreams-by-id parameters: - name: _id in: query description: Entity id required: true schema: type: string - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entityupstream.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /entity-upstream: get: tags: - entityupstream summary: Get entity's upstream by id description: | Get entity's upstream by id. - PERMISSIONS: `api_entity:read` operationId: entityupstream-get-upstream-by-id parameters: - name: _id in: query description: Entity id required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/entityupstream.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /event: post: tags: - events summary: Send event/events description: | Send event/events. - PERMISSIONS: `api_event` operationId: event-send requestBody: description: body content: application/json: schema: $ref: '#/components/schemas/event.Event' examples: check: summary: Check description: Update a state of an alarm. value: { "event_type": "check", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "state": 3, "output": "Lorem ipsum dolor sit amet", "long_output": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." } ack: summary: Ack description: Acknowledge an alarm. value: { "event_type": "ack", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "output": "Lorem ipsum dolor sit amet" } ackremove: summary: Ack remove description: Unacknowledge an alarm. value: { "event_type": "ackremove", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "output": "Lorem ipsum dolor sit amet" } cancel: summary: Cancel description: Cancel an alarm. value: { "event_type": "cancel", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "output": "Lorem ipsum dolor sit amet" } uncancel: summary: Uncancel description: Uncancel an alarm. value: { "event_type": "uncancel", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "output": "Lorem ipsum dolor sit amet" } comment: summary: Comment description: Add new comment to an alarm. value: { "event_type": "comment", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "output": "Lorem ipsum dolor sit amet" } snooze: summary: Snooze description: Snooze an alarm for duration (in seconds). value: { "event_type": "snooze", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "output": "Lorem ipsum dolor sit amet", "duration": 600 } changestate: summary: Change state description: Change a state of an alarm. Following check events won't update the state. value: { "event_type": "changestate", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "output": "Lorem ipsum dolor sit amet", "state": 3 } assocticket: summary: Associate ticket description: Add new ticket to an alarm. value: { "event_type": "assocticket", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "author": "root", "user_id": "root", "ticket": "ENV-116", "ticket_url": "https://jira.local/ENV-116", "ticket_system_name": "Jira", "ticket_data": { "priority": "high", "tag": "env" }, "ticket_comment": "Lorem ipsum dolor sit amet" } declareticket: summary: Declare ticket description: Emit a trigger. A scenario can be started on the trigger. value: { "event_type": "declareticket", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource" } required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/event.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /eventfilter/rules: get: tags: - eventfilters summary: Find all eventfilter description: | Get paginated list of eventfilter. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilters-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - name: only_unread_failure in: query required: false schema: type: boolean responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - eventfilters summary: Create eventfilter description: | Create eventfilter. - PERMISSIONS: `api_eventfilter:create` operationId: eventfilters-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.CreateRequest' examples: CreateDropRule: summary: Create a drop rule description: Create a drop rule. value: { "type": "drop", "event_pattern":[[ { "field": "event_type", "cond": { "type": "eq", "value": "check" } }, { "field": "component", "cond": { "type": "eq", "value": "cps_component" } } ]], "description": "drop rule example", "priority": 1, "enabled": true } CreateBreakRule: summary: Create a break rule description: Create a break rule. value: { "type": "break", "event_pattern":[[ { "field": "event_type", "cond": { "type": "eq", "value": "check" } }, { "field": "component", "cond": { "type": "eq", "value": "cps_component" } } ]], "description": "break rule example", "priority": 1, "enabled": true } CreateEnrichmentRule: summary: Create an enrichment rule description: Create an enrichment rule. value: { "description": "enrichment rule example", "type": "enrichment", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "priority": 0, "enabled": true, "config": { "actions": [ { "type": "set_field", "name": "connector", "value": "kafka_connector" } ], "on_success": "pass", "on_failure": "pass" } } CreateEnrichmentRuleWithTemplate: summary: Create an enrichment rule with template description: Create an enrichment rule with template. value: { "description": "enrichment rule example with template", "type": "enrichment", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "priority": 0, "enabled": true, "config": { "actions": [ { "type": "set_entity_info_from_template", "name": "customer", "description": "Client", "value": "{{ index .Event.ExtraInfos \"customer\" }}" } ], "on_success": "pass", "on_failure": "pass" } } CreateEnrichmentRuleWithExternalTableData: summary: Create an enrichment rule with external table data description: Create an enrichment rule with external table data. value: { "type": "enrichment", "external_data": [ { "reference": "component", "type": "table", "table": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "select": { "component_customer": "{{ .Event.Component }}" } } ], "event_pattern": [ [ { "field": "component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "description": "enruchment rule with external table data", "priority": 1, "enabled": true, "config": { "actions": [ { "type": "set_entity_info_from_template", "name": "status", "value": "{{ .ExternalData.component.component_status }}", "description": "status from assets" } ], "on_success": "pass", "on_failure": "pass" } } CreateEnrichmentRuleWithExternalApiData: summary: Create an enrichment rule with external api data description: Create an enrichment rule with external api data. value: { "type": "enrichment", "external_data": [ { "reference": "title", "type": "api", "request": { "url": "http://localhost:3000/api/external_data", "method": "GET" } } ], "event_pattern": [ [ { "field": "component", "cond": { "type": "eq", "value": "csp_component" } } ] ], "description": "enrichment rule with external api data", "priority": 1, "enabled": true, "config": { "actions": [ { "type": "set_entity_info_from_template", "name": "title", "value": "{{ .ExternalData.title.title }}", "description": "title from external api" } ], "on_success": "pass", "on_failure": "pass" } } CreateChangeEntityRule: summary: Create a change_entity rule description: Create a change_entity rule. value: { "description": "change_entity rule example", "type": "change_entity", "event_pattern": [ [ { "field": "connector", "cond": { "type": "eq", "value": "cps_connector" } }, { "field": "extra.customer_tags", "field_type": "string", "cond": { "type": "regexp", "value": "CMDB:(?P.*?)($|,)" } } ] ], "config": { "component": "{{ .RegexMatch.ExtraInfos.customer_tags.SI_CMDB }}" }, "enabled": true } CreateRuleWithInterval: summary: Create a drop rule with interval description: Create a drop rule with interval. value: { "type": "drop", "start": 1663656515, "stop": 1663657515, "event_pattern":[[ { "field": "event_type", "cond": { "type": "eq", "value": "check" } }, { "field": "component", "cond": { "type": "eq", "value": "csp_component" } } ]], "description": "drop rule example", "priority": 1, "enabled": true } CreateRuleWithRRule: summary: Create a drop rule with rrule description: Create a drop rule with rrule. value: { "type": "drop", "start": 1663656515, "stop": 1663657515, "rrule": "FREQ=WEEKLY", "event_pattern":[[ { "field": "event_type", "cond": { "type": "eq", "value": "check" } }, { "field": "component", "cond": { "type": "eq", "value": "csp_component" } } ]], "description": "drop rule example", "priority": 1, "enabled": true } CreateRuleWithExdate: summary: Create a drop rule with exdate description: Create a drop rule with exdate. value: { "type": "drop", "start": 1663656515, "stop": 1663657515, "rrule": "FREQ=WEEKLY", "event_pattern":[[ { "field": "event_type", "cond": { "type": "eq", "value": "check" } }, { "field": "component", "cond": { "type": "eq", "value": "csp_component" } } ]], "description": "drop rule example", "priority": 1, "enabled": true, "exdates": [ { "begin": 1663656815, "end": 1663657515 } ] } CreateRuleWithException: summary: Create a drop rule with exception description: Create a drop rule with exception. value: { "type": "drop", "start": 1663656515, "stop": 1663657515, "rrule": "FREQ=WEEKLY", "event_pattern":[[ { "field": "event_type", "cond": { "type": "eq", "value": "check" } }, { "field": "component", "cond": { "type": "eq", "value": "csp_component" } } ]], "description": "drop rule example", "priority": 1, "enabled": true, "exceptions": [ "0249b7a8-1e1a-4e3f-b88c-c6d9c1f7db85" ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /eventfilter/rules/{id}: get: tags: - eventfilters summary: Get eventfilter by id description: | Get eventfilter by id. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilters-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - eventfilters summary: Update eventfilter by id description: | Update eventfilter by id. - PERMISSIONS: `api_eventfilter:update` operationId: eventfilters-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.UpdateRequest' examples: Update: summary: Update description: Update an eventfilter. value: { "description": "Update rule", "type": "enrichment", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "priority": 0, "enabled": true, "config": { "actions": [ { "type": "set_field", "name": "connector", "value": "kafka_connector" } ], "on_success": "pass", "on_failure": "pass" } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - eventfilters summary: Delete eventfilter by id description: | Delete eventfilter by id. - PERMISSIONS: `api_eventfilter:delete` operationId: eventfilters-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /eventfilter/{id}/failures: get: tags: - eventfilters summary: Get failures of event filter rule by id description: | Get failures of event filter rule by id. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilters-get-failures parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.FailureResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - eventfilters summary: Make failures of event filter rule by id as read description: | Make failures of event filter rule by id as read. - PERMISSIONS: `api_eventfilter:create` operationId: eventfilters-read-failures parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /eventfilter-db-export: post: tags: - eventfilters summary: Db export eventfilter rules description: | Export eventfilter rules in a db format. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilter-db-export requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/dbexport.Request' examples: Export: summary: Export example description: Export example. value: { "ids": [ "cps-eventfilter-1", "cps-eventfilter-2" ] } required: true responses: '200': description: OK content: text/plain: schema: type: string format: binary /eventfilter-copy-vars: get: tags: - eventfilters summary: Get available copy variables for event filter rules description: | Get available copy variables for event filter rules. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilter-copy-vars responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.CopyVarsResponse' /eventfilter-template-vars: get: tags: - eventfilters summary: Get available template variables for event filter rules description: | Get available template variables for event filter rules. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilter-tpl-vars responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.TemplateVarsResponse' /eventfilter-template-validate: post: tags: - eventfilters summary: Validate event filter rule templates description: | Validate event filter rule templates. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilter-tpl-validate requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/eventfilter.TemplateRequest' examples: validate: summary: Validate description: Validate rule value: { "testdata": { "event": "9c848e2c-bc55-484f-a433-a9e4d1031867", "external_data": { 1: "0dbb862b-cd5d-4643-b069-72ec13a57d63" } }, "rule": { "type": "enrichment", "description": "Enrich rule", "enabled": true, "event_pattern": [ [ { "field": "connector", "cond": { "type": "eq", "value": "cps_connector" } } ] ], "external_data": [ { "reference": "ref1", "type": "table", "table": "6bc4b4af-9302-4671-9a40-84fda8d964fc", "select": { "host": "{{ index .Event.ExtraInfos \"host\" }}" } }, { "reference": "ref2", "type": "api", "request": { "url": "{{ .Env.FetchURL }}?id={{ index .Event.ExtraInfos \"externalid\" }}", "method": "GET" } } ], "config": { "actions": [ { "type": "set_field_from_template", "name": "output", "value": "{{ index .ExternalData.ref1 \"description\" }} }}" }, { "type": "set_entity_info_from_template", "name": "external_id", "value": "{{ index .ExternalData.ref2 \"id\" }} }}" } ], "on_success": "pass", "on_failure": "pass" } } } required: true responses: '200': description: OK content: application/json: schema: type: object additionalProperties: $ref: 'schemas_swagger.yaml#/definitions/template.ValidateResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /eventfilter-pattern-fields: get: tags: - eventfilters summary: Get pattern fields for event filters description: | Get pattern fields for event filters. - PERMISSIONS: `api_eventfilter:read` operationId: eventfilters-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /export-configuration: post: tags: - exportconfiguration summary: Export configurations description: | Export configurations. - PERMISSIONS: `api_export_configurations` operationId: export-configurations requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/exportconfiguration.Request' examples: Export: summary: Export example description: Export example. value: { "export": [ "resolve_rule", "configuration", "state_settings", "notification", "pbehavior_type", "pbehavior_reason", "view_group", "view", "view_tab", "widget", "widget_filter" ] } required: true responses: '200': description: OK content: application/x-yaml: schema: type: string format: binary '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-export/{id}: post: tags: - externaldata summary: Create external data export job description: | Create external data export job. - PERMISSIONS: `api_external_data_table:read` operationId: externaldataexport-create parameters: - name: id in: path description: external data table id required: true schema: type: string requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.ExportRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.ExportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' get: tags: - externaldata summary: Get status of external data export job description: | Get status of external data export job. - PERMISSIONS: `api_external_data_table:read` operationId: externaldataexport-status parameters: - name: id in: path description: external data export job id required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.ExportResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-export/{id}/download: get: tags: - externaldata summary: Get result of external data export job description: | Get result of external data export job. - PERMISSIONS: `api_external_data_table:read` operationId: externaldataexport-download parameters: - name: id in: path description: external data export job id required: true schema: type: string responses: '200': description: OK content: text/csv: schema: type: string format: binary '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-import/{id}: post: tags: - externaldata summary: Create external data import job description: | Create external data import job. - PERMISSIONS: `api_external_data_table:update` operationId: externaldataimport-create parameters: - name: id in: path description: external data table id required: true schema: type: string requestBody: description: body content: multipart/form-data: schema: type: object required: - file properties: separator: type: string file: type: string format: binary required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.ImportJob' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-import/{id}/preview: put: tags: - externaldata summary: Preview external data import job with column configuration description: | Preview the imported data with the specified column configuration. This allows validating and converting column types before completing the import. - PERMISSIONS: `api_external_data_table:update` operationId: externaldataimport-preview parameters: - name: id in: path description: external data import job id required: true schema: type: string requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.PreviewRequest' examples: simple_string_columns: summary: Preview with string columns description: Simple preview with all columns as strings value: { "column_configs": [ { "name": "host", "type": 1 }, { "name": "service", "type": 1 }, { "name": "oncall", "type": 1 }, { "name": "team", "type": 1 } ] } mixed_types: summary: Preview with mixed column types description: Preview with various column types including boolean, number with thousands separator, string array, datetime, timestamp and regexp value: { "column_configs": [ { "name": "string", "type": 1 }, { "name": "bool", "type": 2 }, { "name": "number", "type": 3, "thousands_separator": "space" }, { "name": "string_array", "type": 4, "string_array_type": 1 }, { "name": "datetime", "type": 5 }, { "name": "timestamp", "type": 6 }, { "name": "pattern", "type": 7 } ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.ImportJob' examples: preview_succeeded: summary: Preview succeeded value: { "_id": "df0cfeec-fa53-4136-8b2c-77fb10398d72", "status": 4, "column_configs": [ { "name": "host", "type": 1 }, { "name": "service", "type": 1 } ] } preview_failed: summary: Preview failed with validation errors value: { "_id": "df0cfeec-fa53-4136-8b2c-77fb10398d72", "status": 5, "fail_reason": "preview failed", "column_configs": [ { "name": "number", "type": 3 } ], "error_info": { "number": { "rows": [0, 2], "messages": ["string is not a valid number"] } } } '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-import/{id}/complete: put: tags: - externaldata summary: Complete external data import job description: | Complete the external data import job and persist the data to the external data table. This should be called after a successful preview (status 4). - PERMISSIONS: `api_external_data_table:update` operationId: externaldataimport-complete parameters: - name: id in: path description: external data import job id required: true schema: type: string requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.ImportCompleteRequest' examples: complete_with_tags: summary: Complete import with column tags description: Complete import job with column tags specifying identifier and info columns value: { "column_tags": [ 1, 1, 2, 0 ] } complete_all_no_tags: summary: Complete import with no tags description: Complete import job with all columns having no tags value: { "column_tags": [ 0, 0, 0, 0 ] } required: true responses: '204': description: No Content - Import completed successfully '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' examples: missing_column_tags: summary: Missing column_tags value: { "errors": { "column_tags": "ColumnTags is missing." } } wrong_count: summary: Wrong number of column tags value: { "errors": { "column_tags": "ColumnTags must contain 4 items." } } invalid_tag_value: summary: Invalid tag value value: { "errors": { "column_tags.0": "ColumnTags[0] must be one of [0 1 2]." } } '404': description: Not Found - Job not found or preview not completed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-import/{id}/data: get: tags: - externaldata summary: Get data of external data import job description: | Get data of external data import job. - PERMISSIONS: `api_external_data_table:update` operationId: externaldataimport-data parameters: - name: id in: path description: external data import job id required: true schema: type: string - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: type: object additionalProperties: type: string '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-import/{id}/status: get: tags: - externaldata summary: Get status of external data import job description: | Get status of external data import job. - PERMISSIONS: `api_external_data_table:update` operationId: externaldataimport-status parameters: - name: id in: path description: external data import job id required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.ImportJob' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-tables: get: tags: - externaldata summary: Find all external data tables description: | Find all external data tables. - PERMISSIONS: `api_external_data_table:read` operationId: externaldatatables-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - $ref: '#/components/parameters/ids' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.Table' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - externaldata summary: Create external data table description: | Create external data table. - PERMISSIONS: `api_external_data_table:create` operationId: externaldatatables-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.EditRequest' examples: create: summary: Create external data table description: Create external data table value: { "type": 0, "name": "some_data", "description": "Data for enrichment" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.Table' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /external-data-tables/{id}: get: tags: - externaldata summary: Get external data table by id description: | Get external data table by id. - PERMISSIONS: `api_external_data_table:read` operationId: externaldatatables-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.Table' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - externaldata summary: Update external data table by id description: | Update external data table by id. - PERMISSIONS: `api_external_data_table:update` operationId: externaldatatables-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.UpdateRequest' examples: update: summary: Update external data table description: Update external data table value: { "type": 0, "name": "some_data", "description": "Data for enrichment", "column_tags": [1, 1, 2, 0] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/externaldatatable.Table' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - externaldata summary: Delete external data table by id description: | Delete external data table by id. - PERMISSIONS: `api_external_data_table:delete` operationId: externaldatatables-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-tables/{table}/data: get: tags: - externaldata summary: Find all external data rows in table description: | Find all external data rows in table. - PERMISSIONS: `api_external_data_table:read` operationId: externaldatarows-find-all parameters: - name: table in: path description: external data table id required: true schema: type: string - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/search_by' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - $ref: '#/components/parameters/withFlags' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: type: object additionalProperties: type: string '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - externaldata summary: Create row in external data table description: | Create row in external data table. - PERMISSIONS: `api_external_data_table:update` operationId: externaldatarows-create parameters: - name: table in: path description: external data table id required: true schema: type: string requestBody: description: body content: application/json: schema: type: object additionalProperties: type: string examples: create: summary: Create row description: Create row value: { "field1": "string value 1", "field2": "string value 2", "field3": "string valee 3" } required: true responses: '201': description: Created content: application/json: schema: type: object additionalProperties: type: string '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-tables/{table}/schema: get: tags: - externaldata summary: Get schema of external data table description: | Get schema of external data table. - PERMISSIONS: `api_external_data_table:read` operationId: externaldatatable-schema parameters: - name: table in: path description: external data table id required: true schema: type: string responses: '200': description: OK content: text/csv: schema: type: string format: binary '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /external-data-tables/{table}/data/{id}: get: tags: - externaldata summary: Get row from external data table by id description: | Get row from external data table by id. - PERMISSIONS: `api_external_data_table:read` operationId: externaldatarows-get-by-id parameters: - name: table in: path description: external data table id required: true schema: type: string - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: type: object additionalProperties: type: string '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - externaldata summary: Update row in external data table by id description: | Update row in external data table by id. - PERMISSIONS: `api_external_data_table:update` operationId: externaldatarows-update-by-id parameters: - name: table in: path description: external data table id required: true schema: type: string - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: type: object additionalProperties: type: string examples: update: summary: Update row description: Update row value: { "field1": "string value 1", "field2": "string value 2", "field3": "string value 3" } required: true responses: '200': description: OK content: application/json: schema: type: object additionalProperties: type: string '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - externaldata summary: Delete row from external data table by id description: | Delete row from external data table by id. - PERMISSIONS: `api_external_data_table:update` operationId: externaldatarows-delete-by-id parameters: - name: table in: path description: external data table id required: true schema: type: string - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /file: get: tags: - files summary: List files by ID description: | Get list of file objects by ID. - PERMISSIONS (for private files): `api_file:read` operationId: files-list parameters: - name: id in: query description: file id style: form explode: true schema: type: array items: type: string responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/file.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - files summary: Upload files description: | Upload files. - PERMISSIONS: `api_file:create` operationId: file-upload parameters: - name: public in: query description: file visibility schema: type: boolean requestBody: content: multipart/form-data: schema: type: object required: - files properties: files: type: array items: type: string format: binary required: true responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/file.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /file-access: get: tags: - auth summary: Get file access description: Get file access. Sets cookie with file access token. Need to be called before downloading file when it's impossible to pass token in header. operationId: auth-get-file-access responses: '204': description: OK security: - BearerAuth: [ ] /file/{id}: get: tags: - files summary: Get file by ID description: | Get file content by ID or download with file name. - PERMISSIONS (for private files): `api_file:read` operationId: files-get parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: '*/*': schema: type: string format: binary '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - files summary: Delete file description: | Delete file by ID. - PERMISSIONS: `api_file:delete` operationId: files-delete parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /flapping-rules: get: tags: - flappingrules summary: Find all flapping rule description: | Get paginated list of flapping rule. - PERMISSIONS: `api_flapping_rule:read` operationId: flappingrules-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - flappingrules summary: Create flapping rule description: | Create flapping rule. - PERMISSIONS: `api_flapping_rule:create` operationId: flappingrules-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.CreateRequest' examples: create: summary: Create flapping rule description: Create flapping rule value: { "name": "3 changes in 10s", "description": "Lorem ipsum dolor sit amet", "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "duration": { "value": 10, "unit": "s" }, "freq_limit": 3, "priority": 5 } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /flapping-rules/{id}: get: tags: - flappingrules summary: Get flapping rule by id description: | Get flapping rule by id. - PERMISSIONS: `api_flapping_rule:read` operationId: flappingrules-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - flappingrules summary: Update flapping rule by id description: | Update flapping rule by id. - PERMISSIONS: `api_flapping_rule:update` operationId: flappingrules-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.UpdateRequest' examples: update: summary: Update flapping rule description: Update flapping rule value: { "name": "3 changes in 10s", "description": "Lorem ipsum dolor sit amet", "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "duration": { "value": 10, "unit": "s" }, "freq_limit": 3, "priority": 5 } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/flappingrule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - flappingrules summary: Delete flapping rule by id description: | Delete flapping rule by id. - PERMISSIONS: `api_flapping_rule:delete` operationId: flappingrules-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /flapping-rules-db-export: post: tags: - flappingrules summary: Db export flapping rules description: | Export flapping rules in a db format. - PERMISSIONS: `api_flapping_rule:read` operationId: flappingrules-db-export requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/dbexport.Request' examples: Export: summary: Export example description: Export example. value: { "ids": [ "cps-flapping-rule-1", "cps-flapping-rule-2" ] } required: true responses: '200': description: OK content: text/plain: schema: type: string format: binary /flapping-rule-pattern-fields: get: tags: - flappingrules summary: Get pattern fields for flapping rules description: | Get pattern fields for flapping rules. - PERMISSIONS: `api_flapping_rule:read` operationId: flappingrules-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /healthcheck: get: tags: - healthcheck summary: Get healthcheck status description: | Get healthcheck status. - PERMISSIONS: `api_healthcheck` operationId: healthcheck-get responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/healthcheck.Info' /healthcheck/engines-order: get: tags: - healthcheck summary: Get engines' order description: | Get engines' order. - PERMISSIONS: `api_healthcheck` operationId: healthcheck-get-engines-order responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/healthcheck.Graph' /healthcheck/parameters: get: tags: - healthcheck summary: Get healthcheck parameters description: | Get healthcheck parameters. - PERMISSIONS: `api_healthcheck` operationId: healthcheck-get-parameters responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/config.HealthCheckParameters' put: tags: - healthcheck summary: Update healthcheck parameters description: | Update healthcheck parameters. - PERMISSIONS: `api_healthcheck` operationId: healthcheck-update-parameters requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/config.HealthCheckParameters' examples: update: summary: Update description: Update parameters. value: { "queue": { "limit": 1000, "enabled": true }, "messages": { "limit": 5000, "enabled": true }, "engine-fifo": { "enabled": true, "minimal": 1, "optimal": 2 }, "engine-pbehavior": { "enabled": true, "minimal": 1, "optimal": 2 }, "engine-action": { "enabled": false }, "engine-che": { "enabled": true, "minimal": 1, "optimal": 1 }, "engine-remediation": { "enabled": true, "minimal": 1, "optimal": 1 }, "engine-webhook": { "enabled": true, "minimal": 1, "optimal": 4 }, "engine-axe": { "enabled": true, "minimal": 1, "optimal": 2 }, "engine-correlation": { "enabled": true, "minimal": 1, "optimal": 1 }, "engine-dynamic-infos": { "enabled": true, "minimal": 1, "optimal": 1 } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/config.HealthCheckParameters' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /healthcheck/live: get: tags: - healthcheck summary: Get healthcheck status code description: | Get healthcheck status code. - PERMISSIONS: `api_healthcheck` operationId: healthcheck-get-live responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/healthcheck.LiveResponse' /healthcheck/status: get: tags: - healthcheck summary: Get short healthcheck status description: | Get short healthcheck status. - PERMISSIONS: `api_healthcheck` operationId: healthcheck-get-status responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/healthcheck.Status' /icons: get: tags: - icons summary: List of icons description: Get paginated list of icons. operationId: icons-list parameters: - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/icon.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - icons summary: Create an icon description: | Create an icon. - PERMISSIONS: `api_icon` operationId: icon-create requestBody: content: multipart/form-data: schema: type: object required: - title - file properties: title: type: string file: type: string format: binary required: true responses: '201': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/icon.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /icons/{id}: get: tags: - icons summary: Get an icon by id description: Get icon's content by id or download with file name. operationId: icons-get parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: '*/*': schema: type: string format: binary '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - icons summary: Delete an icon description: | Delete an icon by id. - PERMISSIONS: `api_icon` operationId: icons-delete parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - icons summary: Update an icon description: | Update an icon. - PERMISSIONS: `api_icon` operationId: icon-update parameters: - $ref: '#/components/parameters/id' requestBody: content: multipart/form-data: schema: type: object required: - title - file properties: title: type: string file: type: string format: binary required: true responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/icon.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' patch: tags: - icons summary: Patch an icon description: | Patch an icon. - PERMISSIONS: `api_icon` operationId: icon-patch parameters: - $ref: '#/components/parameters/id' requestBody: content: multipart/form-data: schema: type: object properties: title: type: string file: type: string format: binary required: true responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/icon.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /idle-rules: get: tags: - idlerules summary: Find idle rules description: | Get paginated list of idle rules. - PERMISSIONS: `api_idlerule:read` operationId: idlerules-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/idlerule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - idlerules summary: Create idle rule description: | Create idle rule. - PERMISSIONS: `api_idlerule:create` operationId: idlerules-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/idlerule.EditRequest' examples: alarm: summary: Alarm rule description: Create an alarm rule. value: { "name": "No events in 3s", "description": "Lorem ipsum dolor sit amet", "type": "alarm", "alarm_condition": "last_event", "enabled": true, "priority": 20, "duration": { "value": 3, "unit": "s" }, "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "operation": { "type": "snooze", "parameters": { "output": "Lorem ipsum dolor sit amet", "duration": { "value": 3, "unit": "s" } } }, "disable_during_periods": ["pause"] } entity: summary: Entity rule description: Create an entity rule. value: { "name": "Np events in 3s", "description": "Lorem ipsum dolor sit amet", "type": "entity", "enabled": true, "priority": 21, "duration": { "value": 3, "unit": "s" }, "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "disable_during_periods": ["pause"] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/idlerule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /idle-rules/{id}: get: tags: - idlerules summary: Get idle rule by id description: | Get idle rule by id. - PERMISSIONS: `api_idlerule:read` operationId: idlerules-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/idlerule.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - idlerules summary: Update idle rule by id description: | Update idle rule by id. - PERMISSIONS: `api_idlerule:update` operationId: idlerules-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/idlerule.EditRequest' examples: alarm: summary: Alarm rule description: Update an alarm rule. value: { "name": "No events in 3s", "description": "Lorem ipsum dolor sit amet", "type": "alarm", "alarm_condition": "last_event", "enabled": true, "priority": 20, "duration": { "value": 3, "unit": "s" }, "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "operation": { "type": "snooze", "parameters": { "output": "Lorem ipsum dolor sit amet", "duration": { "value": 3, "unit": "s" } } }, "disable_during_periods": ["pause"] } entity: summary: Entity rule description: Update an entity rule. value: { "name": "No events in 3s", "description": "Lorem ipsum dolor sit amet", "type": "entity", "enabled": true, "priority": 21, "duration": { "value": 3, "unit": "s" }, "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "disable_during_periods": ["pause"] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/idlerule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - idlerules summary: Delete idle rule by id description: | Delete idle rule by id. - PERMISSIONS: `api_idlerule:delete` operationId: idlerules-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /idle-rules-db-export: post: tags: - idlerules summary: Db export idle rules description: | Export idle rules in a db format. - PERMISSIONS: `api_idlerule:read` operationId: idlerules-db-export requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/dbexport.Request' examples: Export: summary: Export example description: Export example. value: { "ids": [ "cps-idle-rule-1", "cps-idle-rule-2" ] } required: true responses: '200': description: OK content: text/plain: schema: type: string format: binary /idle-rule-pattern-fields: get: tags: - idlerules summary: Get pattern fields for idle rules description: | Get pattern fields for idle rules. - PERMISSIONS: `api_idlerule:read` operationId: idlerules-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /internal/user_interface: put: tags: - internal summary: update user interface description: | update user interface. - PERMISSIONS: `api_acl_interface_update` operationId: internal-update-user-interface requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/appinfo.UserInterfaceConf' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/appinfo.UserInterfaceConf' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' delete: tags: - internal summary: delete user interface description: | delete user interface. - PERMISSIONS: `api_acl_interface_delete` operationId: internal-delete-user-interface responses: '204': description: OK /logged-user-count: get: tags: - auth summary: Get logged user count description: Get logged user count. operationId: auth-logged-user-count responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/auth.LoggedUserCountResponse' /login: post: tags: - auth summary: Log in description: Log in. operationId: auth-login requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/auth.LoginRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/auth.LoginResponse' security: - { } /logout: post: tags: - auth summary: Log out description: Log out. operationId: auth-logout responses: '204': description: OK security: - BearerAuth: [ ] /maintenance: put: tags: - maintenance summary: Enable or disable maintenance description: | Enable or disable maintenance. - PERMISSIONS: `api_maintenance` operationId: maintenance requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/maintenance.Request' examples: enable: summary: Enable description: Enable maintenance value: { "enabled": true, "message": "test maintenance" } disable: summary: Disable description: Disable maintenance value: { "enabled": false } required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /message-rate-stats: get: tags: - message-rate-stats summary: Find message rate stats description: | Get paginated list of stats. - PERMISSIONS: `api_message_rate_stats_read` operationId: message-rate-stats-find-all parameters: - name: from in: query required: true schema: type: integer - name: interval in: query required: true schema: type: string - name: to in: query required: true schema: type: integer - name: event_types[] in: query style: form explode: true schema: type: array items: type: string - name: connector_names[] in: query style: form explode: true schema: type: array items: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/messageratestats.StatsListResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /notification-settings: get: tags: - notification summary: Get notification settings description: | Get notification settings. - PERMISSIONS: `api_notification` operationId: notification-settings-get responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/notification.SettingsResponse' put: tags: - notification summary: Update notification settings description: | Update notification settings. - PERMISSIONS: `api_notification` operationId: notification-settings-update requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/notification.UpdateSettingsRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/notification.SettingsResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /notifications: get: tags: - notification summary: Get notifications description: | Get notifications. operationId: notification-get parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/notification.Response' /open-alarms: get: tags: - alarms summary: Get open alarm by entity description: | Get open alarm by entity. - PERMISSIONS: `api_alarm_read` operationId: alarms-get-open-by-entity parameters: - name: _id in: query description: entity id required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/alarm.Alarm' '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /patterns-alarms-count: post: tags: - saved-patterns summary: Count alarm matches description: Count alarm matches of pattern. operationId: saved-patterns-alarms-count requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.CountRequest' examples: count: summary: Count description: Count alarm matches of patterns. value: { "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "pbehavior_pattern": [ [ { "field": "pbehavior_info.type", "cond": { "type": "eq", "value": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" } } ] ] } required: true responses: '200': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.CountAlarmsResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /patterns-entities-count: post: tags: - saved-patterns summary: Count entity matches description: Count entity matches of pattern. operationId: saved-patterns-entities-count requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.CountRequest' examples: count: summary: Count description: Count entity matches of patterns. value: { "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "pbehavior_pattern": [ [ { "field": "pbehavior_info.type", "cond": { "type": "eq", "value": "default_maintenance" } } ] ] } required: true responses: '200': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.CountEntitiesResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /patterns-entities-optimize: post: tags: - optimize-patterns summary: Start entity pattern optimization description: | Start an asynchronous job that optimizes entity patterns by extracting literals from regexp conditions on infos fields and suggesting faster exact match conditions based on existing entity data. operationId: optimize-patterns-optimize-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.OptimizeRequest' examples: optimize: summary: Optimize a regexp condition description: Optimize a regexp condition. value: { "entity_pattern": [ [ { "field": "infos.environment", "field_type": "string", "cond": { "type": "regexp", "value": "prod|staging" } } ] ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.OptimizeJob' examples: jobCreated: summary: Job created description: Optimization job has been created and is pending execution. value: { "_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": 0, "original_pattern_count": 0, "original_pattern_ms": 0 } '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /patterns-entities-optimize/{id}: get: tags: - optimize-patterns summary: Get entity pattern optimization job status description: | Get the current status of an entity pattern optimization job by its ID. operationId: optimize-patterns-optimize-status parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.OptimizeJob' examples: running: summary: Job running description: The optimization job is still in progress. value: { "_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": 1, "original_pattern_count": 0, "original_pattern_ms": 0 } completed: summary: Job completed with suggestions description: The optimization job completed and returned suggestions. value: { "_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": 2, "original_pattern_count": 1, "original_pattern_ms": 150, "suggestions": [ { "entity_pattern": [ [ { "field": "infos.environment", "field_type": "string", "cond": { "type": "is_one_of", "value": ["prod", "staging"] } } ] ], "found_entities": 1, "difference": 0 } ], "optimized_field_regexps": [ { "field": "environment", "regexp": "prod|staging" } ] } '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - optimize-patterns summary: Accept or reject an optimization suggestion description: | Accept or reject a suggestion from a completed entity pattern optimization job. When accepting, provide the index of the suggestion to apply. When rejecting, set accept to false. operationId: optimize-patterns-optimize-accept parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.OptimizeAcceptRequest' examples: accept: summary: Accept first suggestion description: Accept the first suggestion (index 0) from the optimization job. value: { "index": 0, "accept": true } acceptSecond: summary: Accept second suggestion description: Accept the second suggestion (index 1) from the optimization job. value: { "index": 1, "accept": true } reject: summary: Reject suggestions description: Reject all suggestions from the optimization job. value: { "accept": false } required: true responses: '204': description: No Content '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - optimize-patterns summary: Cancel an optimization job description: | Cancel a running entity pattern optimization job. Only jobs with status Created (0) or Running (1) can be cancelled. Completed, accepted, or rejected jobs cannot be cancelled. operationId: optimize-patterns-optimize-cancel parameters: - $ref: '#/components/parameters/id' responses: '204': description: No Content '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /patterns: get: tags: - saved-patterns summary: Find all saved patterns description: | Get paginated list of saved patterns. - PERMISSIONS (for corporate patterns): `api_corporate_pattern` operationId: saved-patterns-find-all parameters: - name: corporate in: query schema: type: boolean - name: type in: query schema: type: string - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pattern.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - saved-patterns summary: Create saved pattern description: | Create saved pattern. - PERMISSIONS (for corporate patterns): `api_corporate_pattern` operationId: saved-patterns-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.EditRequest' examples: alarm: summary: Alarm pattern description: Create an alarm pattern. value: { "title": "Alarm pattern", "type": "alarm", "is_corporate": false, "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } }, { "field": "v.duration", "cond": { "type": "gt", "value": { "value": 3, "unit": "m" } } }, { "field": "v.ack", "cond": { "type": "eq", "value": false } } ] ] } entity: summary: Entity pattern description: Create a entity pattern. value: { "title": "Entity pattern", "type": "entity", "is_corporate": false, "entity_pattern": [ [ { "field": "_id", "cond": { "type": "eq", "value": "cps_resource/cps_component" } }, { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } }, { "field": "category", "cond": { "type": "eq", "value": "293d7b83-e622-40d9-95ef-86b06eda3746" } }, { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.custom_name", "field_type": "string", "cond": { "type": "eq", "value": "custom" } } ] ] } pbehavior: summary: Pbehavior pattern description: Create a pbehavior pattern. value: { "title": "Pbehavior pattern", "type": "pbehavior", "is_corporate": false, "pbehavior_pattern": [ [ { "field": "pbehavior_info.id", "cond": { "type": "eq", "value": "f7501e0a-a04d-46f1-bf10-4a85c4b37433" } }, { "field": "pbehavior_info.type", "cond": { "type": "eq", "value": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" } }, { "field": "pbehavior_info.reason", "cond": { "type": "eq", "value": "f8d6373b-15f0-42a0-9cbe-25249343e5a7" } } ] ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /patterns/{id}: get: tags: - saved-patterns summary: Get saved pattern by id description: | Get saved pattern by id. - PERMISSIONS (for corporate patterns): `api_corporate_pattern` operationId: saved-patterns-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - saved-patterns summary: Update saved pattern by id description: | Update saved pattern by id. - PERMISSIONS (for corporate patterns): `api_corporate_pattern` operationId: saved-patterns-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.EditRequest' examples: update: summary: Update description: Update a pattern. value: { "title": "Alarm pattern", "type": "alarm", "is_corporate": false, "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } }, { "field": "v.duration", "cond": { "type": "gt", "value": { "value": 3, "unit": "m" } } }, { "field": "v.ack", "cond": { "type": "eq", "value": false } } ] ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - saved-patterns summary: Delete saved pattern by id description: | Delete saved pattern by id. - PERMISSIONS (for corporate patterns): `api_corporate_pattern` operationId: saved-patterns-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehavior-comments: post: tags: - pbehavior-comments summary: Create pbehavior comment description: | Create pbehavior comment. - PERMISSIONS: `api_pbehavior:update` operationId: pbehavior-comments-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorcomment.Request' examples: create: summary: Create description: Create a comment value: { "pbehavior": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "message": "Lorem ipsum dolor sit amet" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorcomment.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /pbehavior-comments/{id}: delete: tags: - pbehavior-comments summary: Delete pbehavior comment by id description: | Delete pbehavior comment by id. - PERMISSIONS: `api_pbehavior:update` operationId: pbehavior-comment-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehavior-exception-import: post: tags: - pbehavior-exceptions summary: Import pbehavior exception description: | Import pbehavior exception. - PERMISSIONS: `api_pbehaviorexception:create` operationId: pbehavior-exceptions-import requestBody: content: multipart/form-data: schema: type: object required: - name - type - file properties: name: type: string type: type: string file: type: string format: binary required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /pbehavior-exceptions: get: tags: - pbehavior-exceptions summary: Find all pbehavior exceptions description: | Get paginated list of behavior exceptions. - PERMISSIONS: `api_pbehaviorexception:read` operationId: pbehavior-exceptions-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string - name: with_flags in: query description: with flags schema: type: boolean responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - pbehavior-exceptions summary: Create pbehavior exception description: | Create pbehavior exception. - PERMISSIONS: `api_pbehaviorexception:create` operationId: pbehavior-exceptions-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.CreateRequest' examples: create: summary: Create description: Create an exception value: { "name": "Public holidays '202':2", "description": "New Year, Easter, Christmas", "exdates": [ { "begin": 1640991600, "end": 1641078000, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" }, { "begin": 1650232800, "end": 1650319200, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" }, { "begin": 1671922800, "end": 1672009200, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" } ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /pbehavior-exceptions/{id}: get: tags: - pbehavior-exceptions summary: Get pbehavior exception by id description: | Get pbehavior exception by id. - PERMISSIONS: `api_pbehaviorexception:read` operationId: pbehavior-exceptions-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - pbehavior-exceptions summary: Update behavior exception by id description: | Update behavior exception by id. - PERMISSIONS: `api_pbehaviorexception:update` operationId: pbehavior-exceptions-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.UpdateRequest' examples: update: summary: Update description: Update an exception value: { "name": "Public holidays '202':2", "description": "New Year, Easter, Christmas", "exdates": [ { "begin": 1640991600, "end": 1641078000, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" }, { "begin": 1650232800, "end": 1650319200, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" }, { "begin": 1671922800, "end": 1672009200, "type": "7e5866f8-dbfa-4b14-a4bf-febd0a35ff63" } ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - pbehavior-exceptions summary: Delete pbehavior exception by id description: | Delete pbehavior exception by id. - PERMISSIONS: `api_pbehaviorexception:delete` operationId: pbehavior-exceptions-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehavior-ics/{id}: get: tags: - pbehavior-ics summary: Get pbehavior ICS by id description: | Get pbehavior ICS by id. - PERMISSIONS: `api_pbehavior:read` operationId: pbehavior-ics-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: text/calendar: schema: type: string format: binary '404': description: Not Found content: application/octet-stream: schema: $ref: '#/components/schemas/ErrorResponse' /all-pbehavior-patterns: put: tags: - pbehaviors summary: Execute all pbehavior patterns description: | Execute all pbehavior patterns. - PERMISSIONS: `api_pbehavior_patterns:update` operationId: pbehaviors-exec-patterns responses: '204': description: OK /pbehavior-patterns: put: tags: - pbehaviors summary: Execute pbehavior pattern description: | Execute pbehavior pattern. - PERMISSIONS: `api_pbehavior:update` operationId: pbehaviors-exec-pattern requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.ExecPatternRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pattern.CountResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehavior-reasons: get: tags: - pbehavior-reasons summary: Find pbehavior reasons description: | Get paginated list of behavior reasons. - PERMISSIONS: `api_pbehaviorreason:read` operationId: pbehavior-reasons-find-all parameters: - $ref: '#/components/parameters/ids' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - $ref: '#/components/parameters/withFlags' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - pbehavior-reasons summary: Create pbehavior reason description: | Create pbehavior reason. - PERMISSIONS: `api_pbehaviorreason:create` operationId: pbehavior-reasons-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.CreateRequest' examples: create: summary: Create description: Create a reason value: { "name": "Deployment", "description": "Lorem ipsum dolor sit amet" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /pbehavior-reasons/{id}: get: tags: - pbehavior-reasons summary: Get pbehavior reason by id description: | Get pbehavior reason by id. - PERMISSIONS: `api_pbehaviorreason:read` operationId: pbehavior-reasons-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - pbehavior-reasons summary: Update behavior reason by id description: | Update behavior reason by id. - PERMISSIONS: `api_pbehaviorreason:update` operationId: pbehavior-reasons-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.UpdateRequest' examples: update: summary: Update description: Update a reason value: { "name": "Deployment", "description": "Lorem ipsum dolor sit amet" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - pbehavior-reasons summary: Delete pbehavior reason by id description: | Delete pbehavior reason by id. - PERMISSIONS: `api_pbehaviorreason:delete` operationId: pbehavior-reasons-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehavior-timespans: post: tags: - pbehavior-timespans summary: Get all pbehavior timespans description: | Get time spans of calendar event within view span; {by_date: false} adds exception spans with types, {by_date: true} merges adjacent spans if gap between sequential ones less than 24 hours' - PERMISSIONS: `api_pbehavior:read` operationId: pbehavior-timespans-get-all requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortimespan.TimespansRequest' required: true responses: '200': description: OK content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortimespan.ItemResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-types: delete: tags: - pbehavior-types summary: Bulk delete pbehavior types description: | Bulk delete pbehavior types. - PERMISSIONS: `api_pbehaviortype:delete` operationId: pbehaviortypes-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-types/hide: put: tags: - pbehavior-types summary: Bulk hide pbehavior types description: | Bulk hide pbehavior types. - PERMISSIONS: `api_pbehaviortype:update` operationId: pbehaviortypes-bulk-hide requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.BulkToggleHiddenRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.BulkToggleHiddenRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-types/unhide: put: tags: - pbehavior-types summary: Bulk unhide pbehavior types description: | Bulk unhide pbehavior types. - PERMISSIONS: `api_pbehaviortype:update` operationId: pbehaviortypes-bulk-unhide requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.BulkToggleHiddenRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.BulkToggleHiddenRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-reasons: delete: tags: - pbehavior-reasons summary: Bulk delete pbehavior reasons description: | Bulk delete pbehavior reasons. - PERMISSIONS: `api_pbehaviorreason:delete` operationId: pbehaviorreasons-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-reasons/hide: put: tags: - pbehavior-reasons summary: Bulk hide pbehavior reasons description: | Bulk hide pbehavior reasons. - PERMISSIONS: `api_pbehaviorreason:update` operationId: pbehaviorreasons-bulk-hide requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.BulkToggleHiddenRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.BulkToggleHiddenRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-reasons/unhide: put: tags: - pbehavior-reasons summary: Bulk unhide pbehavior reasons description: | Bulk unhide pbehavior reasons. - PERMISSIONS: `api_pbehaviorreason:update` operationId: pbehaviorreasons-bulk-unhide requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.BulkToggleHiddenRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorreason.BulkToggleHiddenRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-exceptions: delete: tags: - pbehavior-exceptions summary: Bulk delete pbehavior exceptions description: | Bulk delete pbehavior exceptions. - PERMISSIONS: `api_pbehaviorexception:delete` operationId: pbehaviorexceptions-bulk-delete requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.BulkDeleteRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.BulkDeleteRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-exceptions/hide: put: tags: - pbehavior-exceptions summary: Bulk hide pbehavior exceptions description: | Bulk hide pbehavior exceptions. - PERMISSIONS: `api_pbehaviorexception:update` operationId: pbehaviorexceptions-bulk-hide requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.BulkToggleHiddenRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.BulkToggleHiddenRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /bulk/pbehavior-exceptions/unhide: put: tags: - pbehavior-exceptions summary: Bulk unhide pbehavior exceptions description: | Bulk unhide pbehavior exceptions. - PERMISSIONS: `api_pbehaviorexception:update` operationId: pbehaviorexceptions-bulk-unhide requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.BulkToggleHiddenRequestItem' required: true responses: '207': description: Multi-Status content: application/json: schema: type: array items: type: array items: allOf: - $ref: '#/components/schemas/BulkResponseItem' - type: object properties: item: $ref: 'schemas_swagger.yaml#/definitions/pbehaviorexception.BulkToggleHiddenRequestItem' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /pbehavior-types: get: tags: - pbehavior-types summary: Find pbehavior types description: | Get paginated list of behavior types. - PERMISSIONS: `api_pbehaviortype:read` operationId: pbehavior-types-find-all parameters: - name: types[] in: query style: form explode: true schema: type: array items: type: string - $ref: '#/components/parameters/ids' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - $ref: '#/components/parameters/withFlags' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Type' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - pbehavior-types summary: Create pbehavior type description: | Create pbehavior type. - PERMISSIONS: `api_pbehaviortype:create` operationId: pbehavior-types-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.CreateRequest' examples: create: summary: Create description: Create a type value: { "name": "Unplanned maintenance", "description": "Maintenances which are not on the schedule", "type": "maintenance", "priority": 10, "icon_name": "broken_image" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Type' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /pbehavior-types/{id}: get: tags: - pbehavior-types summary: Get pbehavior type by id description: | Get pbehavior type by id. - PERMISSIONS: `api_pbehaviortype:read` operationId: pbehavior-types-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Type' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - pbehavior-types summary: Update behavior type by id description: | Update behavior type by id. - PERMISSIONS: `api_pbehaviortype:update` operationId: pbehavior-types-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.UpdateRequest' examples: update: summary: Update description: Update a type value: { "name": "Unplanned maintenance", "description": "Maintenances which are not on the schedule", "type": "maintenance", "priority": 10, "icon_name": "broken_image" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Type' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - pbehavior-types summary: Delete pbehavior type by id description: | Delete pbehavior type by id. - PERMISSIONS: `api_pbehaviortype:delete` operationId: pbehavior-types-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehavior-types/next-priority: get: tags: - pbehavior-types summary: Get next priority description: | Get next priority. - PERMISSIONS: `api_pbehaviortype:read` operationId: pbehavior-types-get-next-priority responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehaviortype.PriorityResponse' /pbehaviors: delete: tags: - pbehaviors summary: Delete pbehavior by name description: | Delete pbehavior by name. - PERMISSIONS: `api_pbehavior:delete` operationId: pbehaviors-delete-by-name parameters: - name: name in: query description: pbehavior name required: true schema: type: string responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' get: tags: - pbehaviors summary: Find all pbehaviors description: | Get paginated list of pbehaviors. - PERMISSIONS: `api_pbehavior:read` operationId: pbehaviors-find-all parameters: - $ref: '#/components/parameters/ids' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/search_pattern' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - pbehaviors summary: Create pbehavior description: | Create pbehavior. - PERMISSIONS: `api_pbehavior:create` operationId: pbehaviors-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.CreateRequest' examples: maintenance: summary: Maintenance period description: Create a pbehavior with one maintenance period value: { "name": "Maintenance period", "enabled": true, "tstart": 1591172881, "tstop": 1591536400, "rrule": "", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } pause: summary: Pause period description: Create a pbehavior with endless pause period value: { "name": "Pause period", "enabled": true, "tstart": 1591172881, "tstop": null, "rrule": "", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } inactive: summary: Inactive period description: Create a pbehavior with weekend inactive periods value: { "name": "Inactive period", "enabled": true, "tstart": 1651269600, "tstop": 1651442400, "rrule": "FREQ=WEEKLY", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } active: summary: Active period description: Create a pbehavior with daily active periods except some days value: { "name": "Active period", "enabled": true, "tstart": 1650855600, "tstop": 1650891600, "rrule": "FREQ=DAILY", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "exdates": [ { "begin": 1651460400, "end": 1651496400, "type": "3b46e648-f7c0-4c94-8167-30e78728706e" } ], "exceptions": [ "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" ] } with_id: summary: Pbehavior with custom id description: Create a pbehavior with custom id. **Not recommended**, can lead to performance issues. value: { "_id": "maintenance_period", "name": "Maintenance period", "enabled": true, "tstart": 1591172881, "tstop": 1591536400, "rrule": "", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /pbehaviors/{id}: get: tags: - pbehaviors summary: Get pbehavior by id description: | Get pbehavior by id. - PERMISSIONS: `api_pbehavior:read` operationId: pbehaviors-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - pbehaviors summary: Update behavior by id description: | Update behavior by id. - PERMISSIONS: `api_pbehavior:update` operationId: pbehaviors-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.UpdateRequest' examples: update: summary: Update description: Update a pbehavior value: { "name": "Active period", "enabled": true, "tstart": 1650855600, "tstop": 1650891600, "rrule": "FREQ=DAILY", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "exdates": [ { "begin": 1651460400, "end": 1651496400, "type": "3b46e648-f7c0-4c94-8167-30e78728706e" } ], "exceptions": [ "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101" ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - pbehaviors summary: Delete pbehavior by id description: | Delete pbehavior by id. - PERMISSIONS: `api_pbehavior:delete` operationId: pbehaviors-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' patch: tags: - pbehaviors summary: Patch partial set of behavior attributes by id description: | Patch partial set of behavior attributes by id. - PERMISSIONS: `api_pbehavior:update` operationId: pbehaviors-patch-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.PatchRequest' examples: update: summary: Update interval description: Update only a pbehavior interval value: { "tstart": 1650855600, "tstop": 1650891600 } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/pbehavior.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehaviors/{id}/entities: get: tags: - pbehaviors summary: Find entities by pbehavior id description: | Find entities by pbehavior id. - PERMISSIONS: `api_pbehavior:read` operationId: pbehaviors-find-entities parameters: - $ref: '#/components/parameters/id' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/entity.Entity' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /pbehaviors-db-export: post: tags: - pbehaviors summary: Db export pbehaviors description: | Export pbehaviors in a db format. - PERMISSIONS: `api_pbehavior:read` operationId: pbehaviors-db-export requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/dbexport.Request' examples: Export: summary: Export example description: Export example. value: { "ids": [ "cps-pbehavior-1", "cps-pbehavior-2" ] } required: true responses: '200': description: OK content: text/plain: schema: type: string format: binary /pbehavior-pattern-fields: get: tags: - pbehaviors summary: Get pattern fields for pbehaviors description: | Get pattern fields for pbehaviors. - PERMISSIONS: `api_pbehavior:read` operationId: pbehaviors-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /permissions: get: tags: - permissions summary: Find permissions description: | Get paginated list of permissions. - PERMISSIONS: `api_acl:read` operationId: permissions-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/permission.Permission' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /playlists: get: tags: - playlists summary: Find all playlist description: | Get paginated list of playlist. - PERMISSIONS: `api_playlist:read` `{id}:read` operationId: playlists-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/playlist.Playlist' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - playlists summary: Create playlist description: | Create playlist. - PERMISSIONS: `api_playlist:create` operationId: playlists-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/playlist.EditRequest' required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/playlist.Playlist' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /playlists/{id}: get: tags: - playlists summary: Get playlist by id description: | Get playlist by id. - PERMISSIONS: `api_playlist:read` `{id}:read` operationId: playlists-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/playlist.Playlist' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - playlists summary: Update playlist by id description: | Update playlist by id. - PERMISSIONS: `api_playlist:update` `{id}:update` operationId: playlists-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/playlist.Playlist' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/playlist.Playlist' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - playlists summary: Delete playlist by id description: | Delete playlist by id. - PERMISSIONS: `api_playlist:delete` `{id}:update` operationId: playlists-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /resolve-rules: get: tags: - resolverules summary: Find all resolve rule description: | Get paginated list of resolve rule. - PERMISSIONS: `api_resolve_rule:read` operationId: resolverules-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/resolverule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - resolverules summary: Create resolve rule description: | Create resolve rule. - PERMISSIONS: `api_resolve_rule:create` operationId: resolverules-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/resolverule.CreateRequest' examples: create: summary: Create a resolve rule description: Create a resolve rule value: { "name": "Resolve after 2s", "description": "Lorem ipsum dolor sit amet", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "duration": { "value": 2, "unit": "s" }, "priority": 10 } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/resolverule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /resolve-rules/{id}: get: tags: - resolverules summary: Get resolve rule by id description: | Get resolve rule by id. - PERMISSIONS: `api_resolve_rule:read` operationId: resolverules-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/resolverule.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - resolverules summary: Update resolve rule by id description: | Update resolve rule by id. - PERMISSIONS: `api_resolve_rule:update` operationId: resolverules-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/resolverule.UpdateRequest' examples: update: summary: Update a resolve rule description: Update a resolve rule value: { "name": "Resolve after 2s", "description": "Lorem ipsum dolor sit amet", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "duration": { "value": 2, "unit": "s" }, "priority": 10 } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/resolverule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - resolverules summary: Delete resolve rule by id description: | Delete resolve rule by id. - PERMISSIONS: `api_resolve_rule:delete` operationId: resolverules-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /resolve-rule-pattern-fields: get: tags: - resolverules summary: Get pattern fields for resolve rules description: | Get pattern fields for resolve rules. - PERMISSIONS: `api_resolve_rule:read` operationId: resolverules-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /resolved-alarms: get: tags: - alarms summary: Find resolved alarms of entity description: | Get paginated list of alarms. - PERMISSIONS: `api_alarm_read` operationId: alarms-find-resolved-alarms parameters: - name: _id in: query description: entity id required: true schema: type: string - name: tstart in: query schema: type: integer - name: tstop in: query schema: type: integer - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/sort' - name: sort_by in: query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/alarm.Alarm' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /role-templates: get: tags: - roles summary: Get role templates description: | Get list of role templates. - PERMISSIONS: `api_acl:read` operationId: roles-get-templates responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/role.TemplateResponse' /roles: get: tags: - roles summary: Find roles description: | Get paginated list of roles. - PERMISSIONS: `api_acl:read` operationId: roles-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - name: permission in: query description: role permission schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/role.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - roles summary: Create role description: | Create role. - PERMISSIONS: `api_acl:create` operationId: roles-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/role.EditRequest' examples: create_api: summary: Create an API role. description: Create an API role. value: { "name": "cps role", "type": "api", "description": "cps role", "permissions": { "api_alarm_read": [ ], "api_entity": [ "read" ] }, "auth_config": { "expiration_interval": { "value": 1, "unit": "m" }, "inactivity_interval": { "value": 8, "unit": "h" } } } create_ui: summary: Create a UI role. description: Create a UI role. value: { "name": "cps role", "type": "ui", "description": "cps role", "defaultview": "53010391-8f34-4e00-a493-0264431eddd6", "permissions": { "53010391-8f34-4e00-a493-0264431eddd6": [ "read" ], "f8d6373b-15f0-42a0-9cbe-25249343e5a7": [ ] }, "auth_config": { "expiration_interval": { "value": 1, "unit": "m" }, "inactivity_interval": { "value": 8, "unit": "h" } } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/role.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /roles/{id}: get: tags: - roles summary: Get role by id description: | Get role by id. - PERMISSIONS: `api_acl:read` operationId: roles-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/role.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - roles summary: Update role by id description: | Update role by id. - PERMISSIONS: `api_acl:update` operationId: roles-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/role.EditRequest' examples: update: summary: Update a role. description: Update a role. value: { "name": "cps role", "type": "ui", "description": "cps role", "defaultview": "53010391-8f34-4e00-a493-0264431eddd6", "permissions": { "53010391-8f34-4e00-a493-0264431eddd6": [ "read" ], "f8d6373b-15f0-42a0-9cbe-25249343e5a7": [ ] }, "auth_config": { "expiration_interval": { "value": 1, "unit": "m" }, "inactivity_interval": { "value": 8, "unit": "h" } } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/role.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - roles summary: Delete role by id description: | Delete role by id. - PERMISSIONS: `api_acl:delete` operationId: roles-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /scenarios: get: tags: - scenarios summary: Find scenarios description: | Get paginated list of scenarios. - PERMISSIONS: `api_action:read` operationId: scenarios-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/scenario.Scenario' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - scenarios summary: Create scenario description: | Create scenario. - PERMISSIONS: `api_action:create` operationId: scenarios-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/scenario.EditRequest' examples: ack: summary: Acknowledge action description: Create a scenario with acknowledge action. value: { "name": "Scenario with acknowledge action", "comment": "The scenario acknowledges an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "ack", "parameters": { "output": "The alarm is acknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } ackremove: summary: Acknowledge remove action description: Create a scenario with acknowledge remove action. value: { "name": "Scenario with acknowledge remove action", "comment": "The scenario removes an acknowledge of an alarm on state increase", "enabled": true, "priority": 10, "triggers": [ { "type": "stateinc" } ], "actions": [ { "type": "ackremove", "parameters": { "output": "The alarm is unacknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } assocticket: summary: Associate ticket action description: Create a scenario with associate ticket action. value: { "name": "Scenario with associate ticket action", "comment": "The scenario adds a ticket to an alarm on activate", "enabled": true, "priority": 10, "triggers": [ { "type": "activate" } ], "actions": [ { "type": "assocticket", "parameters": { "output": "The ticket is added to the alarm by scenario", "ticket": "ENV-116", "ticket_url": "https://jira.local/ENV-116", "ticket_system_name": "Jira", "ticket_data": { "priority": "high", "tag": "env" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } cancel: summary: Cancel action description: Create a scenario with cancel action. value: { "name": "Scenario with cancel action", "comment": "The scenario cancels an alarm on state decrease", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "cancel", "parameters": { "output": "The alarm is canceled by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 1 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } changestate: summary: Change state action description: Create a scenario with change state action. value: { "name": "Scenario with change state action", "comment": "The scenario changes a state of an alarm on acknowledge", "enabled": true, "priority": 10, "triggers": [ { "type": "ack" } ], "actions": [ { "type": "changestate", "parameters": { "output": "The state of the alarm is changed by scenario", "state": 3 }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 1 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } pbehavior: summary: Pbehavior action description: Create a scenario with pbehavior action. value: { "name": "Scenario with pbehavior action", "comment": "The scenario creates a pbehavior for an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "pbehavior", "parameters": { "name": "The pbehavior is created by scenario", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "start_on_trigger": true, "duration": { "value": 10, "unit": "m" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } snooze: summary: Snooze action description: Create a scenario with snooze action. value: { "name": "Scenario with snooze action", "comment": "The scenario snoozes an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "snooze", "parameters": { "output": "The alarm is snoozed by scenario", "duration": { "value": 10, "unit": "m" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } webhook: summary: Webhook action description: Create a scenario with webhook action. value: { "name": "Scenario with webhook action", "comment": "The scenario does webhook request for an alarm on declare ticket", "enabled": true, "priority": 10, "triggers": [ { "type": "declareticket" } ], "actions": [ { "type": "webhook", "parameters": { "request": { "method": "POST", "url": "https://localhost/ticket", "auth": { "username": "admin", "password": "admin" }, "headers": { "Content-Type": "application/json" }, "payload": "{\"service\":\"{{ .Alarm.Value.Resource }}\",\"host\":\"{{ .Alarm.Value.Component }}\",\"group\":\"{{ (index .Entity.Infos \"group\").Value }}\",\"change\":\"{{ .AdditionalData.Trigger }}\"}" }, "declare_ticket": { "empty_response": false, "is_regexp": false, "ticket_id": "id", "external_link": "link" }, "retry_count": 3, "retry_delay": { "value": 3, "unit": "s" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false, "emit_trigger_fail": false } ] } eventscount: summary: Scenario with check events count trigger description: Create a scenario with acknowledge action. value: { "name": "Scenario with check events count trigger", "comment": "The scenario triggers after 3rd check event", "enabled": true, "priority": 10, "triggers": [ { "type": "eventscount", "threshold": 3 } ], "actions": [ { "type": "ack", "parameters": { "output": "The alarm is acknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/scenario.Scenario' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /scenarios/{id}: get: tags: - scenarios summary: Get scenario by id description: | Get scenario by id. - PERMISSIONS: `api_action:read` operationId: scenarios-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/scenario.Scenario' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - scenarios summary: Update scenario by id description: | Update scenario by id. - PERMISSIONS: `api_action:update` operationId: scenarios-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/scenario.EditRequest' examples: ack: summary: Acknowledge action description: Update a scenario with acknowledge action. value: { "name": "Scenario with acknowledge action", "comment": "The scenario acknowledges an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "ack", "parameters": { "output": "The alarm is acknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } ackremove: summary: Acknowledge remove action description: Update a scenario with acknowledge remove action. value: { "name": "Scenario with acknowledge remove action", "comment": "The scenario removes an acknowledge of an alarm on state increase", "enabled": true, "priority": 10, "triggers": [ { "type": "stateinc" } ], "actions": [ { "type": "ackremove", "parameters": { "output": "The alarm is unacknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } assocticket: summary: Associate ticket action description: Update a scenario with associate ticket action. value: { "name": "Scenario with associate ticket action", "comment": "The scenario adds a ticket to an alarm on activate", "enabled": true, "priority": 10, "triggers": [ { "type": "activate" } ], "actions": [ { "type": "assocticket", "parameters": { "output": "The ticket is added to the alarm by scenario", "ticket": "ENV-116", "ticket_url": "https://%ticket_url%", "ticket_system_name": "Jira Helpdesk", "ticket_data": { "key_1": "value_1", "key_2": "value_2" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } cancel: summary: Cancel action description: Update a scenario with cancel action. value: { "name": "Scenario with cancel action", "comment": "The scenario cancels an alarm on state decrease", "enabled": true, "priority": 10, "triggers": [ { "type": "statedec" } ], "actions": [ { "type": "cancel", "parameters": { "output": "The alarm is canceled by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 1 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } changestate: summary: Change state action description: Update a scenario with change state action. value: { "name": "Scenario with change state action", "comment": "The scenario changes a state of an alarm on acknowledge", "enabled": true, "priority": 10, "triggers": [ { "type": "ack" } ], "actions": [ { "type": "changestate", "parameters": { "output": "The state of the alarm is changed by scenario", "state": 3 }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 1 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } pbehavior: summary: Pbehavior action description: Update a scenario with pbehavior action. value: { "name": "Scenario with pbehavior action", "comment": "The scenario creates a pbehavior for an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "pbehavior", "parameters": { "name": "The pbehavior is created by scenario", "type": "53010391-8f34-4e00-a493-0264431eddd6", "reason": "f8d6373b-15f0-42a0-9cbe-25249343e5a7", "start_on_trigger": true, "duration": { "value": 10, "unit": "m" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } snooze: summary: Snooze action description: Update a scenario with snooze action. value: { "name": "Scenario with snooze action", "comment": "The scenario snoozes an alarm on create", "enabled": true, "priority": 10, "triggers": [ { "type": "create" } ], "actions": [ { "type": "snooze", "parameters": { "output": "The alarm is snoozed by scenario", "duration": { "value": 10, "unit": "m" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } webhook: summary: Webhook action description: Update a scenario with webhook action. value: { "name": "Scenario with webhook action", "comment": "The scenario does webhook request for an alarm on declare ticket", "enabled": true, "priority": 10, "triggers": [ { "type": "declareticket" } ], "actions": [ { "type": "webhook", "parameters": { "request": { "method": "POST", "url": "https://localhost/ticket", "auth": { "username": "admin", "password": "admin" }, "headers": { "Content-Type": "application/json" }, "payload": "{\"service\":\"{{ .Alarm.Value.Resource }}\",\"host\":\"{{ .Alarm.Value.Component }}\",\"group\":\"{{ (index .Entity.Infos \"group\").Value }}\",\"change\":\"{{ .AdditionalData.Trigger }}\"}" }, "declare_ticket": { "empty_response": false, "is_regexp": false, "ticket_id": "id", "external_link": "link" }, "retry_count": 3, "retry_delay": { "value": 3, "unit": "s" } }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false, "emit_trigger_fail": false } ] } eventscount: summary: Scenario with check events count trigger description: Create a scenario with acknowledge action. value: { "name": "Scenario with check events count trigger", "comment": "The scenario triggers after 3rd check event", "enabled": true, "priority": 10, "triggers": [ { "type": "eventscount", "threshold": 3 } ], "actions": [ { "type": "ack", "parameters": { "output": "The alarm is acknowledged by scenario" }, "alarm_pattern": [ [ { "field": "v.state.val", "cond": { "type": "eq", "value": 3 } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false } ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/scenario.Scenario' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - scenarios summary: Delete scenario by id description: | Delete scenario by id. - PERMISSIONS: `api_action:delete` operationId: scenarios-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /scenarios-db-export: post: tags: - scenarios summary: Db export scenarios description: | Export scenarios in a db format. - PERMISSIONS: `api_action:read` operationId: scenarios-db-export requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/dbexport.Request' examples: Export: summary: Export example description: Export example. value: { "ids": [ "cps-scenario-1", "cps-scenario-2" ] } required: true responses: '200': description: OK content: text/plain: schema: type: string format: binary /scenario-template-vars: get: tags: - scenarios summary: Get available template variables for action scenarios description: | Get available template variables for action scenarios. - PERMISSIONS: `api_action:read` operationId: scenarios-tpl-vars responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/scenario.TemplateVarsResponse' /scenario-template-validate: post: tags: - scenarios summary: Validate action scenario templates description: | Validate action scenario templates. - PERMISSIONS: `api_action:read` operationId: scenarios-tpl-validate requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/scenario.TemplateRequest' examples: validate: summary: Validate description: Validate rule value: { "testdata": { "event": "9c848e2c-bc55-484f-a433-a9e4d1031867", "responses": { 1: "0dbb862b-cd5d-4643-b069-72ec13a57d63", 2: "e4166204-fa3c-4b37-aaaa-8b441047e543" } }, "rule": { "name": "Scenario with webhook action", "comment": "The scenario does webhook request for an alarm on activate", "enabled": true, "priority": 10, "triggers": [ { "type": "activate" } ], "actions": [ { "type": "ack", "parameters": { "output": "Ack by {{ .AdditionalData.RuleName }}" }, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false }, { "type": "webhook", "parameters": { "request": { "method": "GET", "url": "{{ .Env.TicketURL }}/info", "headers": { "Content-Type": "application/json" } } }, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false, "emit_trigger_fail": false }, { "type": "webhook", "parameters": { "request": { "method": "POST", "url": "{{ .Env.TicketURL }}/ticket", "headers": { "Content-Type": "application/json" }, "payload": "{\"service\":\"{{ .Alarm.Value.Resource }}\",\"host\":\"{{ .Alarm.Value.Component }}\",\"group\":\"{{ (index .Entity.Infos \"group\").Value }}\",\"change\":\"{{ .AdditionalData.Trigger }}\"}" }, "declare_ticket": { "empty_response": false, "ticket_id_tpl": "{{ .Response.id }}", "ticket_id_url": "{{ index .ResponseMap \"1.url\" }}/ticket/{{ .Response.id }}" } }, "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ], "drop_scenario_if_not_matched": false, "emit_trigger_success": false, "emit_trigger_fail": false } ] } } required: true responses: '200': description: OK content: application/json: schema: type: object additionalProperties: $ref: 'schemas_swagger.yaml#/definitions/template.ValidateResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /scenario-pattern-fields: get: tags: - scenarios summary: Get pattern fields for action scenarios description: | Get pattern fields for action scenarios. - PERMISSIONS: `api_action:read` operationId: scenarios-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /share-tokens: get: tags: - share-tokens summary: Find share tokens description: | Get paginated list of share tokens. - PERMISSIONS: `api_share_token:read` operationId: share-tokens-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/sharetoken.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - share-tokens summary: Create share token description: | Create share token. - PERMISSIONS: `api_share_token:create` operationId: share-tokens-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/sharetoken.EditRequest' examples: create: summary: Create description: Create a share token. value: { "description": "Share token", "duration": { "value": 1, "unit": "d" } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/sharetoken.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /share-tokens/{id}: delete: tags: - share-tokens summary: Delete share token by id description: | Delete share token by id. - PERMISSIONS: `api_share_token:delete` operationId: share-tokens-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /state-settings: get: tags: - state-settings summary: Find all state settings description: | Get paginated list of state settings. - PERMISSIONS: `api_state_settings:read` operationId: state-settings-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/statesettings.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - state-settings summary: Create state setting description: | Create state setting. - PERMISSIONS: `api_state_settings:create` operationId: state-settings-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/statesettings.EditRequest' examples: create_inherited: summary: Create inherited state setting description: Create inherited state setting value: { "title": "Inherited state setting", "method": "inherited", "enabled": true, "type": "component", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "some_service" } } ] ], "inherited_entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } create_dependencies: summary: Create dependencies state setting description: Create dependencies state setting value: { "title": "Dependencies state setting", "method": "dependencies", "enabled": true, "type": "component", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "some_service" } } ] ], "state_thresholds": { "critical": { "method": "share", "state": "major", "cond": "gt", "value": 20 }, "major": { "method": "number", "state": "major", "cond": "lt", "value": 10 }, "minor": { "method": "number", "state": "ok", "cond": "lt", "value": 10 }, "ok": { "method": "share", "state": "minor", "cond": "gt", "value": 10 } } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/statesettings.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /state-settings/{id}: get: tags: - state-settings summary: Get state setting by id description: | Get state setting by id. - PERMISSIONS: `api_state_settings:read` operationId: state-settings-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/statesettings.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - state-settings summary: Update state setting by id description: | Update state setting by id. - PERMISSIONS: `api_state_settings:update` operationId: state-settings-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/statesettings.EditRequest' examples: update_inherited: summary: Update an inherited state setting description: Update an inherited state setting value: { "title": "Inherited state setting", "method": "inherited", "enabled": true, "type": "component", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "some_service" } } ] ], "inherited_entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } update_dependencies: summary: Update a dependencies state setting description: Update a dependencies state setting value: { "title": "Dependencies state setting", "method": "dependencies", "enabled": true, "type": "component", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "some_service" } } ] ], "state_thresholds": { "critical": { "method": "share", "state": "major", "cond": "gt", "value": 20 }, "major": { "method": "number", "state": "major", "cond": "lt", "value": 10 }, "minor": { "method": "number", "state": "ok", "cond": "lt", "value": 10 }, "ok": { "method": "share", "state": "minor", "cond": "gt", "value": 10 } } } update_junit_worst_of_share: summary: Update a junit state setting with worst_of_share method description: Update a junit state setting with worst_of_share method value: { "method": "worst_of_share", "junit_thresholds": { "skipped": { "minor": 15, "major": 20, "critical": 30, "type": 1 }, "errors": { "minor": 10, "major": 20, "critical": 30, "type": 1 }, "failures": { "minor": 0, "major": 20, "critical": 30, "type": 0 } } } update_junit_worst: summary: Update a junit state setting with worst method description: Update a junit state setting with worst method value: { "method": "worst" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/statesettings.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - state-settings summary: Delete state setting by id description: | Delete state setting by id. - PERMISSIONS: `api_state_settings:delete` operationId: state-settings-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /state-setting-pattern-fields: get: tags: - state-settings summary: Get pattern fields for state settings description: | Get pattern fields for state settings. - PERMISSIONS: `api_state_settings:read` operationId: state-settings-pattern-fields parameters: - name: type in: query description: |- State settings rule type. When `service` or `component`, the response also includes `inherited_entity_pattern` with fields enabled/disabled for that type. required: false schema: type: string enum: - service - component responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /tech-metrics-export: post: tags: - tech-metrics summary: Start export tech metrics description: | Start export tech metrics. - PERMISSIONS: `api_techmetrics` operationId: tech-metrics-export-start responses: '201': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/techmetrics.ExportResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' get: tags: - tech-metrics summary: Get status of export tech metrics description: | Get status of export tech metrics. - PERMISSIONS: `api_techmetrics` operationId: tech-metrics-export-get responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/techmetrics.ExportResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /tech-metrics-export/download: get: tags: - tech-metrics summary: Get result of export tech metrics description: | Get result of export tech metrics. - PERMISSIONS: `api_techmetrics` operationId: tech-metrics-export-download responses: '200': description: OK content: application/octet-stream: schema: type: string format: binary '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /tech-metrics-settings: get: tags: - tech-metrics-settings summary: Get tech metrics settings description: | Get tech metrics settings. - PERMISSIONS: `api_techmetrics_settings:read` operationId: tech-metrics-settings-get responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/techmetrics.Settings' put: tags: - tech-metrics-settings summary: Update tech metrics settings description: | Update tech metrics settings. - PERMISSIONS: `api_techmetrics_settings:update` operationId: tech-metrics-settings-update requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/techmetrics.Settings' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/techmetrics.Settings' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /link-categories: get: tags: - linkrules summary: Get link categories description: | Get list of distinct categories, empty list if no categories found. - PERMISSIONS: `api_link_rule:read` operationId: linkrules-categories parameters: - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - name: type in: query description: type schema: type: string enum: - alarm - entity responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.CategoryResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /link-rules: get: tags: - linkrules summary: Find all link rule description: | Get paginated list of link rule. - PERMISSIONS: `api_link_rule:read` operationId: linkrules-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/linkrule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - linkrules summary: Create link rule description: | Create link rule. - PERMISSIONS: `api_link_rule:create` operationId: linkrules-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.EditRequest' examples: links: summary: Create a rule with links description: Create a rule with links value: { "name": "Link rule", "enabled": true, "links": [ { "label": "Dashboard", "category": "Prod", "icon_name": "build", "url": "https://prod.local?user={{ .User.Username }}&{{ .range Alarms }}resources[]={{ .Entity.ID }}&{{ end }}", "action": "open", "single": false } ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ] } source: summary: Create a rule with code description: Create a rule with code value: { "name": "Link rule", "enabled": true, "source_code": "function generate(alarms, user) {\n var queryStr = \"user=\" + user.Username + \"&\";\n for (var alarm of alarms) {\n queryStr += \"resources[]=\" + alarm.Entity.ID + \"&\";\n }\n return [{\"label\": \"Dashboard\", \"category\": \"Prod\", \"icon_name\": \"build\", \"url\": \"https://prod.local\" + queryStr, \"action\": \"copy\", \"single\": false}];\n}", "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /link-rules/{id}: get: tags: - linkrules summary: Get link rule by id description: | Get link rule by id. - PERMISSIONS: `api_link_rule:read` operationId: linkrules-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - linkrules summary: Update link rule by id description: | Update link rule by id. - PERMISSIONS: `api_link_rule:update` operationId: linkrules-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.EditRequest' examples: update: summary: Update a link rule description: Update a link rule value: { value: { "name": "Link rule", "enabled": true, "links": [ { "label": "Dashboard", "category": "Prod", "icon_name": "build", "url": "https://prod.local?user={{ .User.Username }}&{{ .range Alarms }}resources[]={{ .Entity.ID }}&{{ end }}", "action": "open", "single": true } ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ] } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - linkrules summary: Delete link rule by id description: | Delete link rule by id. - PERMISSIONS: `api_link_rule:delete` operationId: linkrules-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /link-rules-db-export: post: tags: - linkrules summary: Db export link rules description: | Export link rules in a db format. - PERMISSIONS: `api_link_rule:read` operationId: linkrules-db-export requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/dbexport.Request' examples: Export: summary: Export example description: Export example. value: { "ids": [ "cps-link-rule-1", "cps-link-rule-2" ] } required: true responses: '200': description: OK content: text/plain: schema: type: string format: binary /link-rule-template-vars: get: tags: - linkrules summary: Get available template variables for link rules description: | Get available template variables for link rules. - PERMISSIONS: `api_link_rule:read` operationId: linkrules-tpl-vars responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.TemplateVarsResponse' /link-rule-template-validate: post: tags: - linkrules summary: Validate link rule templates description: | Validate link rule templates. - PERMISSIONS: `api_link_rule:read` operationId: linkrules-tpl-validate requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/linkrule.TemplateRequest' examples: alarm: summary: Validate alarm description: Validate alarm rule value: { "testdata": { "alarm": "0dbb862b-cd5d-4643-b069-72ec13a57d63", "user": "1e433055-253d-4c94-8ec4-d64075c83575" }, "rule": { "name": "Rule for alarms", "type": "alarm", "enabled": true, "links": [ { "label": "{{ range .Alarms }}{{ (index .Entity.Infos \"text\").Value }} / {{ end }}", "url": "{{ .Env.LinkURL }}?{{ range .Alarms }}id={{ (index .Entity.Infos \"external_id\").Value }}&{{ end }}", "action": "open", "icon_name": "build" } ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ] } } entity: summary: Validate entity description: Validate entity rule value: { "testdata": { "entity": "0dbb862b-cd5d-4643-b069-72ec13a57d63", "user": "1e433055-253d-4c94-8ec4-d64075c83575" }, "rule": { "name": "Rule for entities", "type": "entity", "enabled": true, "links": [ { "label": "{{ range .Entities }}{{ (index .Infos \"text\").Value }} / {{ end }}", "url": "{{ .Env.LinkURL }}?{{ range .Entities }}id={{ (index .Infos \"external_id\").Value }}&{{ end }}", "action": "open", "icon_name": "build" } ], "entity_pattern": [ [ { "field": "type", "cond": { "type": "eq", "value": "resource" } }, { "field": "infos.group", "cond": { "type": "eq", "value": "g1" } } ] ] } } required: true responses: '200': description: OK content: application/json: schema: type: object additionalProperties: $ref: 'schemas_swagger.yaml#/definitions/template.ValidateResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /link-rule-pattern-fields: get: tags: - linkrules summary: Get pattern fields for link rules description: | Get pattern fields for link rules. - PERMISSIONS: `api_link_rule:read` operationId: linkrules-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /template-data: get: tags: - tpldata summary: Find all template data description: | Get paginated list of template data. - PERMISSIONS: `api_template_data:read` operationId: tpldata-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - name: type in: query description: > Filter by type: * `0` - Event data * `1` - Response data schema: type: integer enum: - 0 - 1 - name: event_pattern in: query schema: type: string example: "[[{\"field\": \"event_type\", \"cond\": {\"type\": \"eq\", \"value\": \"check\"}}]]" responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/template.DataResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - tpldata summary: Create template data description: | Create template data. - PERMISSIONS: `api_template_data:create` operationId: tpldata-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.EditDataRequest' examples: event: summary: Create event data description: Create event data value: { "name": "Check event", "description": "Check event", "type": 0, "body": { "event_type": "check", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "state": 3, "output": "Alert" } } response: summary: Create response data description: Create response data value: { "name": "External API response", "description": "External API response", "type": 1, "body": { "id": "e4166204-fa3c-4b37-aaaa-8b441047e543" }, "headers": { "Content-Type": "application/json" } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.DataResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /template-data/{id}: get: tags: - tpldata summary: Get template data by id description: | Get template data by id. - PERMISSIONS: `api_template_data:read` operationId: tpldata-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.DataResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - tpldata summary: Update template data by id description: | Update template data by id. - PERMISSIONS: `api_template_data:update` operationId: tpldata-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.EditDataRequest' examples: event: summary: Update event data description: Update event data value: { "name": "Check event", "description": "Check event", "type": 0, "body": { "event_type": "check", "connector": "cps_connector", "connector_name": "cps_connector_name", "component": "cps_component", "resource": "cps_resource", "source_type": "resource", "state": 3, "output": "Alert" } } response: summary: Update response data description: Update response data value: { "name": "External API response", "description": "External API response", "type": 1, "body": { "id": "e4166204-fa3c-4b37-aaaa-8b441047e543" }, "headers": { "Content-Type": "application/json" } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.DataResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - tpldata summary: Delete template data by id description: | Delete template data by id. - PERMISSIONS: `api_template_data:delete` operationId: tpldata-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /template-test: get: tags: - tpltest summary: Find all template test description: | Get paginated list of template test. operationId: tpltest-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - name: ids[] in: query style: form explode: true schema: type: array items: type: string - name: rule in: query description: rule id schema: type: string - name: type in: query description: > Filter by type: * `0` - Event filter rule * `1` - Link rule * `2` - Action scenario * `3` - Widget * `4` - Declare ticket rule * `5` - Dynamic infos rule * `6` - Instruction * `7` - Job * `8` - Meta-alarm rule schema: type: integer enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/template.TestResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: tags: - tpltest summary: Create template test description: | Create template test. operationId: tpltest-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.EditTestRequest' examples: rule: summary: Create test for rule description: Create test for rule value: { "name": "Test", "description": "Test", "type": 0, "rule": "0dbb862b-cd5d-4643-b069-72ec13a57d63", "data": { "event": "1e433055-253d-4c94-8ec4-d64075c83575" } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.TestResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /template-test/{id}: get: tags: - tpltest summary: Get template test by id description: | Get template test by id. operationId: tpltest-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.TestResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - tpltest summary: Update template test by id description: | Update template test by id. operationId: tpltest-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.EditTestRequest' examples: rule: summary: Update test for rule description: Update test for rule value: { "name": "Test", "description": "Test", "type": 0, "rule": "0dbb862b-cd5d-4643-b069-72ec13a57d63", "data": { "event": "1e433055-253d-4c94-8ec4-d64075c83575" } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/template.TestResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - tpltest summary: Delete template test by id description: | Delete template test by id. operationId: tpltest-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /template-vars: get: tags: - template-validator summary: Get template env vars description: Get template env vars. operationId: template-vars responses: '200': description: OK content: application/json: schema: type: object additionalProperties: type: string security: - { } /user-preferences: put: tags: - userpreference summary: Update user preferences by widget id description: | Update user preferences by widget id. - PERMISSIONS: `{view_id}:read` operationId: userpreference-update-by-widget-id requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/userpreferences.EditRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/userpreferences.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /user-preferences/{id}: get: tags: - userpreference summary: Get user preferences by widget id description: | Get user preferences by widget id. - PERMISSIONS: `{view_id}:read` operationId: userpreference-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/userpreferences.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /users: get: tags: - users summary: Find users description: | Get paginated list of users. - PERMISSIONS: `api_acl:read` operationId: users-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' - $ref: '#/components/parameters/withFlags' - $ref: '#/components/parameters/ids' - name: permission in: query description: role permission schema: type: string responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/user.User' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - users summary: Create user description: | Create user. - PERMISSIONS: `api_acl:create` operationId: users-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/user.CreateRequest' required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/user.User' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /users/{id}: get: tags: - users summary: Get user by id description: | Get user by id. - PERMISSIONS: `api_acl:read` operationId: users-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/user.User' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' patch: tags: - users summary: Partial user update by id description: | Partial user update by id. - PERMISSIONS: `api_acl:update` operationId: users-patch-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/user.PatchRequest' examples: password: summary: Update password description: Update password value: { "password": "qweRTY123" } email: summary: Update email description: Update email value: { "email": "new-email@canopsis.net" } ui_theme: summary: Update UI theme description: Update UI theme value: { "ui_theme": "canopsis_dark" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/user.User' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - users summary: Update user by id description: | Update user by id. - PERMISSIONS: `api_acl:update` operationId: users-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/user.UpdateRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/user.User' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - users summary: Delete user by id description: | Delete user by id. - PERMISSIONS: `api_acl:delete` operationId: users-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /view-copy/{id}: post: tags: - views summary: Copy view description: | Copy view. - PERMISSIONS: `api_view:create` `api_view:read` `{id}:read` or `api_private_view_groups:can` operationId: views-copy parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.EditRequest' examples: copy: summary: Copy description: Copy a view. View's tabs are also copied. value: { "title": "Opened", "description": "Opened alarms", "enabled": true, "group": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "periodic_refresh": { "enabled": true, "value": 600, "unit": "m" }, "tags": [ "alarms" ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /view-export: post: tags: - views summary: Export views description: | Export views. - PERMISSIONS: `api_view:read` `api_viewgroup:read` `{view_id}:read` operationId: views-export requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.ExportRequest' examples: export: summary: Export description: Export selected groups and views. value: { "groups": [ { "_id": "15a8df93-fab2-417b-a96c-f624dc6dc204", "views": ["14e237d4-ad08-47a5-87f2-8ffe6741541f", "0be1d3df-816b-4359-a2ba-7bcccb33ed4f"] }, { "_id": "98a07c80-a731-4e33-992e-c8aaee3eb529" } ], "views": ["6164d665-7ccb-4ffc-9d46-5350b2fefafe"] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.ExportResponse' /view-groups: get: tags: - viewgroups summary: Find view groups description: | Get paginated list of view groups. - PERMISSIONS: `api_viewgroup:read` or `api_private_view_groups:can` operationId: viewgroups-find-all parameters: - name: with_flags in: query schema: type: boolean - name: with_views in: query schema: type: boolean - name: with_tabs in: query schema: type: boolean - name: with_widgets in: query schema: type: boolean - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/search' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/viewgroup.ViewGroup' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - viewgroups summary: Create view group description: | Create view group. - PERMISSIONS: `api_viewgroup:create` operationId: viewgroups-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewgroup.EditRequest' examples: create: summary: Create description: Create a group. value: { "title": "Alarms" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewgroup.ViewGroup' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /view-groups/{id}: get: tags: - viewgroups summary: Get view group by id description: | Get view group by id. - PERMISSIONS: `api_viewgroup:read` operationId: viewgroups-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewgroup.ViewGroup' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - viewgroups summary: Update view group by id description: | Update view group by id. - PERMISSIONS: `api_viewgroup:update` operationId: viewgroups-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewgroup.EditRequest' examples: update: summary: Update description: Update a group. value: { "title": "Alarms" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewgroup.ViewGroup' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - viewgroups summary: Delete view group by id description: | Delete view group by id. - PERMISSIONS: `api_viewgroup:delete` operationId: viewgroups-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /view-import: post: tags: - views summary: Import views description: | Import views. - PERMISSIONS: `api_view:update` `api_viewgroup:update` `{view_id}:update` operationId: views-import requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/view.ImportItemRequest' examples: import: summary: Import description: Import groups and views. value: [ { "title": "New group", "views": [ { "title": "New view", "description": "New view", "enabled": true, "periodic_refresh": { "enabled": true, "value": 1, "unit": "s" }, "tags": [ "alarms" ], "tabs": [ { "title": "New tab", "widgets": [ { "title": "New widget", "type": "AlarmsList", "parameters": { "mainFilter": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "widgetColumns": [ { "value": "v.connector", "label": "Connector" }, { "value": "v.connector_name", "label": "Connector name" }, { "value": "v.component", "label": "Component" }, { "value": "v.resource", "label": "Resource" }, { "value": "v.output", "label": "Output" }, { "value": "extra_details", "label": "Extra details" }, { "value": "v.state.val", "label": "State" }, { "value": "v.status.val", "label": "Status" } ], "sort": { "order": "DESC" }, "itemsPerPage": 15, "alarmsStateFilter": { "opened": true } }, "grid_parameters": { "mobile": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "tablet": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "desktop": { "x": 0, "y": 0, "w": 12, "h": 1, "autoHeight": true } }, "filters": [ { "_id": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "title": "New filter. ID is used to set main filter parameter.", "is_private": false, "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ] }, { "title": "New filter 2", "is_private": false, "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ] } ] } ] }, { "title": "New tab 2" } ] } ] }, { "_id": "0be1d3df-816b-4359-a2ba-7bcccb33ed4f", "views": [ { "_id": "15a8df93-fab2-417b-a96c-f624dc6dc204" }, { "title": "New view. This view is added to existed group between existed views." }, { "_id": "14e237d4-ad08-47a5-87f2-8ffe6741541f" } ] }, { "title": "New group. Existed view is moved to this group.", "views": [ { "_id": "84511962-6b00-4b3e-8a00-29216b2e1be6" } ] } ] required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /view-positions: put: tags: - views summary: Update views positions description: | Update views positions. - PERMISSIONS: `api_view:update` `api_viewgroup:update` `{view_id}:update` operationId: views-update-positions requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/view.EditPositionItemRequest' examples: update: summary: Update positions. description: Update groups' and views' positions. value: [ { "_id": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "views": [ "84511962-6b00-4b3e-8a00-29216b2e1be6", "0be1d3df-816b-4359-a2ba-7bcccb33ed4f", "14e237d4-ad08-47a5-87f2-8ffe6741541f" ] }, { "_id": "15a8df93-fab2-417b-a96c-f624dc6dc204", "views": [ "6164d665-7ccb-4ffc-9d46-5350b2fefafe", "7c573640-239b-4e8d-84e2-e1baf4bd0ae2" ] } ] required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /view-tab-copy/{id}: post: tags: - viewtabs summary: Copy view tab description: | Copy view tab. - PERMISSIONS: `api_view:update` `{view_id}:read` or `api_private_view_groups:can` operationId: viewtabs-copy parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewtab.EditRequest' examples: copy: summary: Copy description: Copy a tab. Tab's widgets are also copied. value: { "title": "Alarms", "view": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewtab.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /view-tab-positions: put: tags: - viewtabs summary: Update view tabs positions description: | Update view tabs positions. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: viewtabs-update-positions requestBody: description: body content: application/json: schema: type: array items: type: string examples: update: summary: Update positions description: Update tabs' positions value: [ "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "6ccfd7ea-9f04-4c0f-8809-25545cbb579e" ] required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /view-tabs: post: tags: - viewtabs summary: Create view tab description: | Create view tab. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: viewtabs-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewtab.EditRequest' examples: create: summary: Create description: Create a tab. value: { "title": "Alarms", "view": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewtab.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /view-tabs/{id}: get: tags: - viewtabs summary: Get view tab by id description: | Get view tab by id. - PERMISSIONS: `api_view:read` `{view_id}:read` or `api_private_view_groups:can` operationId: viewtabs-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewtab.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - viewtabs summary: Update view tab by id description: | Update view tab by id. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: viewtabs-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewtab.EditRequest' examples: update: summary: Update description: Update a tab. value: { "title": "Alarms" } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/viewtab.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - viewtabs summary: Delete view tab by id description: | Delete view tab by id. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: viewtabs-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /views: post: tags: - views summary: Create view description: | Create view. - PERMISSIONS: `api_view:create` or `api_private_view_groups:can` operationId: views-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.EditRequest' examples: create: summary: Create description: Create a view. Only users with author's role can see new view. value: { "title": "Opened", "description": "Opened alarms", "enabled": true, "group": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "periodic_refresh": { "enabled": true, "value": 600, "unit": "m" }, "tags": [ "alarms" ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /views/{id}: get: tags: - views summary: Get view by id description: | Get view by id. - PERMISSIONS: `api_view:read` `{id}:read` or `api_private_view_groups:can` operationId: views-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - views summary: Update view by id description: | Update view by id. - PERMISSIONS: `api_view:update` `{id}:update` or `api_private_view_groups:can` operationId: views-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.EditRequest' examples: update: summary: Update description: Update a view. value: { "title": "Opened", "description": "Opened alarms", "enabled": true, "group": "27e7f6ae-2ba0-4c7d-be4b-3e55e9c6e101", "periodic_refresh": { "enabled": true, "value": 600, "unit": "m" }, "tags": [ "alarms" ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/view.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - views summary: Delete view by id description: | Delete view by id. - PERMISSIONS: `api_view:delete` `{id}:delete` or `api_private_view_groups:can` operationId: views-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /weather-services: get: tags: - weather-services summary: Find all services description: | Get paginated list of services. - PERMISSIONS: `api_entityservice:read` operationId: weather-services-find-all parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - name: filters[] in: query style: form explode: true schema: type: array items: type: string - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string - name: category in: query description: category schema: type: string - name: hide_grey in: query schema: type: boolean - name: with_tag_colors in: query description: retrieve tag colors schema: type: boolean - in: query name: entity_pattern schema: type: string example: "[[{\"field\":\"infos.info1\",\"field_type\":\"string\",\"cond\":{\"type\":\"eq\",\"value\":\"val1\"}}]]" - in: query name: weather_service_pattern schema: type: string example: "[[{\"field\":\"icon\",\"cond\":{\"type\":\"neq\",\"value\":\"wb_sunny\"}}]]" responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/serviceweather.Service' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /weather-services/{id}: get: tags: - weather-services summary: Find all entity by service id description: | Get paginated list of entities. - PERMISSIONS: `api_entityservice:read` operationId: weather-services-find-all-entities parameters: - $ref: '#/components/parameters/id' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/sort' - name: sort_by in: query description: sort query schema: type: string - name: with_instructions in: query description: show assigned instructions and execution flags schema: type: boolean - name: with_declare_tickets in: query description: show assigned declare ticket rules schema: type: boolean - name: with_tag_colors in: query description: retrieve tag colors schema: type: boolean responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/serviceweather.Entity' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /widget-copy/{id}: post: tags: - widgets summary: Copy widget description: | Copy widget. - PERMISSIONS: `api_view:update` `{view_id}:read` or `api_private_view_groups:can` operationId: widgets-copy parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.EditRequest' examples: copy: summary: Copy description: Copy a widget. Widget's filters are also copied. value: { "tab": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "title": "Opened", "type": "AlarmsList", "grid_parameters": { "mobile": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "tablet": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "desktop": { "x": 0, "y": 0, "w": 12, "h": 1, "autoHeight": true } }, "parameters": { "mainFilter": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "widgetColumns": [ { "value": "v.connector", "label": "Connector" }, { "value": "v.connector_name", "label": "Connector name" }, { "value": "v.component", "label": "Component" }, { "value": "v.resource", "label": "Resource" }, { "value": "v.output", "label": "Output" }, { "value": "extra_details", "label": "Extra details" }, { "value": "v.state.val", "label": "State" }, { "value": "v.status.val", "label": "Status" } ], "sort": { "order": "DESC" }, "itemsPerPage": 15, "alarmsStateFilter": { "opened": true } } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /widget-filters: get: tags: - widgetfilters summary: Find widget filters description: | Get paginated list of widget filters. - PERMISSIONS: `api_view:read` or `api_private_view_groups:can` operationId: widgetfilters-find-all parameters: - name: private in: query schema: type: boolean - name: widget in: query required: true schema: type: string - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/widgetfilter.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - widgetfilters summary: Create widget filter description: | Create widget filter. - PERMISSIONS: `api_view:read` or `api_private_view_groups:can` operationId: widgetfilters-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgetfilter.EditRequest' examples: embedpatterns: summary: Embed patterns description: Create a filter with embed patterns. value: { "title": "Filter", "widget": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "is_user_preference": true, "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "pbehavior_pattern": [ [ { "field": "pbehavior_info.type", "cond": { "type": "eq", "value": "df17b079-03fb-4a4f-a19d-14d9c0c3563b" } } ] ] } corporatepatterns: summary: Corporate patterns description: Create a filter with corporate patterns. value: { "title": "Filter", "widget": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "is_private": true, "corporate_alarm_pattern": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "corporate_entity_pattern": "84511962-6b00-4b3e-8a00-29216b2e1be6", "corporate_pbehavior_pattern": "0be1d3df-816b-4359-a2ba-7bcccb33ed4f" } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgetfilter.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /widget-filters/{id}: get: tags: - widgetfilters summary: Get widget filter by id description: | Get widget filter by id. - PERMISSIONS: `api_view:read` or `api_private_view_groups:can` operationId: widgetfilters-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgetfilter.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - widgetfilters summary: Update widget filter by id description: | Update widget filter by id. - PERMISSIONS: `api_view:read` or `api_private_view_groups:can` operationId: widgetfilters-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgetfilter.EditRequest' examples: update: summary: Update description: Update a filter. value: { "title": "Filter", "is_user_preference": true, "alarm_pattern": [ [ { "field": "v.component", "cond": { "type": "eq", "value": "cps_component" } } ] ], "entity_pattern": [ [ { "field": "name", "cond": { "type": "eq", "value": "cps_resource" } } ] ], "pbehavior_pattern": [ [ { "field": "pbehavior_info.type", "cond": { "type": "eq", "value": "df17b079-03fb-4a4f-a19d-14d9c0c3563b" } } ] ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgetfilter.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - widgetfilters summary: Delete widget filter by id description: | Delete widget filter by id. - PERMISSIONS: `api_view:read` or `api_private_view_groups:can` operationId: widgetfilters-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /widget-filter-positions: put: tags: - widgetfilters summary: Update widget filters positions description: | Update widget filters positions. - PERMISSIONS: `api_view:read` `{view_id}:read` or `api_private_view_groups:can` operationId: widgetfilters-update-positions requestBody: description: body content: application/json: schema: type: array items: type: string examples: update: summary: Update positions description: Update filters' positions value: [ "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "6ccfd7ea-9f04-4c0f-8809-25545cbb579e" ] required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /widget-filter-pattern-fields: get: tags: - widgetfilters summary: Get pattern fields for widget filters description: | Get pattern fields for widget filters. - PERMISSIONS: `api_view:read` or `api_private_view_groups:can` operationId: widgetfilters-pattern-fields responses: 200: description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/patternfields.FieldsResponse' /widget-grid-positions: put: tags: - widgets summary: Update widgets grid positions description: | Update widgets grid positions. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: widgets-update-grid-positions requestBody: description: body content: application/json: schema: type: array items: $ref: 'schemas_swagger.yaml#/definitions/widget.EditGridPositionItemRequest' examples: update: summary: Update grid positions description: Update widgets' grid positions. value: [ { "_id": "84511962-6b00-4b3e-8a00-29216b2e1be6", "grid_parameters": { "desktop": {"x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": false} } }, { "_id": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "grid_parameters": { "desktop": {"x": 0, "y": 1, "w": 3, "h": 1, "autoHeight": false} } }, { "_id": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "grid_parameters": { "desktop": {"x": 1, "y": 1, "w": 12, "h": 1, "autoHeight": true} } } ] required: true responses: '204': description: OK '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /widget-templates: get: tags: - widgettemplates summary: Find widget templates description: Get paginated list of widget templates operationId: widgettemplates-find-all parameters: - name: type in: query schema: type: string - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/sort_by' responses: '200': description: OK content: application/json: schema: allOf: - $ref: 'schemas_swagger.yaml#/definitions/pagination.ListResponse' - type: object properties: data: type: array items: $ref: 'schemas_swagger.yaml#/definitions/widgettemplate.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' post: tags: - widgettemplates summary: Create widget template description: Create widget template operationId: widgettemplates-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgettemplate.EditRequest' examples: alarm_columns: summary: Alarm columns template description: Create a template for alarms list. value: { "title": "Template", "type": "alarm_columns", "columns": [ { "value": "v.resource" }, { "value": "v.component" }, { "value": "extra_details" } ] } entity_columns: summary: Entity columns template description: Create a template for entities list. value: { "title": "Template", "type": "entity_columns", "columns": [ { "value": "_id" }, { "value": "type" } ] } alarm_more_infos: summary: Alarm more infos template description: Create a template for alarms list. value: { "title": "Template", "type": "alarm_more_infos", "content": "Name: {{ alarm.v.display_name }}" } alarm_export_to_pdf: summary: Alarm export to pdf template description: Create a template for alarms list. value: { "title": "Template", "type": "alarm_export_to_pdf", "content": "Name: {{ alarm.v.display_name }}" } alarm_sort_columns: summary: Alarm sort columns template description: Create a template for alarms list. value: { "title": "Template", "type": "alarm_sort_columns", "sort_columns": [ { "sort_by": "v.resource", "sort": "asc" }, { "sort_by": "v.component", "sort": "desc" } ] } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgettemplate.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /widget-templates/{id}: get: tags: - widgettemplates summary: Get widget template by id description: Get widget template by id operationId: widgettemplates-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgettemplate.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - widgettemplates summary: Update widget template by id description: Update widget template by id operationId: widgettemplates-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgettemplate.EditRequest' examples: update: summary: Update description: Update a template. value: { "title": "Template", "type": "alarm_columns", "columns": [ { "value": "v.resource" }, { "value": "v.component" }, { "value": "extra_details" } ] } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widgettemplate.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - widgettemplates summary: Delete widget template by id description: Delete widget template by id operationId: widgettemplates-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /widget-template-vars: get: tags: - widgettemplates summary: Get available template variables for widgets description: | Get available template variables for widgets. - PERMISSIONS: `api_view:read` operationId: widgettemplates-tpl-vars responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.TemplateVarsResponse' /widget-template-validate: post: tags: - widgettemplates summary: Validate widget templates description: | Validate widget templates. - PERMISSIONS: `api_view:read` operationId: widgettemplates-tpl-validate requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.TemplateRequest' examples: validate: summary: Validate description: Validate value: { "testdata": { "alarm": "1e433055-253d-4c94-8ec4-d64075c83575" }, "rule": { "columns": [ { "value": "v.resource", "template": "Service: {{ .Alarm.Value.Resource }}\nHost: {{ .Alarm.Value.Component }}\nGroup: {{ index .Entity.Infos \"group\").Value }}" } ] } } required: true responses: '200': description: OK content: application/json: schema: type: object additionalProperties: $ref: 'schemas_swagger.yaml#/definitions/template.ValidateResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /widgets: post: tags: - widgets summary: Create widget description: | Create widget. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: widgets-create requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.EditRequest' examples: create: summary: Create description: Create a widget. value: { "tab": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "title": "Opened", "type": "AlarmsList", "grid_parameters": { "mobile": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "tablet": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "desktop": { "x": 0, "y": 0, "w": 12, "h": 1, "autoHeight": true } }, "parameters": { "mainFilter": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "widgetColumns": [ { "value": "v.connector", "label": "Connector" }, { "value": "v.connector_name", "label": "Connector name" }, { "value": "v.component", "label": "Component" }, { "value": "v.resource", "label": "Resource" }, { "value": "v.output", "label": "Output" }, { "value": "extra_details", "label": "Extra details" }, { "value": "v.state.val", "label": "State" }, { "value": "v.status.val", "label": "Status" } ], "sort": { "order": "DESC" }, "itemsPerPage": 15, "alarmsStateFilter": { "opened": true } } } template: summary: Create with template description: Create a widget with template. value: { "tab": "7c573640-239b-4e8d-84e2-e1baf4bd0ae2", "title": "Opened", "type": "AlarmsList", "grid_parameters": { "mobile": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "tablet": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "desktop": { "x": 0, "y": 0, "w": 12, "h": 1, "autoHeight": true } }, "parameters": { "mainFilter": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "widgetColumnsTemplate": "dedeae28-7829-4093-8165-0705de09efaa", "sort": { "order": "DESC" }, "itemsPerPage": 15, "alarmsStateFilter": { "opened": true } } } required: true responses: '201': description: Created content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' /widgets/{id}: get: tags: - widgets summary: Get widget by id description: | Get widget by id. - PERMISSIONS: `api_view:read` `{view_id}:read` or `api_private_view_groups:can` operationId: widgets-get-by-id parameters: - $ref: '#/components/parameters/id' responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.Response' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: tags: - widgets summary: Update widget by id description: | Update widget by id. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: widgets-update-by-id parameters: - $ref: '#/components/parameters/id' requestBody: description: body content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.EditRequest' examples: update: summary: Update description: Update a widget. value: { "title": "Opened", "type": "AlarmsList", "grid_parameters": { "mobile": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "tablet": { "x": 0, "y": 0, "w": 3, "h": 1, "autoHeight": true }, "desktop": { "x": 0, "y": 0, "w": 12, "h": 1, "autoHeight": true } }, "parameters": { "mainFilter": "6ccfd7ea-9f04-4c0f-8809-25545cbb579e", "widgetColumns": [ { "value": "v.connector", "label": "Connector" }, { "value": "v.connector_name", "label": "Connector name" }, { "value": "v.component", "label": "Component" }, { "value": "v.resource", "label": "Resource" }, { "value": "v.output", "label": "Output" }, { "value": "extra_details", "label": "Extra details" }, { "value": "v.state.val", "label": "State" }, { "value": "v.status.val", "label": "Status" } ], "sort": { "order": "DESC" }, "itemsPerPage": 15, "alarmsStateFilter": { "opened": true } } } required: true responses: '200': description: OK content: application/json: schema: $ref: 'schemas_swagger.yaml#/definitions/widget.Response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: tags: - widgets summary: Delete widget by id description: | Delete widget by id. - PERMISSIONS: `api_view:update` `{view_id}:update` or `api_private_view_groups:can` operationId: widgets-delete-by-id parameters: - $ref: '#/components/parameters/id' responses: '204': description: OK '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: parameters: id: name: id in: path description: id required: true schema: type: string page: name: page in: query description: current page required: false schema: type: integer minimum: 1 limit: name: limit in: query description: items per page required: false schema: type: integer minimum: 1 search: name: search in: query description: search query schema: type: string search_pattern: name: search pattern in: query description: search pattern schema: type: string example: "[[{\"field\":\"name\",\"cond\":{\"type\":\"eq\",\"value\":\"cps_name\"}}]]" search_by: name: search_by[] in: query style: form explode: true description: search by fields schema: type: array items: type: string sort: name: sort in: query description: sort query schema: type: string enum: - asc - desc sort_by: name: sort_by in: query description: sort query schema: type: string withFlags: name: with_flags in: query description: with flags required: false schema: type: boolean ids: name: ids[] in: query style: form explode: true schema: type: array items: type: string schemas: event.Event: type: object required: - connector - connector_name - component - event_type - source_type properties: component: type: string connector: type: string connector_name: type: string event_type: type: string enum: - check - ack - ackremove - cancel - uncancel - comment - snooze - changestate - assocticket - declareticket resource: type: string source_type: type: string enum: - resource - component state: type: integer enum: - 0 - 1 - 2 - 3 description: > State: * `0` - Info * `1` - Minor * `2` - Major * `3` - Critical output: type: string long_output: type: string author: type: string user_id: type: string duration: type: integer event.Response: type: object properties: failed_events: type: array items: $ref: '#/components/schemas/event.Event' retry_events: type: array items: $ref: '#/components/schemas/event.Event' sent_events: type: array items: $ref: '#/components/schemas/event.Event' BulkResponseItem: type: object properties: id: type: string status: type: integer item: type: object error: type: string errors: type: object additionalProperties: type: string ErrorResponse: properties: error: type: string message: type: string type: object ValidationErrorResponse: properties: errors: additionalProperties: type: string type: object type: object securitySchemes: BasicAuth: type: http scheme: basic BearerAuth: type: http scheme: bearer bearerFormat: JWT security: - BearerAuth: [ ] - BasicAuth: [ ]