Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
168 lines (168 sloc) 5.2 KB
openapi: '3.0.0'
info:
version: '1.0.0'
title: 'Kyma Events API'
tags:
- name: 'Kyma events'
description: 'API for publishing events to Kyma.'
paths:
/v1/health:
get:
summary: 'Returns health of a service'
operationId: 'getHealth'
tags:
- 'health'
responses:
'200':
description: 'The service is in a good health'
/v1/events:
post:
summary: 'Publish an event'
operationId: 'publishEvent'
tags:
- 'publish'
requestBody:
description: 'The event to be published'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PublishRequest'
responses:
'200':
description: 'The event was successfully published'
content:
application/json:
schema:
$ref: '#/components/schemas/PublishResponse'
'400':
description: 'Bad Request'
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'401':
description: 'Authentication failure'
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'403':
description: 'Not authorized'
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
'500':
description: 'Server error'
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
components:
schemas:
PublishRequest:
type: object
description: A Publish request
properties:
event-type:
description: Type of the event.
type: string
format: hostname
pattern: '^[a-zA-Z]+([_\-\.]?[a-zA-Z0-9]+)*$'
example: 'order.created'
event-type-version:
description: The version of the event-type. This is applicable to the data payload alone.
type: string
pattern: '^[a-zA-Z0-9]+$'
example: 'v1'
event-id:
description: Optional publisher provided ID (UUID v4) of the to-be-published event. When omitted, one will be automatically generated.
type: string
pattern: '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'
example: '31109198-4d69-4ae0-972d-76117f3748c8'
event-time:
description: RFC 3339 timestamp of when the event happened.
type: string
format: date-time
example: '2012-11-01T22:08:41+00:00'
data:
$ref: '#/components/schemas/AnyValue'
required:
- event-type
- event-type-version
- event-time
- data
PublishResponse:
type: object
description: A Publish response
properties:
event-id:
type: string
description: ID of the published event
pattern: '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'
example: '31109198-4d69-4ae0-972d-76117f3748c8'
required:
- event-id
AnyValue:
nullable: false
description: Can be any value but null.
APIError:
type: object
description: API Error response body
properties:
status:
type: integer
description: >-
original HTTP error code, should be consistent with the response HTTP code
minimum: 100
maximum: 599
type:
type: string
description: >-
classification of the error type, lower case with underscore eg
validation_failure
pattern: '[a-z]+[a-z_]*[a-z]+'
message:
type: string
description: descriptive error message for debugging
moreInfo:
type: string
format: uri
description: link to documentation to investigate further and finding support
details:
type: array
description: list of error causes
items:
$ref: '#/components/schemas/APIErrorDetail'
required:
- status
- type
APIErrorDetail:
description: schema for specific error detail
type: object
properties:
field:
type: string
description: >-
a bean notation expression specifying the element in request
data causing the error, eg product.variants[3].name, this can
be empty if violation was not field specific
type:
type: string
description: >-
classification of the error detail type, lower case with
underscore eg missing_value, this value must be always
interpreted in context of the general error type.
pattern: '[a-z]+[a-z_]*[a-z]+'
message:
type: string
description: descriptive error detail message for debugging
moreInfo:
type: string
format: uri
description: >-
link to documentation to investigate further and finding
support for error detail
required:
- type