Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 1 | openapi: 3.0.1 |
| 2 | info: |
| 3 | title: OpenAPI definition for SDC Helm validator |
| 4 | description: Application for validating Helm charts. |
| 5 | version: v0 |
| 6 | servers: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 7 | - url: http://localhost:8080 |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 8 | description: Generated server url |
| 9 | tags: |
| 10 | - name: Actuator |
| 11 | description: Monitor and interact |
| 12 | externalDocs: |
| 13 | description: Spring Boot Actuator Web API Documentation |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 14 | url: https://docs.spring.io/spring-boot/docs/current/actuator-api/html/ |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 15 | paths: |
| 16 | /validate: |
| 17 | post: |
| 18 | tags: |
| 19 | - ValidationService |
| 20 | summary: Validate chart |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 21 | description: Web endpoint for Helm charts validation. Helm chart in .tgz format |
| 22 | is required. |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 23 | operationId: validate |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 24 | requestBody: |
| 25 | content: |
| 26 | multipart/form-data: |
| 27 | schema: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 28 | $ref: '#/components/schemas/ValidationRequestParameters' |
| 29 | required: true |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 30 | responses: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 31 | "500": |
| 32 | description: Something went wrong during validation execution |
| 33 | content: |
| 34 | application/json: |
| 35 | schema: |
| 36 | $ref: '#/components/schemas/ValidationErrorResponse' |
| 37 | "200": |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 38 | description: Helm chart successfully validated |
| 39 | content: |
| 40 | application/json: |
| 41 | schema: |
| 42 | $ref: '#/components/schemas/ValidationResult' |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 43 | examples: |
| 44 | Simple Validation: |
| 45 | $ref: '#/components/examples/simpleValidation' |
| 46 | Lint Validation: |
| 47 | $ref: '#/components/examples/validationWithLint' |
| 48 | "400": |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 49 | description: Chart cannot be validated using selected version |
| 50 | content: |
| 51 | application/json: |
| 52 | schema: |
| 53 | $ref: '#/components/schemas/ValidationErrorResponse' |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 54 | /versions: |
| 55 | get: |
| 56 | tags: |
| 57 | - VersionsService |
| 58 | summary: Show Helm versions |
| 59 | description: Web endpoint for showing supported Helm versions. |
| 60 | operationId: supportedVersions |
| 61 | responses: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 62 | "500": |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 63 | description: Something went wrong during getting Helm versions |
| 64 | content: |
| 65 | '*/*': |
| 66 | schema: |
| 67 | $ref: '#/components/schemas/ValidationErrorResponse' |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 68 | "200": |
| 69 | description: Supported Helm versions successfully returned |
| 70 | content: |
| 71 | '*/*': |
| 72 | schema: |
| 73 | $ref: '#/components/schemas/VersionsResponse' |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 74 | /actuator: |
| 75 | get: |
| 76 | tags: |
| 77 | - Actuator |
| 78 | summary: Actuator root web endpoint |
| 79 | operationId: links_0 |
| 80 | responses: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 81 | "200": |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 82 | description: OK |
| 83 | content: |
| 84 | '*/*': |
| 85 | schema: |
| 86 | type: object |
| 87 | additionalProperties: |
| 88 | type: object |
| 89 | additionalProperties: |
| 90 | $ref: '#/components/schemas/Link' |
| 91 | /actuator/info: |
| 92 | get: |
| 93 | tags: |
| 94 | - Actuator |
| 95 | summary: Actuator web endpoint 'info' |
| 96 | operationId: handle_1 |
| 97 | responses: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 98 | "200": |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 99 | description: OK |
| 100 | content: |
| 101 | '*/*': |
| 102 | schema: |
| 103 | type: object |
| 104 | /actuator/health: |
| 105 | get: |
| 106 | tags: |
| 107 | - Actuator |
| 108 | summary: Actuator web endpoint 'health' |
| 109 | operationId: handle_2 |
| 110 | responses: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 111 | "200": |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 112 | description: OK |
| 113 | content: |
| 114 | '*/*': |
| 115 | schema: |
| 116 | type: object |
| 117 | /actuator/health/**: |
| 118 | get: |
| 119 | tags: |
| 120 | - Actuator |
| 121 | summary: Actuator web endpoint 'health-path' |
| 122 | operationId: handle_3 |
| 123 | responses: |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 124 | "200": |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 125 | description: OK |
| 126 | content: |
| 127 | '*/*': |
| 128 | schema: |
| 129 | type: object |
| 130 | components: |
| 131 | schemas: |
| 132 | VersionsResponse: |
| 133 | properties: |
| 134 | versions: |
| 135 | type: array |
| 136 | items: |
| 137 | type: string |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 138 | ValidationRequestParameters: |
| 139 | required: |
| 140 | - file |
| 141 | type: object |
| 142 | properties: |
| 143 | versionDesired: |
| 144 | type: string |
| 145 | description: "Desired Helm version which should be used to validate the\ |
| 146 | \ chart. If parameter is not provided validation is processing with version\ |
| 147 | \ based on chart's apiVersion. Version could be provided in 'semantic\ |
| 148 | \ version' or 'major version'.<br> Allowed formats: <br>- Semantic version\ |
| 149 | \ [X.Y.Z] e.g. 3.5.2 <br>- Major version [vX] e.g. v3" |
| 150 | file: |
| 151 | type: string |
| 152 | format: binary |
| 153 | isLinted: |
| 154 | type: boolean |
| 155 | description: "If true, there will be an attempt to lint chart" |
| 156 | isStrictLinted: |
| 157 | type: boolean |
| 158 | description: Strict linting marks the chart as invalid if detect any warning |
Piotr Marcinkiewicz | 85da74a | 2021-04-21 15:30:05 +0200 | [diff] [blame] | 159 | ValidationErrorResponse: |
| 160 | type: object |
| 161 | properties: |
| 162 | message: |
| 163 | type: string |
| 164 | ValidationResult: |
| 165 | type: object |
| 166 | properties: |
| 167 | renderErrors: |
| 168 | type: array |
| 169 | items: |
| 170 | type: string |
| 171 | lintWarning: |
| 172 | type: array |
| 173 | items: |
| 174 | type: string |
| 175 | lintError: |
| 176 | type: array |
| 177 | items: |
| 178 | type: string |
| 179 | versionUsed: |
| 180 | type: string |
| 181 | valid: |
| 182 | type: boolean |
| 183 | deployable: |
| 184 | type: boolean |
| 185 | Link: |
| 186 | type: object |
| 187 | properties: |
| 188 | href: |
| 189 | type: string |
| 190 | templated: |
| 191 | type: boolean |
Tomasz Wrobel | 5bda347 | 2021-04-26 11:28:57 +0200 | [diff] [blame] | 192 | examples: |
| 193 | simpleValidation: |
| 194 | description: Example response when parameter isLinted is set to false |
| 195 | value: "{\"renderErrors\":[],\"versionUsed\":\"3.5.2\",\"deployable\":true}" |
| 196 | validationWithLint: |
| 197 | description: Example response when parameter isLinted is set to true |
| 198 | value: "{\"renderErrors\":[],\"lintWarning\":[],\"lintError\":[],\"versionUsed\"\ |
| 199 | :\"3.5.2\",\"valid\":true,\"deployable\":true}" |