From 6bcd51e097a525a5ee8ff29f4994a075207b2218 Mon Sep 17 00:00:00 2001 From: lcawl Date: Fri, 29 Nov 2024 15:50:40 -0800 Subject: [PATCH 1/2] [OpenAPI] Update Serverless API URL --- oas_docs/output/kibana.serverless.yaml | 6 +---- .../overlays/kibana.overlays.serverless.yaml | 2 +- .../slo/docs/openapi/slo/bundled.json | 22 +++++++------------ .../slo/docs/openapi/slo/bundled.yaml | 10 ++++----- .../slo/docs/openapi/slo/entrypoint.yaml | 6 +++-- .../slo/paths/s@{spaceid}@api@slos.yaml | 3 --- ...@{spaceid}@api@slos@_delete_instances.yaml | 2 -- 7 files changed, 18 insertions(+), 33 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 959c4d886eee2..a43ebdd6068d8 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -40,7 +40,7 @@ servers: - url: https://{kibana_url} variables: kibana_url: - default: localhost:5601 + default: security: - apiKeyAuth: [] tags: @@ -34492,8 +34492,6 @@ paths: schema: $ref: '#/components/schemas/SLOs_409_response' description: Conflict - The SLO id already exists - servers: - - url: https://localhost:5601 summary: Create an SLO tags: - slo @@ -34533,8 +34531,6 @@ paths: schema: $ref: '#/components/schemas/SLOs_403_response' description: Unauthorized response - servers: - - url: https://localhost:5601 summary: Batch delete rollup and summary data tags: - slo diff --git a/oas_docs/overlays/kibana.overlays.serverless.yaml b/oas_docs/overlays/kibana.overlays.serverless.yaml index 1054f774fe11e..36efbe18e9403 100644 --- a/oas_docs/overlays/kibana.overlays.serverless.yaml +++ b/oas_docs/overlays/kibana.overlays.serverless.yaml @@ -14,7 +14,7 @@ actions: - url: https://{kibana_url} variables: kibana_url: - default: localhost:5601 + default: # Mark all operations as beta - target: "$.paths[*]['get','put','post','delete','options','head','patch','trace']" description: Add x-beta diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.json b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.json index b4d66229dc495..4018a4957b9ab 100644 --- a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.json +++ b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.json @@ -14,8 +14,12 @@ }, "servers": [ { - "url": "http://localhost:5601", - "description": "local" + "url": "https://{kibana_url}", + "variables": { + "kibana_url": { + "default": "localhost:5601" + } + } } ], "tags": [ @@ -102,12 +106,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "get": { "summary": "Get a paginated list of SLOs", @@ -738,12 +737,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } } } }, diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml index fde29b3602be0..a1780acc3e008 100644 --- a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml +++ b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml @@ -9,8 +9,10 @@ info: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license servers: - - url: http://localhost:5601 - description: local + - url: https://{kibana_url} + variables: + kibana_url: + default: localhost:5601 tags: - name: slo description: SLO APIs enable you to define, manage and track service-level objectives @@ -63,8 +65,6 @@ paths: application/json: schema: $ref: '#/components/schemas/409_response' - servers: - - url: https://localhost:5601 get: summary: Get a paginated list of SLOs operationId: findSlosOp @@ -448,8 +448,6 @@ paths: application/json: schema: $ref: '#/components/schemas/403_response' - servers: - - url: https://localhost:5601 components: parameters: kbn_xsrf: diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/entrypoint.yaml b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/entrypoint.yaml index a1f7a8739c07c..008d063919815 100644 --- a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/entrypoint.yaml +++ b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/entrypoint.yaml @@ -12,8 +12,10 @@ tags: - name: slo description: SLO APIs enable you to define, manage and track service-level objectives servers: - - url: "http://localhost:5601" - description: local + - url: https://{kibana_url} + variables: + kibana_url: + default: localhost:5601 paths: "/s/{spaceId}/api/observability/slos": $ref: "paths/s@{spaceid}@api@slos.yaml" diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml index ed489df00d800..68de4d633a820 100644 --- a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml +++ b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml @@ -46,9 +46,6 @@ post: application/json: schema: $ref: '../components/schemas/409_response.yaml' - servers: - - url: https://localhost:5601 - get: summary: Get a paginated list of SLOs operationId: findSlosOp diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml index 3ae6388f09d59..f7d0e3a3c884c 100644 --- a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml +++ b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml @@ -37,5 +37,3 @@ post: application/json: schema: $ref: '../components/schemas/403_response.yaml' - servers: - - url: https://localhost:5601 From 756fb8582251990fefdee6b038f383400355cb6c Mon Sep 17 00:00:00 2001 From: lcawl Date: Fri, 29 Nov 2024 16:05:55 -0800 Subject: [PATCH 2/2] [OpenAPI] Move server definition to overlay --- oas_docs/kibana.info.yaml | 5 ----- oas_docs/overlays/kibana.overlays.yaml | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/oas_docs/kibana.info.yaml b/oas_docs/kibana.info.yaml index cb478f300214e..693f4db5981e4 100644 --- a/oas_docs/kibana.info.yaml +++ b/oas_docs/kibana.info.yaml @@ -42,11 +42,6 @@ info: x-feedbackLink: label: Feedback url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+ -servers: - - url: https://{kibana_url} - variables: - kibana_url: - default: localhost:5601 security: - apiKeyAuth: [] - basicAuth: [] diff --git a/oas_docs/overlays/kibana.overlays.yaml b/oas_docs/overlays/kibana.overlays.yaml index ed41f56088bf8..666cba540a658 100644 --- a/oas_docs/overlays/kibana.overlays.yaml +++ b/oas_docs/overlays/kibana.overlays.yaml @@ -4,6 +4,17 @@ info: title: Overlays for the Kibana API document version: 0.0.1 actions: +# Clean up server definitions + - target: '$.servers.*' + description: Remove all servers so we can add our own. + remove: true + - target: '$.servers' + description: Add server into the now empty server array. + update: + - url: https://{kibana_url} + variables: + kibana_url: + default: localhost:5601 # Add an introduction to spaces - target: '$' description: Add an extra page about spaces