From eff3cd5ca041a5a4aec3204ec7ffbfcd33d4c9d7 Mon Sep 17 00:00:00 2001 From: kong-apiops <122612077+kong-apiops@users.noreply.github.com> Date: Fri, 12 Apr 2024 18:53:50 +0100 Subject: [PATCH] Automated OAS update: openapi.yaml --- openapi.yaml | 177 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 147 insertions(+), 30 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index dad6480..fa5b44c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -165,6 +165,8 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/PostCredentials403Response' '404': $ref: '#/components/responses/NotFound' tags: @@ -984,6 +986,20 @@ paths: - Application Analytics security: - portalAccessToken: [] + /api/v2/stats/config: + get: + summary: Application Analytics Config + operationId: get-application-analytics-config + description: Get config for application analytics + responses: + '200': + $ref: '#/components/responses/GetConfig' + '401': + $ref: '#/components/responses/Unauthorized' + tags: + - Application Analytics + security: + - portalAccessToken: [] components: securitySchemes: portalAccessToken: @@ -1360,6 +1376,24 @@ components: description: Query response data. items: $ref: '#/components/schemas/QueryResponseRecord' + GetConfigResponse: + additionalProperties: false + type: object + required: + - analytics + properties: + analytics: + type: object + nullable: true + additionalProperties: false + description: Null if analytics is not enabled. + properties: + percentiles: + type: boolean + description: True if analytics percentiles are enabled. + retention_ms: + type: integer + description: Analytics retention in milliseconds. BaseError: type: object title: Error @@ -1425,6 +1459,21 @@ components: example: Forbidden allOf: - $ref: '#/components/schemas/BaseError' + UnauthorizedError: + type: object + properties: + status: + example: 401 + title: + example: Unauthorized + type: + example: https://httpstatuses.com/401 + instance: + example: kong:trace:1234567890 + detail: + example: Invalid credentials + allOf: + - $ref: '#/components/schemas/BaseError' AuthStrategyId: description: >- ID of the auth strategy to use for the application. If null or not @@ -1481,6 +1530,8 @@ components: $ref: '#/components/schemas/UUID' name: type: string + labels: + $ref: '#/components/schemas/Labels' reference_id: $ref: '#/components/schemas/ApplicationReferenceId' description: @@ -1502,6 +1553,7 @@ components: - name - reference_id - description + - labels - updated_at - created_at ListCredentialsResponse: @@ -1575,6 +1627,8 @@ components: description: A brief description of the application type: string maxLength: 255 + labels: + $ref: '#/components/schemas/Labels' auth_strategy_id: $ref: '#/components/schemas/AuthStrategyId' scopes: @@ -1592,6 +1646,7 @@ components: - created_at - updated_at - auth_strategy + - labels properties: id: $ref: '#/components/schemas/UUID' @@ -1602,6 +1657,8 @@ components: description: type: string nullable: true + labels: + $ref: '#/components/schemas/Labels' redirect_uri: type: string nullable: true @@ -1629,8 +1686,6 @@ components: type: object title: UpdateApplicationPayload description: Payload required to update an application - required: - - name properties: name: description: The name of the application @@ -1646,6 +1701,8 @@ components: description: A brief description of the application type: string maxLength: 255 + labels: + $ref: '#/components/schemas/LabelsUpdate' scopes: $ref: '#/components/schemas/Scopes' ApplicationUpdateResponse: @@ -1660,6 +1717,7 @@ components: - description - updated_at - created_at + - labels properties: id: $ref: '#/components/schemas/UUID' @@ -1671,6 +1729,8 @@ components: type: string example: A brief description of the application nullable: true + labels: + $ref: '#/components/schemas/Labels' redirect_uri: type: string example: https://example.com/callback @@ -1738,6 +1798,24 @@ components: example: 5f9fd312-a987-4628-b4c5-bb4f4fddd5f7 description: Contains a unique identifier used by the API for this resource. readOnly: true + Labels: + title: Labels + type: object + example: + env: test + maxProperties: 50 + description: > + Labels store metadata of an entity that can be used for filtering an + entity list or for searching across entity types. + + + Keys must be of length 1-63 characters, and cannot start with "kong", + "konnect", "mesh", "kic", or "_". + additionalProperties: + type: string + pattern: ^[a-z0-9A-Z]{1}([a-z0-9A-Z-._]*[a-z0-9A-Z]+)?$ + minLength: 1 + maxLength: 63 ApplicationReferenceId: description: | An identifier to correlate the application with an external system. @@ -1945,21 +2023,6 @@ components: $ref: '#/components/schemas/InvalidParameters' allOf: - $ref: '#/components/schemas/BaseError' - UnauthorizedError: - type: object - properties: - status: - example: 401 - title: - example: Unauthorized - type: - example: https://httpstatuses.com/401 - instance: - example: kong:trace:1234567890 - detail: - example: Invalid credentials - allOf: - - $ref: '#/components/schemas/BaseError' NotFoundError: type: object properties: @@ -2005,6 +2068,26 @@ components: example: Too Many Requests allOf: - $ref: '#/components/schemas/BaseError' + LabelsUpdate: + type: object + nullable: true + description: > + Labels store metadata of an entity that can be used for filtering an + entity list or for searching across entity types. + + + Keys must be of length 1-63 characters, and cannot start with "kong", + "konnect", "mesh", "kic", or "_". + example: + env: test + maxProperties: 50 + additionalProperties: + type: string + pattern: ^[a-z0-9A-Z]{1}([a-z0-9A-Z-._]*[a-z0-9A-Z]+)?$ + minLength: 1 + maxLength: 63 + nullable: true + writeOnly: true RefreshedGrantedScopes: description: List of granted scopes, directly updated from the IDP type: array @@ -3347,6 +3430,17 @@ components: #/components/examples/ResponseExampleWithMetricAndMultipleDimensions Response with time dimension: $ref: '#/components/examples/ResponseExampleWithTimeDimension' + GetConfig: + description: Get config + content: + application/json: + schema: + $ref: '#/components/schemas/GetConfigResponse' + examples: + GetConfigNoAnalytics200response: + $ref: '#/components/examples/GetConfigNoAnalytics200response' + GetConfigAnalytics200response: + $ref: '#/components/examples/GetConfigAnalytics200response' Forbidden: description: Forbidden content: @@ -3356,6 +3450,19 @@ components: examples: UnauthorizedExample: $ref: '#/components/examples/ForbiddenExample' + Unauthorized: + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/UnauthorizedError' + examples: + UnauthorizedExample: + $ref: '#/components/examples/UnauthorizedExample' + 401-Unauthorized: + $ref: '#/components/examples/401-Unauthorized' + 401-Account-Not-Approved: + $ref: '#/components/examples/401-Account-Not-Approved' ListApplications: description: Get applications response content: @@ -3416,6 +3523,15 @@ components: examples: GetGrantedScopesProductVersion422Example: $ref: '#/components/examples/GetGrantedScopesProductVersion422Example' + PostCredentials403Response: + description: Error returned when the number of credentials exceed the quota. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ForbiddenError' + examples: + PostCredentials403Example: + $ref: '#/components/examples/PostCredentials403Example' ListAuthStrategies: description: List auth strategies response content: @@ -3433,19 +3549,6 @@ components: $ref: '#/components/examples/400-Invalid-Token' 400-Login-Failed: $ref: '#/components/examples/400-Login-Failed' - Unauthorized: - description: Unauthorized - content: - application/problem+json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - examples: - UnauthorizedExample: - $ref: '#/components/examples/UnauthorizedExample' - 401-Unauthorized: - $ref: '#/components/examples/401-Unauthorized' - 401-Account-Not-Approved: - $ref: '#/components/examples/401-Account-Not-Approved' NotFound: description: Not Found content: @@ -3837,6 +3940,14 @@ components: instance: kong:trace:8347343766220159418 detail: Unauthorized invalid_parameters: [] + GetConfigNoAnalytics200response: + value: + analytics: null + GetConfigAnalytics200response: + value: + analytics: + percentiles: true + retention_ms: 31536000000 ForbiddenExample: value: status: 403 @@ -3854,6 +3965,12 @@ components: type: https://kongapi.info/konnect/portal/granted-scopes-unavailable detail: This feature is not supported by the application. instance: kong:trace:2724154947768991354 + PostCredentials403Example: + value: + status: 403 + title: Forbidden + detail: 'Maximum number of Credentials exceeded. Max Allowed: 20' + instance: kong:trace:2724154947768991355 NotFoundExample: value: status: 404