zrok/specs/zrok.yml

482 lines
9.2 KiB
YAML
Raw Normal View History

2022-07-22 16:52:36 +02:00
info:
description: zrok client access
title: zrok
2022-07-22 16:52:36 +02:00
version: 1.0.0
basePath: /api/v1
securityDefinitions:
key:
type: apiKey
in: header
name: x-token
2022-07-22 16:52:36 +02:00
paths:
2022-09-20 19:51:54 +02:00
#
# identity
#
/account:
post:
tags:
- identity
operationId: createAccount
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/accountRequest"
responses:
201:
description: account created
2022-07-25 22:23:55 +02:00
400:
description: account not created (already exists)
2022-07-27 19:38:35 +02:00
schema:
$ref: "#/definitions/errorMessage"
2022-07-25 22:23:55 +02:00
500:
description: internal server error
2022-07-27 19:38:35 +02:00
schema:
$ref: "#/definitions/errorMessage"
2022-08-03 17:54:11 +02:00
2022-07-25 23:05:44 +02:00
/enable:
post:
tags:
- identity
security:
- key: []
2022-07-25 23:05:44 +02:00
operationId: enable
2022-08-03 20:25:27 +02:00
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/enableRequest"
2022-07-25 23:05:44 +02:00
responses:
201:
description: environment enabled
schema:
$ref: "#/definitions/enableResponse"
2022-07-27 20:50:46 +02:00
401:
description: invalid api key
2022-07-25 23:05:44 +02:00
404:
description: account not found
500:
description: internal server error
2022-07-27 19:38:35 +02:00
schema:
$ref: "#/definitions/errorMessage"
2022-08-03 17:54:11 +02:00
/disable:
post:
tags:
- identity
security:
- key: []
operationId: disable
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/disableRequest"
responses:
200:
description: environment disabled
401:
description: invalid environment
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
2022-08-02 19:23:31 +02:00
/login:
post:
tags:
- identity
operationId: login
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/loginRequest"
responses:
200:
description: login successful
schema:
$ref: "#/definitions/loginResponse"
401:
description: invalid login
2022-08-03 17:54:11 +02:00
2022-09-20 19:51:54 +02:00
/register:
post:
2022-08-03 20:36:40 +02:00
tags:
2022-09-20 19:51:54 +02:00
- identity
operationId: register
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/registerRequest"
2022-08-03 20:36:40 +02:00
responses:
200:
2022-09-20 19:51:54 +02:00
description: account created
schema:
$ref: "#/definitions/registerResponse"
2022-09-20 19:51:54 +02:00
404:
description: request not found
2022-08-03 20:36:40 +02:00
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
2022-09-20 19:51:54 +02:00
/verify:
2022-09-20 19:42:34 +02:00
post:
tags:
- identity
2022-09-20 19:51:54 +02:00
operationId: verify
2022-09-20 19:42:34 +02:00
parameters:
- name: body
in: body
schema:
2022-09-20 19:51:54 +02:00
$ref: "#/definitions/verifyRequest"
2022-09-20 19:42:34 +02:00
responses:
200:
2022-09-20 19:51:54 +02:00
description: token ready
schema:
$ref: "#/definitions/verifyResponse"
2022-09-20 19:42:34 +02:00
404:
2022-09-20 19:51:54 +02:00
description: token not found
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
#
# metadata
#
/overview:
get:
tags:
- metadata
security:
- key: []
operationId: overview
responses:
200:
description: overview returned
schema:
$ref: "#/definitions/environmentServicesList"
2022-09-20 19:42:34 +02:00
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
2022-09-20 19:51:54 +02:00
/version:
get:
tags:
- metadata
operationId: version
responses:
200:
description: current server version
schema:
$ref: "#/definitions/version"
#
# service
2022-09-20 19:51:54 +02:00
#
2022-11-23 18:12:11 +01:00
/access:
post:
tags:
- service
security:
- key: []
operationId: access
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/accessRequest"
responses:
201:
description: access created
401:
description: unauthorized
2022-11-23 18:24:35 +01:00
404:
description: not found
2022-11-23 18:12:11 +01:00
500:
description: internal server error
/unaccess:
delete:
tags:
- service
security:
- key: []
operationId: unaccess
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/unaccessRequest"
responses:
200:
description: access removed
401:
description: unauthorized
404:
description: not found
500:
description: internal server error
/share:
2022-07-26 21:38:35 +02:00
post:
tags:
- service
security:
- key: []
operationId: share
2022-07-26 21:38:35 +02:00
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/shareRequest"
2022-07-26 21:38:35 +02:00
responses:
201:
description: service created
2022-07-26 21:38:35 +02:00
schema:
$ref: "#/definitions/shareResponse"
2022-08-01 21:44:26 +02:00
401:
description: unauthorized
2022-07-27 19:17:47 +02:00
500:
description: internal server error
2022-07-27 19:38:35 +02:00
schema:
$ref: "#/definitions/errorMessage"
2022-11-23 18:12:11 +01:00
/unshare:
2022-07-27 17:35:28 +02:00
delete:
tags:
- service
security:
- key: []
operationId: unshare
2022-07-27 17:35:28 +02:00
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/unshareRequest"
2022-07-27 17:35:28 +02:00
responses:
200:
description: service removed
401:
description: unauthorized
2022-08-01 21:44:26 +02:00
404:
description: not found
2022-07-27 17:35:28 +02:00
500:
description: internal server error
2022-07-27 19:38:35 +02:00
schema:
$ref: "#/definitions/errorMessage"
2022-07-22 16:52:36 +02:00
definitions:
2022-11-23 18:12:11 +01:00
accessRequest:
type: object
properties:
zId:
type: string
svcName:
type: string
accountRequest:
type: object
properties:
2022-09-09 16:20:05 +02:00
email:
type: string
2022-08-03 17:54:11 +02:00
authUser:
type: object
properties:
username:
type: string
password:
type: string
2022-08-03 20:25:27 +02:00
enableRequest:
type: object
properties:
description:
type: string
host:
type: string
2022-07-25 22:42:06 +02:00
enableResponse:
type: object
properties:
identity:
type: string
cfg:
type: string
2022-08-03 17:54:11 +02:00
disableRequest:
type: object
properties:
identity:
type: string
2022-08-03 17:54:11 +02:00
environments:
type: array
items:
2022-08-03 17:54:11 +02:00
$ref: "#/definitions/environment"
environment:
type: object
properties:
2022-08-03 19:48:17 +02:00
description:
type: string
host:
type: string
address:
type: string
2022-10-19 18:35:29 +02:00
zId:
type: string
active:
type: boolean
createdAt:
type: integer
updatedAt:
type: integer
2022-08-03 17:54:11 +02:00
2022-08-03 21:05:28 +02:00
environmentServicesList:
type: array
items:
$ref: "#/definitions/environmentServices"
2022-08-03 20:36:40 +02:00
environmentServices:
type: object
properties:
environment:
$ref: "#/definitions/environment"
services:
$ref: "#/definitions/services"
2022-08-03 17:54:11 +02:00
errorMessage:
type: string
2022-08-02 19:23:31 +02:00
loginRequest:
type: object
properties:
email:
type: string
password:
type: string
loginResponse:
type: string
2022-08-03 17:54:11 +02:00
principal:
2022-07-28 18:12:50 +02:00
type: object
properties:
id:
type: integer
2022-09-09 16:20:05 +02:00
email:
2022-07-28 18:12:50 +02:00
type: string
token:
type: string
2022-08-03 17:54:11 +02:00
2022-09-20 19:42:34 +02:00
registerRequest:
type: object
properties:
token:
type: string
password:
type: string
registerResponse:
type: object
properties:
token:
type: string
2022-09-20 19:42:34 +02:00
2022-08-03 20:36:40 +02:00
services:
type: array
items:
$ref: "#/definitions/service"
service:
type: object
properties:
2022-10-19 18:35:29 +02:00
zId:
2022-08-03 20:36:40 +02:00
type: string
2022-10-19 18:35:29 +02:00
name:
type: string
frontend:
type: string
backend:
2022-08-03 20:36:40 +02:00
type: string
metrics:
$ref: "#/definitions/serviceMetrics"
2022-08-03 20:36:40 +02:00
createdAt:
type: integer
2022-08-03 20:36:40 +02:00
updatedAt:
type: integer
2022-08-03 20:36:40 +02:00
serviceMetrics:
type: array
items:
type: integer
shareRequest:
2022-07-26 21:38:35 +02:00
type: object
properties:
2022-10-19 18:35:29 +02:00
zId:
2022-07-26 21:38:35 +02:00
type: string
shareMode:
type: string
enum: ["public", "private"]
frontendSelection:
type: array
items:
type: string
backendMode:
type: string
enum: ["proxy", "web", "dav"]
backendProxyEndpoint:
2022-07-26 21:38:35 +02:00
type: string
authScheme:
type: string
authUsers:
type: array
items:
$ref: "#/definitions/authUser"
shareResponse:
2022-07-26 21:38:35 +02:00
type: object
properties:
frontendProxyEndpoint:
type: string
2022-10-19 18:35:29 +02:00
svcName:
2022-07-26 21:38:35 +02:00
type: string
2022-08-03 17:54:11 +02:00
2022-11-23 18:12:11 +01:00
unaccessRequest:
type: object
properties:
zId:
type: string
svcName:
type: string
unshareRequest:
2022-07-27 17:35:28 +02:00
type: object
properties:
2022-10-19 18:35:29 +02:00
zId:
2022-08-03 20:58:11 +02:00
type: string
2022-10-19 18:35:29 +02:00
svcName:
2022-07-27 17:35:28 +02:00
type: string
2022-08-03 17:54:11 +02:00
2022-09-19 21:58:52 +02:00
verifyRequest:
type: object
properties:
token:
type: string
verifyResponse:
type: object
properties:
email:
type: string
version:
type: string
2022-07-22 16:52:36 +02:00
produces:
2022-07-22 17:45:37 +02:00
- application/zrok.v1+json
2022-07-22 16:52:36 +02:00
consumes:
2022-07-22 17:45:37 +02:00
- application/zrok.v1+json
2022-07-22 16:52:36 +02:00
schemes:
- http
2022-08-03 17:54:11 +02:00
swagger: "2.0"