zrok/specs/zrok.yml

232 lines
4.7 KiB
YAML

info:
description: zrok client access
title: zrok
version: 1.0.0
basePath: /api/v1
securityDefinitions:
key:
type: apiKey
in: header
name: x-token
paths:
/account:
post:
tags:
- identity
operationId: createAccount
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/accountRequest"
responses:
201:
description: account created
schema:
$ref: "#/definitions/accountResponse"
400:
description: account not created (already exists)
schema:
$ref: "#/definitions/errorMessage"
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
/enable:
post:
tags:
- identity
security:
- key: []
operationId: enable
responses:
201:
description: environment enabled
schema:
$ref: "#/definitions/enableResponse"
401:
description: invalid api key
404:
description: account not found
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
/listIdentities:
get:
tags:
- metadata
security:
- key: []
operationId: listIdentities
responses:
200:
description: success
schema:
$ref: "#/definitions/identities"
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
/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
/tunnel:
post:
tags:
- tunnel
security:
- key: []
operationId: tunnel
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/tunnelRequest"
responses:
201:
description: tunnel created
schema:
$ref: "#/definitions/tunnelResponse"
401:
description: invalid environment identity
schema:
$ref: "#/definitions/errorMessage"
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
/untunnel:
delete:
tags:
- tunnel
security:
- key: []
operationId: untunnel
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/untunnelRequest"
responses:
200:
description: tunnel removed
404:
description: not found
schema:
$ref: "#/definitions/errorMessage"
500:
description: internal server error
schema:
$ref: "#/definitions/errorMessage"
/version:
get:
tags:
- metadata
operationId: version
responses:
200:
description: retrieve the current server version
schema:
$ref: "#/definitions/version"
definitions:
accountRequest:
type: object
properties:
username:
type: string
password:
type: string
accountResponse:
type: object
properties:
token:
type: string
enableResponse:
type: object
properties:
identity:
type: string
cfg:
type: string
errorMessage:
type: string
identities:
type: array
items:
$ref: "#/definitions/identity"
identity:
type: object
properties:
zitiId:
type: string
active:
type: boolean
createdAt:
type: string
updatedAt:
type: string
loginRequest:
type: object
properties:
email:
type: string
password:
type: string
loginResponse:
type: string
principal:
type: object
properties:
id:
type: integer
username:
type: string
token:
type: string
tunnelRequest:
type: object
properties:
identity:
type: string
endpoint:
type: string
tunnelResponse:
type: object
properties:
service:
type: string
untunnelRequest:
type: object
properties:
service:
type: string
version:
type: string
produces:
- application/zrok.v1+json
consumes:
- application/zrok.v1+json
schemes:
- http
swagger: "2.0"