swagger/servicelocator.yml

214 lines
5.0 KiB
YAML
Raw Normal View History

2021-10-28 12:43:26 +02:00
openapi: 3.0.3
info:
title: Service Locator
description: REST API for service location in a 5G core network
contact:
email: tormakristof@tormakristof.eu
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: https://servicelocator.k8s.kmlabz.com
tags:
- name: servicedatabase
description: Service locator function database API
- name: servicelocator
description: Service location API
paths:
2021-11-03 12:12:19 +01:00
/service/location/{serviceID}:
2021-10-28 12:43:26 +02:00
get:
tags:
- servicelocator
summary: get service with location by ID
operationId: getServiceLocation
parameters:
- name: serviceID
in: path
description: ID of service
required: true
schema:
type: string
format: uuid
responses:
200:
description: Service with given ID
content:
application/json:
schema:
2021-10-28 12:44:45 +02:00
type: object
properties:
location:
type: string
format: ipv4
required:
- location
2021-10-28 12:43:26 +02:00
404:
description: Not found
2021-11-03 12:12:19 +01:00
/service/directory:
get:
tags:
- servicelocator
summary: Get service directory
operationId: serviceDirectory
responses:
200:
description: Service with given ID
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceDirectory'
404:
description: Not found
2021-10-28 12:43:26 +02:00
/service:
get:
tags:
- servicedatabase
summary: Get all services
operationId: getall
responses:
200:
description: Array of all services
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceLocator'
404:
description: No object matching filter
post:
tags:
- servicedatabase
summary: create a service
operationId: createservice
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceLocatorObject'
required: true
responses:
200:
description: successful operation
400:
description: JSON parse error
417:
description: JSON invalid schema
/service/{serviceID}:
get:
tags:
- servicedatabase
summary: get service by ID
operationId: getService
parameters:
- name: serviceID
in: path
description: ID of service
required: true
schema:
type: string
format: uuid
responses:
200:
description: Service with given ID
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceLocatorObject'
404:
description: Not found
delete:
tags:
- servicedatabase
summary: delete a service
operationId: deleteService
parameters:
- name: serviceID
in: path
description: ID of service
required: true
schema:
type: string
format: uuid
responses:
200:
description: Service deleted
404:
description: Not found
put:
tags:
- servicedatabase
summary: updates a service
operationId: updateservice
parameters:
- name: serviceID
in: path
description: ID of service
required: true
schema:
type: string
format: uuid
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceLocatorObject'
required: true
responses:
200:
description: successful operation
400:
description: JSON parse error
417:
description: JSON invalid schema
404:
description: Not found
components:
schemas:
ServiceLocator:
type: array
items:
$ref: '#/components/schemas/ServiceLocatorObject'
2021-11-03 12:12:19 +01:00
ServiceDirectory:
type: array
items:
$ref: '#/components/schemas/ServiceDirectoryObject'
ServiceDirectoryObject:
required:
- id
- name
type: object
properties:
name:
type: string
id:
type: string
format: uuid
2021-10-28 12:43:26 +02:00
ServiceLocatorObject:
required:
2021-11-03 12:12:19 +01:00
- servicearray
2021-10-28 12:43:26 +02:00
- id
2021-11-03 12:12:19 +01:00
- name
2021-10-28 12:43:26 +02:00
type: object
properties:
2021-11-03 12:12:19 +01:00
name:
type: string
2021-10-28 12:43:26 +02:00
id:
type: string
format: uuid
servicearray:
$ref: '#/components/schemas/ServiceArray'
ServiceArray:
type: array
items:
$ref: '#/components/schemas/Service'
Service:
type: object
required:
- location
- zone
properties:
location:
type: string
format: ipv4
zone:
type: string