From f1753c91bb2d98fea2a06f7068bc9b02ff3ea2a7 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 7 Oct 2024 15:56:02 -0700 Subject: [PATCH 01/28] [DOCS][OpenAPI] Add descriptions for create space API --- .../plugins/spaces/server/lib/space_schema.ts | 42 +++++++++++++++++-- .../spaces/server/routes/api/external/post.ts | 5 +++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/spaces/server/lib/space_schema.ts b/x-pack/plugins/spaces/server/lib/space_schema.ts index 852e1a98096c4..b5206e534129e 100644 --- a/x-pack/plugins/spaces/server/lib/space_schema.ts +++ b/x-pack/plugins/spaces/server/lib/space_schema.ts @@ -18,10 +18,29 @@ const spaceSchema = schema.object({ return `must be lower case, a-z, 0-9, '_', and '-' are allowed`; } }, + meta: { + description: + 'The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.', + }, + }), + name: schema.string({ + minLength: 1, + meta: { description: 'The display name for the space. ' }, }), - name: schema.string({ minLength: 1 }), - description: schema.maybe(schema.string()), - initials: schema.maybe(schema.string({ maxLength: MAX_SPACE_INITIALS })), + description: schema.maybe( + schema.string({ + meta: { description: 'A description for the space.' }, + }) + ), + initials: schema.maybe( + schema.string({ + maxLength: MAX_SPACE_INITIALS, + meta: { + description: + 'One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.', + }, + }) + ), color: schema.maybe( schema.string({ validate: (value) => { @@ -29,9 +48,20 @@ const spaceSchema = schema.object({ return `must be a 6 digit hex color, starting with a #`; } }, + meta: { + description: + 'The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.', + }, }) ), - disabledFeatures: schema.arrayOf(schema.string(), { defaultValue: [] }), + disabledFeatures: schema.arrayOf( + schema.string({ + meta: { + description: 'The list of features that are turned off in the space.', + }, + }), + { defaultValue: [] } + ), _reserved: schema.maybe(schema.boolean()), imageUrl: schema.maybe( schema.string({ @@ -40,6 +70,10 @@ const spaceSchema = schema.object({ return `must start with 'data:image'`; } }, + meta: { + description: + 'The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.', + }, }) ), }); diff --git a/x-pack/plugins/spaces/server/routes/api/external/post.ts b/x-pack/plugins/spaces/server/routes/api/external/post.ts index c47ea4ad5f9bf..42d7c3da74714 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/post.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/post.ts @@ -34,6 +34,11 @@ export function initPostSpacesApi(deps: ExternalRouteDeps) { request: { body: getSpaceSchema(isServerless), }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { From 6266d1f0b8649dc661d586d97633298a59f82408 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 7 Oct 2024 16:18:16 -0700 Subject: [PATCH 02/28] Put examples in single shared overlay file --- oas_docs/examples/create_space_request.yaml | 9 + oas_docs/makefile | 10 +- oas_docs/overlays/alerting.overlays.yaml | 150 ----------------- ...rlays.yaml => kibana.overlays.shared.yaml} | 159 +++++++++++++++++- 4 files changed, 169 insertions(+), 159 deletions(-) create mode 100644 oas_docs/examples/create_space_request.yaml delete mode 100644 oas_docs/overlays/alerting.overlays.yaml rename oas_docs/overlays/{connectors.overlays.yaml => kibana.overlays.shared.yaml} (72%) diff --git a/oas_docs/examples/create_space_request.yaml b/oas_docs/examples/create_space_request.yaml new file mode 100644 index 0000000000000..0e037504f7e7c --- /dev/null +++ b/oas_docs/examples/create_space_request.yaml @@ -0,0 +1,9 @@ +summary: Create a marketing space +value: + id: marketing + name: Marketing + description : This is the Marketing Space + color: #aabbcc + initials: MK + disabledFeatures: [] + imageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAABACAYAAABC6cT1AAAGf0lEQVRoQ+3abYydRRUH8N882xYo0IqagEVjokQJKAiKBjXExC9G/aCkGowCIghCkRcrVSSKIu/FEiqgGL6gBIlAYrAqUTH6hZgQFVEMKlQFfItWoQWhZe8z5uzMLdvbfbkLxb13d+fbvfe588x/zpn/+Z9zJpmnI81T3BaAzzfLL1h8weLzZAcWXH2eGHo7zAWLL1h8nuzAjFw9G1N6Kzq8HnuM36MR8iibF3Fv4q+7cv8yDV6K13bYq2furSP8Ag8ncr/vnSnwRViJT2GfCV7yL1yHGxLb+l3EdM9lluNEnIC9xz+f2ZL4Er6Z2DrdXN3fZwp8CU7OfDHxggle8lTLbQ1nJ/7Z7yKmey5zYGZt4h2IzR8/trRc2PDlxJPTzfVcgJ+CC0wMPOa9F6cm7up3EVM9V9386MxliVdM8GwAv6hh/awCz/w7lY25OtF5ruBz4ZLP42NYNrDAFbC3YPWuILnMAfgq3oaRQQYea/stViV+sgssvjKzLvGySeaaNVfP4d7Btokgvxj/bblgpueuF1hmWcyTCmfE3J3M1lTcv0vMswM88zR+jpw4osu6me8kzkpsfLZWzxyRuabO22buxxOJ12FxnXfWgEe83pB5sOE47BsLymzscOoi7nw2JJfZreUjiUsTyzKPZm5NvBDvSuw268AzNzV8H5/Am+qCnsAXgpgSW2Zq9cyKlksbPlTd+te4quWNieMHBfiNDdciYnwsdI/MaOaWhnMTf54J8CqNj8x8JXFIZltYu+HqlmNT8YSBsHgAPw/vxvlVV4du/s0oaxbxg0TbL/jMni0nNcVjQq7+HZfgtpbzBg342TgQ63AkmsymxBW4IjE6A+D7Vzd/fyWxIM/VuCe+HzTgZ2Jpy/kNJ2FJLmLm24mPJ/42A+Bvrxt4SISwlhsaPodH26LZB8rVA3inwwebsrixJCZzX+KMxI/7AV61eVh3DV6Mx3EOvh4kN6jAg8nfUCXm4d1wE66OyxNPTQc+s3/o/MoXizL3JE5O3F3P/uBZPPF4Zr+Wi5uSO48ZPRdyCwn7YB/A35m5KhWNHox4fcNnIs0ddOCRSBxf8+cQG+Huf0l8NJVYP+nI7NXy2ar4QqIGm69JfKPOE2w/mBavCzwM11R2D+ChsUO7hyUfmwx55qDM1xJvqZ7y08TpifuGBfjeURVJnNIVGpkNiXNS0ds7jcySDitDCCWW56LJ10fRo8sNA+3qXUSZD2CtQlZh9T+1rB7h9oliembflnMbzqgSNZKbKGHdPm7OwXb1CvQ1metSETMpszmzvikCJNh/h5E5PHNl4qga/+/cxqrdeWDYgIe7X5L4cGJPJX2940lOX8pD41FnFnc4riluvQKbK0dcHJFi2IBHNTQSlguru4d2/wPOTNzRA3x5y+U1E1uqWDkETOT026XuUJzx6u7ReLhSYenQ7uHua0fKZmwfmcPqsQjxE5WVONcRxn7X89zgn/EKPMRMxOVQXmP18Mx3q3b/Y/0cQE/IhFtHESMsHFlZ1Ml3CH3DZPHImY+pxcKumNmYirtvqMBfhMuU6s3iqOQkTsMPe1tCQwO8Ajs0lxr7W+vnp1MJc9EgCNd/cy6x+9D4veXmprj5wxMw/3C4egW6zzgZOlYZzfwo3F2J7ael0pJamvlPKgWNKFft1AAcKotXoFEbD7kaoSoQPVKB35+5KHF0lai/rJo+up87jWEE/qqqwY+qrL21LWLm95lPJ16ppKw31XC3PXYPJauPEx7B6BHCgrSizRs18qiaRp8tlN3ueCTYPHH9RNaunjI8Z7wLYpT3jZSCYXQ8e9vTsRE/q+no3XMKeObgGtaintbb/AvXj4JDkNw/5hrwYPfIvlZFUbLn7G5q+eQIN09Vnho6cqvnM/Lt99RixH49wO8K0ZL41WTWHoQzvsNVkOheZqKhEGpsp3SzB+BBtZAYve7uOR9tuTaaB6l0XScdYfEQPpkTUyHEGP+XqyDBzu+NBCITUjNWHynkrbWKOuWFn1xKzqsyx0bdvS78odp0+N503Zao0uCsWuSIDku8/7EO60b41vN5+Ses9BKlTdvd8bhp9EBvJjWJAIn/vxwHe6b3tSk6JFPV4nq85oAOrx555v/x/rh3E6Lo+bnuNS4uB4Cuq0ZfvO8X1rM6q/+vnjLVqZq7v83onttc2oYF4HPJmv1gWbB4P7s0l55ZsPhcsmY/WBYs3s8uzaVn5q3F/wf70mRuBCtbjQAAAABJRU5ErkJggg==" \ No newline at end of file diff --git a/oas_docs/makefile b/oas_docs/makefile index 717895f9b6c1c..e3930674e8824 100644 --- a/oas_docs/makefile +++ b/oas_docs/makefile @@ -50,13 +50,11 @@ api-docs-lint-serverless: ## Run spectral API docs linter on kibana.serverless.y .PHONY: api-docs-overlay api-docs-overlay: ## Run spectral API docs linter on kibana.serverless.yaml @npx bump overlay "output/kibana.serverless.yaml" "overlays/kibana.overlays.serverless.yaml" > "output/kibana.serverless.tmp1.yaml" - @npx bump overlay "output/kibana.serverless.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.serverless.tmp2.yaml" - @npx bump overlay "output/kibana.serverless.tmp2.yaml" "overlays/connectors.overlays.yaml" > "output/kibana.serverless.tmp3.yaml" + @npx bump overlay "output/kibana.serverless.tmp1.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.serverless.tmp2.yaml" @npx bump overlay "output/kibana.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.tmp1.yaml" - @npx bump overlay "output/kibana.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.tmp2.yaml" - @npx bump overlay "output/kibana.tmp2.yaml" "overlays/connectors.overlays.yaml" > "output/kibana.tmp3.yaml" - @npx @redocly/cli bundle output/kibana.serverless.tmp3.yaml --ext yaml -o output/kibana.serverless.new.yaml - @npx @redocly/cli bundle output/kibana.tmp3.yaml --ext yaml -o output/kibana.new.yaml + @npx bump overlay "output/kibana.tmp1.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.tmp2.yaml" + @npx @redocly/cli bundle output/kibana.serverless.tmp2.yaml --ext yaml -o output/kibana.serverless.new.yaml + @npx @redocly/cli bundle output/kibana.tmp2.yaml --ext yaml -o output/kibana.new.yaml rm output/kibana.tmp*.yaml rm output/kibana.serverless.tmp*.yaml diff --git a/oas_docs/overlays/alerting.overlays.yaml b/oas_docs/overlays/alerting.overlays.yaml deleted file mode 100644 index c4cc25b685783..0000000000000 --- a/oas_docs/overlays/alerting.overlays.yaml +++ /dev/null @@ -1,150 +0,0 @@ -# overlays.yaml -overlay: 1.0.0 -info: - title: Overlays for the alerting rule examples and parameters - version: 0.0.1 -actions: - # Add some alerting API examples - - target: "$.paths['/api/alerting/rule/{id}']['post']" - description: "Add examples to create rule API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createEsQueryEsqlRuleRequest: - $ref: "../examples/create_es_query_esql_rule_request.yaml" - createEsQueryRuleRequest: - $ref: "../examples/create_es_query_rule_request.yaml" - createEsQueryKqlRuleRequest: - $ref: "../examples/create_es_query_kql_rule_request.yaml" - createIndexThresholdRuleRequest: - $ref: "../examples/create_index_threshold_rule_request.yaml" - createTrackingContainmentRuleRequest: - $ref: "../examples/create_tracking_containment_rule_request.yaml" - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createEsQueryEsqlRuleResponse: - $ref: "../examples/create_es_query_esql_rule_response.yaml" - createEsQueryRuleResponse: - $ref: "../examples/create_es_query_rule_response.yaml" - createEsQueryKqlRuleResponse: - $ref: "../examples/create_es_query_kql_rule_response.yaml" - createIndexThresholdRuleResponse: - $ref: "../examples/create_index_threshold_rule_response.yaml" - createTrackingContainmentRuleResponse: - $ref: "../examples/create_tracking_containment_rule_response.yaml" - - target: "$.paths['/api/alerting/rule/{id}']['put']" - description: "Add examples to update rule API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuleRequest: - $ref: '../examples/update_rule_request.yaml' - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuleResponse: - $ref: '../examples/update_rule_response.yaml' - - target: "$.paths['/api/alerting/rules/_find']['get']" - description: "Add examples to find rules API" - update: - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - findRulesResponse: - $ref: '../examples/find_rules_response.yaml' - findConditionalActionRulesResponse: - $ref: '../examples/find_rules_response_conditional_action.yaml' - # Fix some optional path parameters - - target: "$.paths['/api/alerting/rule/{id}']['post'].parameters[?(@.name=='id')]" - description: Remove optional indicator from path parameter - update: - required: true - # Remove the alerting rule parameters - - target: "$.paths['/api/alerting/rule/{id}']['post'].requestBody.content.*.schema.properties.params" - description: "Remove params type in create rule API" - remove: true - # Add some alerting rule parameters - - target: "$.paths['/api/alerting/rule/{id}']['post']" - description: "Add params to create rule API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - params: - additionalProperties: {} - default: {} - description: The parameters for the rule. - anyOf: - # APM anomaly rule (apm.anomaly) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_anomaly.yaml' - # APM error count rule (apm.error_rate) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_error_count.yaml' - # APM transaction duration rule (apm.transaction_duration) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_duration.yaml' - # APM transaction error rate rule (apm.transaction_error_rate) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_error_rate.yaml' - # Elasticsearch DSL query rule (.es-query) - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml' - # Elasticsearch ES|QL query rule (.es-query) - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml' - # Elasticsearch KQL query rule (.es-query) - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml' - # Index threshold rule () - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml' - # Infra inventory rule (metrics.alert.inventory.threshold) - - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_inventory.yaml' - # Log threshold rule (logs.alert.document.count) - - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_log_threshold.yaml' - # Infra metric threshold rule (metrics.alert.threshold) - - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_metric_threshold.yaml' - # SLO burn rate (slo.rules.burnRate) - - $ref: '../../x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' - # Synthetics uptime TLS rule (xpack.uptime.alerts.tls) - - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml' - # Uptime monitor status rule (xpack.uptime.alerts.monitorStatus) - - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml' - # TBD - # Anomaly detection alert rule (xpack.ml.anomaly_detection_alert) - # Anomaly detection jobs health rule (xpack.ml.anomaly_detection_jobs_health) - # Tracking containment rule (.geo-containment) - # Infrastructure anomaly rule (metrics.alert.anomaly) - # CCR read exceptions rule (monitoring_ccr_read_exceptions) - # Cluster health rule (monitoring_alert_cluster_health) - # CPU usage rule (monitoring_alert_cpu_usage) - # Custom query rule (siem.queryRule) - # Disk usage rule (monitoring_alert_disk_usage) - # Elasticsearch version mismatch rule (monitoring_alert_elasticsearch_version_mismatch) - # Event correlation rule (siem.eqlRule) - # Indicator match rule (siem.indicatorRule) - # JVM memory usage rule (monitoring_alert_jvm_memory_usage) - # Kibana version mismatch rule ( monitoring_alert_kibana_version_mismatch) - # License expiration rule (monitoring_alert_license_expiration) - # Logstash version mismatch rule (monitoring_alert_logstash_version_mismatch) - # Machine learning rule (siem.mlRule) - # Missing monitoring data rule (monitoring_alert_missing_monitoring_data) - # New terms rule (siem.newTermsRule) - # Nodes changed rule (monitoring_alert_nodes_changed) - # Saved query rule (siem.savedQueryRule) - # Security solution notification (legacy) rule (siem.notifications) - # Shard size rule (monitoring_shard_size) - # Synthetics monitor status rule (xpack.synthetics.alerts.monitorStatus) - # Synthetics uptime duration anomaly rule (xpack.uptime.alerts.durationAnomaly) - # Thread pool search rejections rule (monitoring_alert_thread_pool_search_rejections) - # Thread pool write rejections rule (monitoring_alert_thread_pool_write_rejections) - # Threshold rule (siem.thresholdRule) - # TLS certificate rule (xpack.uptime.alerts.tlsCertificate) - # Transform health (transform_health) - \ No newline at end of file diff --git a/oas_docs/overlays/connectors.overlays.yaml b/oas_docs/overlays/kibana.overlays.shared.yaml similarity index 72% rename from oas_docs/overlays/connectors.overlays.yaml rename to oas_docs/overlays/kibana.overlays.shared.yaml index 022946e893be2..a1648fdcab1b8 100644 --- a/oas_docs/overlays/connectors.overlays.yaml +++ b/oas_docs/overlays/kibana.overlays.shared.yaml @@ -1,15 +1,158 @@ # overlays.yaml overlay: 1.0.0 info: - title: Overlays for the connector objects and examples + title: Overlays that are applicable to both serverless and non-serverless documentas version: 0.0.1 actions: +# Add some alerting API examples + - target: "$.paths['/api/alerting/rule/{id}']['post']" + description: "Add examples to create rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEsQueryEsqlRuleRequest: + $ref: "../examples/create_es_query_esql_rule_request.yaml" + createEsQueryRuleRequest: + $ref: "../examples/create_es_query_rule_request.yaml" + createEsQueryKqlRuleRequest: + $ref: "../examples/create_es_query_kql_rule_request.yaml" + createIndexThresholdRuleRequest: + $ref: "../examples/create_index_threshold_rule_request.yaml" + createTrackingContainmentRuleRequest: + $ref: "../examples/create_tracking_containment_rule_request.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEsQueryEsqlRuleResponse: + $ref: "../examples/create_es_query_esql_rule_response.yaml" + createEsQueryRuleResponse: + $ref: "../examples/create_es_query_rule_response.yaml" + createEsQueryKqlRuleResponse: + $ref: "../examples/create_es_query_kql_rule_response.yaml" + createIndexThresholdRuleResponse: + $ref: "../examples/create_index_threshold_rule_response.yaml" + createTrackingContainmentRuleResponse: + $ref: "../examples/create_tracking_containment_rule_response.yaml" + - target: "$.paths['/api/alerting/rule/{id}']['put']" + description: "Add examples to update rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuleRequest: + $ref: '../examples/update_rule_request.yaml' + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuleResponse: + $ref: '../examples/update_rule_response.yaml' + - target: "$.paths['/api/alerting/rules/_find']['get']" + description: "Add examples to find rules API" + update: + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + findRulesResponse: + $ref: '../examples/find_rules_response.yaml' + findConditionalActionRulesResponse: + $ref: '../examples/find_rules_response_conditional_action.yaml' # Fix some optional path parameters + - target: "$.paths['/api/alerting/rule/{id}']['post'].parameters[?(@.name=='id')]" + description: Remove optional indicator from path parameter + update: + required: true + # Remove the alerting rule parameters + - target: "$.paths['/api/alerting/rule/{id}']['post'].requestBody.content.*.schema.properties.params" + description: "Remove params type in create rule API" + remove: true + # Add some alerting rule parameters + - target: "$.paths['/api/alerting/rule/{id}']['post']" + description: "Add params to create rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + params: + additionalProperties: {} + default: {} + description: The parameters for the rule. + anyOf: + # APM anomaly rule (apm.anomaly) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_anomaly.yaml' + # APM error count rule (apm.error_rate) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_error_count.yaml' + # APM transaction duration rule (apm.transaction_duration) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_duration.yaml' + # APM transaction error rate rule (apm.transaction_error_rate) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_error_rate.yaml' + # Elasticsearch DSL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml' + # Elasticsearch ES|QL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml' + # Elasticsearch KQL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml' + # Index threshold rule () + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml' + # Infra inventory rule (metrics.alert.inventory.threshold) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_inventory.yaml' + # Log threshold rule (logs.alert.document.count) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_log_threshold.yaml' + # Infra metric threshold rule (metrics.alert.threshold) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_metric_threshold.yaml' + # SLO burn rate (slo.rules.burnRate) + - $ref: '../../x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' + # Synthetics uptime TLS rule (xpack.uptime.alerts.tls) + - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml' + # Uptime monitor status rule (xpack.uptime.alerts.monitorStatus) + - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml' + # TBD + # Anomaly detection alert rule (xpack.ml.anomaly_detection_alert) + # Anomaly detection jobs health rule (xpack.ml.anomaly_detection_jobs_health) + # Tracking containment rule (.geo-containment) + # Infrastructure anomaly rule (metrics.alert.anomaly) + # CCR read exceptions rule (monitoring_ccr_read_exceptions) + # Cluster health rule (monitoring_alert_cluster_health) + # CPU usage rule (monitoring_alert_cpu_usage) + # Custom query rule (siem.queryRule) + # Disk usage rule (monitoring_alert_disk_usage) + # Elasticsearch version mismatch rule (monitoring_alert_elasticsearch_version_mismatch) + # Event correlation rule (siem.eqlRule) + # Indicator match rule (siem.indicatorRule) + # JVM memory usage rule (monitoring_alert_jvm_memory_usage) + # Kibana version mismatch rule ( monitoring_alert_kibana_version_mismatch) + # License expiration rule (monitoring_alert_license_expiration) + # Logstash version mismatch rule (monitoring_alert_logstash_version_mismatch) + # Machine learning rule (siem.mlRule) + # Missing monitoring data rule (monitoring_alert_missing_monitoring_data) + # New terms rule (siem.newTermsRule) + # Nodes changed rule (monitoring_alert_nodes_changed) + # Saved query rule (siem.savedQueryRule) + # Security solution notification (legacy) rule (siem.notifications) + # Shard size rule (monitoring_shard_size) + # Synthetics monitor status rule (xpack.synthetics.alerts.monitorStatus) + # Synthetics uptime duration anomaly rule (xpack.uptime.alerts.durationAnomaly) + # Thread pool search rejections rule (monitoring_alert_thread_pool_search_rejections) + # Thread pool write rejections rule (monitoring_alert_thread_pool_write_rejections) + # Threshold rule (siem.thresholdRule) + # TLS certificate rule (xpack.uptime.alerts.tlsCertificate) + # Transform health (transform_health) +# Fix some optional path parameters - target: "$.paths['/api/actions/connector/{id}']['post'].parameters[?(@.name=='id')]" description: Remove optional indicator from path parameter update: required: true - # Add some connector API examples +# Add some connector API examples - target: "$.paths['/api/actions/connector/{id}']['post']" description: "Add examples to create connector API" update: @@ -388,4 +531,14 @@ actions: - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_issuetypes.yaml' - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_postmessage.yaml' - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_pushtoservice.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_validchannelid.yaml' \ No newline at end of file + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_validchannelid.yaml' +# Add some spaces API examples + - target: "$.paths['/api/spaces/space']['post']" + description: "Add example to create space API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createSpaceRequest: + $ref: "../examples/create_space_request.yaml" From 400df85404ba58a5fb0832eadaeece5387e82a67 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 7 Oct 2024 16:34:15 -0700 Subject: [PATCH 03/28] Add update space example and response code --- oas_docs/examples/update_space_request.yaml | 10 ++++++++++ oas_docs/overlays/kibana.overlays.shared.yaml | 9 +++++++++ .../plugins/spaces/server/routes/api/external/put.ts | 5 +++++ 3 files changed, 24 insertions(+) create mode 100644 oas_docs/examples/update_space_request.yaml diff --git a/oas_docs/examples/update_space_request.yaml b/oas_docs/examples/update_space_request.yaml new file mode 100644 index 0000000000000..42d1972390759 --- /dev/null +++ b/oas_docs/examples/update_space_request.yaml @@ -0,0 +1,10 @@ +summary: Update a marketing space +description: Update the marketing space to remove the imageUrl. +value: + id: marketing + name: Marketing + description : This is the Marketing Space + color: #aabbcc + initials: MK + disabledFeatures: [] + imageUrl: "" \ No newline at end of file diff --git a/oas_docs/overlays/kibana.overlays.shared.yaml b/oas_docs/overlays/kibana.overlays.shared.yaml index a1648fdcab1b8..bf63c6e92a685 100644 --- a/oas_docs/overlays/kibana.overlays.shared.yaml +++ b/oas_docs/overlays/kibana.overlays.shared.yaml @@ -542,3 +542,12 @@ actions: examples: createSpaceRequest: $ref: "../examples/create_space_request.yaml" + - target: "$.paths['/api/spaces/space/{id}']['put']" + description: "Add example to update space API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateSpaceRequest: + $ref: "../examples/update_space_request.yaml" diff --git a/x-pack/plugins/spaces/server/routes/api/external/put.ts b/x-pack/plugins/spaces/server/routes/api/external/put.ts index 10374dc94f600..91e89e13cd03b 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/put.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/put.ts @@ -36,6 +36,11 @@ export function initPutSpacesApi(deps: ExternalRouteDeps) { }), body: getSpaceSchema(isServerless), }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { From 104980ac46ef3f68b6363714019048b52ad30eb0 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 7 Oct 2024 16:48:32 -0700 Subject: [PATCH 04/28] Revert changes to connector and alerting overlay files --- oas_docs/makefile | 12 +- oas_docs/overlays/alerting.overlays.yaml | 150 +++++ oas_docs/overlays/connectors.overlays.yaml | 391 +++++++++++++ oas_docs/overlays/kibana.overlays.shared.yaml | 528 ------------------ 4 files changed, 549 insertions(+), 532 deletions(-) create mode 100644 oas_docs/overlays/alerting.overlays.yaml create mode 100644 oas_docs/overlays/connectors.overlays.yaml diff --git a/oas_docs/makefile b/oas_docs/makefile index e3930674e8824..ce24aa5b7b8b7 100644 --- a/oas_docs/makefile +++ b/oas_docs/makefile @@ -50,11 +50,15 @@ api-docs-lint-serverless: ## Run spectral API docs linter on kibana.serverless.y .PHONY: api-docs-overlay api-docs-overlay: ## Run spectral API docs linter on kibana.serverless.yaml @npx bump overlay "output/kibana.serverless.yaml" "overlays/kibana.overlays.serverless.yaml" > "output/kibana.serverless.tmp1.yaml" - @npx bump overlay "output/kibana.serverless.tmp1.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.serverless.tmp2.yaml" + @npx bump overlay "output/kibana.serverless.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.serverless.tmp2.yaml" + @npx bump overlay "output/kibana.serverless.tmp2.yaml" "overlays/connectors.overlays.yaml" > "output/kibana.serverless.tmp3.yaml" + @npx bump overlay "output/kibana.serverless.tmp3.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.serverless.tmp4.yaml" @npx bump overlay "output/kibana.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.tmp1.yaml" - @npx bump overlay "output/kibana.tmp1.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.tmp2.yaml" - @npx @redocly/cli bundle output/kibana.serverless.tmp2.yaml --ext yaml -o output/kibana.serverless.new.yaml - @npx @redocly/cli bundle output/kibana.tmp2.yaml --ext yaml -o output/kibana.new.yaml + @npx bump overlay "output/kibana.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.tmp2.yaml" + @npx bump overlay "output/kibana.tmp2.yaml" "overlays/connectors.overlays.yaml" > "output/kibana.tmp3.yaml" + @npx bump overlay "output/kibana.tmp3.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.tmp4.yaml" + @npx @redocly/cli bundle output/kibana.serverless.tmp4.yaml --ext yaml -o output/kibana.serverless.new.yaml + @npx @redocly/cli bundle output/kibana.tmp4.yaml --ext yaml -o output/kibana.new.yaml rm output/kibana.tmp*.yaml rm output/kibana.serverless.tmp*.yaml diff --git a/oas_docs/overlays/alerting.overlays.yaml b/oas_docs/overlays/alerting.overlays.yaml new file mode 100644 index 0000000000000..c4cc25b685783 --- /dev/null +++ b/oas_docs/overlays/alerting.overlays.yaml @@ -0,0 +1,150 @@ +# overlays.yaml +overlay: 1.0.0 +info: + title: Overlays for the alerting rule examples and parameters + version: 0.0.1 +actions: + # Add some alerting API examples + - target: "$.paths['/api/alerting/rule/{id}']['post']" + description: "Add examples to create rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEsQueryEsqlRuleRequest: + $ref: "../examples/create_es_query_esql_rule_request.yaml" + createEsQueryRuleRequest: + $ref: "../examples/create_es_query_rule_request.yaml" + createEsQueryKqlRuleRequest: + $ref: "../examples/create_es_query_kql_rule_request.yaml" + createIndexThresholdRuleRequest: + $ref: "../examples/create_index_threshold_rule_request.yaml" + createTrackingContainmentRuleRequest: + $ref: "../examples/create_tracking_containment_rule_request.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEsQueryEsqlRuleResponse: + $ref: "../examples/create_es_query_esql_rule_response.yaml" + createEsQueryRuleResponse: + $ref: "../examples/create_es_query_rule_response.yaml" + createEsQueryKqlRuleResponse: + $ref: "../examples/create_es_query_kql_rule_response.yaml" + createIndexThresholdRuleResponse: + $ref: "../examples/create_index_threshold_rule_response.yaml" + createTrackingContainmentRuleResponse: + $ref: "../examples/create_tracking_containment_rule_response.yaml" + - target: "$.paths['/api/alerting/rule/{id}']['put']" + description: "Add examples to update rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuleRequest: + $ref: '../examples/update_rule_request.yaml' + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateRuleResponse: + $ref: '../examples/update_rule_response.yaml' + - target: "$.paths['/api/alerting/rules/_find']['get']" + description: "Add examples to find rules API" + update: + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + findRulesResponse: + $ref: '../examples/find_rules_response.yaml' + findConditionalActionRulesResponse: + $ref: '../examples/find_rules_response_conditional_action.yaml' + # Fix some optional path parameters + - target: "$.paths['/api/alerting/rule/{id}']['post'].parameters[?(@.name=='id')]" + description: Remove optional indicator from path parameter + update: + required: true + # Remove the alerting rule parameters + - target: "$.paths['/api/alerting/rule/{id}']['post'].requestBody.content.*.schema.properties.params" + description: "Remove params type in create rule API" + remove: true + # Add some alerting rule parameters + - target: "$.paths['/api/alerting/rule/{id}']['post']" + description: "Add params to create rule API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + params: + additionalProperties: {} + default: {} + description: The parameters for the rule. + anyOf: + # APM anomaly rule (apm.anomaly) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_anomaly.yaml' + # APM error count rule (apm.error_rate) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_error_count.yaml' + # APM transaction duration rule (apm.transaction_duration) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_duration.yaml' + # APM transaction error rate rule (apm.transaction_error_rate) + - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_error_rate.yaml' + # Elasticsearch DSL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml' + # Elasticsearch ES|QL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml' + # Elasticsearch KQL query rule (.es-query) + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml' + # Index threshold rule () + - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml' + # Infra inventory rule (metrics.alert.inventory.threshold) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_inventory.yaml' + # Log threshold rule (logs.alert.document.count) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_log_threshold.yaml' + # Infra metric threshold rule (metrics.alert.threshold) + - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_metric_threshold.yaml' + # SLO burn rate (slo.rules.burnRate) + - $ref: '../../x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' + # Synthetics uptime TLS rule (xpack.uptime.alerts.tls) + - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml' + # Uptime monitor status rule (xpack.uptime.alerts.monitorStatus) + - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml' + # TBD + # Anomaly detection alert rule (xpack.ml.anomaly_detection_alert) + # Anomaly detection jobs health rule (xpack.ml.anomaly_detection_jobs_health) + # Tracking containment rule (.geo-containment) + # Infrastructure anomaly rule (metrics.alert.anomaly) + # CCR read exceptions rule (monitoring_ccr_read_exceptions) + # Cluster health rule (monitoring_alert_cluster_health) + # CPU usage rule (monitoring_alert_cpu_usage) + # Custom query rule (siem.queryRule) + # Disk usage rule (monitoring_alert_disk_usage) + # Elasticsearch version mismatch rule (monitoring_alert_elasticsearch_version_mismatch) + # Event correlation rule (siem.eqlRule) + # Indicator match rule (siem.indicatorRule) + # JVM memory usage rule (monitoring_alert_jvm_memory_usage) + # Kibana version mismatch rule ( monitoring_alert_kibana_version_mismatch) + # License expiration rule (monitoring_alert_license_expiration) + # Logstash version mismatch rule (monitoring_alert_logstash_version_mismatch) + # Machine learning rule (siem.mlRule) + # Missing monitoring data rule (monitoring_alert_missing_monitoring_data) + # New terms rule (siem.newTermsRule) + # Nodes changed rule (monitoring_alert_nodes_changed) + # Saved query rule (siem.savedQueryRule) + # Security solution notification (legacy) rule (siem.notifications) + # Shard size rule (monitoring_shard_size) + # Synthetics monitor status rule (xpack.synthetics.alerts.monitorStatus) + # Synthetics uptime duration anomaly rule (xpack.uptime.alerts.durationAnomaly) + # Thread pool search rejections rule (monitoring_alert_thread_pool_search_rejections) + # Thread pool write rejections rule (monitoring_alert_thread_pool_write_rejections) + # Threshold rule (siem.thresholdRule) + # TLS certificate rule (xpack.uptime.alerts.tlsCertificate) + # Transform health (transform_health) + \ No newline at end of file diff --git a/oas_docs/overlays/connectors.overlays.yaml b/oas_docs/overlays/connectors.overlays.yaml new file mode 100644 index 0000000000000..022946e893be2 --- /dev/null +++ b/oas_docs/overlays/connectors.overlays.yaml @@ -0,0 +1,391 @@ +# overlays.yaml +overlay: 1.0.0 +info: + title: Overlays for the connector objects and examples + version: 0.0.1 +actions: + # Fix some optional path parameters + - target: "$.paths['/api/actions/connector/{id}']['post'].parameters[?(@.name=='id')]" + description: Remove optional indicator from path parameter + update: + required: true + # Add some connector API examples + - target: "$.paths['/api/actions/connector/{id}']['post']" + description: "Add examples to create connector API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEmailConnectorRequest: + $ref: "../examples/create_email_connector_request.yaml" + createIndexConnectorRequest: + $ref: "../examples/create_index_connector_request.yaml" + createWebhookConnectorRequest: + $ref: "../examples/create_webhook_connector_request.yaml" + createXmattersConnectorRequest: + $ref: "../examples/create_xmatters_connector_request.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + createEmailConnectorResponse: + $ref: "../examples/create_email_connector_response.yaml" + createIndexConnectorResponse: + $ref: "../examples/create_index_connector_response.yaml" + createWebhookConnectorResponse: + $ref: "../examples/create_webhook_connector_response.yaml" + createXmattersConnectorResponse: + $ref: "../examples/get_connector_response.yaml" + - target: "$.paths['/api/actions/connector/{id}/_execute']['post']" + description: "Add examples to run connector API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + runIndexConnectorRequest: + $ref: "../examples/run_index_connector_request.yaml" + runJiraConnectorRequest: + $ref: "../examples/run_jira_connector_request.yaml" + runServerLogConnectorRequest: + $ref: "../examples/run_servicenow_itom_connector_request.yaml" + runSlackConnectorRequest: + $ref: "../examples/run_slack_api_connector_request.yaml" + runSwimlaneConnectorRequest: + $ref: "../examples/run_swimlane_connector_request.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + runIndexConnectorResponse: + $ref: "../examples/run_index_connector_response.yaml" + runJiraConnectorResponse: + $ref: "../examples/run_jira_connector_response.yaml" + runServerLogConnectorResponse: + $ref: "../examples/run_server_log_connector_response.yaml" + runServiceNowITOMConnectorResponse: + $ref: "../examples/run_servicenow_itom_connector_response.yaml" + runSlackConnectorResponse: + $ref: "../examples/run_slack_api_connector_response.yaml" + runSwimlaneConnectorResponse: + $ref: "../examples/run_swimlane_connector_response.yaml" + - target: "$.paths['/api/actions/connector/{id}']['get']" + description: "Add examples to get connector API" + update: + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorResponse: + $ref: '../examples/get_connector_response.yaml' + - target: "$.paths['/api/actions/connector_types']['get']" + description: "Add examples to get connector types API" + update: + responses: + 200: + description: Indicates a successful call. + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorTypesServerlessResponse: + $ref: '../examples/get_connector_types_generativeai_response.yaml' + - target: "$.paths['/api/actions/connectors']['get']" + description: "Add examples to get all connectors API" + update: + responses: + 200: + description: Indicates a successful call. + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + getConnectorsResponse: + $ref: '../examples/get_connectors_response.yaml' + - target: "$.paths['/api/actions/connector/{id}']['put']" + description: "Add examples to update connector API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateIndexConnectorRequest: + $ref: '../examples/update_index_connector_request.yaml' + # Remove the automated empty connector config and secrets + - target: "$.paths['/api/actions/connector/{id}']['post'].requestBody.content.*.schema.properties.config" + description: "Remove config in create connector API" + remove: true + - target: "$.paths['/api/actions/connector/{id}']['put'].requestBody.content.*.schema.properties.config" + description: "Remove config in update connector API" + remove: true + - target: "$.paths['/api/actions/connector/{id}']['post'].requestBody.content.*.schema.properties.secrets" + description: "Remove secrets in create connector API" + remove: true + - target: "$.paths['/api/actions/connector/{id}']['put'].requestBody.content.*.schema.properties.secrets" + description: "Remove secrets in update connector API" + remove: true + # Add some connector configuration schemas + - target: "$.paths['/api/actions/connector/{id}']['post']" + description: "Add config and secrets to create connector API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + config: + additionalProperties: {} + default: {} + description: The connector configuration details. + oneOf: + # Bedrock (.bedrock) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_config.yaml' + # Crowdstrike (.crowdstrike) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_config.yaml' + # D3 Security (.d3security) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_config.yaml' + # Email (.email) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_config.yaml' + # Google Gemini (.gemini) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_config.yaml' + # IBM Resilient (.resilient) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_config.yaml' + # Index (.index) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/index_config.yaml' + # Jira (.jira) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_config.yaml' + # Microsoft Teams (.teams) N/A + # Observability AI Assistant (.observability-ai-assistant) TBD + # Azure OpenAI (.gen-ai) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_azure_config.yaml' + # OpenAI (.gen-ai) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_openai_config.yaml' + # Opsgenie (.opsgenie) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_config.yaml' + # PagerDuty (.pagerduty) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_config.yaml' + # SentinelOne (.sentinelone) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_config.yaml' + # Server log (.server-log) N/A + # ServiceNow ITSM (.servicenow) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_config.yaml' + # ServiceNow SecOps (.servicenow-sir) TBD + # ServiceNow ITOM (.servicenow-itom) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_itom_config.yaml' + # Slack (.slack_api) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_config.yaml' + # Swimlane (.swimlane) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_config.yaml' + # TheHive (.thehive) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_config.yaml' + # Tines (.tines) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_config.yaml' + # Torq (.torq) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_config.yaml' + # Webhook (.webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_config.yaml' + # Webhook - Case Management (.cases-webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_config.yaml' + # xMatters (.xmatters) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_config.yaml' + secrets: + additionalProperties: {} + default: {} + oneOf: + # Bedrock (.bedrock) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_secrets.yaml' + # Crowdstrike (.crowdstrike) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_secrets.yaml' + # D3 Security (.d3security) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_secrets.yaml' + # Email (.email) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_secrets.yaml' + # Google Gemini (.gemini) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_secrets.yaml' + # IBM Resilient (.resilient) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_secrets.yaml' + # Index (.index) N/A + # Jira (.jira) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_secrets.yaml' + # Microsoft Teams (.teams) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/teams_secrets.yaml' + # Observability AI Assistant (.observability-ai-assistant) TBD + # OpenAI (.gen-ai) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_secrets.yaml' + # Opsgenie (.opsgenie) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_secrets.yaml' + # PagerDuty (.pagerduty) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_secrets.yaml' + # SentinelOne (.sentinelone) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_secrets.yaml' + # ServiceNow (.servicenow) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_secrets.yaml' + # ServiceNow Sec Ops (.servicenow-sir) TBD + # ServiceNow (.servicenow-itom) TBD + # Slack (.slack_api) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_secrets.yaml' + # Swimlane (.swimlane) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_secrets.yaml' + # TheHive (.thehive) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_secrets.yaml' + # Tines (.tines) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_secrets.yaml' + # Torq (.torq) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_secrets.yaml' + # Webhook (.webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_secrets.yaml' + # Webhook - Case Management (.cases-webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_secrets.yaml' + # xMatters (.xmatters) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_secrets.yaml' + - target: "$.paths['/api/actions/connector/{id}']['put']" + description: "Add config and secrets to update connector API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + config: + additionalProperties: {} + default: {} + description: The connector configuration details. + oneOf: + # Bedrock (.bedrock) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_config.yaml' + # Crowdstrike (.crowdstrike) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_config.yaml' + # D3 Security (.d3security) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_config.yaml' + # Email (.email) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_config.yaml' + # Google Gemini (.gemini) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_config.yaml' + # IBM Resilient (.resilient) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_config.yaml' + # Index (.index) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/index_config.yaml' + # Jira (.jira) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_config.yaml' + # Microsoft Teams (.teams) N/A + # Observability AI Assistant (.observability-ai-assistant) TBD + # Azue OpenAI (.gen-ai) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_azure_config.yaml' + # OpenAI (.gen-ai) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_openai_config.yaml' + # Opsgenie (.opsgenie) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_config.yaml' + # PagerDuty (.pagerduty) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_config.yaml' + # SentinelOne (.sentinelone) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_config.yaml' + # Server log (.server-log) N/A + # ServiceNow ITSM (.servicenow) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_config.yaml' + # ServiceNow SecOps (.servicenow-sir) TBD + # ServiceNow ITOM (.servicenow-itom) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_itom_config.yaml' + # Slack (.slack_api) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_config.yaml' + # Swimlane (.swimlane) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_config.yaml' + # TheHive (.thehive) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_config.yaml' + # Tines (.tines) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_config.yaml' + # Torq (.torq) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_config.yaml' + # Webhook (.webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_config.yaml' + # Webhook - Case Management (.cases-webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_config.yaml' + # xMatters (.xmatters) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_config.yaml' + secrets: + additionalProperties: {} + default: {} + oneOf: + # Bedrock (.bedrock) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_secrets.yaml' + # Crowdstrike (.crowdstrike) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_secrets.yaml' + # D3 Security (.d3security) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_secrets.yaml' + # Email (.email) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_secrets.yaml' + # Google Gemini (.gemini) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_secrets.yaml' + # IBM Resilient (.resilient) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_secrets.yaml' + # Index (.index) N/A + # Jira (.jira) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_secrets.yaml' + # Microsoft Teams (.teams) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/teams_secrets.yaml' + # Observability AI Assistant (.observability-ai-assistant) TBD + # OpenAI (.gen-ai) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_secrets.yaml' + # Opsgenie (.opsgenie) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_secrets.yaml' + # PagerDuty (.pagerduty) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_secrets.yaml' + # SentinelOne (.sentinelone) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_secrets.yaml' + # ServiceNow (.servicenow) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_secrets.yaml' + # ServiceNow SecOps (.servicenow-sir) TBD + # ServiceNow ITOM (.servicenow-itom) TBD + # Slack (.slack_api) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_secrets.yaml' + # Swimlane (.swimlane) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_secrets.yaml' + # TheHive (.thehive) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_secrets.yaml' + # Tines (.tines) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_secrets.yaml' + # Torq (.torq) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_secrets.yaml' + # Webhook (.webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_secrets.yaml' + # Webhook - Case Management (.cases-webhook) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_secrets.yaml' + # xMatters (.xmatters) + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_secrets.yaml' + # Remove the automated empty run connector params + - target: "$.paths['/api/actions/connector/{id}/_execute']['post'].requestBody.content.*.schema.properties.params" + description: "Remove params in run connector API" + remove: true + # Add some run connector params + - target: "$.paths['/api/actions/connector/{id}/_execute']['post']" + description: "Add examples to run connector API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + properties: + params: + additionalProperties: {} + oneOf: + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_acknowledge_resolve_pagerduty.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_documents.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_message_email.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_message_serverlog.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_message_slack.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_trigger_pagerduty.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_addevent.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_closealert.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_closeincident.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_createalert.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_fieldsbyissuetype.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_getchoices.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_getfields.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_getincident.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_issue.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_issues.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_issuetypes.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_postmessage.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_pushtoservice.yaml' + - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_validchannelid.yaml' \ No newline at end of file diff --git a/oas_docs/overlays/kibana.overlays.shared.yaml b/oas_docs/overlays/kibana.overlays.shared.yaml index bf63c6e92a685..ad262a2d14de4 100644 --- a/oas_docs/overlays/kibana.overlays.shared.yaml +++ b/oas_docs/overlays/kibana.overlays.shared.yaml @@ -4,534 +4,6 @@ info: title: Overlays that are applicable to both serverless and non-serverless documentas version: 0.0.1 actions: -# Add some alerting API examples - - target: "$.paths['/api/alerting/rule/{id}']['post']" - description: "Add examples to create rule API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createEsQueryEsqlRuleRequest: - $ref: "../examples/create_es_query_esql_rule_request.yaml" - createEsQueryRuleRequest: - $ref: "../examples/create_es_query_rule_request.yaml" - createEsQueryKqlRuleRequest: - $ref: "../examples/create_es_query_kql_rule_request.yaml" - createIndexThresholdRuleRequest: - $ref: "../examples/create_index_threshold_rule_request.yaml" - createTrackingContainmentRuleRequest: - $ref: "../examples/create_tracking_containment_rule_request.yaml" - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createEsQueryEsqlRuleResponse: - $ref: "../examples/create_es_query_esql_rule_response.yaml" - createEsQueryRuleResponse: - $ref: "../examples/create_es_query_rule_response.yaml" - createEsQueryKqlRuleResponse: - $ref: "../examples/create_es_query_kql_rule_response.yaml" - createIndexThresholdRuleResponse: - $ref: "../examples/create_index_threshold_rule_response.yaml" - createTrackingContainmentRuleResponse: - $ref: "../examples/create_tracking_containment_rule_response.yaml" - - target: "$.paths['/api/alerting/rule/{id}']['put']" - description: "Add examples to update rule API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuleRequest: - $ref: '../examples/update_rule_request.yaml' - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - updateRuleResponse: - $ref: '../examples/update_rule_response.yaml' - - target: "$.paths['/api/alerting/rules/_find']['get']" - description: "Add examples to find rules API" - update: - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - findRulesResponse: - $ref: '../examples/find_rules_response.yaml' - findConditionalActionRulesResponse: - $ref: '../examples/find_rules_response_conditional_action.yaml' - # Fix some optional path parameters - - target: "$.paths['/api/alerting/rule/{id}']['post'].parameters[?(@.name=='id')]" - description: Remove optional indicator from path parameter - update: - required: true - # Remove the alerting rule parameters - - target: "$.paths['/api/alerting/rule/{id}']['post'].requestBody.content.*.schema.properties.params" - description: "Remove params type in create rule API" - remove: true - # Add some alerting rule parameters - - target: "$.paths['/api/alerting/rule/{id}']['post']" - description: "Add params to create rule API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - params: - additionalProperties: {} - default: {} - description: The parameters for the rule. - anyOf: - # APM anomaly rule (apm.anomaly) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_anomaly.yaml' - # APM error count rule (apm.error_rate) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_error_count.yaml' - # APM transaction duration rule (apm.transaction_duration) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_duration.yaml' - # APM transaction error rate rule (apm.transaction_error_rate) - - $ref: '../../x-pack/plugins/observability_solution/apm/server/routes/alerts/rule_types/docs/params_property_apm_transaction_error_rate.yaml' - # Elasticsearch DSL query rule (.es-query) - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_dsl_rule.yaml' - # Elasticsearch ES|QL query rule (.es-query) - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_esql_rule.yaml' - # Elasticsearch KQL query rule (.es-query) - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_es_query_kql_rule.yaml' - # Index threshold rule () - - $ref: '../../x-pack/plugins/alerting/docs/openapi/components/schemas/params_index_threshold_rule.yaml' - # Infra inventory rule (metrics.alert.inventory.threshold) - - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_inventory.yaml' - # Log threshold rule (logs.alert.document.count) - - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_log_threshold.yaml' - # Infra metric threshold rule (metrics.alert.threshold) - - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_metric_threshold.yaml' - # SLO burn rate (slo.rules.burnRate) - - $ref: '../../x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' - # Synthetics uptime TLS rule (xpack.uptime.alerts.tls) - - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml' - # Uptime monitor status rule (xpack.uptime.alerts.monitorStatus) - - $ref: '../../x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml' - # TBD - # Anomaly detection alert rule (xpack.ml.anomaly_detection_alert) - # Anomaly detection jobs health rule (xpack.ml.anomaly_detection_jobs_health) - # Tracking containment rule (.geo-containment) - # Infrastructure anomaly rule (metrics.alert.anomaly) - # CCR read exceptions rule (monitoring_ccr_read_exceptions) - # Cluster health rule (monitoring_alert_cluster_health) - # CPU usage rule (monitoring_alert_cpu_usage) - # Custom query rule (siem.queryRule) - # Disk usage rule (monitoring_alert_disk_usage) - # Elasticsearch version mismatch rule (monitoring_alert_elasticsearch_version_mismatch) - # Event correlation rule (siem.eqlRule) - # Indicator match rule (siem.indicatorRule) - # JVM memory usage rule (monitoring_alert_jvm_memory_usage) - # Kibana version mismatch rule ( monitoring_alert_kibana_version_mismatch) - # License expiration rule (monitoring_alert_license_expiration) - # Logstash version mismatch rule (monitoring_alert_logstash_version_mismatch) - # Machine learning rule (siem.mlRule) - # Missing monitoring data rule (monitoring_alert_missing_monitoring_data) - # New terms rule (siem.newTermsRule) - # Nodes changed rule (monitoring_alert_nodes_changed) - # Saved query rule (siem.savedQueryRule) - # Security solution notification (legacy) rule (siem.notifications) - # Shard size rule (monitoring_shard_size) - # Synthetics monitor status rule (xpack.synthetics.alerts.monitorStatus) - # Synthetics uptime duration anomaly rule (xpack.uptime.alerts.durationAnomaly) - # Thread pool search rejections rule (monitoring_alert_thread_pool_search_rejections) - # Thread pool write rejections rule (monitoring_alert_thread_pool_write_rejections) - # Threshold rule (siem.thresholdRule) - # TLS certificate rule (xpack.uptime.alerts.tlsCertificate) - # Transform health (transform_health) -# Fix some optional path parameters - - target: "$.paths['/api/actions/connector/{id}']['post'].parameters[?(@.name=='id')]" - description: Remove optional indicator from path parameter - update: - required: true -# Add some connector API examples - - target: "$.paths['/api/actions/connector/{id}']['post']" - description: "Add examples to create connector API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createEmailConnectorRequest: - $ref: "../examples/create_email_connector_request.yaml" - createIndexConnectorRequest: - $ref: "../examples/create_index_connector_request.yaml" - createWebhookConnectorRequest: - $ref: "../examples/create_webhook_connector_request.yaml" - createXmattersConnectorRequest: - $ref: "../examples/create_xmatters_connector_request.yaml" - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - createEmailConnectorResponse: - $ref: "../examples/create_email_connector_response.yaml" - createIndexConnectorResponse: - $ref: "../examples/create_index_connector_response.yaml" - createWebhookConnectorResponse: - $ref: "../examples/create_webhook_connector_response.yaml" - createXmattersConnectorResponse: - $ref: "../examples/get_connector_response.yaml" - - target: "$.paths['/api/actions/connector/{id}/_execute']['post']" - description: "Add examples to run connector API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - runIndexConnectorRequest: - $ref: "../examples/run_index_connector_request.yaml" - runJiraConnectorRequest: - $ref: "../examples/run_jira_connector_request.yaml" - runServerLogConnectorRequest: - $ref: "../examples/run_servicenow_itom_connector_request.yaml" - runSlackConnectorRequest: - $ref: "../examples/run_slack_api_connector_request.yaml" - runSwimlaneConnectorRequest: - $ref: "../examples/run_swimlane_connector_request.yaml" - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - runIndexConnectorResponse: - $ref: "../examples/run_index_connector_response.yaml" - runJiraConnectorResponse: - $ref: "../examples/run_jira_connector_response.yaml" - runServerLogConnectorResponse: - $ref: "../examples/run_server_log_connector_response.yaml" - runServiceNowITOMConnectorResponse: - $ref: "../examples/run_servicenow_itom_connector_response.yaml" - runSlackConnectorResponse: - $ref: "../examples/run_slack_api_connector_response.yaml" - runSwimlaneConnectorResponse: - $ref: "../examples/run_swimlane_connector_response.yaml" - - target: "$.paths['/api/actions/connector/{id}']['get']" - description: "Add examples to get connector API" - update: - responses: - 200: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorResponse: - $ref: '../examples/get_connector_response.yaml' - - target: "$.paths['/api/actions/connector_types']['get']" - description: "Add examples to get connector types API" - update: - responses: - 200: - description: Indicates a successful call. - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorTypesServerlessResponse: - $ref: '../examples/get_connector_types_generativeai_response.yaml' - - target: "$.paths['/api/actions/connectors']['get']" - description: "Add examples to get all connectors API" - update: - responses: - 200: - description: Indicates a successful call. - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - getConnectorsResponse: - $ref: '../examples/get_connectors_response.yaml' - - target: "$.paths['/api/actions/connector/{id}']['put']" - description: "Add examples to update connector API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - examples: - updateIndexConnectorRequest: - $ref: '../examples/update_index_connector_request.yaml' - # Remove the automated empty connector config and secrets - - target: "$.paths['/api/actions/connector/{id}']['post'].requestBody.content.*.schema.properties.config" - description: "Remove config in create connector API" - remove: true - - target: "$.paths['/api/actions/connector/{id}']['put'].requestBody.content.*.schema.properties.config" - description: "Remove config in update connector API" - remove: true - - target: "$.paths['/api/actions/connector/{id}']['post'].requestBody.content.*.schema.properties.secrets" - description: "Remove secrets in create connector API" - remove: true - - target: "$.paths['/api/actions/connector/{id}']['put'].requestBody.content.*.schema.properties.secrets" - description: "Remove secrets in update connector API" - remove: true - # Add some connector configuration schemas - - target: "$.paths['/api/actions/connector/{id}']['post']" - description: "Add config and secrets to create connector API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - config: - additionalProperties: {} - default: {} - description: The connector configuration details. - oneOf: - # Bedrock (.bedrock) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_config.yaml' - # Crowdstrike (.crowdstrike) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_config.yaml' - # D3 Security (.d3security) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_config.yaml' - # Email (.email) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_config.yaml' - # Google Gemini (.gemini) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_config.yaml' - # IBM Resilient (.resilient) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_config.yaml' - # Index (.index) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/index_config.yaml' - # Jira (.jira) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_config.yaml' - # Microsoft Teams (.teams) N/A - # Observability AI Assistant (.observability-ai-assistant) TBD - # Azure OpenAI (.gen-ai) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_azure_config.yaml' - # OpenAI (.gen-ai) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_openai_config.yaml' - # Opsgenie (.opsgenie) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_config.yaml' - # PagerDuty (.pagerduty) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_config.yaml' - # SentinelOne (.sentinelone) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_config.yaml' - # Server log (.server-log) N/A - # ServiceNow ITSM (.servicenow) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_config.yaml' - # ServiceNow SecOps (.servicenow-sir) TBD - # ServiceNow ITOM (.servicenow-itom) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_itom_config.yaml' - # Slack (.slack_api) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_config.yaml' - # Swimlane (.swimlane) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_config.yaml' - # TheHive (.thehive) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_config.yaml' - # Tines (.tines) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_config.yaml' - # Torq (.torq) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_config.yaml' - # Webhook (.webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_config.yaml' - # Webhook - Case Management (.cases-webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_config.yaml' - # xMatters (.xmatters) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_config.yaml' - secrets: - additionalProperties: {} - default: {} - oneOf: - # Bedrock (.bedrock) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_secrets.yaml' - # Crowdstrike (.crowdstrike) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_secrets.yaml' - # D3 Security (.d3security) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_secrets.yaml' - # Email (.email) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_secrets.yaml' - # Google Gemini (.gemini) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_secrets.yaml' - # IBM Resilient (.resilient) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_secrets.yaml' - # Index (.index) N/A - # Jira (.jira) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_secrets.yaml' - # Microsoft Teams (.teams) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/teams_secrets.yaml' - # Observability AI Assistant (.observability-ai-assistant) TBD - # OpenAI (.gen-ai) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_secrets.yaml' - # Opsgenie (.opsgenie) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_secrets.yaml' - # PagerDuty (.pagerduty) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_secrets.yaml' - # SentinelOne (.sentinelone) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_secrets.yaml' - # ServiceNow (.servicenow) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_secrets.yaml' - # ServiceNow Sec Ops (.servicenow-sir) TBD - # ServiceNow (.servicenow-itom) TBD - # Slack (.slack_api) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_secrets.yaml' - # Swimlane (.swimlane) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_secrets.yaml' - # TheHive (.thehive) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_secrets.yaml' - # Tines (.tines) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_secrets.yaml' - # Torq (.torq) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_secrets.yaml' - # Webhook (.webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_secrets.yaml' - # Webhook - Case Management (.cases-webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_secrets.yaml' - # xMatters (.xmatters) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_secrets.yaml' - - target: "$.paths['/api/actions/connector/{id}']['put']" - description: "Add config and secrets to update connector API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - config: - additionalProperties: {} - default: {} - description: The connector configuration details. - oneOf: - # Bedrock (.bedrock) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_config.yaml' - # Crowdstrike (.crowdstrike) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_config.yaml' - # D3 Security (.d3security) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_config.yaml' - # Email (.email) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_config.yaml' - # Google Gemini (.gemini) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_config.yaml' - # IBM Resilient (.resilient) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_config.yaml' - # Index (.index) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/index_config.yaml' - # Jira (.jira) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_config.yaml' - # Microsoft Teams (.teams) N/A - # Observability AI Assistant (.observability-ai-assistant) TBD - # Azue OpenAI (.gen-ai) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_azure_config.yaml' - # OpenAI (.gen-ai) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_openai_config.yaml' - # Opsgenie (.opsgenie) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_config.yaml' - # PagerDuty (.pagerduty) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_config.yaml' - # SentinelOne (.sentinelone) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_config.yaml' - # Server log (.server-log) N/A - # ServiceNow ITSM (.servicenow) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_config.yaml' - # ServiceNow SecOps (.servicenow-sir) TBD - # ServiceNow ITOM (.servicenow-itom) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_itom_config.yaml' - # Slack (.slack_api) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_config.yaml' - # Swimlane (.swimlane) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_config.yaml' - # TheHive (.thehive) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_config.yaml' - # Tines (.tines) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_config.yaml' - # Torq (.torq) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_config.yaml' - # Webhook (.webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_config.yaml' - # Webhook - Case Management (.cases-webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_config.yaml' - # xMatters (.xmatters) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_config.yaml' - secrets: - additionalProperties: {} - default: {} - oneOf: - # Bedrock (.bedrock) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/bedrock_secrets.yaml' - # Crowdstrike (.crowdstrike) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/crowdstrike_secrets.yaml' - # D3 Security (.d3security) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/d3security_secrets.yaml' - # Email (.email) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/email_secrets.yaml' - # Google Gemini (.gemini) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/gemini_secrets.yaml' - # IBM Resilient (.resilient) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/resilient_secrets.yaml' - # Index (.index) N/A - # Jira (.jira) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/jira_secrets.yaml' - # Microsoft Teams (.teams) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/teams_secrets.yaml' - # Observability AI Assistant (.observability-ai-assistant) TBD - # OpenAI (.gen-ai) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/genai_secrets.yaml' - # Opsgenie (.opsgenie) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/opsgenie_secrets.yaml' - # PagerDuty (.pagerduty) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/pagerduty_secrets.yaml' - # SentinelOne (.sentinelone) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/sentinelone_secrets.yaml' - # ServiceNow (.servicenow) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/servicenow_secrets.yaml' - # ServiceNow SecOps (.servicenow-sir) TBD - # ServiceNow ITOM (.servicenow-itom) TBD - # Slack (.slack_api) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/slack_api_secrets.yaml' - # Swimlane (.swimlane) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/swimlane_secrets.yaml' - # TheHive (.thehive) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/thehive_secrets.yaml' - # Tines (.tines) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/tines_secrets.yaml' - # Torq (.torq) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/torq_secrets.yaml' - # Webhook (.webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/webhook_secrets.yaml' - # Webhook - Case Management (.cases-webhook) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/cases_webhook_secrets.yaml' - # xMatters (.xmatters) - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/xmatters_secrets.yaml' - # Remove the automated empty run connector params - - target: "$.paths['/api/actions/connector/{id}/_execute']['post'].requestBody.content.*.schema.properties.params" - description: "Remove params in run connector API" - remove: true - # Add some run connector params - - target: "$.paths['/api/actions/connector/{id}/_execute']['post']" - description: "Add examples to run connector API" - update: - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - properties: - params: - additionalProperties: {} - oneOf: - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_acknowledge_resolve_pagerduty.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_documents.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_message_email.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_message_serverlog.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_message_slack.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_trigger_pagerduty.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_addevent.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_closealert.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_closeincident.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_createalert.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_fieldsbyissuetype.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_getchoices.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_getfields.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_getincident.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_issue.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_issues.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_issuetypes.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_postmessage.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_pushtoservice.yaml' - - $ref: '../../x-pack/plugins/actions/docs/openapi/components/schemas/run_validchannelid.yaml' # Add some spaces API examples - target: "$.paths['/api/spaces/space']['post']" description: "Add example to create space API" From 2f3c518c8ae216a6edf33b703216314e8f5c250c Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 8 Oct 2024 10:01:21 -0700 Subject: [PATCH 05/28] Add summary and tags to all space APIs --- .../spaces/server/routes/api/external/copy_to_space.ts | 4 ++-- .../plugins/spaces/server/routes/api/external/delete.ts | 8 +++++++- .../routes/api/external/disable_legacy_url_aliases.ts | 3 ++- x-pack/plugins/spaces/server/routes/api/external/get.ts | 2 +- .../plugins/spaces/server/routes/api/external/get_all.ts | 2 +- .../routes/api/external/get_shareable_references.ts | 3 ++- x-pack/plugins/spaces/server/routes/api/external/post.ts | 2 +- x-pack/plugins/spaces/server/routes/api/external/put.ts | 2 +- .../server/routes/api/external/update_objects_spaces.ts | 3 ++- 9 files changed, 19 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index f1f1f22b55e32..6553bddb42a05 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -39,8 +39,8 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { path: '/api/spaces/_copy_saved_objects', options: { access: isServerless ? 'internal' : 'public', - tags: ['access:copySavedObjectsToSpaces'], - description: `Copy saved objects to spaces`, + tags: ['access:copySavedObjectsToSpaces', 'oas-tag:spaces'], + summary: `Copy saved objects to spaces`, }, validate: { body: schema.object( diff --git a/x-pack/plugins/spaces/server/routes/api/external/delete.ts b/x-pack/plugins/spaces/server/routes/api/external/delete.ts index 515f8811e5dcf..5562083f38aa3 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/delete.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/delete.ts @@ -22,7 +22,8 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) { .delete({ path: '/api/spaces/space/{id}', access: 'public', - description: `Delete a space`, + summary: `Delete a space`, + description: `When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.`, options: { tags: ['oas-tag:spaces'], }, @@ -36,6 +37,11 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) { id: schema.string(), }), }, + response: { + 204: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts index 6b3c70eb64ffa..bce20c3616eef 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts @@ -20,7 +20,8 @@ export function initDisableLegacyUrlAliasesApi(deps: ExternalRouteDeps) { path: '/api/spaces/_disable_legacy_url_aliases', options: { access: isServerless ? 'internal' : 'public', - description: `Disable legacy URL aliases`, + summary: `Disable legacy URL aliases`, + tags: ['oas-tag:spaces'], }, validate: { body: schema.object({ diff --git a/x-pack/plugins/spaces/server/routes/api/external/get.ts b/x-pack/plugins/spaces/server/routes/api/external/get.ts index 8d4e3c0c359ef..58e913a79a35c 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/get.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/get.ts @@ -20,7 +20,7 @@ export function initGetSpaceApi(deps: ExternalRouteDeps) { .get({ path: '/api/spaces/space/{id}', access: 'public', - description: `Get a space`, + summary: `Get a space`, options: { tags: ['oas-tag:spaces'], }, diff --git a/x-pack/plugins/spaces/server/routes/api/external/get_all.ts b/x-pack/plugins/spaces/server/routes/api/external/get_all.ts index baa47ca6956dc..4211b97e318fb 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/get_all.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/get_all.ts @@ -19,7 +19,7 @@ export function initGetAllSpacesApi(deps: ExternalRouteDeps) { .get({ path: '/api/spaces/space', access: 'public', - description: `Get all spaces`, + summary: `Get all spaces`, options: { tags: ['oas-tag:spaces'], }, diff --git a/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts b/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts index 93a210cd82b3e..5821cc8535bfe 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts @@ -19,7 +19,8 @@ export function initGetShareableReferencesApi(deps: ExternalRouteDeps) { path: '/api/spaces/_get_shareable_references', options: { access: isServerless ? 'internal' : 'public', - description: `Get shareable references`, + summary: `Get shareable references`, + tags: ['oas-tag:spaces'], }, validate: { body: schema.object({ diff --git a/x-pack/plugins/spaces/server/routes/api/external/post.ts b/x-pack/plugins/spaces/server/routes/api/external/post.ts index 42d7c3da74714..de1ec53aaee44 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/post.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/post.ts @@ -22,7 +22,7 @@ export function initPostSpacesApi(deps: ExternalRouteDeps) { .post({ path: '/api/spaces/space', access: 'public', - description: `Create a space`, + summary: `Create a space`, options: { tags: ['oas-tag:spaces'], }, diff --git a/x-pack/plugins/spaces/server/routes/api/external/put.ts b/x-pack/plugins/spaces/server/routes/api/external/put.ts index 91e89e13cd03b..4ce32152f30f4 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/put.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/put.ts @@ -21,7 +21,7 @@ export function initPutSpacesApi(deps: ExternalRouteDeps) { .put({ path: '/api/spaces/space/{id}', access: 'public', - description: `Update a space`, + summary: `Update a space`, options: { tags: ['oas-tag:spaces'], }, diff --git a/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts b/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts index 68b89d0934cf1..ba90077946b7e 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts @@ -38,7 +38,8 @@ export function initUpdateObjectsSpacesApi(deps: ExternalRouteDeps) { path: '/api/spaces/_update_objects_spaces', options: { access: isServerless ? 'internal' : 'public', - description: `Update saved objects in spaces`, + summary: `Update saved objects in spaces`, + tags: ['oas-tag:spaces'], }, validate: { body: schema.object({ From 6bba78b79ed6bfe58722ab3d9acaa03fc4814ee4 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 8 Oct 2024 14:17:08 -0700 Subject: [PATCH 06/28] Added descriptions to more space APIs --- oas_docs/examples/get_space_response.yaml | 10 + .../routes/api/external/copy_to_space.ts | 243 ++++++++++++------ .../external/disable_legacy_url_aliases.ts | 25 +- .../spaces/server/routes/api/external/get.ts | 7 +- .../server/routes/api/external/get_all.ts | 31 ++- .../api/external/get_shareable_references.ts | 14 +- .../api/external/update_objects_spaces.ts | 31 ++- 7 files changed, 252 insertions(+), 109 deletions(-) create mode 100644 oas_docs/examples/get_space_response.yaml diff --git a/oas_docs/examples/get_space_response.yaml b/oas_docs/examples/get_space_response.yaml new file mode 100644 index 0000000000000..6cf8a250d90aa --- /dev/null +++ b/oas_docs/examples/get_space_response.yaml @@ -0,0 +1,10 @@ +summary: Get details about a marketing space +value: + id: marketing + name: Marketing + description : This is the Marketing Space + color: #aabbcc + initials: MK + disabledFeatures: [] + imageUrl: "" + solution: es \ No newline at end of file diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index 6553bddb42a05..d78aea4a355ad 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -41,56 +41,96 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { access: isServerless ? 'internal' : 'public', tags: ['access:copySavedObjectsToSpaces', 'oas-tag:spaces'], summary: `Copy saved objects to spaces`, + description: + 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.', }, validate: { - body: schema.object( - { - spaces: schema.arrayOf( - schema.string({ - validate: (value) => { - if (!SPACE_ID_REGEX.test(value)) { - return `lower case, a-z, 0-9, "_", and "-" are allowed`; - } + request: { + body: schema.object( + { + spaces: schema.arrayOf( + schema.string({ + validate: (value) => { + if (!SPACE_ID_REGEX.test(value)) { + return `lower case, a-z, 0-9, "_", and "-" are allowed`; + } + }, + meta: { + description: + 'The identifiers of the spaces where you want to copy the specified objects.', + }, + }), + { + validate: (spaceIds) => { + if (_.uniq(spaceIds).length !== spaceIds.length) { + return 'duplicate space ids are not allowed'; + } + }, + } + ), + objects: schema.arrayOf( + schema.object({ + type: schema.string({ + meta: { description: 'The type of the saved object to copy.' }, + }), + id: schema.string({ + meta: { description: 'The identifier of the saved object to copy.' }, + }), + }), + { + validate: (objects) => { + if (!areObjectsUnique(objects)) { + return 'duplicate objects are not allowed'; + } + }, + } + ), + includeReferences: schema.boolean({ + defaultValue: false, + meta: { + description: + 'When set to true, all saved objects related to the specified saved objects will also be copied into the target spaces.', }, }), - { - validate: (spaceIds) => { - if (_.uniq(spaceIds).length !== spaceIds.length) { - return 'duplicate space ids are not allowed'; - } + overwrite: schema.boolean({ + defaultValue: false, + meta: { + description: + 'When set to true, all conflicts are automatically overridden. When a saved object with a matching type and identifier exists in the target space, that version is replaced with the version from the source space. This option cannot be used with the `createNewCopies` option.', }, - } - ), - objects: schema.arrayOf( - schema.object({ - type: schema.string(), - id: schema.string(), }), - { - validate: (objects) => { - if (!areObjectsUnique(objects)) { - return 'duplicate objects are not allowed'; - } + createNewCopies: schema.boolean({ + defaultValue: true, + meta: { + description: + 'Create new copies of saved objects, regenerate each object identifier, and reset the origin. When used, potential conflict errors are avoided. This option cannot be used with the `overwrite` and `compatibilityMode` options.', }, - } - ), - includeReferences: schema.boolean({ defaultValue: false }), - overwrite: schema.boolean({ defaultValue: false }), - createNewCopies: schema.boolean({ defaultValue: true }), - compatibilityMode: schema.boolean({ defaultValue: false }), - }, - { - validate: (object) => { - if (object.overwrite && object.createNewCopies) { - return 'cannot use [overwrite] with [createNewCopies]'; - } - - if (object.compatibilityMode && object.createNewCopies) { - return 'cannot use [compatibilityMode] with [createNewCopies]'; - } + }), + compatibilityMode: schema.boolean({ + defaultValue: false, + meta: { + description: + 'Apply various adjustments to the saved objects that are being copied to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with copied saved objects. This option cannot be used with the `createNewCopies` option.', + }, + }), }, - } - ), + { + validate: (object) => { + if (object.overwrite && object.createNewCopies) { + return 'cannot use [overwrite] with [createNewCopies]'; + } + if (object.compatibilityMode && object.createNewCopies) { + return 'cannot use [compatibilityMode] with [createNewCopies]'; + } + }, + } + ), + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { @@ -158,55 +198,88 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { options: { access: isServerless ? 'internal' : 'public', tags: ['access:copySavedObjectsToSpaces'], - description: `Resolve conflicts copying saved objects`, + summary: `Resolve conflicts copying saved objects`, + description: + 'Overwrite saved objects that are returned as errors from the copy saved objects to space API.', }, validate: { - body: schema.object( - { - retries: schema.recordOf( - schema.string({ - validate: (spaceId) => { - if (!SPACE_ID_REGEX.test(spaceId)) { - return `Invalid space id: ${spaceId}`; - } - }, - }), - schema.arrayOf( + request: { + body: schema.object( + { + retries: schema.recordOf( + schema.string({ + meta: { + description: + 'The retry operations to attempt, which can specify how to resolve different types of errors. Object keys represent the target space identifiers.', + }, + validate: (spaceId) => { + if (!SPACE_ID_REGEX.test(spaceId)) { + return `Invalid space id: ${spaceId}`; + } + }, + }), + schema.arrayOf( + schema.object({ + type: schema.string({ meta: { description: 'The saved object type.' } }), + id: schema.string({ meta: { description: 'The saved object identifier.' } }), + overwrite: schema.boolean({ + defaultValue: false, + meta: { + description: + 'When set to true, the saved object from the source space overwrites the conflicting object in the destination space.', + }, + }), + destinationId: schema.maybe( + schema.string({ + meta: { + description: + 'Specifies the destination identifier that the copied object should have, if different from the current identifier.', + }, + }) + ), + createNewCopy: schema.maybe(schema.boolean()), + ignoreMissingReferences: schema.maybe( + schema.boolean({ + meta: { + description: + 'When set to true, any missing references errors are ignored.', + }, + }) + ), + }) + ) + ), + objects: schema.arrayOf( schema.object({ type: schema.string(), id: schema.string(), - overwrite: schema.boolean({ defaultValue: false }), - destinationId: schema.maybe(schema.string()), - createNewCopy: schema.maybe(schema.boolean()), - ignoreMissingReferences: schema.maybe(schema.boolean()), - }) - ) - ), - objects: schema.arrayOf( - schema.object({ - type: schema.string(), - id: schema.string(), - }), - { - validate: (objects) => { - if (!areObjectsUnique(objects)) { - return 'duplicate objects are not allowed'; - } - }, - } - ), - includeReferences: schema.boolean({ defaultValue: false }), - createNewCopies: schema.boolean({ defaultValue: true }), - compatibilityMode: schema.boolean({ defaultValue: false }), - }, - { - validate: (object) => { - if (object.createNewCopies && object.compatibilityMode) { - return 'cannot use [createNewCopies] with [compatibilityMode]'; - } + }), + { + validate: (objects) => { + if (!areObjectsUnique(objects)) { + return 'duplicate objects are not allowed'; + } + }, + } + ), + includeReferences: schema.boolean({ defaultValue: false }), + createNewCopies: schema.boolean({ defaultValue: true }), + compatibilityMode: schema.boolean({ defaultValue: false }), }, - } - ), + { + validate: (object) => { + if (object.createNewCopies && object.compatibilityMode) { + return 'cannot use [createNewCopies] with [compatibilityMode]'; + } + }, + } + ), + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts index bce20c3616eef..d94cd2d88e206 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts @@ -24,15 +24,22 @@ export function initDisableLegacyUrlAliasesApi(deps: ExternalRouteDeps) { tags: ['oas-tag:spaces'], }, validate: { - body: schema.object({ - aliases: schema.arrayOf( - schema.object({ - targetSpace: schema.string(), - targetType: schema.string(), - sourceId: schema.string(), - }) - ), - }), + request: { + body: schema.object({ + aliases: schema.arrayOf( + schema.object({ + targetSpace: schema.string(), + targetType: schema.string(), + sourceId: schema.string(), + }) + ), + }), + }, + response: { + 204: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (_context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/get.ts b/x-pack/plugins/spaces/server/routes/api/external/get.ts index 58e913a79a35c..b1ab2dc575774 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/get.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/get.ts @@ -31,9 +31,14 @@ export function initGetSpaceApi(deps: ExternalRouteDeps) { validate: { request: { params: schema.object({ - id: schema.string(), + id: schema.string({ meta: { description: 'The space identifier.' } }), }), }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/get_all.ts b/x-pack/plugins/spaces/server/routes/api/external/get_all.ts index 4211b97e318fb..746735bb3736e 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/get_all.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/get_all.ts @@ -31,20 +31,39 @@ export function initGetAllSpacesApi(deps: ExternalRouteDeps) { request: { query: schema.object({ purpose: schema.maybe( - schema.oneOf([ - schema.literal('any'), - schema.literal('copySavedObjectsIntoSpace'), - schema.literal('shareSavedObjectsIntoSpace'), - ]) + schema.oneOf( + [ + schema.literal('any'), + schema.literal('copySavedObjectsIntoSpace'), + schema.literal('shareSavedObjectsIntoSpace'), + ], + { + meta: { + description: + 'Specifies which authorization checks are applied to the API call. The default value is `any`.', + }, + } + ) ), include_authorized_purposes: schema.conditional( schema.siblingRef('purpose'), schema.string(), schema.maybe(schema.literal(false)), - schema.maybe(schema.boolean()) + schema.maybe(schema.boolean()), + { + meta: { + description: + 'When enabled, the API returns any spaces that the user is authorized to access in any capacity and each space will contain the purposes for which the user is authorized. This can be useful to determine which spaces a user can read but not take a specific action in. If the security plugin is not enabled, this parameter has no effect, since no authorization checks take place. This parameter cannot be used in with the `purpose` parameter.', + }, + } ), }), }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts b/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts index 5821cc8535bfe..c7592c47b3d67 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts @@ -21,11 +21,19 @@ export function initGetShareableReferencesApi(deps: ExternalRouteDeps) { access: isServerless ? 'internal' : 'public', summary: `Get shareable references`, tags: ['oas-tag:spaces'], + description: 'Collect references and space contexts for saved objects.', }, validate: { - body: schema.object({ - objects: schema.arrayOf(schema.object({ type: schema.string(), id: schema.string() })), - }), + request: { + body: schema.object({ + objects: schema.arrayOf(schema.object({ type: schema.string(), id: schema.string() })), + }), + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts b/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts index ba90077946b7e..0312c96eb514d 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts @@ -18,6 +18,10 @@ export function initUpdateObjectsSpacesApi(deps: ExternalRouteDeps) { const spacesSchema = schema.arrayOf( schema.string({ + meta: { + description: + 'The identifiers of the spaces the saved objects should be added to or removed from.', + }, validate: (value) => { if (value !== ALL_SPACES_ID && !SPACE_ID_REGEX.test(value)) { return `lower case, a-z, 0-9, "_", and "-" are allowed, OR "*"`; @@ -40,13 +44,30 @@ export function initUpdateObjectsSpacesApi(deps: ExternalRouteDeps) { access: isServerless ? 'internal' : 'public', summary: `Update saved objects in spaces`, tags: ['oas-tag:spaces'], + description: 'Update one or more saved objects to add or remove them from some spaces.', }, validate: { - body: schema.object({ - objects: schema.arrayOf(schema.object({ type: schema.string(), id: schema.string() })), - spacesToAdd: spacesSchema, - spacesToRemove: spacesSchema, - }), + request: { + body: schema.object({ + objects: schema.arrayOf( + schema.object({ + type: schema.string({ + meta: { description: 'The type of the saved object to update.' }, + }), + id: schema.string({ + meta: { description: 'The identifier of the saved object to update.' }, + }), + }) + ), + spacesToAdd: spacesSchema, + spacesToRemove: spacesSchema, + }), + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, createLicensedRouteHandler(async (_context, request, response) => { From 20a98df3debf70fa5d069ad1410566c8b996798b Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 8 Oct 2024 14:29:57 -0700 Subject: [PATCH 07/28] Generate output --- oas_docs/bundle.json | 144 +++++++++++++---- oas_docs/bundle.serverless.json | 63 ++++++-- oas_docs/output/kibana.serverless.yaml | 102 +++++++++--- oas_docs/output/kibana.yaml | 207 ++++++++++++++++++++----- 4 files changed, 412 insertions(+), 104 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 4597c6a6043c0..dd7c8ee7409d7 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -41335,7 +41335,7 @@ }, "/api/spaces/_copy_saved_objects": { "post": { - "description": "Copy saved objects to spaces", + "description": "It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.", "operationId": "%2Fapi%2Fspaces%2F_copy_saved_objects#0", "parameters": [ { @@ -41369,14 +41369,17 @@ "properties": { "compatibilityMode": { "default": false, + "description": "Apply various adjustments to the saved objects that are being copied to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with copied saved objects. This option cannot be used with the `createNewCopies` option.", "type": "boolean" }, "createNewCopies": { "default": true, + "description": "Create new copies of saved objects, regenerate each object identifier, and reset the origin. When used, potential conflict errors are avoided. This option cannot be used with the `overwrite` and `compatibilityMode` options.", "type": "boolean" }, "includeReferences": { "default": false, + "description": "When set to true, all saved objects related to the specified saved objects will also be copied into the target spaces.", "type": "boolean" }, "objects": { @@ -41384,9 +41387,11 @@ "additionalProperties": false, "properties": { "id": { + "description": "The identifier of the saved object to copy.", "type": "string" }, "type": { + "description": "The type of the saved object to copy.", "type": "string" } }, @@ -41400,10 +41405,12 @@ }, "overwrite": { "default": false, + "description": "When set to true, all conflicts are automatically overridden. When a saved object with a matching type and identifier exists in the target space, that version is replaced with the version from the source space. This option cannot be used with the `createNewCopies` option.", "type": "boolean" }, "spaces": { "items": { + "description": "The identifiers of the spaces where you want to copy the specified objects.", "type": "string" }, "type": "array" @@ -41418,14 +41425,19 @@ } } }, - "responses": {}, - "summary": "", - "tags": [] + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Copy saved objects to spaces", + "tags": [ + "spaces" + ] } }, "/api/spaces/_disable_legacy_url_aliases": { "post": { - "description": "Disable legacy URL aliases", "operationId": "%2Fapi%2Fspaces%2F_disable_legacy_url_aliases#0", "parameters": [ { @@ -41489,14 +41501,20 @@ } } }, - "responses": {}, - "summary": "", - "tags": [] + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Disable legacy URL aliases", + "tags": [ + "spaces" + ] } }, "/api/spaces/_get_shareable_references": { "post": { - "description": "Get shareable references", + "description": "Collect references and space contexts for saved objects.", "operationId": "%2Fapi%2Fspaces%2F_get_shareable_references#0", "parameters": [ { @@ -41556,14 +41574,20 @@ } } }, - "responses": {}, - "summary": "", - "tags": [] + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get shareable references", + "tags": [ + "spaces" + ] } }, "/api/spaces/_resolve_copy_saved_objects_errors": { "post": { - "description": "Resolve conflicts copying saved objects", + "description": "Overwrite saved objects that are returned as errors from the copy saved objects to space API.", "operationId": "%2Fapi%2Fspaces%2F_resolve_copy_saved_objects_errors#0", "parameters": [ { @@ -41635,19 +41659,24 @@ "type": "boolean" }, "destinationId": { + "description": "Specifies the destination identifier that the copied object should have, if different from the current identifier.", "type": "string" }, "id": { + "description": "The saved object identifier.", "type": "string" }, "ignoreMissingReferences": { + "description": "When set to true, any missing references errors are ignored.", "type": "boolean" }, "overwrite": { "default": false, + "description": "When set to true, the saved object from the source space overwrites the conflicting object in the destination space.", "type": "boolean" }, "type": { + "description": "The saved object type.", "type": "string" } }, @@ -41671,14 +41700,18 @@ } } }, - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Resolve conflicts copying saved objects", "tags": [] } }, "/api/spaces/_update_objects_spaces": { "post": { - "description": "Update saved objects in spaces", + "description": "Update one or more saved objects to add or remove them from some spaces.", "operationId": "%2Fapi%2Fspaces%2F_update_objects_spaces#0", "parameters": [ { @@ -41715,9 +41748,11 @@ "additionalProperties": false, "properties": { "id": { + "description": "The identifier of the saved object to update.", "type": "string" }, "type": { + "description": "The type of the saved object to update.", "type": "string" } }, @@ -41731,12 +41766,14 @@ }, "spacesToAdd": { "items": { + "description": "The identifiers of the spaces the saved objects should be added to or removed from.", "type": "string" }, "type": "array" }, "spacesToRemove": { "items": { + "description": "The identifiers of the spaces the saved objects should be added to or removed from.", "type": "string" }, "type": "array" @@ -41752,14 +41789,19 @@ } } }, - "responses": {}, - "summary": "", - "tags": [] + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Update saved objects in spaces", + "tags": [ + "spaces" + ] } }, "/api/spaces/space": { "get": { - "description": "Get all spaces", "operationId": "%2Fapi%2Fspaces%2Fspace#0", "parameters": [ { @@ -41775,6 +41817,7 @@ } }, { + "description": "Specifies which authorization checks are applied to the API call. The default value is `any`.", "in": "query", "name": "purpose", "required": false, @@ -41788,6 +41831,7 @@ } }, { + "description": "When enabled, the API returns any spaces that the user is authorized to access in any capacity and each space will contain the purposes for which the user is authorized. This can be useful to determine which spaces a user can read but not take a specific action in. If the security plugin is not enabled, this parameter has no effect, since no authorization checks take place. This parameter cannot be used in with the `purpose` parameter.", "in": "query", "name": "include_authorized_purposes", "required": true, @@ -41827,14 +41871,17 @@ } } ], - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get all spaces", "tags": [ "spaces" ] }, "post": { - "description": "Create a space", "operationId": "%2Fapi%2Fspaces%2Fspace#1", "parameters": [ { @@ -41870,29 +41917,36 @@ "type": "boolean" }, "color": { + "description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.", "type": "string" }, "description": { + "description": "A description for the space.", "type": "string" }, "disabledFeatures": { "default": [], "items": { + "description": "The list of features that are turned off in the space.", "type": "string" }, "type": "array" }, "id": { + "description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.", "type": "string" }, "imageUrl": { + "description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.", "type": "string" }, "initials": { + "description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.", "maxLength": 2, "type": "string" }, "name": { + "description": "The display name for the space. ", "minLength": 1, "type": "string" }, @@ -41915,8 +41969,12 @@ } } }, - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Create a space", "tags": [ "spaces" ] @@ -41924,7 +41982,7 @@ }, "/api/spaces/space/{id}": { "delete": { - "description": "Delete a space", + "description": "When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.", "operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2", "parameters": [ { @@ -41958,14 +42016,17 @@ } } ], - "responses": {}, - "summary": "", + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a space", "tags": [ "spaces" ] }, "get": { - "description": "Get a space", "operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0", "parameters": [ { @@ -41981,6 +42042,7 @@ } }, { + "description": "The space identifier.", "in": "path", "name": "id", "required": true, @@ -41989,14 +42051,17 @@ } } ], - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get a space", "tags": [ "spaces" ] }, "put": { - "description": "Update a space", "operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1", "parameters": [ { @@ -42040,29 +42105,36 @@ "type": "boolean" }, "color": { + "description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.", "type": "string" }, "description": { + "description": "A description for the space.", "type": "string" }, "disabledFeatures": { "default": [], "items": { + "description": "The list of features that are turned off in the space.", "type": "string" }, "type": "array" }, "id": { + "description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.", "type": "string" }, "imageUrl": { + "description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.", "type": "string" }, "initials": { + "description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.", "maxLength": 2, "type": "string" }, "name": { + "description": "The display name for the space. ", "minLength": 1, "type": "string" }, @@ -42085,8 +42157,12 @@ } } }, - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Update a space", "tags": [ "spaces" ] diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index f548497693088..16d5b2fce3db3 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -40673,7 +40673,6 @@ }, "/api/spaces/space": { "get": { - "description": "Get all spaces", "operationId": "%2Fapi%2Fspaces%2Fspace#0", "parameters": [ { @@ -40689,6 +40688,7 @@ } }, { + "description": "Specifies which authorization checks are applied to the API call. The default value is `any`.", "in": "query", "name": "purpose", "required": false, @@ -40702,6 +40702,7 @@ } }, { + "description": "When enabled, the API returns any spaces that the user is authorized to access in any capacity and each space will contain the purposes for which the user is authorized. This can be useful to determine which spaces a user can read but not take a specific action in. If the security plugin is not enabled, this parameter has no effect, since no authorization checks take place. This parameter cannot be used in with the `purpose` parameter.", "in": "query", "name": "include_authorized_purposes", "required": true, @@ -40741,14 +40742,17 @@ } } ], - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get all spaces", "tags": [ "spaces" ] }, "post": { - "description": "Create a space", "operationId": "%2Fapi%2Fspaces%2Fspace#1", "parameters": [ { @@ -40784,29 +40788,36 @@ "type": "boolean" }, "color": { + "description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.", "type": "string" }, "description": { + "description": "A description for the space.", "type": "string" }, "disabledFeatures": { "default": [], "items": { + "description": "The list of features that are turned off in the space.", "type": "string" }, "type": "array" }, "id": { + "description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.", "type": "string" }, "imageUrl": { + "description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.", "type": "string" }, "initials": { + "description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.", "maxLength": 2, "type": "string" }, "name": { + "description": "The display name for the space. ", "minLength": 1, "type": "string" } @@ -40820,8 +40831,12 @@ } } }, - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Create a space", "tags": [ "spaces" ] @@ -40829,7 +40844,7 @@ }, "/api/spaces/space/{id}": { "delete": { - "description": "Delete a space", + "description": "When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.", "operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2", "parameters": [ { @@ -40863,14 +40878,17 @@ } } ], - "responses": {}, - "summary": "", + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a space", "tags": [ "spaces" ] }, "get": { - "description": "Get a space", "operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0", "parameters": [ { @@ -40886,6 +40904,7 @@ } }, { + "description": "The space identifier.", "in": "path", "name": "id", "required": true, @@ -40894,14 +40913,17 @@ } } ], - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get a space", "tags": [ "spaces" ] }, "put": { - "description": "Update a space", "operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1", "parameters": [ { @@ -40945,29 +40967,36 @@ "type": "boolean" }, "color": { + "description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.", "type": "string" }, "description": { + "description": "A description for the space.", "type": "string" }, "disabledFeatures": { "default": [], "items": { + "description": "The list of features that are turned off in the space.", "type": "string" }, "type": "array" }, "id": { + "description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.", "type": "string" }, "imageUrl": { + "description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.", "type": "string" }, "initials": { + "description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.", "maxLength": 2, "type": "string" }, "name": { + "description": "The display name for the space. ", "minLength": 1, "type": "string" } @@ -40981,8 +41010,12 @@ } } }, - "responses": {}, - "summary": "", + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Update a space", "tags": [ "spaces" ] diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 8bd9bd198e5e1..4084f34f86d60 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -36264,7 +36264,6 @@ paths: - Prompts API /api/spaces/space: get: - description: Get all spaces operationId: '%2Fapi%2Fspaces%2Fspace#0' parameters: - description: The version of the API to use @@ -36275,7 +36274,10 @@ paths: enum: - '2023-10-31' type: string - - in: query + - description: >- + Specifies which authorization checks are applied to the API call. + The default value is `any`. + in: query name: purpose required: false schema: @@ -36284,7 +36286,15 @@ paths: - copySavedObjectsIntoSpace - shareSavedObjectsIntoSpace type: string - - in: query + - description: >- + When enabled, the API returns any spaces that the user is authorized + to access in any capacity and each space will contain the purposes + for which the user is authorized. This can be useful to determine + which spaces a user can read but not take a specific action in. If + the security plugin is not enabled, this parameter has no effect, + since no authorization checks take place. This parameter cannot be + used in with the `purpose` parameter. + in: query name: include_authorized_purposes required: true schema: @@ -36303,12 +36313,13 @@ paths: x-oas-optional: true - type: boolean x-oas-optional: true - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get all spaces tags: - spaces post: - description: Create a space operationId: '%2Fapi%2Fspaces%2Fspace#1' parameters: - description: The version of the API to use @@ -36336,34 +36347,61 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Create a space tags: - spaces /api/spaces/space/{id}: delete: - description: Delete a space + description: >- + When you delete a space, all saved objects that belong to the space are + automatically deleted, which is permanent and cannot be undone. operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2' parameters: - description: The version of the API to use @@ -36386,12 +36424,13 @@ paths: required: true schema: type: string - responses: {} - summary: '' + responses: + '204': + description: Indicates a successful call. + summary: Delete a space tags: - spaces get: - description: Get a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0' parameters: - description: The version of the API to use @@ -36402,17 +36441,19 @@ paths: enum: - '2023-10-31' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: type: string - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get a space tags: - spaces put: - description: Update a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1' parameters: - description: The version of the API to use @@ -36445,29 +36486,54 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Update a space tags: - spaces /api/status: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index aba85f8c82ca9..3cbcfb2764963 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -40786,7 +40786,13 @@ paths: - roles /api/spaces/_copy_saved_objects: post: - description: Copy saved objects to spaces + description: >- + It also allows you to automatically copy related objects, so when you + copy a dashboard, this can automatically copy over the associated + visualizations, data views, and saved searches, as required. You can + request to overwrite any objects that already exist in the target space + if they share an identifier or you can use the resolve copy saved + objects conflicts API to do this on a per-object basis. operationId: '%2Fapi%2Fspaces%2F_copy_saved_objects#0' parameters: - description: The version of the API to use @@ -40813,12 +40819,26 @@ paths: properties: compatibilityMode: default: false + description: >- + Apply various adjustments to the saved objects that are + being copied to maintain compatibility between different + Kibana versions. Use this option only if you encounter + issues with copied saved objects. This option cannot be used + with the `createNewCopies` option. type: boolean createNewCopies: default: true + description: >- + Create new copies of saved objects, regenerate each object + identifier, and reset the origin. When used, potential + conflict errors are avoided. This option cannot be used + with the `overwrite` and `compatibilityMode` options. type: boolean includeReferences: default: false + description: >- + When set to true, all saved objects related to the specified + saved objects will also be copied into the target spaces. type: boolean objects: items: @@ -40826,8 +40846,10 @@ paths: type: object properties: id: + description: The identifier of the saved object to copy. type: string type: + description: The type of the saved object to copy. type: string required: - type @@ -40835,20 +40857,31 @@ paths: type: array overwrite: default: false + description: >- + When set to true, all conflicts are automatically + overridden. When a saved object with a matching type and + identifier exists in the target space, that version is + replaced with the version from the source space. This option + cannot be used with the `createNewCopies` option. type: boolean spaces: items: + description: >- + The identifiers of the spaces where you want to copy the + specified objects. type: string type: array required: - spaces - objects - responses: {} - summary: '' - tags: [] + responses: + '200': + description: Indicates a successful call. + summary: Copy saved objects to spaces + tags: + - spaces /api/spaces/_disable_legacy_url_aliases: post: - description: Disable legacy URL aliases operationId: '%2Fapi%2Fspaces%2F_disable_legacy_url_aliases#0' parameters: - description: The version of the API to use @@ -40891,12 +40924,15 @@ paths: type: array required: - aliases - responses: {} - summary: '' - tags: [] + responses: + '204': + description: Indicates a successful call. + summary: Disable legacy URL aliases + tags: + - spaces /api/spaces/_get_shareable_references: post: - description: Get shareable references + description: Collect references and space contexts for saved objects. operationId: '%2Fapi%2Fspaces%2F_get_shareable_references#0' parameters: - description: The version of the API to use @@ -40936,12 +40972,17 @@ paths: type: array required: - objects - responses: {} - summary: '' - tags: [] + responses: + '200': + description: Indicates a successful call. + summary: Get shareable references + tags: + - spaces /api/spaces/_resolve_copy_saved_objects_errors: post: - description: Resolve conflicts copying saved objects + description: >- + Overwrite saved objects that are returned as errors from the copy saved + objects to space API. operationId: '%2Fapi%2Fspaces%2F_resolve_copy_saved_objects_errors#0' parameters: - description: The version of the API to use @@ -40997,15 +41038,28 @@ paths: createNewCopy: type: boolean destinationId: + description: >- + Specifies the destination identifier that the copied + object should have, if different from the current + identifier. type: string id: + description: The saved object identifier. type: string ignoreMissingReferences: + description: >- + When set to true, any missing references errors are + ignored. type: boolean overwrite: default: false + description: >- + When set to true, the saved object from the source + space overwrites the conflicting object in the + destination space. type: boolean type: + description: The saved object type. type: string required: - type @@ -41015,12 +41069,14 @@ paths: required: - retries - objects - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Resolve conflicts copying saved objects tags: [] /api/spaces/_update_objects_spaces: post: - description: Update saved objects in spaces + description: Update one or more saved objects to add or remove them from some spaces. operationId: '%2Fapi%2Fspaces%2F_update_objects_spaces#0' parameters: - description: The version of the API to use @@ -41051,8 +41107,10 @@ paths: type: object properties: id: + description: The identifier of the saved object to update. type: string type: + description: The type of the saved object to update. type: string required: - type @@ -41060,22 +41118,30 @@ paths: type: array spacesToAdd: items: + description: >- + The identifiers of the spaces the saved objects should be + added to or removed from. type: string type: array spacesToRemove: items: + description: >- + The identifiers of the spaces the saved objects should be + added to or removed from. type: string type: array required: - objects - spacesToAdd - spacesToRemove - responses: {} - summary: '' - tags: [] + responses: + '200': + description: Indicates a successful call. + summary: Update saved objects in spaces + tags: + - spaces /api/spaces/space: get: - description: Get all spaces operationId: '%2Fapi%2Fspaces%2Fspace#0' parameters: - description: The version of the API to use @@ -41086,7 +41152,10 @@ paths: enum: - '2023-10-31' type: string - - in: query + - description: >- + Specifies which authorization checks are applied to the API call. + The default value is `any`. + in: query name: purpose required: false schema: @@ -41095,7 +41164,15 @@ paths: - copySavedObjectsIntoSpace - shareSavedObjectsIntoSpace type: string - - in: query + - description: >- + When enabled, the API returns any spaces that the user is authorized + to access in any capacity and each space will contain the purposes + for which the user is authorized. This can be useful to determine + which spaces a user can read but not take a specific action in. If + the security plugin is not enabled, this parameter has no effect, + since no authorization checks take place. This parameter cannot be + used in with the `purpose` parameter. + in: query name: include_authorized_purposes required: true schema: @@ -41114,12 +41191,13 @@ paths: x-oas-optional: true - type: boolean x-oas-optional: true - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get all spaces tags: - spaces post: - description: Create a space operationId: '%2Fapi%2Fspaces%2Fspace#1' parameters: - description: The version of the API to use @@ -41147,22 +41225,45 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string solution: @@ -41175,13 +41276,17 @@ paths: required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Create a space tags: - spaces /api/spaces/space/{id}: delete: - description: Delete a space + description: >- + When you delete a space, all saved objects that belong to the space are + automatically deleted, which is permanent and cannot be undone. operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2' parameters: - description: The version of the API to use @@ -41204,12 +41309,13 @@ paths: required: true schema: type: string - responses: {} - summary: '' + responses: + '204': + description: Indicates a successful call. + summary: Delete a space tags: - spaces get: - description: Get a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0' parameters: - description: The version of the API to use @@ -41220,17 +41326,19 @@ paths: enum: - '2023-10-31' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: type: string - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get a space tags: - spaces put: - description: Update a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1' parameters: - description: The version of the API to use @@ -41263,22 +41371,45 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string solution: @@ -41291,8 +41422,10 @@ paths: required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Update a space tags: - spaces /api/status: From 9eb921fd1b57ddc5b30f2cbc209f9deb7830a66f Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 8 Oct 2024 16:55:39 -0700 Subject: [PATCH 08/28] Add examples for space APIs --- .../examples/copy_saved_objects_request1.yaml | 11 +++ .../examples/copy_saved_objects_request2.yaml | 12 +++ .../copy_saved_objects_response1.yaml | 28 +++++++ .../copy_saved_objects_response2.yaml | 24 ++++++ .../copy_saved_objects_response3.yaml | 72 +++++++++++++++++ .../copy_saved_objects_response4.yaml | 33 ++++++++ .../examples/disable_legacy_url_request1.yaml | 9 +++ oas_docs/examples/get_spaces_response1.yaml | 24 ++++++ oas_docs/examples/get_spaces_response2.yaml | 41 ++++++++++ .../resolve_copy_saved_objects_request1.yaml | 26 +++++++ .../resolve_copy_saved_objects_request2.yaml | 20 +++++ .../resolve_copy_saved_objects_response1.yaml | 31 ++++++++ .../resolve_copy_saved_objects_response2.yaml | 24 ++++++ .../update_saved_objects_spaces_request1.yaml | 9 +++ ...update_saved_objects_spaces_response1.yaml | 10 +++ oas_docs/overlays/kibana.overlays.shared.yaml | 22 ++++++ oas_docs/overlays/kibana.overlays.yaml | 78 ++++++++++++++++++- 17 files changed, 470 insertions(+), 4 deletions(-) create mode 100644 oas_docs/examples/copy_saved_objects_request1.yaml create mode 100644 oas_docs/examples/copy_saved_objects_request2.yaml create mode 100644 oas_docs/examples/copy_saved_objects_response1.yaml create mode 100644 oas_docs/examples/copy_saved_objects_response2.yaml create mode 100644 oas_docs/examples/copy_saved_objects_response3.yaml create mode 100644 oas_docs/examples/copy_saved_objects_response4.yaml create mode 100644 oas_docs/examples/disable_legacy_url_request1.yaml create mode 100644 oas_docs/examples/get_spaces_response1.yaml create mode 100644 oas_docs/examples/get_spaces_response2.yaml create mode 100644 oas_docs/examples/resolve_copy_saved_objects_request1.yaml create mode 100644 oas_docs/examples/resolve_copy_saved_objects_request2.yaml create mode 100644 oas_docs/examples/resolve_copy_saved_objects_response1.yaml create mode 100644 oas_docs/examples/resolve_copy_saved_objects_response2.yaml create mode 100644 oas_docs/examples/update_saved_objects_spaces_request1.yaml create mode 100644 oas_docs/examples/update_saved_objects_spaces_response1.yaml diff --git a/oas_docs/examples/copy_saved_objects_request1.yaml b/oas_docs/examples/copy_saved_objects_request1.yaml new file mode 100644 index 0000000000000..00aac45b02b9b --- /dev/null +++ b/oas_docs/examples/copy_saved_objects_request1.yaml @@ -0,0 +1,11 @@ +summary: Copy with createNewCopies +description: > + Copy a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + In this example, the dashboard has a reference to a visualization and that has a reference to a data view. +value: + objects: + - type: dashboard + id: my-dashboard + spaces: + - marketing + includeReferences: true \ No newline at end of file diff --git a/oas_docs/examples/copy_saved_objects_request2.yaml b/oas_docs/examples/copy_saved_objects_request2.yaml new file mode 100644 index 0000000000000..82fc80727d7d4 --- /dev/null +++ b/oas_docs/examples/copy_saved_objects_request2.yaml @@ -0,0 +1,12 @@ +summary: Copy without createNewCopies +description: > + Copy a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + In this example, the dashboard has a reference to a visualization and that has a reference to a data view. +value: + objects: + - type: dashboard + id: my-dashboard + spaces: + - marketing + includeReferences: true + createNewCopies: false \ No newline at end of file diff --git a/oas_docs/examples/copy_saved_objects_response1.yaml b/oas_docs/examples/copy_saved_objects_response1.yaml new file mode 100644 index 0000000000000..2966b0805a884 --- /dev/null +++ b/oas_docs/examples/copy_saved_objects_response1.yaml @@ -0,0 +1,28 @@ +summary: Copy with createNewCopies +description: > + The response for successfully copying a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + The result indicates a successful copy and all three objects are created. + Since these objects were created as new copies, each entry in the successResults array includes a destinationId attribute. +value: + marketing: + success: true + successCount: 3 + successResults: + - id: my-dashboard + type: dashboard + destinationId: "1e127098-5b80-417f-b0f1-c60c8395358f" + meta: + icon: dashboardApp + title: Look at my dashboard + - id: my-vis + type: visualization + destinationId: "a610ed80-1c73-4507-9e13-d3af736c8e04" + meta: + icon: visualizeApp + title: Look at my visualization + - id: my-index-pattern + type: index-pattern + destinationId: "bc3c9c70-bf6f-4bec-b4ce-f4189aa9e26b" + meta: + icon: indexPatternApp + title: my-pattern-* diff --git a/oas_docs/examples/copy_saved_objects_response2.yaml b/oas_docs/examples/copy_saved_objects_response2.yaml new file mode 100644 index 0000000000000..e96be0c116063 --- /dev/null +++ b/oas_docs/examples/copy_saved_objects_response2.yaml @@ -0,0 +1,24 @@ +summary: Copy without createNewCopies +description: > + The response for successfully copying a dashboard with the `my-dashboard` ID with `createNewCopies` turned off. + The result indicates a successful copy and all three objects are created. +value: + marketing: + success: true + successCount: 3 + successResults: + - id: my-dashboard + type: dashboard + meta: + icon: dashboardApp + title: Look at my dashboard + - id: my-vis + type: visualization + meta: + icon: visualizeApp + title: Look at my visualization + - id: my-index-pattern + type: index-pattern + meta: + icon: indexPatternApp + title: my-pattern-* diff --git a/oas_docs/examples/copy_saved_objects_response3.yaml b/oas_docs/examples/copy_saved_objects_response3.yaml new file mode 100644 index 0000000000000..59306f97cdecd --- /dev/null +++ b/oas_docs/examples/copy_saved_objects_response3.yaml @@ -0,0 +1,72 @@ +summary: Failed copy with conflict errors +description: > + A response for a failed copy of a dashboard with the my-dashboard ID including all references from the default space to the marketing and sales spaces. In this example, the dashboard has a reference to a visualization and a Canvas workpad and the visualization has a reference to an index pattern. + The result indicates a successful copy for the marketing space and an unsuccessful copy for the sales space because the data view, visualization, and Canvas workpad each resulted in a conflict error. + Objects are created when the error is resolved using the resolve copy conflicts API. +value: + marketing: + success: true + successCount: 4 + successResults: + - id: my-dashboard + type: dashboard + meta: + icon: dashboardApp + title: Look at my dashboard + - id: my-vis + type: visualization + meta: + icon: visualizeApp + title: Look at my visualization + - id: my-canvas + type: canvas-workpad + meta: + icon: canvasApp + title: Look at my canvas + - id: my-index-pattern + type: index-pattern + meta: + icon: indexPatternApp + title: my-pattern-* + sales: + success: false + successCount: 1, + errors: + - id: my-pattern + type: index-pattern + title: my-pattern-* + error: + type: conflict + meta: + icon: indexPatternApp + title: my-pattern-* + - id: my-visualization + type: my-vis + title: Look at my visualization + error: + type: conflict + destinationId: another-vis + meta: + icon: visualizeApp + title: Look at my visualization + - id: my-canvas + type: canvas-workpad + title: Look at my canvas + error: + type: ambiguous_conflict + destinations: + - id: another-canvas + title: Look at another canvas + updatedAt: "2020-07-08T16:36:32.377Z" + - id: yet-another-canvas + title: Look at yet another canvas + updatedAt: "2020-07-05T12:29:54.849Z" + meta: + icon: canvasApp + title: Look at my canvas + successResults": + - id: my-dashboard + type: dashboard + meta: + icon: dashboardApp + title: Look at my dashboard \ No newline at end of file diff --git a/oas_docs/examples/copy_saved_objects_response4.yaml b/oas_docs/examples/copy_saved_objects_response4.yaml new file mode 100644 index 0000000000000..ad6a4a489f41a --- /dev/null +++ b/oas_docs/examples/copy_saved_objects_response4.yaml @@ -0,0 +1,33 @@ +summary: Failed copy with missing reference errors +description: > + The response for successfully copying a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + In this example, the dashboard has a reference to a visualization and a Canvas workpad and the visualization has a reference to a data view. + The result indicates an unsuccessful copy because the visualization resulted in a missing references error. + Objects are created when the errors are resolved using the resolve copy conflicts API. +value: + marketing: + success: false + successCount: 2 + errors: + - id: my-vis + type: visualization + title: Look at my visualization + error: + type: missing_references + references: + - type: index-pattern + id: my-pattern-* + meta: + icon: visualizeApp + title: Look at my visualization + successResults: + - id: my-dashboard + type: dashboard + meta: + icon: dashboardApp + title: Look at my dashboard + - id: my-canvas + type: canvas-workpad + meta: + icon: canvasApp + title: Look at my canvas diff --git a/oas_docs/examples/disable_legacy_url_request1.yaml b/oas_docs/examples/disable_legacy_url_request1.yaml new file mode 100644 index 0000000000000..a85a14d4e1c16 --- /dev/null +++ b/oas_docs/examples/disable_legacy_url_request1.yaml @@ -0,0 +1,9 @@ +summary: Disable legacy URL aliases +description: > + This request leaves the alias intact but the legacy URL for this alias (http://localhost:5601/s/bills-space/app/dashboards#/view/123) will no longer function. + The dashboard still exists and you can access it with the new URL. +value: + aliases: + - targetSpace: bills-space + targetType: dashboard + sourceId: 123 \ No newline at end of file diff --git a/oas_docs/examples/get_spaces_response1.yaml b/oas_docs/examples/get_spaces_response1.yaml new file mode 100644 index 0000000000000..88e938821a378 --- /dev/null +++ b/oas_docs/examples/get_spaces_response1.yaml @@ -0,0 +1,24 @@ +summary: Get all spaces +description: Get all spaces without specifying any options. +value: + - id: default + name: Default + description: This is the Default Space + disabledFeatures: [] + imageUrl: "" + _reserved: true + - id: marketing + name: Marketing + description: This is the Marketing Space + color: #aabbcc + disabledFeatures: + - apm + initials: MK + imageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSU" + - id: sales + name: Sales + initials: MK + disabledFeatures: + - discover + imageUr": "" + solution: oblt \ No newline at end of file diff --git a/oas_docs/examples/get_spaces_response2.yaml b/oas_docs/examples/get_spaces_response2.yaml new file mode 100644 index 0000000000000..4f27e2db1f6a4 --- /dev/null +++ b/oas_docs/examples/get_spaces_response2.yaml @@ -0,0 +1,41 @@ +summary: Get all spaces with custom options +description: > + The user has read-only access to the Sales space. + Get all spaces with the following query parameters: + `purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true` +value: + - id: default + name: Default + description: This is the Default Space + disabledFeatures: [] + imageUrl: "" + _reserved: true + authorizedPurposes: + any: true + copySavedObjectsIntoSpace: true + findSavedObjects: true + shareSavedObjectsIntoSpace: true + - id: marketing + name: Marketing + description: This is the Marketing Space + color: #aabbcc + disabledFeatures: + - apm + initials: MK + imageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSU" + authorizedPurposes: + any: true + copySavedObjectsIntoSpace: true + findSavedObjects: true + shareSavedObjectsIntoSpace: true + - id: sales + name: Sales + initials: MK + disabledFeatures: + - discover + imageUrl: "" + authorizedPurposes: + any: true + copySavedObjectsIntoSpace: false + findSavedObjects: true + shareSavedObjectsIntoSpace: false \ No newline at end of file diff --git a/oas_docs/examples/resolve_copy_saved_objects_request1.yaml b/oas_docs/examples/resolve_copy_saved_objects_request1.yaml new file mode 100644 index 0000000000000..11cee7931e38c --- /dev/null +++ b/oas_docs/examples/resolve_copy_saved_objects_request1.yaml @@ -0,0 +1,26 @@ +summary: Resolve conflict errors +description: > + Resolve conflict errors for a data view, visualization, and Canvas workpad by overwriting the existing saved objects. + NOTE: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that were returned in the successResults array. + In this example, we retried copying the dashboard accordingly. +value: + objects: + - type: dashboard + id: my-dashboard + includeReferences: true + createNewCopies: false + retries: + sales: + - type: index-pattern + id: my-pattern + overwrite: true + - type: visualization + id: my-vis + overwrite: true, + destinationId: another-vis + - type: canvas + id: my-canvas + overwrite: true + destinationId: yet-another-canvas + - type: dashboard + id: my-dashboard \ No newline at end of file diff --git a/oas_docs/examples/resolve_copy_saved_objects_request2.yaml b/oas_docs/examples/resolve_copy_saved_objects_request2.yaml new file mode 100644 index 0000000000000..e8438b77fc1a5 --- /dev/null +++ b/oas_docs/examples/resolve_copy_saved_objects_request2.yaml @@ -0,0 +1,20 @@ +summary: Resolve missing reference errors +description: > + Resolve missing reference errors for a visualization by ignoring the error. + NOTE: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that were returned in the successResults array. + In this example, we retried copying the dashboard and canvas accordingly. +value: + objects: + - type: dashboard + id: my-dashboard + includeReferences: true + createNewCopies: false + retries: + marketing: + - type: visualization + id: my-vis + ignoreMissingReferences: true + - type: canvas + id: my-canvas + - type: dashboard + id: my-dashboard diff --git a/oas_docs/examples/resolve_copy_saved_objects_response1.yaml b/oas_docs/examples/resolve_copy_saved_objects_response1.yaml new file mode 100644 index 0000000000000..fee42792f05a0 --- /dev/null +++ b/oas_docs/examples/resolve_copy_saved_objects_response1.yaml @@ -0,0 +1,31 @@ +summary: Resolve conflict errors +description: > + The response for resolving conflict errors for a data view, visualization, and Canvas workpad by overwriting the existing saved objects. + The result indicates a successful copy and all four objects are created. +value: + sales: + success: true + successCount: 4 + successResults: + - id: my-pattern + type: index-pattern + meta: + icon: indexPatternApp + title: my-pattern-* + - id: my-vis + type: visualization + destinationId: another-vis + meta: + icon: visualizeApp + title: Look at my visualization + - id: my-canvas + type: canvas-workpad + destinationId: yet-another-canvas + meta: + icon: canvasApp + title: Look at my canvas + - id: my-dashboard + type: dashboard + meta: + icon: dashboardApp + title: Look at my dashboard diff --git a/oas_docs/examples/resolve_copy_saved_objects_response2.yaml b/oas_docs/examples/resolve_copy_saved_objects_response2.yaml new file mode 100644 index 0000000000000..0ea8f58ce405d --- /dev/null +++ b/oas_docs/examples/resolve_copy_saved_objects_response2.yaml @@ -0,0 +1,24 @@ +summary: Resolve conflict errors +description: > + The response for resolving missing reference errors for a visualization. + The result indicates a successful copy and all three objects are created. +value: + marketing: + success: true + successCount: 3 + successResults: + - id: my-vis + type: visualization + meta: + icon: visualizeApp + title: Look at my visualization + - id: my-canvas + type: canvas-workpad + meta: + icon: canvasApp + title: Look at my canvas + - id: my-dashboard + type: dashboard + meta: + icon: dashboardApp + title: Look at my dashboard diff --git a/oas_docs/examples/update_saved_objects_spaces_request1.yaml b/oas_docs/examples/update_saved_objects_spaces_request1.yaml new file mode 100644 index 0000000000000..0f341e6c3ace4 --- /dev/null +++ b/oas_docs/examples/update_saved_objects_spaces_request1.yaml @@ -0,0 +1,9 @@ +summary: Update saved object spaces +description: Update the spaces of each saved object and all its references. +value: + objects: + - type: index-pattern + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + spacesToAdd: + - test + spacesToRemove: [] \ No newline at end of file diff --git a/oas_docs/examples/update_saved_objects_spaces_response1.yaml b/oas_docs/examples/update_saved_objects_spaces_response1.yaml new file mode 100644 index 0000000000000..1f1c1d47c8b06 --- /dev/null +++ b/oas_docs/examples/update_saved_objects_spaces_response1.yaml @@ -0,0 +1,10 @@ +summary: Update saved object spaces +description: > + The response from updating the spaces of saved objects. +value: + objects: + - type: index-pattern + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + spaces: + - default + - test \ No newline at end of file diff --git a/oas_docs/overlays/kibana.overlays.shared.yaml b/oas_docs/overlays/kibana.overlays.shared.yaml index ad262a2d14de4..5f16b6dfa6719 100644 --- a/oas_docs/overlays/kibana.overlays.shared.yaml +++ b/oas_docs/overlays/kibana.overlays.shared.yaml @@ -23,3 +23,25 @@ actions: examples: updateSpaceRequest: $ref: "../examples/update_space_request.yaml" + - target: "$.paths['/api/spaces/space/{id}']['get']" + description: "Add example to get space API" + update: + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + getSpaceResponseExample: + $ref: "../examples/get_space_response.yaml" + - target: "$.paths['/api/spaces/space']['get']" + description: "Add example to get all spaces API" + update: + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + getSpacesResponseExample1: + $ref: "../examples/get_spaces_response1.yaml" + getSpacesResponseExample2: + $ref: "../examples/get_spaces_response2.yaml" diff --git a/oas_docs/overlays/kibana.overlays.yaml b/oas_docs/overlays/kibana.overlays.yaml index c4747d7d13a0a..4a21c029ef80a 100644 --- a/oas_docs/overlays/kibana.overlays.yaml +++ b/oas_docs/overlays/kibana.overlays.yaml @@ -4,7 +4,7 @@ info: title: Overlays for the Kibana API document version: 0.0.1 actions: - # Add an introduction to spaces +# Add an introduction to spaces - target: '$' description: Add an extra page about spaces update: @@ -24,7 +24,7 @@ actions: If you use the Kibana console to send API requests, it automatically adds the appropriate space identifier. To learn more, check out [Spaces](https://www.elastic.co/guide/en/kibana/master/xpack-spaces.html). - # Add some tag descriptions and displayNames +# Add some tag descriptions and displayNames - target: '$.tags[?(@.name=="alerting")]' description: Change tag description and displayName update: @@ -91,7 +91,77 @@ actions: x-displayName: "System" description: > Get information about the system status, resource usage, and installed plugins. - # Remove extra tags from operations +# Remove extra tags from operations - target: "$.paths[*][*].tags[1:]" description: Remove all but first tag from operations - remove: true \ No newline at end of file + remove: true +# Examples that are not applicable to serverless + - target: "$.paths['/api/spaces/_copy_saved_objects']['post']" + description: "Add example to copy saved objects to space API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + copySavedObjectsRequestExample1: + $ref: "../examples/copy_saved_objects_request1.yaml" + copySavedObjectsRequestExample2: + $ref: "../examples/copy_saved_objects_request2.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + copySavedObjectsResponseExample1: + $ref: "../examples/copy_saved_objects_response1.yaml" + copySavedObjectsResponseExample2: + $ref: "../examples/copy_saved_objects_response2.yaml" + copySavedObjectsResponseExample3: + $ref: "../examples/copy_saved_objects_response3.yaml" + copySavedObjectsResponseExample4: + $ref: "../examples/copy_saved_objects_response4.yaml" + - target: "$.paths['/api/spaces/_resolve_copy_saved_objects_errors']['post']" + description: "Add example to resolve copy saved objects to space conflicts API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + resolveCopySavedObjectsRequestExample1: + $ref: "../examples/resolve_copy_saved_objects_request1.yaml" + resolveCopySavedObjectsRequestExample2: + $ref: "../examples/resolve_copy_saved_objects_request2.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + resolveCopySavedObjectsResponseExample1: + $ref: "../examples/copy_saved_objects_response1.yaml" + resolveCopySavedObjectsResponseExample2: + $ref: "../examples/copy_saved_objects_response2.yaml" + - target: "$.paths['/api/spaces/_disable_legacy_url_aliases']['post']" + description: "Add example to disable legacy URL aliases API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + disableLegacyURLRequestExample1: + $ref: "../examples/disable_legacy_url_request1.yaml" + - target: "$.paths['/api/spaces/_update_objects_spaces']['post']" + description: "Add example to update saved object spaces API" + update: + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateObjectSpacesRequestExample1: + $ref: "../examples/update_saved_objects_spaces_request1.yaml" + responses: + 200: + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + updateObjectSpacesResponseExample1: + $ref: "../examples/update_saved_objects_spaces_response1.yaml" \ No newline at end of file From 21cf8a0af4b16bbc6717e5a2481ea99b94ac89b5 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 8 Oct 2024 17:04:19 -0700 Subject: [PATCH 09/28] Add more missing descriptions --- oas_docs/bundle.json | 5 +++++ oas_docs/bundle.serverless.json | 2 ++ oas_docs/output/kibana.serverless.yaml | 6 ++++-- oas_docs/output/kibana.yaml | 11 +++++++++-- .../spaces/server/routes/api/external/delete.ts | 4 +++- .../api/external/disable_legacy_url_aliases.ts | 15 ++++++++++++--- .../spaces/server/routes/api/external/put.ts | 2 +- 7 files changed, 36 insertions(+), 9 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index dd7c8ee7409d7..a198947d2625b 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -41474,12 +41474,15 @@ "additionalProperties": false, "properties": { "sourceId": { + "description": "The alias source object identifier. This is the legacy object identifier.", "type": "string" }, "targetSpace": { + "description": "The space where the alias target object exists.", "type": "string" }, "targetType": { + "description": "The type of alias target object. ", "type": "string" } }, @@ -42008,6 +42011,7 @@ } }, { + "description": "The space identifier.", "in": "path", "name": "id", "required": true, @@ -42087,6 +42091,7 @@ } }, { + "description": "The space identifier.", "in": "path", "name": "id", "required": true, diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index 16d5b2fce3db3..2f3812ebcccd2 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -40870,6 +40870,7 @@ } }, { + "description": "The space identifier.", "in": "path", "name": "id", "required": true, @@ -40949,6 +40950,7 @@ } }, { + "description": "The space identifier.", "in": "path", "name": "id", "required": true, diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 4084f34f86d60..0e9ea637ccb30 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -36419,7 +36419,8 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: @@ -36471,7 +36472,8 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 3cbcfb2764963..bc9bc517c3869 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -40912,10 +40912,15 @@ paths: type: object properties: sourceId: + description: >- + The alias source object identifier. This is the legacy + object identifier. type: string targetSpace: + description: The space where the alias target object exists. type: string targetType: + description: 'The type of alias target object. ' type: string required: - targetSpace @@ -41304,7 +41309,8 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: @@ -41356,7 +41362,8 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: diff --git a/x-pack/plugins/spaces/server/routes/api/external/delete.ts b/x-pack/plugins/spaces/server/routes/api/external/delete.ts index 5562083f38aa3..f575b74265e3e 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/delete.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/delete.ts @@ -34,7 +34,9 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) { validate: { request: { params: schema.object({ - id: schema.string(), + id: schema.string({ + meta: { description: 'The space identifier.' }, + }), }), }, response: { diff --git a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts index d94cd2d88e206..1c38111082e73 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts @@ -28,9 +28,18 @@ export function initDisableLegacyUrlAliasesApi(deps: ExternalRouteDeps) { body: schema.object({ aliases: schema.arrayOf( schema.object({ - targetSpace: schema.string(), - targetType: schema.string(), - sourceId: schema.string(), + targetSpace: schema.string({ + meta: { description: 'The space where the alias target object exists.' }, + }), + targetType: schema.string({ + meta: { description: 'The type of alias target object. ' }, + }), + sourceId: schema.string({ + meta: { + description: + 'The alias source object identifier. This is the legacy object identifier.', + }, + }), }) ), }), diff --git a/x-pack/plugins/spaces/server/routes/api/external/put.ts b/x-pack/plugins/spaces/server/routes/api/external/put.ts index 4ce32152f30f4..54bbd443ce981 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/put.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/put.ts @@ -32,7 +32,7 @@ export function initPutSpacesApi(deps: ExternalRouteDeps) { validate: { request: { params: schema.object({ - id: schema.string(), + id: schema.string({ meta: { description: 'The space identifier.' } }), }), body: getSpaceSchema(isServerless), }, From a5050bce20c3ee63e5f9bd74ad6d49a000b53327 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 8 Oct 2024 17:07:33 -0700 Subject: [PATCH 10/28] Edit markdown in example descriptions --- oas_docs/examples/copy_saved_objects_request1.yaml | 2 +- oas_docs/examples/copy_saved_objects_request2.yaml | 2 +- oas_docs/examples/copy_saved_objects_response1.yaml | 2 +- oas_docs/examples/copy_saved_objects_response2.yaml | 2 +- oas_docs/examples/copy_saved_objects_response4.yaml | 2 +- oas_docs/examples/get_spaces_response2.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/oas_docs/examples/copy_saved_objects_request1.yaml b/oas_docs/examples/copy_saved_objects_request1.yaml index 00aac45b02b9b..4ddb9cc39da22 100644 --- a/oas_docs/examples/copy_saved_objects_request1.yaml +++ b/oas_docs/examples/copy_saved_objects_request1.yaml @@ -1,6 +1,6 @@ summary: Copy with createNewCopies description: > - Copy a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + Copy a dashboard with the my-dashboard ID, including all references from the default space to the marketing space. In this example, the dashboard has a reference to a visualization and that has a reference to a data view. value: objects: diff --git a/oas_docs/examples/copy_saved_objects_request2.yaml b/oas_docs/examples/copy_saved_objects_request2.yaml index 82fc80727d7d4..52ae83b66b95d 100644 --- a/oas_docs/examples/copy_saved_objects_request2.yaml +++ b/oas_docs/examples/copy_saved_objects_request2.yaml @@ -1,6 +1,6 @@ summary: Copy without createNewCopies description: > - Copy a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + Copy a dashboard with the my-dashboard ID, including all references from the default space to the marketing space. In this example, the dashboard has a reference to a visualization and that has a reference to a data view. value: objects: diff --git a/oas_docs/examples/copy_saved_objects_response1.yaml b/oas_docs/examples/copy_saved_objects_response1.yaml index 2966b0805a884..d65fc50c5a317 100644 --- a/oas_docs/examples/copy_saved_objects_response1.yaml +++ b/oas_docs/examples/copy_saved_objects_response1.yaml @@ -1,6 +1,6 @@ summary: Copy with createNewCopies description: > - The response for successfully copying a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + The response for successfully copying a dashboard with the my-dashboard ID, including all references from the default space to the marketing space. The result indicates a successful copy and all three objects are created. Since these objects were created as new copies, each entry in the successResults array includes a destinationId attribute. value: diff --git a/oas_docs/examples/copy_saved_objects_response2.yaml b/oas_docs/examples/copy_saved_objects_response2.yaml index e96be0c116063..1e49191eaeaa1 100644 --- a/oas_docs/examples/copy_saved_objects_response2.yaml +++ b/oas_docs/examples/copy_saved_objects_response2.yaml @@ -1,6 +1,6 @@ summary: Copy without createNewCopies description: > - The response for successfully copying a dashboard with the `my-dashboard` ID with `createNewCopies` turned off. + The response for successfully copying a dashboard with the my-dashboard ID with createNewCopies turned off. The result indicates a successful copy and all three objects are created. value: marketing: diff --git a/oas_docs/examples/copy_saved_objects_response4.yaml b/oas_docs/examples/copy_saved_objects_response4.yaml index ad6a4a489f41a..c9acefafb1d6e 100644 --- a/oas_docs/examples/copy_saved_objects_response4.yaml +++ b/oas_docs/examples/copy_saved_objects_response4.yaml @@ -1,6 +1,6 @@ summary: Failed copy with missing reference errors description: > - The response for successfully copying a dashboard with the `my-dashboard` ID, including all references from the default space to the marketing space. + The response for successfully copying a dashboard with the my-dashboard ID, including all references from the default space to the marketing space. In this example, the dashboard has a reference to a visualization and a Canvas workpad and the visualization has a reference to a data view. The result indicates an unsuccessful copy because the visualization resulted in a missing references error. Objects are created when the errors are resolved using the resolve copy conflicts API. diff --git a/oas_docs/examples/get_spaces_response2.yaml b/oas_docs/examples/get_spaces_response2.yaml index 4f27e2db1f6a4..a95c92676b236 100644 --- a/oas_docs/examples/get_spaces_response2.yaml +++ b/oas_docs/examples/get_spaces_response2.yaml @@ -2,7 +2,7 @@ summary: Get all spaces with custom options description: > The user has read-only access to the Sales space. Get all spaces with the following query parameters: - `purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true` + "purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true" value: - id: default name: Default From d674b8339ce8a8bc7486feb25b28f977a96968ce Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 8 Oct 2024 17:40:12 -0700 Subject: [PATCH 11/28] [DOCS] Remove old API pages --- docs/api/spaces-management.asciidoc | 36 +- .../copy_saved_objects.asciidoc | 491 ------------------ docs/api/spaces-management/delete.asciidoc | 23 - .../disable_legacy_url_aliases.asciidoc | 59 --- docs/api/spaces-management/get.asciidoc | 37 -- docs/api/spaces-management/get_all.asciidoc | 138 ----- .../get_shareable_references.asciidoc | 81 --- docs/api/spaces-management/post.asciidoc | 64 --- docs/api/spaces-management/put.asciidoc | 64 --- ...olve_copy_saved_objects_conflicts.asciidoc | 317 ----------- .../update_objects_spaces.asciidoc | 142 ----- .../managing-saved-objects.asciidoc | 79 ++- docs/redirects.asciidoc | 50 ++ docs/user/management.asciidoc | 2 + 14 files changed, 129 insertions(+), 1454 deletions(-) delete mode 100644 docs/api/spaces-management/copy_saved_objects.asciidoc delete mode 100644 docs/api/spaces-management/delete.asciidoc delete mode 100644 docs/api/spaces-management/disable_legacy_url_aliases.asciidoc delete mode 100644 docs/api/spaces-management/get.asciidoc delete mode 100644 docs/api/spaces-management/get_all.asciidoc delete mode 100644 docs/api/spaces-management/get_shareable_references.asciidoc delete mode 100644 docs/api/spaces-management/post.asciidoc delete mode 100644 docs/api/spaces-management/put.asciidoc delete mode 100644 docs/api/spaces-management/resolve_copy_saved_objects_conflicts.asciidoc delete mode 100644 docs/api/spaces-management/update_objects_spaces.asciidoc diff --git a/docs/api/spaces-management.asciidoc b/docs/api/spaces-management.asciidoc index 91b7ae349b9a8..7390a3815cd65 100644 --- a/docs/api/spaces-management.asciidoc +++ b/docs/api/spaces-management.asciidoc @@ -1,38 +1,4 @@ -[role="xpack"] [[spaces-api]] == {kib} spaces APIs -Manage your {kib} spaces. - -The following {kib} spaces APIs are available: - -* <> to create a {kib} space - -* <> to update an existing {kib} space - -* <> to retrieve a specified {kib} space - -* <> to retrieve all {kib} spaces - -* <> to delete a {kib} space - -* <> to copy saved objects between spaces - -* <> to overwrite saved objects returned as errors from the copy saved objects to space API - -* <> to disable legacy URL aliases if an error is encountered - -* <> to update one or more saved objects to add and/or remove them from specified spaces - -* <> to collect references and spaces context for saved objects - -include::spaces-management/post.asciidoc[] -include::spaces-management/put.asciidoc[] -include::spaces-management/get.asciidoc[] -include::spaces-management/get_all.asciidoc[] -include::spaces-management/delete.asciidoc[] -include::spaces-management/copy_saved_objects.asciidoc[] -include::spaces-management/resolve_copy_saved_objects_conflicts.asciidoc[] -include::spaces-management/disable_legacy_url_aliases.asciidoc[] -include::spaces-management/update_objects_spaces.asciidoc[] -include::spaces-management/get_shareable_references.asciidoc[] +For the latest details, refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. diff --git a/docs/api/spaces-management/copy_saved_objects.asciidoc b/docs/api/spaces-management/copy_saved_objects.asciidoc deleted file mode 100644 index 32f7480a39b87..0000000000000 --- a/docs/api/spaces-management/copy_saved_objects.asciidoc +++ /dev/null @@ -1,491 +0,0 @@ -[role="xpack"] -[[spaces-api-copy-saved-objects]] -=== Copy saved objects to space API -++++ -Copy saved objects to space -++++ - -experimental[] Copy saved objects between spaces. - -It also allows you to automatically copy related objects, so when you copy a `dashboard`, this can automatically copy over the -associated visualizations, {data-sources}, and saved searches, as required. - -You can request to overwrite any objects that already exist in the target space if they share an ID, or you can use the -<> to do this on a per-object basis. - -[[spaces-api-copy-saved-objects-request]] -==== {api-request-title} - -`POST :/api/spaces/_copy_saved_objects` - -`POST :/s//api/spaces/_copy_saved_objects` - -[[spaces-api-copy-saved-objects-path-params]] -==== {api-path-parms-title} - -`space_id`:: - (Optional, string) The ID of the space that contains the saved objects you want to copy. When `space_id` is unspecified in the URL, the - default space is used. - -[role="child_attributes"] -[[spaces-api-copy-saved-objects-request-body]] -==== {api-request-body-title} - -`spaces`:: - (Required, string array) The IDs of the spaces where you want to copy the specified objects. - -`objects`:: - (Required, object array) The saved objects to copy. -+ -.Properties of `objects` -[%collapsible%open] -===== - `type`::: - (Required, string) The saved object type. - - `id`::: - (Required, string) The saved object ID. -===== - -`includeReferences`:: - (Optional, boolean) When set to `true`, all saved objects related to the specified saved objects will also be copied into the target - spaces. The default value is `false`. - -`createNewCopies`:: - (Optional, boolean) Creates new copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict - errors are avoided. The default value is `true`. -+ -NOTE: This option cannot be used with the `overwrite` and `compatibilityMode` options. - -`overwrite`:: - (Optional, boolean) When set to `true`, all conflicts are automatically overridden. When a saved object with a matching `type` and `id` - exists in the target space, that version is replaced with the version from the source space. The default value is `false`. -+ -NOTE: This option cannot be used with the `createNewCopies` option. - -`compatibilityMode`:: - (Optional, boolean) Applies various adjustments to the saved objects that are being copied to maintain compatibility between different {kib} - versions. Use this option only if you encounter issues with copied saved objects. -+ -NOTE: This option cannot be used with the `createNewCopies` option. - -[[spaces-api-copy-saved-objects-response-codes]] -==== Response codes - -`200`:: - Indicates a successful call. - -`404`:: - Indicates that the request failed because one or more of the objects specified could not be found. A list of the unresolved objects are included in the 404 response attributes. - -[role="child_attributes"] -[[spaces-api-copy-saved-objects-response-body]] -==== {api-response-body-title} - -``:: - (object) An object that describes the result of the copy operation for the space. Includes the dynamic keys in the response. -+ -.Properties of `` -[%collapsible%open] -===== - `success`::: - (boolean) The copy operation was successful. When set to `false`, some objects may have been copied. For additional information, refer - to the `errors` and `successResults` properties. - - `successCount`::: - (number) The number of objects that successfully copied. - - `errors`::: - (Optional, array) The errors that occurred during the copy operation. When errors are reported, the `success` flag is set to `false`. -+ -NOTE: One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and a -`conflict` error. -+ -.Properties of `errors` -[%collapsible%open] -====== - `id`:::: - (string) The saved object ID that failed to copy. - `type`:::: - (string) The type of saved object that failed to copy. - `error`:::: - (object) The error that caused the copy operation to fail. -+ -.Properties of `error` -[%collapsible%open] -======= - `type`:::: - (string) The type of error. For example, `conflict`, `ambiguous_conflict`, `missing_references`, `unsupported_type`, or `unknown`. - Errors marked as `conflict` or `ambiguous_conflict` may be resolved by using the <>. - `destinationId`:::: - (Optional, string) The destination ID that was used during the copy attempt. This is only present on `conflict` error types. - `destinations`:::: - (Optional, array) A list of possible object destinations with `id`, `title`, and `updatedAt` fields to describe each one. This is - only present on `ambiguous_conflict` error types. -======= -====== - - `successResults`::: - (Optional, array) Indicates successfully copied objects, with any applicable metadata. -+ -NOTE: Objects are created when all resolvable errors are addressed, including conflict and missing references errors. For more information, -refer to the <>. - -===== -[[spaces-api-copy-saved-objects-example]] -==== {api-examples-title} - -[[spaces-api-copy-saved-objects-example-1]] -===== Successful copy (with `createNewCopies` enabled) - -Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example, -the dashboard has a reference to a visualization, and that has a reference to a {data-source}: - -[source,sh] ----- -$ curl -X POST api/spaces/_copy_saved_objects -{ - "objects": [{ - "type": "dashboard", - "id": "my-dashboard" - }], - "spaces": ["marketing"], - "includeReferences": true -} ----- -// KIBANA - -The API returns the following: - -[source,sh] ----- -{ - "marketing": { - "success": true, - "successCount": 3, - "successResults": [ - { - "id": "my-dashboard", - "type": "dashboard", - "destinationId": "1e127098-5b80-417f-b0f1-c60c8395358f", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - }, - { - "id": "my-vis", - "type": "visualization", - "destinationId": "a610ed80-1c73-4507-9e13-d3af736c8e04", - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-index-pattern", - "type": "index-pattern", - "destinationId": "bc3c9c70-bf6f-4bec-b4ce-f4189aa9e26b", - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - } - ] - } -} ----- - -The result indicates a successful copy, and all three objects are created. Since these objects were created as new copies, each entry in the -`successResults` array includes a `destinationId` attribute. - -[[spaces-api-copy-saved-objects-example-2]] -===== Successful copy (with `createNewCopies` disabled) - -Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example, -the dashboard has a reference to a visualization, and that has a reference to a {data-source}: - -[source,sh] ----- -$ curl -X POST api/spaces/_copy_saved_objects -{ - "objects": [{ - "type": "dashboard", - "id": "my-dashboard" - }], - "spaces": ["marketing"], - "includeReferences": true, - "createNewCopies": false -} ----- -// KIBANA - -The API returns the following: - -[source,sh] ----- -{ - "marketing": { - "success": true, - "successCount": 3, - "successResults": [ - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - }, - { - "id": "my-vis", - "type": "visualization", - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-index-pattern", - "type": "index-pattern", - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - } - ] - } -} ----- - -The result indicates a successful copy, and all three objects are created. - -[[spaces-api-copy-saved-objects-example-3]] -===== Failed copy (with conflict errors) - -Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` and `sales` spaces. In -this example, the dashboard has a reference to a visualization and a *Canvas* workpad, and the visualization has a reference to an index -pattern: - -[source,sh] ----- -$ curl -X POST api/spaces/_copy_saved_objects -{ - "objects": [{ - "type": "dashboard", - "id": "my-dashboard" - }], - "spaces": ["marketing", "sales"], - "includeReferences": true, - "createNewCopies": false -} ----- -// KIBANA - -The API returns the following: - -[source,sh] ----- -{ - "marketing": { - "success": true, - "successCount": 4, - "successResults": [ - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - }, - { - "id": "my-vis", - "type": "visualization", - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-canvas", - "type": "canvas-workpad", - "meta": { - "icon": "canvasApp", - "title": "Look at my canvas" - } - }, - { - "id": "my-index-pattern", - "type": "index-pattern", - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - } - ] - }, - "sales": { - "success": false, - "successCount": 1, - "errors": [ - { - "id": "my-pattern", - "type": "index-pattern", - "title": "my-pattern-*", - "error": { - "type": "conflict" - }, - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - }, - { - "id": "my-visualization", - "type": "my-vis", - "title": "Look at my visualization", - "error": { - "type": "conflict", - "destinationId": "another-vis" - }, - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-canvas", - "type": "canvas-workpad", - "title": "Look at my canvas", - "error": { - "type": "ambiguous_conflict", - "destinations": [ - { - "id": "another-canvas", - "title": "Look at another canvas", - "updatedAt": "2020-07-08T16:36:32.377Z" - }, - { - "id": "yet-another-canvas", - "title": "Look at yet another canvas", - "updatedAt": "2020-07-05T12:29:54.849Z" - } - ] - }, - "meta": { - "icon": "canvasApp", - "title": "Look at my canvas" - } - } - ], - "successResults": [ - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] - } -} ----- - -The result indicates a successful copy for the `marketing` space, and an unsuccessful copy for the `sales` space because the {data-source}, -visualization, and *Canvas* workpad each resulted in a conflict error: - -* A {data-source} with the same ID already exists, which resulted in a conflict error. To resolve the error, overwrite the existing object, -or skip the object. - -* A visualization with a different ID, but the same origin already exists, which resulted in a conflict error. The `destinationId` field -contains the `id` of the other visualization, which caused the conflict. The behavior is added to make sure that new objects that can be -shared between spaces behave in a similar way as legacy non-shareable objects. When a shareable object is copied into a new space, it -retains its origin so that the conflicts are encountered as expected. To resolve, overwrite the specified destination object, or skip the -object. - -* Two *Canvas* workpads with different IDs, but the same origin, already exist, which resulted in a conflict error. The `destinations` array -describes the other workpads which caused the conflict. When a shareable object is copied into a new space, then shared to another space -where an object of the same origin exists, the conflict error occurs. To resolve, pick a destination object to overwrite, or skip the -object. - -Objects are created when the error is resolved using the <>. - -[[spaces-api-copy-saved-objects-example-4]] -===== Failed copy (with missing reference errors) - -Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example, -the dashboard has a reference to a visualization and a *Canvas* workpad, and the visualization has a reference to a {data-source}: - -[source,sh] ----- -$ curl -X POST api/spaces/_copy_saved_objects -{ - "objects": [{ - "type": "dashboard", - "id": "my-dashboard" - }], - "spaces": ["marketing"], - "includeReferences": true, - "createNewCopies": false -} ----- -// KIBANA - -The API returns the following: - -[source,sh] ----- -{ - "marketing": { - "success": false, - "successCount": 2, - "errors": [ - { - "id": "my-vis", - "type": "visualization", - "title": "Look at my visualization", - "error": { - "type": "missing_references", - "references": [ - { - "type": "index-pattern", - "id": "my-pattern-*" - } - ] - }, - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - ] - "successResults": [ - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - }, - { - "id": "my-canvas", - "type": "canvas-workpad", - "meta": { - "icon": "canvasApp", - "title": "Look at my canvas" - } - } - ], - } -} ----- - -The result indicates an unsuccessful copy because the visualization resulted in a missing references error. - -Objects are created when the errors are resolved using the <>. diff --git a/docs/api/spaces-management/delete.asciidoc b/docs/api/spaces-management/delete.asciidoc deleted file mode 100644 index b1b453a0e2d3e..0000000000000 --- a/docs/api/spaces-management/delete.asciidoc +++ /dev/null @@ -1,23 +0,0 @@ -[[spaces-api-delete]] -=== Delete space API -++++ -Delete space -++++ - -experimental[] Delete a {kib} space. - -WARNING: When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone. - -[[spaces-api-delete-request]] -==== Request - -`DELETE :/api/spaces/space/` - -[[spaces-api-delete-errors-codes]] -==== Response codes - -`204`:: - Indicates a successful call. - -`404`:: - Indicates that the request failed. diff --git a/docs/api/spaces-management/disable_legacy_url_aliases.asciidoc b/docs/api/spaces-management/disable_legacy_url_aliases.asciidoc deleted file mode 100644 index 3f713d9d0c25e..0000000000000 --- a/docs/api/spaces-management/disable_legacy_url_aliases.asciidoc +++ /dev/null @@ -1,59 +0,0 @@ -[[spaces-api-disable-legacy-url-aliases]] -=== Disable legacy URL aliases API -++++ -Disable legacy URL aliases -++++ - -experimental[] Disable a <> in {kib}. - -[[spaces-api-disable-legacy-url-aliases-request]] -==== {api-request-title} - -`POST :/api/spaces/_disable_legacy_url_aliases` - -[role="child_attributes"] -[[spaces-api-disable-legacy-url-aliases-request-body]] -==== {api-request-body-title} - -`aliases`:: - (Required, object array) The aliases to disable. -+ -.Properties of `aliases` -[%collapsible%open] -===== - `targetSpace`::: - (Required, string) The space where the alias target object exists. - - `targetType`::: - (Required, string) The type of the alias target object. - - `sourceId`::: - (Required, string) The ID of the alias source object. This is the "legacy" object ID. -===== - -[[spaces-api-disable-legacy-url-aliases-response-codes]] -==== {api-response-codes-title} - -`204`:: - Indicates a successful call. - -[[spaces-api-disable-legacy-url-aliases-example]] -==== {api-examples-title} - -[source,sh] --------------------------------------------------- -$ curl -X POST api/spaces/_disable_legacy_url_aliases -{ - "aliases": [ - { - "targetSpace": "bills-space", - "targetType": "dashboard", - "sourceId": "123" - } - ] -} --------------------------------------------------- -// KIBANA - -This example leaves the alias intact, but the legacy URL for this alias, http://localhost:5601/s/bills-space/app/dashboards#/view/123, will -no longer function. The dashboard still exists, and you can access it with the new URL. \ No newline at end of file diff --git a/docs/api/spaces-management/get.asciidoc b/docs/api/spaces-management/get.asciidoc deleted file mode 100644 index f3e3462b2e0da..0000000000000 --- a/docs/api/spaces-management/get.asciidoc +++ /dev/null @@ -1,37 +0,0 @@ -[[spaces-api-get]] -=== Get a space API -++++ -Get space -++++ - -experimental[] Retrieve a specified {kib} space. - -[[spaces-api-get-request]] -==== Request - -`GET :/api/spaces/space/marketing` - -[[spaces-api-get-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[spaces-api-get-example]] -==== Example - -The API returns the following: - -[source,sh] --------------------------------------------------- -{ - "id": "marketing", - "name": "Marketing", - "description" : "This is the Marketing Space", - "color": "#aabbcc", - "initials": "MK", - "disabledFeatures": [], - "imageUrl": "", - "solution": "es" -} --------------------------------------------------- diff --git a/docs/api/spaces-management/get_all.asciidoc b/docs/api/spaces-management/get_all.asciidoc deleted file mode 100644 index 92a65d670ad87..0000000000000 --- a/docs/api/spaces-management/get_all.asciidoc +++ /dev/null @@ -1,138 +0,0 @@ -[[spaces-api-get-all]] -=== Get all {kib} spaces API -++++ -Get all spaces -++++ - -experimental[] Retrieve all {kib} spaces. - -[[spaces-api-get-all-request]] -==== Request - -`GET :/api/spaces/space` - -[[spaces-api-get-all-query-params]] -==== Query parameters - -`purpose`:: - (Optional, string) Valid options include `any`, `copySavedObjectsIntoSpace`, and `shareSavedObjectsIntoSpace`. This determines what - authorization checks are applied to the API call. If `purpose` is not provided in the URL, the `any` purpose is used. - -`include_authorized_purposes`:: - (Optional, boolean) When enabled, the API will return any spaces that the user is authorized to access in any capacity, and each space - will contain the purpose(s) for which the user is authorized. This can be useful to determine which spaces a user can read but not take a - specific action in. If the Security plugin is not enabled, this will have no effect, as no authorization checks would take place. -+ -NOTE: This option cannot be used in conjunction with `purpose`. - -[[spaces-api-get-all-response-codes]] -==== Response code - -`200`:: - Indicates a successful call. - -[[spaces-api-get-all-example]] -==== Examples - -[[spaces-api-get-all-example-1]] -===== Default options - -Retrieve all spaces without specifying any options: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/spaces/space --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id": "default", - "name": "Default", - "description" : "This is the Default Space", - "disabledFeatures": [], - "imageUrl": "", - "_reserved": true - }, - { - "id": "marketing", - "name": "Marketing", - "description" : "This is the Marketing Space", - "color": "#aabbcc", - "disabledFeatures": ["apm"], - "initials": "MK", - "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU" - }, - { - "id": "sales", - "name": "Sales", - "initials": "MK", - "disabledFeatures": ["discover"], - "imageUrl": "", - "solution": "oblt" - } -] --------------------------------------------------- - -[[spaces-api-get-all-example-2]] -===== Custom options - -The user has read-only access to the Sales space. Retrieve all spaces and specify options: - -[source,sh] --------------------------------------------------- -$ curl -X GET api/spaces/space?purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true --------------------------------------------------- - -The API returns the following: - -[source,sh] --------------------------------------------------- -[ - { - "id": "default", - "name": "Default", - "description" : "This is the Default Space", - "disabledFeatures": [], - "imageUrl": "", - "_reserved": true, - "authorizedPurposes": { - "any": true, - "copySavedObjectsIntoSpace": true, - "findSavedObjects": true, - "shareSavedObjectsIntoSpace": true, - } - }, - { - "id": "marketing", - "name": "Marketing", - "description" : "This is the Marketing Space", - "color": "#aabbcc", - "disabledFeatures": ["apm"], - "initials": "MK", - "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU", - "authorizedPurposes": { - "any": true, - "copySavedObjectsIntoSpace": true, - "findSavedObjects": true, - "shareSavedObjectsIntoSpace": true, - } - }, - { - "id": "sales", - "name": "Sales", - "initials": "MK", - "disabledFeatures": ["discover"], - "imageUrl": "", - "authorizedPurposes": { - "any": true, - "copySavedObjectsIntoSpace": false, - "findSavedObjects": true, - "shareSavedObjectsIntoSpace": false, - } - } -] --------------------------------------------------- diff --git a/docs/api/spaces-management/get_shareable_references.asciidoc b/docs/api/spaces-management/get_shareable_references.asciidoc deleted file mode 100644 index 8066736c0c15d..0000000000000 --- a/docs/api/spaces-management/get_shareable_references.asciidoc +++ /dev/null @@ -1,81 +0,0 @@ -[role="xpack"] -[[spaces-api-get-shareable-references]] -=== Get shareable references API -++++ -Get shareable references -++++ - -experimental[] Get shareable references. - -Collects references and spaces context for saved objects. - -[[spaces-api-get-shareable-references-request]] -==== {api-request-title} - -`POST :/api/spaces/_get_shareable_references` - -[[spaces-api-get-shareable-references-request-body]] -==== {api-request-body-title} - -`objects`:: - (Required, object array) The saved objects to collect outbound references for. -+ -.Properties of `objects` -[%collapsible%open] -===== - `type`::: - (Required, string) The saved object type. - - `id`::: - (Required, string) The saved object ID. -===== - -[role="child_attributes"] -[[spaces-api-get-shareable-references-response-body]] -==== {api-response-body-title} - -`objects`:: - (object array) The returned input object or one of its references, with additional context. -+ -.Properties of `objects` -[%collapsible%open] -===== - `type`::: - (string) The saved object type. - - `id`::: - (string) The saved object ID. - - `originId`::: - (string) The origin ID of the referenced object (if it has one). - - `inboundReferences`::: - (object array) References to this object. -+ -NOTE: This does not contain _all inbound references everywhere_, it only contains inbound references to this object within the scope of this operation. -+ -.Properties of `inboundReferences` -[%collapsible%open] -====== - `type`:::: - (string) The type of the object that has the inbound reference. - - `id`:::: - (string) The ID of the object that has the inbound reference. - - `name`:::: - (string) The name of the inbound reference. -====== - - `spaces`::: - (string array) The space(s) that the referenced saved object exists in. - - `spacesWithMatchingAliases`::: - (string array) The space(s) that legacy URL aliases matching this type/id exist in. (if there are any) - - `spacesWithMatchingOrigins`::: - (string array) The space(s) that objects matching this origin exist in (including this one). (if there are any) - - `isMissing`::: - (boolean) Whether or not this object or reference is missing. -===== diff --git a/docs/api/spaces-management/post.asciidoc b/docs/api/spaces-management/post.asciidoc deleted file mode 100644 index 4c5976249f80e..0000000000000 --- a/docs/api/spaces-management/post.asciidoc +++ /dev/null @@ -1,64 +0,0 @@ -[[spaces-api-post]] -=== Create space API -++++ -Create space -++++ - -experimental[] Create a {kib} space. - -[[spaces-api-post-request]] -==== Request - -`POST :/api/spaces/space` - -[[spaces-api-post-request-body]] -==== Request body - -`id`:: - (Required, string) The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, '_', and '-'). You are unable to change the ID with the update operation. - -`name`:: - (Required, string) The display name for the space. - -`description`:: - (Optional, string) The description for the space. - -`disabledFeatures`:: - (Optional, string array) The list of disabled features for the space. To get a list of available feature IDs, use the <>. - -`initials`:: - (Optional, string) The initials shown in the space avatar. By default, the initials are automatically generated from the space name. Initials must be 1 or 2 characters. - -`color`:: - (Optional, string) The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name. - -`imageUrl`:: - (Optional, string) The data-URL encoded image to display in the space avatar. If specified, `initials` will not be displayed, and the `color` will be visible as the background color for transparent images. - For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images. - -`solution`:: - (Optional, string) The solution defined for the space. Can be one of `security`, `oblt`, `es`, `classic` - -[[spaces-api-post-response-codes]] -==== Response codes - -`200`:: - Indicates a successful call. - -[[spaces-api-post-example]] -==== Example - -[source,sh] --------------------------------------------------- -$ curl -X POST api/spaces/space -{ - "id": "marketing", - "name": "Marketing", - "description" : "This is the Marketing Space", - "color": "#aabbcc", - "initials": "MK", - "disabledFeatures": [], - "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAABACAYAAABC6cT1AAAGf0lEQVRoQ+3abYydRRUH8N882xYo0IqagEVjokQJKAiKBjXExC9G/aCkGowCIghCkRcrVSSKIu/FEiqgGL6gBIlAYrAqUTH6hZgQFVEMKlQFfItWoQWhZe8z5uzMLdvbfbkLxb13d+fbvfe588x/zpn/+Z9zJpmnI81T3BaAzzfLL1h8weLzZAcWXH2eGHo7zAWLL1h8nuzAjFw9G1N6Kzq8HnuM36MR8iibF3Fv4q+7cv8yDV6K13bYq2furSP8Ag8ncr/vnSnwRViJT2GfCV7yL1yHGxLb+l3EdM9lluNEnIC9xz+f2ZL4Er6Z2DrdXN3fZwp8CU7OfDHxggle8lTLbQ1nJ/7Z7yKmey5zYGZt4h2IzR8/trRc2PDlxJPTzfVcgJ+CC0wMPOa9F6cm7up3EVM9V9386MxliVdM8GwAv6hh/awCz/w7lY25OtF5ruBz4ZLP42NYNrDAFbC3YPWuILnMAfgq3oaRQQYea/stViV+sgssvjKzLvGySeaaNVfP4d7Btokgvxj/bblgpueuF1hmWcyTCmfE3J3M1lTcv0vMswM88zR+jpw4osu6me8kzkpsfLZWzxyRuabO22buxxOJ12FxnXfWgEe83pB5sOE47BsLymzscOoi7nw2JJfZreUjiUsTyzKPZm5NvBDvSuw268AzNzV8H5/Am+qCnsAXgpgSW2Zq9cyKlksbPlTd+te4quWNieMHBfiNDdciYnwsdI/MaOaWhnMTf54J8CqNj8x8JXFIZltYu+HqlmNT8YSBsHgAPw/vxvlVV4du/s0oaxbxg0TbL/jMni0nNcVjQq7+HZfgtpbzBg342TgQ63AkmsymxBW4IjE6A+D7Vzd/fyWxIM/VuCe+HzTgZ2Jpy/kNJ2FJLmLm24mPJ/42A+Bvrxt4SISwlhsaPodH26LZB8rVA3inwwebsrixJCZzX+KMxI/7AV61eVh3DV6Mx3EOvh4kN6jAg8nfUCXm4d1wE66OyxNPTQc+s3/o/MoXizL3JE5O3F3P/uBZPPF4Zr+Wi5uSO48ZPRdyCwn7YB/A35m5KhWNHox4fcNnIs0ddOCRSBxf8+cQG+Huf0l8NJVYP+nI7NXy2ar4QqIGm69JfKPOE2w/mBavCzwM11R2D+ChsUO7hyUfmwx55qDM1xJvqZ7y08TpifuGBfjeURVJnNIVGpkNiXNS0ds7jcySDitDCCWW56LJ10fRo8sNA+3qXUSZD2CtQlZh9T+1rB7h9oliembflnMbzqgSNZKbKGHdPm7OwXb1CvQ1metSETMpszmzvikCJNh/h5E5PHNl4qga/+/cxqrdeWDYgIe7X5L4cGJPJX2940lOX8pD41FnFnc4riluvQKbK0dcHJFi2IBHNTQSlguru4d2/wPOTNzRA3x5y+U1E1uqWDkETOT026XuUJzx6u7ReLhSYenQ7uHua0fKZmwfmcPqsQjxE5WVONcRxn7X89zgn/EKPMRMxOVQXmP18Mx3q3b/Y/0cQE/IhFtHESMsHFlZ1Ml3CH3DZPHImY+pxcKumNmYirtvqMBfhMuU6s3iqOQkTsMPe1tCQwO8Ajs0lxr7W+vnp1MJc9EgCNd/cy6x+9D4veXmprj5wxMw/3C4egW6zzgZOlYZzfwo3F2J7ael0pJamvlPKgWNKFft1AAcKotXoFEbD7kaoSoQPVKB35+5KHF0lai/rJo+up87jWEE/qqqwY+qrL21LWLm95lPJ16ppKw31XC3PXYPJauPEx7B6BHCgrSizRs18qiaRp8tlN3ueCTYPHH9RNaunjI8Z7wLYpT3jZSCYXQ8e9vTsRE/q+no3XMKeObgGtaintbb/AvXj4JDkNw/5hrwYPfIvlZFUbLn7G5q+eQIN09Vnho6cqvnM/Lt99RixH49wO8K0ZL41WTWHoQzvsNVkOheZqKhEGpsp3SzB+BBtZAYve7uOR9tuTaaB6l0XScdYfEQPpkTUyHEGP+XqyDBzu+NBCITUjNWHynkrbWKOuWFn1xKzqsyx0bdvS78odp0+N503Zao0uCsWuSIDku8/7EO60b41vN5+Ses9BKlTdvd8bhp9EBvJjWJAIn/vxwHe6b3tSk6JFPV4nq85oAOrx555v/x/rh3E6Lo+bnuNS4uB4Cuq0ZfvO8X1rM6q/+vnjLVqZq7v83onttc2oYF4HPJmv1gWbB4P7s0l55ZsPhcsmY/WBYs3s8uzaVn5q3F/wf70mRuBCtbjQAAAABJRU5ErkJggg==" -} --------------------------------------------------- -// KIBANA diff --git a/docs/api/spaces-management/put.asciidoc b/docs/api/spaces-management/put.asciidoc deleted file mode 100644 index 88d0d41114eb5..0000000000000 --- a/docs/api/spaces-management/put.asciidoc +++ /dev/null @@ -1,64 +0,0 @@ -[[spaces-api-put]] -=== Update space API -++++ -Update space -++++ - -experimental[] Update an existing {kib} space. - -[[spaces-api-put-api-request]] -==== Request - -`PUT :/api/spaces/space/` - -[[spaces-api-put-request-body]] -==== Request body - -`id`:: - (Required, string) The space ID that is part of the {kib} URL when inside the space. You are unable to change the ID with the update operation. - -`name`:: - (Required, string) The display name for the space. - -`description`:: - (Optional, string) The description for the space. - -`disabledFeatures`:: - (Optional, string array) The list of disabled features for the space. To get a list of available feature IDs, use the <>. - -`initials`:: - (Optional, string) Specifies the initials shown in the space avatar. By default, the initials are automatically generated from the space name. Initials must be 1 or 2 characters. - -`color`:: - (Optional, string) Specifies the hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name. - -`imageUrl`:: - (Optional, string) Specifies the data-url encoded image to display in the space avatar. If specified, `initials` will not be displayed, and the `color` will be visible as the background color for transparent images. - For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images. - -`solution`:: - (Optional, string) The solution defined for the space. Can be one of `security`, `oblt`, `es`, `classic`. - -[[spaces-api-put-response-codes]] -==== Response codes - -`200`:: - Indicates a successful call. - -[[sample-api-example]] -==== Example - -[source,sh] --------------------------------------------------- -$ curl -X PUT api/spaces/space/marketing -{ - "id": "marketing", - "name": "Marketing", - "description" : "This is the Marketing Space", - "color": "#aabbcc", - "initials": "MK", - "disabledFeatures": [], - "imageUrl": "" -} --------------------------------------------------- -// KIBANA diff --git a/docs/api/spaces-management/resolve_copy_saved_objects_conflicts.asciidoc b/docs/api/spaces-management/resolve_copy_saved_objects_conflicts.asciidoc deleted file mode 100644 index 0ca5c72070a86..0000000000000 --- a/docs/api/spaces-management/resolve_copy_saved_objects_conflicts.asciidoc +++ /dev/null @@ -1,317 +0,0 @@ -[role="xpack"] -[[spaces-api-resolve-copy-saved-objects-conflicts]] -=== Resolve copy saved objects to space conflicts API -++++ -Resolve copy to space conflicts -++++ - -experimental[] Overwrite saved objects that are returned as errors from the <>. - -[[spaces-api-resolve-copy-saved-objects-conflicts-request]] -==== {api-request-title} - -`POST :/api/spaces/_resolve_copy_saved_objects_errors` - -`POST :/s//api/spaces/_resolve_copy_saved_objects_errors` - -[[spaces-api-resolve-copy-saved-objects-conflicts-prereqs]] -==== {api-prereq-title} - -Execute the <>, which returns the errors for you to resolve. - -[[spaces-api-resolve-copy-saved-objects-conflicts-path-params]] -==== {api-path-parms-title} - -`space_id`:: -(Optional, string) The ID of the space that contains the saved objects you want to copy. When `space_id` is unspecified in the URL, the default space is used. The `space_id` must be the same value used during the failed <> operation. - -[role="child_attributes"] -[[spaces-api-resolve-copy-saved-objects-conflicts-request-body]] -==== {api-request-body-title} - -`objects`:: - (Required, object array) The saved objects to copy. The `objects` must be the same values used during the failed <> operation. -+ -.Properties of `objects` -[%collapsible%open] -===== - `type`::: - (Required, string) The saved object type. - - `id`::: - (Required, string) The saved object ID. -===== - -`includeReferences`:: - (Optional, boolean) When set to `true`, all saved objects related to the specified saved objects are copied into the target spaces. The `includeReferences` must be the same values used during the failed <> operation. The default value is `false`. - -`createNewCopies`:: - (Optional, boolean) Creates new copies of the saved objects, regenerates each object ID, and resets the origin. When enabled during the - initial copy, also enable when resolving copy errors. The default value is `true`. - -`retries`:: - (Required, object) The retry operations to attempt, which can specify how to resolve different types of errors. Object keys represent the - target space IDs. -+ -.Properties of `retries` -[%collapsible%open] -===== - ``::: - (Required, array) The errors to resolve for the specified ``. -+ - -.Properties of `` -[%collapsible%open] -====== - `type`:::: - (Required, string) The saved object type. - `id`:::: - (Required, string) The saved object ID. - `overwrite`:::: - (Required, boolean) When set to `true`, the saved object from the source space (designated by the <>) overwrites the conflicting object in the destination space. When set to `false`, this does nothing. - `destinationId`:::: - (Optional, string) Specifies the destination ID that the copied object should have, if different from the current ID. - `ignoreMissingReferences`::: - (Optional, boolean) When set to `true`, any missing references errors are ignored. When set to `false`, does nothing. -====== -===== - -[role="child_attributes"] -[[spaces-api-resolve-copy-saved-objects-conflicts-response-body]] -==== {api-response-body-title} - -``:: - (object) An object that describes the result of the copy operation for the space. Includes the dynamic keys in the response. -+ -.Properties of `` -[%collapsible%open] -===== - `success`::: - (boolean) The copy operation was successful. When set to `false`, some objects may have been copied. For additional information, refer to the `successCount` and `errors` properties. - - `successCount`::: - (number) The number of objects that successfully copied. - - `errors`::: - (Optional, array) The errors that occurred during the copy operation. When errors are reported, the `success` flag is set to `false`. -+ -NOTE: One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and a -`conflict` error. -+ - -.Properties of `errors` -[%collapsible%open] -====== - `id`:::: - (string) The saved object ID that failed to copy. - - `type`:::: - (string) The type of saved object that failed to copy. - - `error`:::: - (object) The error that caused the copy operation to fail. -+ - -.Properties of `error` -[%collapsible%open] -======= - `type`:::: - (string) The type of error. For example, `conflict`, `ambiguous_conflict`, `missing_references`, `unsupported_type`, or `unknown`. - `destinationId`:::: - (Optional, string) The destination ID that was used during the copy attempt. This is only present on `conflict` errors types. - `destinations`:::: - (Optional, array) A list of possible object destinations with `id`, `title`, and `updatedAt` fields to describe each one. This is - only present on `ambiguous_conflict` error types. -======= -====== - -`successResults`::: - (Optional, array) Indicates successfully copied objects, with any applicable metadata. -+ -NOTE: Objects are created when all resolvable errors are addressed, including conflict and missing references errors. For more information, -refer to the <>. - -===== - -[[spaces-api-resolve-copy-saved-objects-conflicts-example]] -==== {api-examples-title} - -[[spaces-api-resolve-copy-saved-objects-conflicts-example-1]] -===== Resolve conflict errors - -This example builds upon the <>. - -Resolve conflict errors for a {data-source}, visualization, and *Canvas* workpad by overwriting the existing saved objects: - -[source,sh] ----- -$ curl -X POST api/spaces/_resolve_copy_saved_objects_errors -{ - "objects": [{ - "type": "dashboard", - "id": "my-dashboard" - }], - "includeReferences": true, - "createNewCopies": false, - "retries": { - "sales": [ - { - "type": "index-pattern", - "id": "my-pattern", - "overwrite": true - }, - { - "type": "visualization", - "id": "my-vis", - "overwrite": true, - "destinationId": "another-vis" - }, - { - "type": "canvas", - "id": "my-canvas", - "overwrite": true, - "destinationId": "yet-another-canvas" - }, - { - "type": "dashboard", - "id": "my-dashboard" - } - ] - } -} ----- -// KIBANA - -The API returns the following: - -[source,sh] ----- -{ - "sales": { - "success": true, - "successCount": 4, - "successResults": [ - { - "id": "my-pattern", - "type": "index-pattern", - "meta": { - "icon": "indexPatternApp", - "title": "my-pattern-*" - } - }, - { - "id": "my-vis", - "type": "visualization", - "destinationId": "another-vis", - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-canvas", - "type": "canvas-workpad", - "destinationId": "yet-another-canvas", - "meta": { - "icon": "canvasApp", - "title": "Look at my canvas" - } - }, - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] - } -} ----- - -The result indicates a successful copy, and all four objects are created. - -TIP: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that -were returned in the `successResults` array. In this example, we retried copying the dashboard accordingly. - -[[spaces-api-resolve-copy-saved-objects-conflicts-example-2]] -===== Resolve missing reference errors - -This example builds upon the <>. - -Resolve missing reference errors for a visualization by ignoring the error: - -[source,sh] ----- -$ curl -X POST api/spaces/_resolve_copy_saved_objects_errors -{ - "objects": [{ - "type": "dashboard", - "id": "my-dashboard" - }], - "includeReferences": true, - "createNewCopies": false, - "retries": { - "marketing": [ - { - "type": "visualization", - "id": "my-vis", - "ignoreMissingReferences": true - }, - { - "type": "canvas", - "id": "my-canvas" - }, - { - "type": "dashboard", - "id": "my-dashboard" - } - ] - } -} ----- -// KIBANA - -The API returns the following: - -[source,sh] ----- -{ - "marketing": { - "success": true, - "successCount": 3, - "successResults": [ - { - "id": "my-vis", - "type": "visualization", - "meta": { - "icon": "visualizeApp", - "title": "Look at my visualization" - } - }, - { - "id": "my-canvas", - "type": "canvas-workpad", - "meta": { - "icon": "canvasApp", - "title": "Look at my canvas" - } - }, - { - "id": "my-dashboard", - "type": "dashboard", - "meta": { - "icon": "dashboardApp", - "title": "Look at my dashboard" - } - } - ] - } -} ----- - -The result indicates a successful copy and all three objects are created. - -TIP: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that -were returned in the `successResults` array. In this example, we retried copying the dashboard and canvas accordingly. diff --git a/docs/api/spaces-management/update_objects_spaces.asciidoc b/docs/api/spaces-management/update_objects_spaces.asciidoc deleted file mode 100644 index dec846fd6fee0..0000000000000 --- a/docs/api/spaces-management/update_objects_spaces.asciidoc +++ /dev/null @@ -1,142 +0,0 @@ -[role="xpack"] -[[spaces-api-update-objects-spaces]] -=== Update saved objects spaces API -++++ -Update saved objects spaces -++++ - -experimental[] Update saved objects spaces. - -Updates one or more saved objects to add and/or remove them from specified spaces. - -[[spaces-api-update-objects-spaces-request]] -==== {api-request-title} - -`POST :/api/spaces/_update_objects_spaces` - -[[spaces-api-update-objects-spaces-request-body]] -==== {api-request-body-title} - -`objects`:: - (Required, object array) The saved objects to update. -+ -.Properties of `objects` -[%collapsible%open] -===== - `type`::: - (Required, string) The saved object type. - - `id`::: - (Required, string) The saved object ID. -===== - -`spacesToAdd`:: - (Required, string array) The IDs of the spaces the specified objects should be added to. - -`spacesToRemove`:: - (Required, string array) The IDs of the spaces the specified objects should be removed from. - -[role="child_attributes"] -[[spaces-api-update-objects-spaces-response-body]] -==== {api-response-body-title} - -`objects`:: - (object array) The saved objects that have been updated. -+ -.Properties of `objects` -[%collapsible%open] -===== - `type`::: - (string) The saved object type. - - `id`::: - (string) The saved object ID. - - `spaces`::: - (string array) The space(s) that the referenced saved object exists in. - - `errors`::: - (string) Included if there was an error updating this object's spaces. -===== - -[[spaces-api-update-objects-spaces-example]] -==== {api-examples-title} - -[[spaces-api-update-objects-spaces-example-1]] -===== Sharing saved objects - -To share a saved object to a space programmatically follow these steps: - -1. Collect reference graph and spaces context for each saved object that you want to share using <>: -+ -[source,sh] ----- -$ curl -X POST /api/spaces/_get_shareable_references -{ - "objects": [ - { - "type": "index-pattern", - "id": "90943e30-9a47-11e8-b64d-95841ca0b247" - } - ] -} ----- -+ -The API returns the following: -+ -[source,json] ----- -{ - "objects": [ - { - "type": "index-pattern", - "id": "90943e30-9a47-11e8-b64d-95841ca0b247", - "spaces": ["default"], - "inboundReferences": [], - "spacesWithMatchingOrigins": ["default"] - } - ] -} ----- - -2. Check each saved object for `spacesWithMatchingOrigins` conflicts. -+ -Objects should not be shared to spaces with matching origins or you will create URL conflicts (causing the same URL to point to different saved objects). - -3. Check each saved object for `spacesWithMatchingAliases` conflicts. -+ -If these match the space(s) that these saved objects will be shared to you should disable legacy URL aliases for them using <>. -+ -When sharing to all spaces (`*`) all entries in `spacesWithMatchingAliases` should be checked. - -4. Update spaces of each saved object and all its references: -+ -[source,sh] ----- -$ curl -X POST /api/spaces/_update_objects_spaces -{ - "objects": [ - { - "type": "index-pattern", - "id": "90943e30-9a47-11e8-b64d-95841ca0b247" - } - ], - "spacesToAdd": ["test"], - "spacesToRemove": [] -} ----- -+ -The API returns the following: -+ -[source,json] ----- -{ - "objects": [ - { - "type": "index-pattern", - "id": "90943e30-9a47-11e8-b64d-95841ca0b247", - "spaces": ["default", "test"] - } - ] -} ----- diff --git a/docs/management/managing-saved-objects.asciidoc b/docs/management/managing-saved-objects.asciidoc index df96721205d59..231843081e7e1 100644 --- a/docs/management/managing-saved-objects.asciidoc +++ b/docs/management/managing-saved-objects.asciidoc @@ -100,7 +100,6 @@ into an older version of {kib}. For example: [float] -[role="xpack"] [[managing-saved-objects-copy-to-space]] === Copy to other {kib} spaces @@ -117,7 +116,6 @@ the saved object. If you don't want this behavior, use the <> instead. [float] -[role="xpack"] [[managing-saved-objects-share-to-space]] === Share to other {kib} spaces @@ -135,4 +133,79 @@ those space icons to open the Share UI. + The share operation automatically includes child objects that are related to the saved objects. -include::saved-objects/saved-object-ids.asciidoc[] +[[spaces-api-update-objects-spaces-example-1]] +To share a saved object to a space programmatically with the {api-kibana}/group/endpoint-spaces[spaces APIs], follow these steps: + +1. Collect reference graph and spaces context for each saved object that you want to share using get shareable references API: ++ +[source,sh] +---- +$ curl -X POST /api/spaces/_get_shareable_references +{ + "objects": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + ] +} +---- ++ +The API returns the following: ++ +[source,json] +---- +{ + "objects": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "spaces": ["default"], + "inboundReferences": [], + "spacesWithMatchingOrigins": ["default"] + } + ] +} +---- + +2. Check each saved object for `spacesWithMatchingOrigins` conflicts. ++ +Objects should not be shared to spaces with matching origins or you will create URL conflicts (causing the same URL to point to different saved objects). + +3. Check each saved object for `spacesWithMatchingAliases` conflicts. ++ +If these match the spaces that these saved objects will be shared to you should disable legacy URL aliases for them using the disable legacy URL aliases API. ++ +When sharing to all spaces (`*`) all entries in `spacesWithMatchingAliases` should be checked. + +4. Update spaces of each saved object and all its references: ++ +[source,sh] +---- +$ curl -X POST /api/spaces/_update_objects_spaces +{ + "objects": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + ], + "spacesToAdd": ["test"], + "spacesToRemove": [] +} +---- ++ +The API returns the following: ++ +[source,json] +---- +{ + "objects": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "spaces": ["default", "test"] + } + ] +} +---- diff --git a/docs/redirects.asciidoc b/docs/redirects.asciidoc index 4088342a6832b..1fa61881eca92 100644 --- a/docs/redirects.asciidoc +++ b/docs/redirects.asciidoc @@ -1147,3 +1147,53 @@ Refer to {api-kibana}/group/endpoint-cases[cases API]. == Sync {ml} saved objects API Refer to {api-kibana}/group/endpoint-ml[machine learning APIs]. + +[role="exclude",id="spaces-api-post"] +== Create space API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-put"] +== Update space API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-get"] +== Get a space API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-get-all"] +== Get all {kib} spaces API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-delete"] +== Delete space API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-copy-saved-objects"] +== Copy saved objects to space API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-disable-legacy-url-aliases"] +== Disable legacy URL aliases API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-get-shareable-references"] +== Get shareable references API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-resolve-copy-saved-objects-conflicts"] +== Resolve copy saved objects to space conflicts API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. + +[role="exclude",id="spaces-api-update-objects-spaces"] +== Update saved objects spaces API + +Refer to {api-kibana}/group/endpoint-spaces[spaces APIs]. \ No newline at end of file diff --git a/docs/user/management.asciidoc b/docs/user/management.asciidoc index 0365d39c43d3f..c46786b98829d 100644 --- a/docs/user/management.asciidoc +++ b/docs/user/management.asciidoc @@ -197,6 +197,8 @@ include::{kibana-root}/docs/management/rollups/create_and_manage_rollups.asciido include::{kibana-root}/docs/management/managing-saved-objects.asciidoc[] +include::{kibana-root}/docs/management/saved-objects/saved-object-ids.asciidoc[] + include::security/index.asciidoc[] include::{kibana-root}/docs/spaces/index.asciidoc[] From 62275a1067cab902c4422e8d38cae3bf836eb750 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:19:27 +0000 Subject: [PATCH 12/28] [CI] Auto-commit changed files from 'make api-docs && make api-docs-staging' --- .../output/kibana.serverless.staging.yaml | 108 +++++++-- oas_docs/output/kibana.staging.yaml | 218 ++++++++++++++---- 2 files changed, 267 insertions(+), 59 deletions(-) diff --git a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml index 8bd9bd198e5e1..0e9ea637ccb30 100644 --- a/oas_docs/output/kibana.serverless.staging.yaml +++ b/oas_docs/output/kibana.serverless.staging.yaml @@ -36264,7 +36264,6 @@ paths: - Prompts API /api/spaces/space: get: - description: Get all spaces operationId: '%2Fapi%2Fspaces%2Fspace#0' parameters: - description: The version of the API to use @@ -36275,7 +36274,10 @@ paths: enum: - '2023-10-31' type: string - - in: query + - description: >- + Specifies which authorization checks are applied to the API call. + The default value is `any`. + in: query name: purpose required: false schema: @@ -36284,7 +36286,15 @@ paths: - copySavedObjectsIntoSpace - shareSavedObjectsIntoSpace type: string - - in: query + - description: >- + When enabled, the API returns any spaces that the user is authorized + to access in any capacity and each space will contain the purposes + for which the user is authorized. This can be useful to determine + which spaces a user can read but not take a specific action in. If + the security plugin is not enabled, this parameter has no effect, + since no authorization checks take place. This parameter cannot be + used in with the `purpose` parameter. + in: query name: include_authorized_purposes required: true schema: @@ -36303,12 +36313,13 @@ paths: x-oas-optional: true - type: boolean x-oas-optional: true - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get all spaces tags: - spaces post: - description: Create a space operationId: '%2Fapi%2Fspaces%2Fspace#1' parameters: - description: The version of the API to use @@ -36336,34 +36347,61 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Create a space tags: - spaces /api/spaces/space/{id}: delete: - description: Delete a space + description: >- + When you delete a space, all saved objects that belong to the space are + automatically deleted, which is permanent and cannot be undone. operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2' parameters: - description: The version of the API to use @@ -36381,17 +36419,19 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: type: string - responses: {} - summary: '' + responses: + '204': + description: Indicates a successful call. + summary: Delete a space tags: - spaces get: - description: Get a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0' parameters: - description: The version of the API to use @@ -36402,17 +36442,19 @@ paths: enum: - '2023-10-31' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: type: string - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get a space tags: - spaces put: - description: Update a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1' parameters: - description: The version of the API to use @@ -36430,7 +36472,8 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: @@ -36445,29 +36488,54 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Update a space tags: - spaces /api/status: diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml index aba85f8c82ca9..bc9bc517c3869 100644 --- a/oas_docs/output/kibana.staging.yaml +++ b/oas_docs/output/kibana.staging.yaml @@ -40786,7 +40786,13 @@ paths: - roles /api/spaces/_copy_saved_objects: post: - description: Copy saved objects to spaces + description: >- + It also allows you to automatically copy related objects, so when you + copy a dashboard, this can automatically copy over the associated + visualizations, data views, and saved searches, as required. You can + request to overwrite any objects that already exist in the target space + if they share an identifier or you can use the resolve copy saved + objects conflicts API to do this on a per-object basis. operationId: '%2Fapi%2Fspaces%2F_copy_saved_objects#0' parameters: - description: The version of the API to use @@ -40813,12 +40819,26 @@ paths: properties: compatibilityMode: default: false + description: >- + Apply various adjustments to the saved objects that are + being copied to maintain compatibility between different + Kibana versions. Use this option only if you encounter + issues with copied saved objects. This option cannot be used + with the `createNewCopies` option. type: boolean createNewCopies: default: true + description: >- + Create new copies of saved objects, regenerate each object + identifier, and reset the origin. When used, potential + conflict errors are avoided. This option cannot be used + with the `overwrite` and `compatibilityMode` options. type: boolean includeReferences: default: false + description: >- + When set to true, all saved objects related to the specified + saved objects will also be copied into the target spaces. type: boolean objects: items: @@ -40826,8 +40846,10 @@ paths: type: object properties: id: + description: The identifier of the saved object to copy. type: string type: + description: The type of the saved object to copy. type: string required: - type @@ -40835,20 +40857,31 @@ paths: type: array overwrite: default: false + description: >- + When set to true, all conflicts are automatically + overridden. When a saved object with a matching type and + identifier exists in the target space, that version is + replaced with the version from the source space. This option + cannot be used with the `createNewCopies` option. type: boolean spaces: items: + description: >- + The identifiers of the spaces where you want to copy the + specified objects. type: string type: array required: - spaces - objects - responses: {} - summary: '' - tags: [] + responses: + '200': + description: Indicates a successful call. + summary: Copy saved objects to spaces + tags: + - spaces /api/spaces/_disable_legacy_url_aliases: post: - description: Disable legacy URL aliases operationId: '%2Fapi%2Fspaces%2F_disable_legacy_url_aliases#0' parameters: - description: The version of the API to use @@ -40879,10 +40912,15 @@ paths: type: object properties: sourceId: + description: >- + The alias source object identifier. This is the legacy + object identifier. type: string targetSpace: + description: The space where the alias target object exists. type: string targetType: + description: 'The type of alias target object. ' type: string required: - targetSpace @@ -40891,12 +40929,15 @@ paths: type: array required: - aliases - responses: {} - summary: '' - tags: [] + responses: + '204': + description: Indicates a successful call. + summary: Disable legacy URL aliases + tags: + - spaces /api/spaces/_get_shareable_references: post: - description: Get shareable references + description: Collect references and space contexts for saved objects. operationId: '%2Fapi%2Fspaces%2F_get_shareable_references#0' parameters: - description: The version of the API to use @@ -40936,12 +40977,17 @@ paths: type: array required: - objects - responses: {} - summary: '' - tags: [] + responses: + '200': + description: Indicates a successful call. + summary: Get shareable references + tags: + - spaces /api/spaces/_resolve_copy_saved_objects_errors: post: - description: Resolve conflicts copying saved objects + description: >- + Overwrite saved objects that are returned as errors from the copy saved + objects to space API. operationId: '%2Fapi%2Fspaces%2F_resolve_copy_saved_objects_errors#0' parameters: - description: The version of the API to use @@ -40997,15 +41043,28 @@ paths: createNewCopy: type: boolean destinationId: + description: >- + Specifies the destination identifier that the copied + object should have, if different from the current + identifier. type: string id: + description: The saved object identifier. type: string ignoreMissingReferences: + description: >- + When set to true, any missing references errors are + ignored. type: boolean overwrite: default: false + description: >- + When set to true, the saved object from the source + space overwrites the conflicting object in the + destination space. type: boolean type: + description: The saved object type. type: string required: - type @@ -41015,12 +41074,14 @@ paths: required: - retries - objects - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Resolve conflicts copying saved objects tags: [] /api/spaces/_update_objects_spaces: post: - description: Update saved objects in spaces + description: Update one or more saved objects to add or remove them from some spaces. operationId: '%2Fapi%2Fspaces%2F_update_objects_spaces#0' parameters: - description: The version of the API to use @@ -41051,8 +41112,10 @@ paths: type: object properties: id: + description: The identifier of the saved object to update. type: string type: + description: The type of the saved object to update. type: string required: - type @@ -41060,22 +41123,30 @@ paths: type: array spacesToAdd: items: + description: >- + The identifiers of the spaces the saved objects should be + added to or removed from. type: string type: array spacesToRemove: items: + description: >- + The identifiers of the spaces the saved objects should be + added to or removed from. type: string type: array required: - objects - spacesToAdd - spacesToRemove - responses: {} - summary: '' - tags: [] + responses: + '200': + description: Indicates a successful call. + summary: Update saved objects in spaces + tags: + - spaces /api/spaces/space: get: - description: Get all spaces operationId: '%2Fapi%2Fspaces%2Fspace#0' parameters: - description: The version of the API to use @@ -41086,7 +41157,10 @@ paths: enum: - '2023-10-31' type: string - - in: query + - description: >- + Specifies which authorization checks are applied to the API call. + The default value is `any`. + in: query name: purpose required: false schema: @@ -41095,7 +41169,15 @@ paths: - copySavedObjectsIntoSpace - shareSavedObjectsIntoSpace type: string - - in: query + - description: >- + When enabled, the API returns any spaces that the user is authorized + to access in any capacity and each space will contain the purposes + for which the user is authorized. This can be useful to determine + which spaces a user can read but not take a specific action in. If + the security plugin is not enabled, this parameter has no effect, + since no authorization checks take place. This parameter cannot be + used in with the `purpose` parameter. + in: query name: include_authorized_purposes required: true schema: @@ -41114,12 +41196,13 @@ paths: x-oas-optional: true - type: boolean x-oas-optional: true - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get all spaces tags: - spaces post: - description: Create a space operationId: '%2Fapi%2Fspaces%2Fspace#1' parameters: - description: The version of the API to use @@ -41147,22 +41230,45 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string solution: @@ -41175,13 +41281,17 @@ paths: required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Create a space tags: - spaces /api/spaces/space/{id}: delete: - description: Delete a space + description: >- + When you delete a space, all saved objects that belong to the space are + automatically deleted, which is permanent and cannot be undone. operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2' parameters: - description: The version of the API to use @@ -41199,17 +41309,19 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: type: string - responses: {} - summary: '' + responses: + '204': + description: Indicates a successful call. + summary: Delete a space tags: - spaces get: - description: Get a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0' parameters: - description: The version of the API to use @@ -41220,17 +41332,19 @@ paths: enum: - '2023-10-31' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: type: string - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Get a space tags: - spaces put: - description: Update a space operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1' parameters: - description: The version of the API to use @@ -41248,7 +41362,8 @@ paths: schema: example: 'true' type: string - - in: path + - description: The space identifier. + in: path name: id required: true schema: @@ -41263,22 +41378,45 @@ paths: _reserved: type: boolean color: + description: >- + The hexadecimal color code used in the space avatar. By + default, the color is automatically generated from the space + name. type: string description: + description: A description for the space. type: string disabledFeatures: default: [] items: + description: The list of features that are turned off in the space. type: string type: array id: + description: >- + The space ID that is part of the Kibana URL when inside the + space. Space IDs are limited to lowercase alphanumeric, + underscore, and hyphen characters (a-z, 0-9, _, and -). You + are cannot change the ID with the update operation. type: string imageUrl: + description: >- + The data-URL encoded image to display in the space avatar. + If specified, initials will not be displayed and the color + will be visible as the background color for transparent + images. For best results, your image should be 64x64. Images + will not be optimized by this API call, so care should be + taken when using custom images. type: string initials: + description: >- + One or two characters that are shown in the space avatar. By + default, the initials are automatically generated from the + space name. maxLength: 2 type: string name: + description: 'The display name for the space. ' minLength: 1 type: string solution: @@ -41291,8 +41429,10 @@ paths: required: - id - name - responses: {} - summary: '' + responses: + '200': + description: Indicates a successful call. + summary: Update a space tags: - spaces /api/status: From 30d4b0fac7260e5f93106cdb5e7bfd0a65df9295 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 10 Oct 2024 20:03:00 -0700 Subject: [PATCH 13/28] Revert request response changes in unversioned operations --- .../routes/api/external/copy_to_space.ts | 145 +++++++++--------- .../external/disable_legacy_url_aliases.ts | 43 +++--- .../api/external/get_shareable_references.ts | 13 +- .../api/external/update_objects_spaces.ts | 35 ++--- 4 files changed, 104 insertions(+), 132 deletions(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index d78aea4a355ad..3d6728b23b786 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -45,92 +45,85 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.', }, validate: { - request: { - body: schema.object( - { - spaces: schema.arrayOf( - schema.string({ - validate: (value) => { - if (!SPACE_ID_REGEX.test(value)) { - return `lower case, a-z, 0-9, "_", and "-" are allowed`; - } - }, - meta: { - description: - 'The identifiers of the spaces where you want to copy the specified objects.', - }, - }), - { - validate: (spaceIds) => { - if (_.uniq(spaceIds).length !== spaceIds.length) { - return 'duplicate space ids are not allowed'; - } - }, - } - ), - objects: schema.arrayOf( - schema.object({ - type: schema.string({ - meta: { description: 'The type of the saved object to copy.' }, - }), - id: schema.string({ - meta: { description: 'The identifier of the saved object to copy.' }, - }), - }), - { - validate: (objects) => { - if (!areObjectsUnique(objects)) { - return 'duplicate objects are not allowed'; - } - }, - } - ), - includeReferences: schema.boolean({ - defaultValue: false, - meta: { - description: - 'When set to true, all saved objects related to the specified saved objects will also be copied into the target spaces.', + body: schema.object( + { + spaces: schema.arrayOf( + schema.string({ + validate: (value) => { + if (!SPACE_ID_REGEX.test(value)) { + return `lower case, a-z, 0-9, "_", and "-" are allowed`; + } }, - }), - overwrite: schema.boolean({ - defaultValue: false, meta: { description: - 'When set to true, all conflicts are automatically overridden. When a saved object with a matching type and identifier exists in the target space, that version is replaced with the version from the source space. This option cannot be used with the `createNewCopies` option.', + 'The identifiers of the spaces where you want to copy the specified objects.', }, }), - createNewCopies: schema.boolean({ - defaultValue: true, - meta: { - description: - 'Create new copies of saved objects, regenerate each object identifier, and reset the origin. When used, potential conflict errors are avoided. This option cannot be used with the `overwrite` and `compatibilityMode` options.', + { + validate: (spaceIds) => { + if (_.uniq(spaceIds).length !== spaceIds.length) { + return 'duplicate space ids are not allowed'; + } }, + } + ), + objects: schema.arrayOf( + schema.object({ + type: schema.string({ + meta: { description: 'The type of the saved object to copy.' }, + }), + id: schema.string({ + meta: { description: 'The identifier of the saved object to copy.' }, + }), }), - compatibilityMode: schema.boolean({ - defaultValue: false, - meta: { - description: - 'Apply various adjustments to the saved objects that are being copied to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with copied saved objects. This option cannot be used with the `createNewCopies` option.', + { + validate: (objects) => { + if (!areObjectsUnique(objects)) { + return 'duplicate objects are not allowed'; + } }, - }), - }, - { - validate: (object) => { - if (object.overwrite && object.createNewCopies) { - return 'cannot use [overwrite] with [createNewCopies]'; - } - if (object.compatibilityMode && object.createNewCopies) { - return 'cannot use [compatibilityMode] with [createNewCopies]'; - } + } + ), + includeReferences: schema.boolean({ + defaultValue: false, + meta: { + description: + 'When set to true, all saved objects related to the specified saved objects will also be copied into the target spaces.', }, - } - ), - }, - response: { - 200: { - description: 'Indicates a successful call.', + }), + overwrite: schema.boolean({ + defaultValue: false, + meta: { + description: + 'When set to true, all conflicts are automatically overridden. When a saved object with a matching type and identifier exists in the target space, that version is replaced with the version from the source space. This option cannot be used with the `createNewCopies` option.', + }, + }), + createNewCopies: schema.boolean({ + defaultValue: true, + meta: { + description: + 'Create new copies of saved objects, regenerate each object identifier, and reset the origin. When used, potential conflict errors are avoided. This option cannot be used with the `overwrite` and `compatibilityMode` options.', + }, + }), + compatibilityMode: schema.boolean({ + defaultValue: false, + meta: { + description: + 'Apply various adjustments to the saved objects that are being copied to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with copied saved objects. This option cannot be used with the `createNewCopies` option.', + }, + }), }, - }, + { + validate: (object) => { + if (object.overwrite && object.createNewCopies) { + return 'cannot use [overwrite] with [createNewCopies]'; + } + if (object.compatibilityMode && object.createNewCopies) { + return 'cannot use [compatibilityMode] with [createNewCopies]'; + } + }, + } + ), }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts index 1c38111082e73..07356a4d9a959 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts @@ -24,31 +24,24 @@ export function initDisableLegacyUrlAliasesApi(deps: ExternalRouteDeps) { tags: ['oas-tag:spaces'], }, validate: { - request: { - body: schema.object({ - aliases: schema.arrayOf( - schema.object({ - targetSpace: schema.string({ - meta: { description: 'The space where the alias target object exists.' }, - }), - targetType: schema.string({ - meta: { description: 'The type of alias target object. ' }, - }), - sourceId: schema.string({ - meta: { - description: - 'The alias source object identifier. This is the legacy object identifier.', - }, - }), - }) - ), - }), - }, - response: { - 204: { - description: 'Indicates a successful call.', - }, - }, + body: schema.object({ + aliases: schema.arrayOf( + schema.object({ + targetSpace: schema.string({ + meta: { description: 'The space where the alias target object exists.' }, + }), + targetType: schema.string({ + meta: { description: 'The type of alias target object. ' }, + }), + sourceId: schema.string({ + meta: { + description: + 'The alias source object identifier. This is the legacy object identifier.', + }, + }), + }) + ), + }), }, }, createLicensedRouteHandler(async (_context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts b/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts index c7592c47b3d67..f49070be66fe2 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/get_shareable_references.ts @@ -24,16 +24,9 @@ export function initGetShareableReferencesApi(deps: ExternalRouteDeps) { description: 'Collect references and space contexts for saved objects.', }, validate: { - request: { - body: schema.object({ - objects: schema.arrayOf(schema.object({ type: schema.string(), id: schema.string() })), - }), - }, - response: { - 200: { - description: 'Indicates a successful call.', - }, - }, + body: schema.object({ + objects: schema.arrayOf(schema.object({ type: schema.string(), id: schema.string() })), + }), }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts b/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts index 0312c96eb514d..9fb2a8626a841 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/update_objects_spaces.ts @@ -47,27 +47,20 @@ export function initUpdateObjectsSpacesApi(deps: ExternalRouteDeps) { description: 'Update one or more saved objects to add or remove them from some spaces.', }, validate: { - request: { - body: schema.object({ - objects: schema.arrayOf( - schema.object({ - type: schema.string({ - meta: { description: 'The type of the saved object to update.' }, - }), - id: schema.string({ - meta: { description: 'The identifier of the saved object to update.' }, - }), - }) - ), - spacesToAdd: spacesSchema, - spacesToRemove: spacesSchema, - }), - }, - response: { - 200: { - description: 'Indicates a successful call.', - }, - }, + body: schema.object({ + objects: schema.arrayOf( + schema.object({ + type: schema.string({ + meta: { description: 'The type of the saved object to update.' }, + }), + id: schema.string({ + meta: { description: 'The identifier of the saved object to update.' }, + }), + }) + ), + spacesToAdd: spacesSchema, + spacesToRemove: spacesSchema, + }), }, }, createLicensedRouteHandler(async (_context, request, response) => { From 1e1780a27ced152f48e6f302b95c6445699aa8a2 Mon Sep 17 00:00:00 2001 From: lcawl Date: Fri, 11 Oct 2024 10:24:07 -0700 Subject: [PATCH 14/28] Regenerate output --- oas_docs/bundle.json | 24 ++++-------------------- oas_docs/output/kibana.yaml | 16 ++++------------ 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 1ebba3e366e18..ab106eb0e3a48 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -41683,11 +41683,7 @@ } } }, - "responses": { - "200": { - "description": "Indicates a successful call." - } - }, + "responses": {}, "summary": "Copy saved objects to spaces", "tags": [ "spaces" @@ -41762,11 +41758,7 @@ } } }, - "responses": { - "204": { - "description": "Indicates a successful call." - } - }, + "responses": {}, "summary": "Disable legacy URL aliases", "tags": [ "spaces" @@ -41835,11 +41827,7 @@ } } }, - "responses": { - "200": { - "description": "Indicates a successful call." - } - }, + "responses": {}, "summary": "Get shareable references", "tags": [ "spaces" @@ -42050,11 +42038,7 @@ } } }, - "responses": { - "200": { - "description": "Indicates a successful call." - } - }, + "responses": {}, "summary": "Update saved objects in spaces", "tags": [ "spaces" diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 6f359b1f1d71c..d09de7f91022a 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -41066,9 +41066,7 @@ paths: required: - spaces - objects - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Copy saved objects to spaces tags: - spaces @@ -41121,9 +41119,7 @@ paths: type: array required: - aliases - responses: - '204': - description: Indicates a successful call. + responses: {} summary: Disable legacy URL aliases tags: - spaces @@ -41169,9 +41165,7 @@ paths: type: array required: - objects - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Get shareable references tags: - spaces @@ -41331,9 +41325,7 @@ paths: - objects - spacesToAdd - spacesToRemove - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Update saved objects in spaces tags: - spaces From 517c67cb74f7956889bbad564ca744a312dc4389 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:16:00 +0000 Subject: [PATCH 15/28] [CI] Auto-commit changed files from 'make api-docs && make api-docs-staging' --- oas_docs/output/kibana.staging.yaml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml index 6f359b1f1d71c..d09de7f91022a 100644 --- a/oas_docs/output/kibana.staging.yaml +++ b/oas_docs/output/kibana.staging.yaml @@ -41066,9 +41066,7 @@ paths: required: - spaces - objects - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Copy saved objects to spaces tags: - spaces @@ -41121,9 +41119,7 @@ paths: type: array required: - aliases - responses: - '204': - description: Indicates a successful call. + responses: {} summary: Disable legacy URL aliases tags: - spaces @@ -41169,9 +41165,7 @@ paths: type: array required: - objects - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Get shareable references tags: - spaces @@ -41331,9 +41325,7 @@ paths: - objects - spacesToAdd - spacesToRemove - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Update saved objects in spaces tags: - spaces From c099b5d49c9bca1b9ec5bb61b2253cd887ae9572 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 15 Oct 2024 13:44:45 -0700 Subject: [PATCH 16/28] Remove response from resolve conflicts --- .../routes/api/external/copy_to_space.ts | 138 +++++++++--------- 1 file changed, 65 insertions(+), 73 deletions(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index 3d6728b23b786..90de76b63ae0e 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -196,83 +196,75 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { 'Overwrite saved objects that are returned as errors from the copy saved objects to space API.', }, validate: { - request: { - body: schema.object( - { - retries: schema.recordOf( - schema.string({ - meta: { - description: - 'The retry operations to attempt, which can specify how to resolve different types of errors. Object keys represent the target space identifiers.', - }, - validate: (spaceId) => { - if (!SPACE_ID_REGEX.test(spaceId)) { - return `Invalid space id: ${spaceId}`; - } - }, - }), - schema.arrayOf( - schema.object({ - type: schema.string({ meta: { description: 'The saved object type.' } }), - id: schema.string({ meta: { description: 'The saved object identifier.' } }), - overwrite: schema.boolean({ - defaultValue: false, + body: schema.object( + { + retries: schema.recordOf( + schema.string({ + meta: { + description: + 'The retry operations to attempt, which can specify how to resolve different types of errors. Object keys represent the target space identifiers.', + }, + validate: (spaceId) => { + if (!SPACE_ID_REGEX.test(spaceId)) { + return `Invalid space id: ${spaceId}`; + } + }, + }), + schema.arrayOf( + schema.object({ + type: schema.string({ meta: { description: 'The saved object type.' } }), + id: schema.string({ meta: { description: 'The saved object identifier.' } }), + overwrite: schema.boolean({ + defaultValue: false, + meta: { + description: + 'When set to true, the saved object from the source space overwrites the conflicting object in the destination space.', + }, + }), + destinationId: schema.maybe( + schema.string({ meta: { description: - 'When set to true, the saved object from the source space overwrites the conflicting object in the destination space.', + 'Specifies the destination identifier that the copied object should have, if different from the current identifier.', }, - }), - destinationId: schema.maybe( - schema.string({ - meta: { - description: - 'Specifies the destination identifier that the copied object should have, if different from the current identifier.', - }, - }) - ), - createNewCopy: schema.maybe(schema.boolean()), - ignoreMissingReferences: schema.maybe( - schema.boolean({ - meta: { - description: - 'When set to true, any missing references errors are ignored.', - }, - }) - ), - }) - ) - ), - objects: schema.arrayOf( - schema.object({ - type: schema.string(), - id: schema.string(), - }), - { - validate: (objects) => { - if (!areObjectsUnique(objects)) { - return 'duplicate objects are not allowed'; - } - }, - } - ), - includeReferences: schema.boolean({ defaultValue: false }), - createNewCopies: schema.boolean({ defaultValue: true }), - compatibilityMode: schema.boolean({ defaultValue: false }), - }, - { - validate: (object) => { - if (object.createNewCopies && object.compatibilityMode) { - return 'cannot use [createNewCopies] with [compatibilityMode]'; - } - }, - } - ), - }, - response: { - 200: { - description: 'Indicates a successful call.', + }) + ), + createNewCopy: schema.maybe(schema.boolean()), + ignoreMissingReferences: schema.maybe( + schema.boolean({ + meta: { + description: 'When set to true, any missing references errors are ignored.', + }, + }) + ), + }) + ) + ), + objects: schema.arrayOf( + schema.object({ + type: schema.string(), + id: schema.string(), + }), + { + validate: (objects) => { + if (!areObjectsUnique(objects)) { + return 'duplicate objects are not allowed'; + } + }, + } + ), + includeReferences: schema.boolean({ defaultValue: false }), + createNewCopies: schema.boolean({ defaultValue: true }), + compatibilityMode: schema.boolean({ defaultValue: false }), }, - }, + { + validate: (object) => { + if (object.createNewCopies && object.compatibilityMode) { + return 'cannot use [createNewCopies] with [compatibilityMode]'; + } + }, + } + ), }, }, createLicensedRouteHandler(async (context, request, response) => { From 68d06ae8e27868385a066675e0f853d7a56d9a2d Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 15 Oct 2024 15:13:25 -0700 Subject: [PATCH 17/28] Regenerate output --- oas_docs/bundle.json | 6 +----- oas_docs/output/kibana.yaml | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 7ceff35360616..4333955b3d16c 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -42042,11 +42042,7 @@ } } }, - "responses": { - "200": { - "description": "Indicates a successful call." - } - }, + "responses": {}, "summary": "Resolve conflicts copying saved objects", "tags": [] } diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 37348409e3e4d..d07e2b46e4209 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -41371,9 +41371,7 @@ paths: required: - retries - objects - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Resolve conflicts copying saved objects tags: [] /api/spaces/_update_objects_spaces: From 695289ab2960471839452b85bd8f08d546b8e96b Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 15 Oct 2024 17:24:16 -0700 Subject: [PATCH 18/28] Regenerate staging output --- oas_docs/output/kibana.staging.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml index 37348409e3e4d..d07e2b46e4209 100644 --- a/oas_docs/output/kibana.staging.yaml +++ b/oas_docs/output/kibana.staging.yaml @@ -41371,9 +41371,7 @@ paths: required: - retries - objects - responses: - '200': - description: Indicates a successful call. + responses: {} summary: Resolve conflicts copying saved objects tags: [] /api/spaces/_update_objects_spaces: From 537e85ba70319e517027caaad5db901b9eef2b2e Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 16 Oct 2024 07:49:16 -0700 Subject: [PATCH 19/28] Update x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com> --- .../plugins/spaces/server/routes/api/external/copy_to_space.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index 90de76b63ae0e..3228dca6cac3b 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -40,7 +40,7 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { options: { access: isServerless ? 'internal' : 'public', tags: ['access:copySavedObjectsToSpaces', 'oas-tag:spaces'], - summary: `Copy saved objects to spaces`, + summary: `Copy saved objects between spaces`, description: 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.', }, From dcd8b38d633278bde2b717dc0c6275dc201f81b8 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 16 Oct 2024 07:49:24 -0700 Subject: [PATCH 20/28] Update oas_docs/examples/copy_saved_objects_response3.yaml Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com> --- oas_docs/examples/copy_saved_objects_response3.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oas_docs/examples/copy_saved_objects_response3.yaml b/oas_docs/examples/copy_saved_objects_response3.yaml index 59306f97cdecd..aa497ca6bc520 100644 --- a/oas_docs/examples/copy_saved_objects_response3.yaml +++ b/oas_docs/examples/copy_saved_objects_response3.yaml @@ -1,4 +1,4 @@ -summary: Failed copy with conflict errors +summary: Failed copy response with conflict errors description: > A response for a failed copy of a dashboard with the my-dashboard ID including all references from the default space to the marketing and sales spaces. In this example, the dashboard has a reference to a visualization and a Canvas workpad and the visualization has a reference to an index pattern. The result indicates a successful copy for the marketing space and an unsuccessful copy for the sales space because the data view, visualization, and Canvas workpad each resulted in a conflict error. From 5fdd9d6ed3f17ef8940a5880aaf66262650e24eb Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 16 Oct 2024 07:49:55 -0700 Subject: [PATCH 21/28] Update x-pack/plugins/spaces/server/routes/api/external/delete.ts Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com> --- x-pack/plugins/spaces/server/routes/api/external/delete.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugins/spaces/server/routes/api/external/delete.ts b/x-pack/plugins/spaces/server/routes/api/external/delete.ts index f575b74265e3e..6456e895a3ba3 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/delete.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/delete.ts @@ -44,6 +44,9 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) { description: 'Indicates a successful call.', }, }, + 404: { + description: 'Indicates that the request failed.' + } }, }, createLicensedRouteHandler(async (context, request, response) => { From ef6e2f99f12fa1a334fc434abdfbafb1acb51194 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 16 Oct 2024 07:50:05 -0700 Subject: [PATCH 22/28] Update x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com> --- .../server/routes/api/external/disable_legacy_url_aliases.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts index 07356a4d9a959..a1610bbfed975 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/disable_legacy_url_aliases.ts @@ -20,7 +20,7 @@ export function initDisableLegacyUrlAliasesApi(deps: ExternalRouteDeps) { path: '/api/spaces/_disable_legacy_url_aliases', options: { access: isServerless ? 'internal' : 'public', - summary: `Disable legacy URL aliases`, + summary: 'Disable legacy URL aliases', tags: ['oas-tag:spaces'], }, validate: { From 26b1656bd1c75e01ca3fb2bebc185c85706330c1 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 16 Oct 2024 07:50:32 -0700 Subject: [PATCH 23/28] Update x-pack/plugins/spaces/server/routes/api/external/put.ts Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com> --- x-pack/plugins/spaces/server/routes/api/external/put.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/put.ts b/x-pack/plugins/spaces/server/routes/api/external/put.ts index 54bbd443ce981..10f6d65188bcf 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/put.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/put.ts @@ -32,7 +32,7 @@ export function initPutSpacesApi(deps: ExternalRouteDeps) { validate: { request: { params: schema.object({ - id: schema.string({ meta: { description: 'The space identifier.' } }), + id: schema.string({ meta: { description: 'The space identifier. You are unable to change the ID with the update operation.' } }), }), body: getSpaceSchema(isServerless), }, From cb83fe5b2800260762ca81e2aa8458cd9b361bc4 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 16 Oct 2024 07:54:08 -0700 Subject: [PATCH 24/28] Update x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com> --- .../plugins/spaces/server/routes/api/external/copy_to_space.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index 3228dca6cac3b..c9ee9bbb1a2ff 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -229,7 +229,7 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { }, }) ), - createNewCopy: schema.maybe(schema.boolean()), + createNewCopy: schema.maybe(schema.boolean({ meta: { description: 'Creates new copies of the saved objects, regenerates each object ID, and resets the origin'}})), ignoreMissingReferences: schema.maybe( schema.boolean({ meta: { From dbe30c40bcff76495599bb3b102c03f3a8c082f4 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 16 Oct 2024 08:12:28 -0700 Subject: [PATCH 25/28] Regenerate output --- oas_docs/bundle.json | 5 +++-- oas_docs/bundle.serverless.json | 2 +- oas_docs/output/kibana.serverless.yaml | 4 +++- oas_docs/output/kibana.yaml | 9 +++++++-- .../spaces/server/routes/api/external/copy_to_space.ts | 9 ++++++++- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 4333955b3d16c..a982da893c945 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -41777,7 +41777,7 @@ } }, "responses": {}, - "summary": "Copy saved objects to spaces", + "summary": "Copy saved objects between spaces", "tags": [ "spaces" ] @@ -41998,6 +41998,7 @@ "additionalProperties": false, "properties": { "createNewCopy": { + "description": "Creates new copies of the saved objects, regenerates each object ID, and resets the origin.", "type": "boolean" }, "destinationId": { @@ -42422,7 +42423,7 @@ } }, { - "description": "The space identifier.", + "description": "The space identifier. You are unable to change the ID with the update operation.", "in": "path", "name": "id", "required": true, diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index 81a1c14477a16..017e108263f02 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -41272,7 +41272,7 @@ } }, { - "description": "The space identifier.", + "description": "The space identifier. You are unable to change the ID with the update operation.", "in": "path", "name": "id", "required": true, diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 27248a04bc8c4..063e6d8e08c07 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -36766,7 +36766,9 @@ paths: schema: example: 'true' type: string - - description: The space identifier. + - description: >- + The space identifier. You are unable to change the ID with the + update operation. in: path name: id required: true diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 55fa00e5626ae..0c1cd9b31853e 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -41187,7 +41187,7 @@ paths: - spaces - objects responses: {} - summary: Copy saved objects to spaces + summary: Copy saved objects between spaces tags: - spaces /api/spaces/_disable_legacy_url_aliases: @@ -41347,6 +41347,9 @@ paths: type: object properties: createNewCopy: + description: >- + Creates new copies of the saved objects, regenerates + each object ID, and resets the origin. type: boolean destinationId: description: >- @@ -41664,7 +41667,9 @@ paths: schema: example: 'true' type: string - - description: The space identifier. + - description: >- + The space identifier. You are unable to change the ID with the + update operation. in: path name: id required: true diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index c9ee9bbb1a2ff..b0758f5645cc1 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -229,7 +229,14 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { }, }) ), - createNewCopy: schema.maybe(schema.boolean({ meta: { description: 'Creates new copies of the saved objects, regenerates each object ID, and resets the origin'}})), + createNewCopy: schema.maybe( + schema.boolean({ + meta: { + description: + 'Creates new copies of the saved objects, regenerates each object ID, and resets the origin.', + }, + }) + ), ignoreMissingReferences: schema.maybe( schema.boolean({ meta: { From 355002b836f9047da001b55a3d6998e5c004759b Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:02:02 +0000 Subject: [PATCH 26/28] [CI] Auto-commit changed files from 'make api-docs && make api-docs-staging' --- oas_docs/output/kibana.serverless.staging.yaml | 4 +++- oas_docs/output/kibana.staging.yaml | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml index 27248a04bc8c4..063e6d8e08c07 100644 --- a/oas_docs/output/kibana.serverless.staging.yaml +++ b/oas_docs/output/kibana.serverless.staging.yaml @@ -36766,7 +36766,9 @@ paths: schema: example: 'true' type: string - - description: The space identifier. + - description: >- + The space identifier. You are unable to change the ID with the + update operation. in: path name: id required: true diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml index 55fa00e5626ae..0c1cd9b31853e 100644 --- a/oas_docs/output/kibana.staging.yaml +++ b/oas_docs/output/kibana.staging.yaml @@ -41187,7 +41187,7 @@ paths: - spaces - objects responses: {} - summary: Copy saved objects to spaces + summary: Copy saved objects between spaces tags: - spaces /api/spaces/_disable_legacy_url_aliases: @@ -41347,6 +41347,9 @@ paths: type: object properties: createNewCopy: + description: >- + Creates new copies of the saved objects, regenerates + each object ID, and resets the origin. type: boolean destinationId: description: >- @@ -41664,7 +41667,9 @@ paths: schema: example: 'true' type: string - - description: The space identifier. + - description: >- + The space identifier. You are unable to change the ID with the + update operation. in: path name: id required: true From d2bc4052ca0e399da6547c9e0a0abf1e3e0515f1 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:56:23 +0000 Subject: [PATCH 27/28] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- x-pack/plugins/spaces/server/routes/api/external/delete.ts | 4 ++-- x-pack/plugins/spaces/server/routes/api/external/put.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/spaces/server/routes/api/external/delete.ts b/x-pack/plugins/spaces/server/routes/api/external/delete.ts index 6456e895a3ba3..09feb4fec6522 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/delete.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/delete.ts @@ -45,8 +45,8 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) { }, }, 404: { - description: 'Indicates that the request failed.' - } + description: 'Indicates that the request failed.', + }, }, }, createLicensedRouteHandler(async (context, request, response) => { diff --git a/x-pack/plugins/spaces/server/routes/api/external/put.ts b/x-pack/plugins/spaces/server/routes/api/external/put.ts index 10f6d65188bcf..740e81bac446e 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/put.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/put.ts @@ -32,7 +32,12 @@ export function initPutSpacesApi(deps: ExternalRouteDeps) { validate: { request: { params: schema.object({ - id: schema.string({ meta: { description: 'The space identifier. You are unable to change the ID with the update operation.' } }), + id: schema.string({ + meta: { + description: + 'The space identifier. You are unable to change the ID with the update operation.', + }, + }), }), body: getSpaceSchema(isServerless), }, From 7c863db6c24a98213abc082baa30f399e86e0443 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 16 Oct 2024 11:32:43 -0700 Subject: [PATCH 28/28] Fix 404 in delete API --- oas_docs/bundle.json | 3 +++ oas_docs/bundle.serverless.json | 3 +++ oas_docs/output/kibana.serverless.staging.yaml | 2 ++ oas_docs/output/kibana.serverless.yaml | 2 ++ oas_docs/output/kibana.staging.yaml | 2 ++ oas_docs/output/kibana.yaml | 2 ++ x-pack/plugins/spaces/server/routes/api/external/delete.ts | 6 +++--- 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index a982da893c945..ca864dd0bcc63 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -42355,6 +42355,9 @@ "responses": { "204": { "description": "Indicates a successful call." + }, + "404": { + "description": "Indicates that the request failed." } }, "summary": "Delete a space", diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index 017e108263f02..fd41029331181 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -41204,6 +41204,9 @@ "responses": { "204": { "description": "Indicates a successful call." + }, + "404": { + "description": "Indicates that the request failed." } }, "summary": "Delete a space", diff --git a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml index 063e6d8e08c07..6bb2333e3f786 100644 --- a/oas_docs/output/kibana.serverless.staging.yaml +++ b/oas_docs/output/kibana.serverless.staging.yaml @@ -36722,6 +36722,8 @@ paths: responses: '204': description: Indicates a successful call. + '404': + description: Indicates that the request failed. summary: Delete a space tags: - spaces diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 063e6d8e08c07..6bb2333e3f786 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -36722,6 +36722,8 @@ paths: responses: '204': description: Indicates a successful call. + '404': + description: Indicates that the request failed. summary: Delete a space tags: - spaces diff --git a/oas_docs/output/kibana.staging.yaml b/oas_docs/output/kibana.staging.yaml index 0c1cd9b31853e..19c40c263b3c9 100644 --- a/oas_docs/output/kibana.staging.yaml +++ b/oas_docs/output/kibana.staging.yaml @@ -41623,6 +41623,8 @@ paths: responses: '204': description: Indicates a successful call. + '404': + description: Indicates that the request failed. summary: Delete a space tags: - spaces diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 0c1cd9b31853e..19c40c263b3c9 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -41623,6 +41623,8 @@ paths: responses: '204': description: Indicates a successful call. + '404': + description: Indicates that the request failed. summary: Delete a space tags: - spaces diff --git a/x-pack/plugins/spaces/server/routes/api/external/delete.ts b/x-pack/plugins/spaces/server/routes/api/external/delete.ts index 09feb4fec6522..06bef75774aa0 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/delete.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/delete.ts @@ -43,9 +43,9 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) { 204: { description: 'Indicates a successful call.', }, - }, - 404: { - description: 'Indicates that the request failed.', + 404: { + description: 'Indicates that the request failed.', + }, }, }, },