Skip to content

Commit

Permalink
feat(oapi): add mesh and meshgateway to oapi spec (#12272)
Browse files Browse the repository at this point in the history
## Motivation

We want to be able to mange these resources using Terraform and need
OpenAPI spec to be able to generate that. Read the MADR if you're
interested in more details:
https://docs.google.com/document/d/1Ewe0yRx-vvAuQn5CWRFhJbBPLzdbBQ2wsQosZXk4Go8/
.

<!-- Why are we doing this change -->

## Implementation information

All described in the madr -
https://docs.google.com/document/d/1Ewe0yRx-vvAuQn5CWRFhJbBPLzdbBQ2wsQosZXk4Go8/edit?tab=t.0#heading=h.9m1k72xxi21x
.

<!-- Explain how this was done and potentially alternatives considered
and discarded -->

## Supporting documentation

<!-- Is there a MADR? An Issue? A related PR? -->

Closes #11507

<!--
> Changelog: skip
-->
<!--
Uncomment the above section to explicitly set a [`> Changelog:` entry
here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)?
-->

---------

Signed-off-by: Charly Molter <[email protected]>
Signed-off-by: slonka <[email protected]>
Co-authored-by: Charly Molter <[email protected]>
  • Loading branch information
slonka and lahabana authored Dec 18, 2024
1 parent 227f724 commit 39a5f17
Show file tree
Hide file tree
Showing 14 changed files with 1,641 additions and 39 deletions.
115 changes: 115 additions & 0 deletions api/mesh/v1alpha1/mesh/rest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
openapi: 3.0.3
info:
version: v1alpha1
title: Kuma API
description: Kuma API
x-ref-schema-name: "Mesh"

paths:
/meshes/{name}:
get:
summary: Returns Mesh entity
tags: [ "Mesh" ]
parameters:
- in: path
name: name
schema:
type: string
required: true
description: name of the Mesh
responses:
'200':
$ref: "#/components/responses/MeshItem"

put:
summary: Creates or Updates Mesh entity
tags: [ "Mesh" ]
parameters:
- in: path
name: name
schema:
type: string
required: true
description: name of the Mesh
requestBody:
description: Put request
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MeshItem'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/MeshCreateOrUpdateSuccessResponse'
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/MeshCreateOrUpdateSuccessResponse'

delete:
summary: Deletes Mesh entity
tags: [ "Mesh" ]
parameters:
- in: path
name: name
schema:
type: string
required: true
description: name of the Mesh
responses:
'200':
description: Successful response

/meshes:
get:
summary: Returns a list of Mesh in the mesh.
tags: [ "Mesh" ]
responses:
'200':
$ref: "#/components/responses/MeshList"

components:
schemas:
MeshItem:
$ref: 'schema.yaml'
MeshCreateOrUpdateSuccessResponse:
type: object
properties:
warnings:
type: array
description: |
warnings is a list of warning messages to return to the requesting Kuma API clients.
Warning messages describe a problem the client making the API request should correct or be aware of.
items:
type: string

responses:
MeshItem:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/MeshItem'
MeshList:
description: List
content:
application/json:
schema:
type: object
properties:
items:
type: array
items:
$ref: "#/components/schemas/MeshItem"
total:
type: number
description: The total number of entities
next:
type: string
description: URL to the next page
Loading

0 comments on commit 39a5f17

Please sign in to comment.