Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add openApi spec for new proxy and rules API #12889

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 222 additions & 0 deletions api/openapi/specs/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,179 @@ paths:
$ref: "./common/error_schema.yaml#/components/responses/NotFound"
'500':
$ref: '#/components/responses/Internal'
/meshes/{mesh}/proxies:
get:
parameters:
- in: path
name: mesh
example: default
schema:
type: string
required: true
description: The mesh the proxy is part of
responses:
'200':
$ref: '#/components/responses/ProxyListResponse'
'500':
$ref: '#/components/responses/Internal'
/meshes/{mesh}/proxies/{proxyName}:
get:
parameters:
- in: path
name: mesh
example: default
schema:
type: string
required: true
description: The mesh the proxy is part of
- in: path
name: proxyName
example: TODO
schema:
type: string
required: true
description: TODO
responses:
'200':
$ref: '#/components/responses/ProxyResponse'
'404':
$ref: "./common/error_schema.yaml#/components/responses/NotFound"
'500':
$ref: '#/components/responses/Internal'
/meshes/{mesh}/proxies/{proxyName}/rules:
get:
parameters:
- in: path
name: mesh
example: default
schema:
type: string
required: true
description: The mesh the proxy is part of
- in: path
name: proxyName
example: TODO
schema:
type: string
required: true
description: TODO
responses:
'200':
$ref: '#/components/responses/ProxyRulesResponse'
'404':
$ref: "./common/error_schema.yaml#/components/responses/NotFound"
'500':
$ref: '#/components/responses/Internal'
/meshes/{mesh}/proxies/{proxyName}/inbounds:
get:
parameters:
- in: path
name: mesh
example: default
schema:
type: string
required: true
description: The mesh the proxy is part of
- in: path
name: proxyName
example: TODO
schema:
type: string
required: true
description: TODO
responses:
'200':
$ref: '#/components/responses/ProxyInboundsResponse'
'404':
$ref: "./common/error_schema.yaml#/components/responses/NotFound"
'500':
$ref: '#/components/responses/Internal'
/meshes/{mesh}/proxies/{proxyName}/inbounds/{kri}/rules:
get:
parameters:
- in: path
name: mesh
example: default
schema:
type: string
required: true
description: The mesh the proxy is part of
- in: path
name: proxyName
example: TODO
schema:
type: string
required: true
description: TODO
- in: path
name: kri
example: TODO
schema:
type: string
required: true
description: TODO
responses:
'200':
$ref: '#/components/responses/ProxyInboundRulesResponse'
'404':
$ref: "./common/error_schema.yaml#/components/responses/NotFound"
'500':
$ref: '#/components/responses/Internal'
/meshes/{mesh}/proxies/{proxyName}/outbounds:
get:
parameters:
- in: path
name: mesh
example: default
schema:
type: string
required: true
description: The mesh the proxy is part of
- in: path
name: proxyName
example: TODO
schema:
type: string
required: true
description: TODO
responses:
'200':
$ref: '#/components/responses/ProxyOutboundsResponse'
'404':
$ref: "./common/error_schema.yaml#/components/responses/NotFound"
'500':
$ref: '#/components/responses/Internal'
/meshes/{mesh}/proxies/{proxyName}/outbounds/{kri}/rules:
get:
parameters:
- in: path
name: mesh
example: default
schema:
type: string
required: true
description: The mesh the proxy is part of
- in: path
name: proxyName
example: TODO
schema:
type: string
required: true
description: TODO
- in: path
name: kri
example: TODO
schema:
type: string
required: true
description: TODO
responses:
'200':
$ref: '#/components/responses/ProxyOutboundRulesResponse'
'404':
$ref: "./common/error_schema.yaml#/components/responses/NotFound"
'500':
$ref: '#/components/responses/Internal'
components:
schemas:
Index:
Expand Down Expand Up @@ -296,6 +469,13 @@ components:
type: array
items:
$ref: './common/resource.yaml#/components/schemas/HttpMatch'
ProxiesList:
type: object
properties:
proxies:
type: array
items:
$ref: './common/resource.yaml#/components/schemas/ProxyResource'
BaseStatus:
type: object
title: Status
Expand Down Expand Up @@ -576,6 +756,48 @@ components:
application/problem+json:
schema:
$ref: './common/error_schema.yaml#/components/schemas/Error'
ProxyListResponse:
description: TODO
content:
application/json:
schema:
$ref: '#/components/schemas/ProxiesList'
ProxyResponse:
description: TODO
content:
application/json:
schema:
$ref: './common/resource.yaml/#/components/schemas/ProxyResource'
ProxyRulesResponse:
description: TODO
content:
application/json:
schema:
$ref: './common/resource.yaml/#/components/schemas/ProxyRules'
ProxyInboundsResponse:
description: TODO
content:
application/json:
schema:
$ref: './common/resource.yaml/#/components/schemas/ProxyInboundsList'
ProxyInboundRulesResponse:
description: TODO
content:
application/json:
schema:
$ref: './common/resource.yaml/#/components/schemas/InboundRules'
ProxyOutboundsResponse:
description: TODO
content:
application/json:
schema:
$ref: './common/resource.yaml/#/components/schemas/ProxyOutboundsList'
ProxyOutboundRulesResponse:
description: TODO
content:
application/json:
schema:
$ref: './common/resource.yaml/#/components/schemas/OutboundRules'
examples:
GlobalInsightExample:
value:
Expand Down
93 changes: 93 additions & 0 deletions api/openapi/specs/common/resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,22 @@ components:
type: array
items:
$ref: '#/components/schemas/Meta'
InboundRule:
type: object
required: [ conf, origin ]
properties:
conf:
description: The actual conf generated
type: array
items:
type: object
additionalProperties: true
x-go-type: 'interface{}'
origin:
type: array
description: The list of policies that contributed to the 'conf'. The order is important as it reflects in what order confs were merged to get the resulting 'conf'.
items:
$ref: '#/components/schemas/ResourceRuleOrigin'
Rule:
type: object
required: [matchers, conf, origin]
Expand Down Expand Up @@ -201,3 +217,80 @@ components:
match:
type: object
x-go-type: interface{}
KumaResourceIdentifier:
type: string
ProxyResource:
type: object
required: [kri]
properties:
kri:
type: string
labels:
type: object
inbounds:
type: array
items:
$ref: '#/components/schemas/ProxyInbound'
outbounds:
type: array
items:
$ref: '#/components/schemas/ProxyOutbound'
ProxyInbound:
type: object
required: [name, port, kri, address]
properties:
kri:
$ref: '#/components/schemas/KumaResourceIdentifier'
port:
type: number
address:
type: string
protocol:
type: string
state:
type: string
ProxyInboundsList:
type: object
properties:
inbounds:
type: array
items:
$ref: '#/components/schemas/ProxyInbound'
ProxyOutbound:
type: object
required: [kri, port, address]
properties:
kri:
$ref: '#/components/schemas/KumaResourceIdentifier'
port:
type: number
address:
type: string
ProxyOutboundsList:
type: object
properties:
outbounds:
type: array
items:
$ref: '#/components/schemas/ProxyOutbound'
InboundRules:
type: object
properties:
rules:
type: array
items:
$ref: '#/components/schemas/InboundRule'
OutboundRules:
type: object
properties:
rules:
type: array
items:
$ref: '#/components/schemas/ResourceRule'
ProxyRules:
type: object
properties:
rules:
type: array
items:
$ref: '#/components/schemas/ProxyRule'
Loading
Loading