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

Add purge openapi #125

Merged
merged 2 commits into from
Oct 31, 2022
Merged
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
165 changes: 139 additions & 26 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ info:
title: Reverse Proxy as a Service
description: |-
The presented API definition (formally called as RPaaS v2 API) is a superset of [Tsuru Service API] and the [legacy RPaaS][RPaaS v1 API] (aka RPaaS v1).

Source code: [github.com/tsuru/rpaas-operator](https://github.com/tsuru/rpaas-operator.git)

[Tsuru Service API]: https://app.swaggerhub.com/apis/tsuru/tsuru-service_api/1.0.0
[RPaaS v1 API]: https://raw.githubusercontent.com/tsuru/rpaas/master/rpaas/api.py
contact:
Expand Down Expand Up @@ -234,27 +234,27 @@ paths:
schema:
type: string

post:
operationId: BindInstance
deprecated: true
summary: Bind Unit
description: Not used, just to follow Tsuru Service API spec
tags:
- rpaas
responses:
'200':
description: Nothing happens

delete:
operationId: UnbindInstance
deprecated: true
summary: Unbind Unit
description: Not used, just to follow Tsuru Service API spec
tags:
- rpaas
responses:
'200':
description: Nothing happens
post:
operationId: BindInstance
deprecated: true
summary: Bind Unit
description: Not used, just to follow Tsuru Service API spec
tags:
- rpaas
responses:
'200':
description: Nothing happens

delete:
operationId: UnbindInstance
deprecated: true
summary: Unbind Unit
description: Not used, just to follow Tsuru Service API spec
tags:
- rpaas
responses:
'200':
description: Nothing happens

/resources/{instance}/info:
get:
Expand Down Expand Up @@ -415,12 +415,99 @@ paths:
text/plain:
example: failed to get flavors from storage

/resources/{instance}/purge:
parameters:
- name: instance
in: path
description: Instance name
required: true
schema:
type: string
post:
summary: Purge cache key of rpaasv2.
description: |-
This endpoint is exclusive for RPaaS v2 API.
operationId: PurgeCache
tags:
- rpaas
parameters:
- in: path
name: instance
schema:
type: string
required: true
description: Instance name
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Purge'
responses:
'200':
description: OK
content:
application/json:
schema:
type: string
example: "Object purged on 2 servers"
'400':
description: Body or instance name empty.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/resources/{instance}/purge/bulk:
parameters:
- name: instance
in: path
description: Instance name
required: true
schema:
type: string
post:
summary: Purge objects from rpaasv2.
description: |-
This endpoint is exclusive for RPaaS v2 API.
operationId: PurgeBulkCache
tags:
- rpaas
parameters:
- in: path
name: instance
schema:
type: string
required: true
description: Instance name
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Purge'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PurgeBulkResponse'
'400':
description: Body or instance name empty.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

components:
securitySchemes:
basicAuth:
type: http
scheme: basic

schemas:
AdditionalInstanceInfo:
type: object
Expand Down Expand Up @@ -494,7 +581,7 @@ components:
# Some custom Nginx conf snippet which will be injected into root/main context.
# See more at https://nginx.org/en/docs/ngx_core_module.html
load_module /path/to/my/module.so;

CertificateInfo:
type: object
properties:
Expand Down Expand Up @@ -644,7 +731,7 @@ components:
type: array
items:
$ref: '#/components/schemas/Route'

Plan:
type: object
properties:
Expand Down Expand Up @@ -738,6 +825,32 @@ components:
type: string
example: 0.0.0.0

Purge:
type: object
properties:
path:
type: string
example: http/v1/product/catalog.json
preserve_path:
type: boolean
example: true
extra_headers:
type: string
example: '{"accept": "image/jpeg,image/webp"}'

PurgeBulkResponse:
type: object
properties:
path:
type: string
example: http/v1/product/catalog.json
instances_purged:
type: integer
example: 2
error:
type: string
example: "Error trying purge cache."

Route:
type: object
properties:
Expand Down