diff --git a/bundle/bundled.json b/bundle/bundled.json new file mode 100644 index 0000000000000..21c305d6f4216 --- /dev/null +++ b/bundle/bundled.json @@ -0,0 +1,326 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Saved objects", + "description": "OpenAPI schema for saved object endpoints", + "version": "0.1", + "contact": { + "name": "Kibana Core Team" + }, + "license": { + "name": "Elastic License 2.0", + "url": "https://www.elastic.co/licensing/elastic-license" + } + }, + "servers": [ + { + "url": "http://localhost:5601", + "description": "local" + } + ], + "security": [ + { + "basicAuth": [] + }, + { + "apiKeyAuth": [] + } + ], + "tags": [ + { + "name": "saved objects", + "description": "Manage Kibana saved objects, including dashboards, visualizations, and more." + } + ], + "paths": { + "/api/saved_objects/_export": { + "post": { + "summary": "Retrieve sets of saved objects that you want to import into Kibana.", + "operationId": "exportSavedObjects", + "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be exported.\n", + "tags": [ + "saved objects" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "anyOf": [ + { + "required": [ + "type" + ] + }, + { + "required": [ + "objects" + ] + } + ], + "properties": { + "excludeExportDetails": { + "description": "Do not add export details entry at the end of the stream.", + "type": "boolean", + "default": false + }, + "includeReferencesDeep": { + "description": "Includes all of the referenced objects in the exported objects.", + "type": "boolean" + }, + "objects": { + "description": "A list of objects to export.", + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "description": "The saved object types to include in the export.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "examples": { + "exportSavedObjectsRequest": { + "$ref": "#/components/examples/export_objects_request" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "multipart/form-data": { + "schema": { + "type": "string" + }, + "examples": { + "exportSavedObjectsResponse": { + "$ref": "#/components/examples/export_objects_response" + } + } + } + } + }, + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/saved_objects/_import": { + "post": { + "summary": "Create sets of Kibana saved objects from a file created by the export API.", + "operationId": "importSavedObjects", + "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Saved objects can be imported only into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of Kibana.\n", + "tags": [ + "saved objects" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "in": "query", + "name": "compatibilityMode", + "schema": { + "type": "boolean" + }, + "required": false, + "description": "Applies various adjustments to the saved objects that are being imported to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with imported saved objects. NOTE: This option cannot be used with the `createNewCopies` option.\n" + }, + { + "in": "query", + "name": "createNewCopies", + "schema": { + "type": "boolean" + }, + "required": false, + "description": "Creates copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict errors are avoided. NOTE: This option cannot be used with the `overwrite` and `compatibilityMode` options.\n" + }, + { + "in": "query", + "name": "overwrite", + "schema": { + "type": "boolean" + }, + "required": false, + "description": "Overwrites saved objects when they already exist. When used, potential conflict errors are automatically resolved by overwriting the destination object. NOTE: This option cannot be used with the `createNewCopies` option.\n" + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "description": "A file exported using the export API. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be included in this file. Similarly, the `savedObjects.maxImportPayloadBytes` setting limits the overall size of the file that can be imported.\n" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Indicates the import was unsuccessful and specifies the objects that failed to import. One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and conflict error.\n" + }, + "success": { + "type": "boolean", + "description": "Indicates when the import was successfully completed. When set to false, some objects may not have been created. For additional information, refer to the `errors` and `successResults` properties.\n" + }, + "successCount": { + "type": "integer", + "description": "Indicates the number of successfully imported records." + }, + "successResults": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Indicates the objects that are successfully imported, with any metadata if applicable. Objects are created only when all resolvable errors are addressed, including conflicts and missing references. If objects are created as new copies, each entry in the `successResults` array includes a `destinationId` attribute.\n" + }, + "warnings": { + "type": "array" + } + } + }, + "examples": { + "importObjectsResponse": { + "$ref": "#/components/examples/import_objects_response" + } + } + } + } + }, + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + } + }, + "components": { + "securitySchemes": { + "basicAuth": { + "type": "http", + "scheme": "basic" + }, + "apiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "ApiKey" + } + }, + "parameters": { + "kbn_xsrf": { + "schema": { + "type": "string" + }, + "in": "header", + "name": "kbn-xsrf", + "description": "Cross-site request forgery protection", + "required": true + } + }, + "examples": { + "export_objects_request": { + "summary": "Export a specific saved object.", + "value": { + "objects": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + ], + "includeReferencesDeep": false + } + }, + "export_objects_response": { + "summary": "The export objects API response contains a JSON record for each exported object and an export result details record.", + "value": "{\"attributes\":{\"fieldFormatMap\":\"{\\\"hour_of_day\\\":{}}\",\"name\":\"Kibana Sample Data Logs\",\"runtimeFieldMap\":\"{\\\"hour_of_day\\\":{\\\"type\\\":\\\"long\\\",\\\"script\\\":{\\\"source\\\":\\\"emit(doc['timestamp'].value.getHour());\\\"}}}\",\"timeFieldName\":\"timestamp\",\"title\":\"kibana_sample_data_logs\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2023-07-25T19:36:36.695Z\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"managed\":false,\"references\":[],\"type\":\"index-pattern\",\"typeMigrationVersion\":\"8.0.0\",\"updated_at\":\"2023-07-25T19:36:36.695Z\",\"version\":\"WzM5LDJd\"}\n{\"excludedObjects\":[],\"excludedObjectsCount\":0,\"exportedCount\":1,\"missingRefCount\":0,\"missingReferences\":[]}\n" + }, + "import_objects_response": { + "summary": "The import objects API response indicates a successful import and the objects are created. Since these objects are created as new copies, each entry in the successResults array includes a destinationId attribute.", + "value": { + "successCount": 1, + "success": true, + "warnings": [], + "successResults": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "meta": { + "title": "Kibana Sample Data Logs", + "icon": "indexPatternApp" + }, + "managed": false, + "destinationId": "82d2760c-468f-49cf-83aa-b9a35b6a8943" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/bundle/bundled.yaml b/bundle/bundled.yaml new file mode 100644 index 0000000000000..0facbd5446640 --- /dev/null +++ b/bundle/bundled.yaml @@ -0,0 +1,209 @@ +openapi: 3.1.0 +info: + title: Saved objects + description: OpenAPI schema for saved object endpoints + version: '0.1' + contact: + name: Kibana Core Team + license: + name: Elastic License 2.0 + url: https://www.elastic.co/licensing/elastic-license +servers: + - url: http://localhost:5601 + description: local +security: + - basicAuth: [] + - apiKeyAuth: [] +tags: + - name: saved objects + description: Manage Kibana saved objects, including dashboards, visualizations, and more. +paths: + /api/saved_objects/_export: + post: + summary: Retrieve sets of saved objects that you want to import into Kibana. + operationId: exportSavedObjects + description: | + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be exported. + tags: + - saved objects + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + type: object + anyOf: + - required: + - type + - required: + - objects + properties: + excludeExportDetails: + description: Do not add export details entry at the end of the stream. + type: boolean + default: false + includeReferencesDeep: + description: Includes all of the referenced objects in the exported objects. + type: boolean + objects: + description: A list of objects to export. + type: array + items: + type: object + type: + description: The saved object types to include in the export. + oneOf: + - type: string + - type: array + items: + type: string + examples: + exportSavedObjectsRequest: + $ref: '#/components/examples/export_objects_request' + responses: + '200': + description: Indicates a successful call. + content: + multipart/form-data: + schema: + type: string + examples: + exportSavedObjectsResponse: + $ref: '#/components/examples/export_objects_response' + '400': + description: Bad request. + content: + application/json: + schema: + type: object + additionalProperties: true + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/saved_objects/_import: + post: + summary: Create sets of Kibana saved objects from a file created by the export API. + operationId: importSavedObjects + description: | + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Saved objects can be imported only into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of Kibana. + tags: + - saved objects + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - in: query + name: compatibilityMode + schema: + type: boolean + required: false + description: | + Applies various adjustments to the saved objects that are being imported to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with imported saved objects. NOTE: This option cannot be used with the `createNewCopies` option. + - in: query + name: createNewCopies + schema: + type: boolean + required: false + description: | + Creates copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict errors are avoided. NOTE: This option cannot be used with the `overwrite` and `compatibilityMode` options. + - in: query + name: overwrite + schema: + type: boolean + required: false + description: | + Overwrites saved objects when they already exist. When used, potential conflict errors are automatically resolved by overwriting the destination object. NOTE: This option cannot be used with the `createNewCopies` option. + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + description: | + A file exported using the export API. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be included in this file. Similarly, the `savedObjects.maxImportPayloadBytes` setting limits the overall size of the file that can be imported. + responses: + '200': + description: Indicates a successful call. + content: + application/json: + schema: + type: object + properties: + errors: + type: array + description: | + Indicates the import was unsuccessful and specifies the objects that failed to import. One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and conflict error. + success: + type: boolean + description: | + Indicates when the import was successfully completed. When set to false, some objects may not have been created. For additional information, refer to the `errors` and `successResults` properties. + successCount: + type: integer + description: Indicates the number of successfully imported records. + successResults: + type: array + items: + type: object + description: | + Indicates the objects that are successfully imported, with any metadata if applicable. Objects are created only when all resolvable errors are addressed, including conflicts and missing references. If objects are created as new copies, each entry in the `successResults` array includes a `destinationId` attribute. + warnings: + type: array + examples: + importObjectsResponse: + $ref: '#/components/examples/import_objects_response' + '400': + description: Bad request. + content: + application/json: + schema: + type: object + additionalProperties: true + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 +components: + securitySchemes: + basicAuth: + type: http + scheme: basic + apiKeyAuth: + type: apiKey + in: header + name: ApiKey + parameters: + kbn_xsrf: + schema: + type: string + in: header + name: kbn-xsrf + description: Cross-site request forgery protection + required: true + examples: + export_objects_request: + summary: Export a specific saved object. + value: + objects: + - type: index-pattern + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + includeReferencesDeep: false + export_objects_response: + summary: The export objects API response contains a JSON record for each exported object and an export result details record. + value: | + {"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","name":"Kibana Sample Data Logs","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"8.8.0","created_at":"2023-07-25T19:36:36.695Z","id":"90943e30-9a47-11e8-b64d-95841ca0b247","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2023-07-25T19:36:36.695Z","version":"WzM5LDJd"} + {"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":1,"missingRefCount":0,"missingReferences":[]} + import_objects_response: + summary: The import objects API response indicates a successful import and the objects are created. Since these objects are created as new copies, each entry in the successResults array includes a destinationId attribute. + value: + successCount: 1 + success: true + warnings: [] + successResults: + - type: index-pattern + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + meta: + title: Kibana Sample Data Logs + icon: indexPatternApp + managed: false + destinationId: 82d2760c-468f-49cf-83aa-b9a35b6a8943 diff --git a/bundle/entrypoint.json b/bundle/entrypoint.json new file mode 100644 index 0000000000000..21c305d6f4216 --- /dev/null +++ b/bundle/entrypoint.json @@ -0,0 +1,326 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Saved objects", + "description": "OpenAPI schema for saved object endpoints", + "version": "0.1", + "contact": { + "name": "Kibana Core Team" + }, + "license": { + "name": "Elastic License 2.0", + "url": "https://www.elastic.co/licensing/elastic-license" + } + }, + "servers": [ + { + "url": "http://localhost:5601", + "description": "local" + } + ], + "security": [ + { + "basicAuth": [] + }, + { + "apiKeyAuth": [] + } + ], + "tags": [ + { + "name": "saved objects", + "description": "Manage Kibana saved objects, including dashboards, visualizations, and more." + } + ], + "paths": { + "/api/saved_objects/_export": { + "post": { + "summary": "Retrieve sets of saved objects that you want to import into Kibana.", + "operationId": "exportSavedObjects", + "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be exported.\n", + "tags": [ + "saved objects" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "anyOf": [ + { + "required": [ + "type" + ] + }, + { + "required": [ + "objects" + ] + } + ], + "properties": { + "excludeExportDetails": { + "description": "Do not add export details entry at the end of the stream.", + "type": "boolean", + "default": false + }, + "includeReferencesDeep": { + "description": "Includes all of the referenced objects in the exported objects.", + "type": "boolean" + }, + "objects": { + "description": "A list of objects to export.", + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "description": "The saved object types to include in the export.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "examples": { + "exportSavedObjectsRequest": { + "$ref": "#/components/examples/export_objects_request" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "multipart/form-data": { + "schema": { + "type": "string" + }, + "examples": { + "exportSavedObjectsResponse": { + "$ref": "#/components/examples/export_objects_response" + } + } + } + } + }, + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "/api/saved_objects/_import": { + "post": { + "summary": "Create sets of Kibana saved objects from a file created by the export API.", + "operationId": "importSavedObjects", + "description": "This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Saved objects can be imported only into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of Kibana.\n", + "tags": [ + "saved objects" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "in": "query", + "name": "compatibilityMode", + "schema": { + "type": "boolean" + }, + "required": false, + "description": "Applies various adjustments to the saved objects that are being imported to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with imported saved objects. NOTE: This option cannot be used with the `createNewCopies` option.\n" + }, + { + "in": "query", + "name": "createNewCopies", + "schema": { + "type": "boolean" + }, + "required": false, + "description": "Creates copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict errors are avoided. NOTE: This option cannot be used with the `overwrite` and `compatibilityMode` options.\n" + }, + { + "in": "query", + "name": "overwrite", + "schema": { + "type": "boolean" + }, + "required": false, + "description": "Overwrites saved objects when they already exist. When used, potential conflict errors are automatically resolved by overwriting the destination object. NOTE: This option cannot be used with the `createNewCopies` option.\n" + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "description": "A file exported using the export API. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be included in this file. Similarly, the `savedObjects.maxImportPayloadBytes` setting limits the overall size of the file that can be imported.\n" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Indicates the import was unsuccessful and specifies the objects that failed to import. One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and conflict error.\n" + }, + "success": { + "type": "boolean", + "description": "Indicates when the import was successfully completed. When set to false, some objects may not have been created. For additional information, refer to the `errors` and `successResults` properties.\n" + }, + "successCount": { + "type": "integer", + "description": "Indicates the number of successfully imported records." + }, + "successResults": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Indicates the objects that are successfully imported, with any metadata if applicable. Objects are created only when all resolvable errors are addressed, including conflicts and missing references. If objects are created as new copies, each entry in the `successResults` array includes a `destinationId` attribute.\n" + }, + "warnings": { + "type": "array" + } + } + }, + "examples": { + "importObjectsResponse": { + "$ref": "#/components/examples/import_objects_response" + } + } + } + } + }, + "400": { + "description": "Bad request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + }, + "servers": [ + { + "url": "https://localhost:5601" + } + ] + } + }, + "components": { + "securitySchemes": { + "basicAuth": { + "type": "http", + "scheme": "basic" + }, + "apiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "ApiKey" + } + }, + "parameters": { + "kbn_xsrf": { + "schema": { + "type": "string" + }, + "in": "header", + "name": "kbn-xsrf", + "description": "Cross-site request forgery protection", + "required": true + } + }, + "examples": { + "export_objects_request": { + "summary": "Export a specific saved object.", + "value": { + "objects": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + ], + "includeReferencesDeep": false + } + }, + "export_objects_response": { + "summary": "The export objects API response contains a JSON record for each exported object and an export result details record.", + "value": "{\"attributes\":{\"fieldFormatMap\":\"{\\\"hour_of_day\\\":{}}\",\"name\":\"Kibana Sample Data Logs\",\"runtimeFieldMap\":\"{\\\"hour_of_day\\\":{\\\"type\\\":\\\"long\\\",\\\"script\\\":{\\\"source\\\":\\\"emit(doc['timestamp'].value.getHour());\\\"}}}\",\"timeFieldName\":\"timestamp\",\"title\":\"kibana_sample_data_logs\"},\"coreMigrationVersion\":\"8.8.0\",\"created_at\":\"2023-07-25T19:36:36.695Z\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"managed\":false,\"references\":[],\"type\":\"index-pattern\",\"typeMigrationVersion\":\"8.0.0\",\"updated_at\":\"2023-07-25T19:36:36.695Z\",\"version\":\"WzM5LDJd\"}\n{\"excludedObjects\":[],\"excludedObjectsCount\":0,\"exportedCount\":1,\"missingRefCount\":0,\"missingReferences\":[]}\n" + }, + "import_objects_response": { + "summary": "The import objects API response indicates a successful import and the objects are created. Since these objects are created as new copies, each entry in the successResults array includes a destinationId attribute.", + "value": { + "successCount": 1, + "success": true, + "warnings": [], + "successResults": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "meta": { + "title": "Kibana Sample Data Logs", + "icon": "indexPatternApp" + }, + "managed": false, + "destinationId": "82d2760c-468f-49cf-83aa-b9a35b6a8943" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/bundle/entrypoint.yaml b/bundle/entrypoint.yaml new file mode 100644 index 0000000000000..0facbd5446640 --- /dev/null +++ b/bundle/entrypoint.yaml @@ -0,0 +1,209 @@ +openapi: 3.1.0 +info: + title: Saved objects + description: OpenAPI schema for saved object endpoints + version: '0.1' + contact: + name: Kibana Core Team + license: + name: Elastic License 2.0 + url: https://www.elastic.co/licensing/elastic-license +servers: + - url: http://localhost:5601 + description: local +security: + - basicAuth: [] + - apiKeyAuth: [] +tags: + - name: saved objects + description: Manage Kibana saved objects, including dashboards, visualizations, and more. +paths: + /api/saved_objects/_export: + post: + summary: Retrieve sets of saved objects that you want to import into Kibana. + operationId: exportSavedObjects + description: | + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be exported. + tags: + - saved objects + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + type: object + anyOf: + - required: + - type + - required: + - objects + properties: + excludeExportDetails: + description: Do not add export details entry at the end of the stream. + type: boolean + default: false + includeReferencesDeep: + description: Includes all of the referenced objects in the exported objects. + type: boolean + objects: + description: A list of objects to export. + type: array + items: + type: object + type: + description: The saved object types to include in the export. + oneOf: + - type: string + - type: array + items: + type: string + examples: + exportSavedObjectsRequest: + $ref: '#/components/examples/export_objects_request' + responses: + '200': + description: Indicates a successful call. + content: + multipart/form-data: + schema: + type: string + examples: + exportSavedObjectsResponse: + $ref: '#/components/examples/export_objects_response' + '400': + description: Bad request. + content: + application/json: + schema: + type: object + additionalProperties: true + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 + /api/saved_objects/_import: + post: + summary: Create sets of Kibana saved objects from a file created by the export API. + operationId: importSavedObjects + description: | + This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Saved objects can be imported only into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of Kibana. + tags: + - saved objects + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - in: query + name: compatibilityMode + schema: + type: boolean + required: false + description: | + Applies various adjustments to the saved objects that are being imported to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with imported saved objects. NOTE: This option cannot be used with the `createNewCopies` option. + - in: query + name: createNewCopies + schema: + type: boolean + required: false + description: | + Creates copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict errors are avoided. NOTE: This option cannot be used with the `overwrite` and `compatibilityMode` options. + - in: query + name: overwrite + schema: + type: boolean + required: false + description: | + Overwrites saved objects when they already exist. When used, potential conflict errors are automatically resolved by overwriting the destination object. NOTE: This option cannot be used with the `createNewCopies` option. + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + description: | + A file exported using the export API. NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be included in this file. Similarly, the `savedObjects.maxImportPayloadBytes` setting limits the overall size of the file that can be imported. + responses: + '200': + description: Indicates a successful call. + content: + application/json: + schema: + type: object + properties: + errors: + type: array + description: | + Indicates the import was unsuccessful and specifies the objects that failed to import. One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and conflict error. + success: + type: boolean + description: | + Indicates when the import was successfully completed. When set to false, some objects may not have been created. For additional information, refer to the `errors` and `successResults` properties. + successCount: + type: integer + description: Indicates the number of successfully imported records. + successResults: + type: array + items: + type: object + description: | + Indicates the objects that are successfully imported, with any metadata if applicable. Objects are created only when all resolvable errors are addressed, including conflicts and missing references. If objects are created as new copies, each entry in the `successResults` array includes a `destinationId` attribute. + warnings: + type: array + examples: + importObjectsResponse: + $ref: '#/components/examples/import_objects_response' + '400': + description: Bad request. + content: + application/json: + schema: + type: object + additionalProperties: true + servers: + - url: https://localhost:5601 + servers: + - url: https://localhost:5601 +components: + securitySchemes: + basicAuth: + type: http + scheme: basic + apiKeyAuth: + type: apiKey + in: header + name: ApiKey + parameters: + kbn_xsrf: + schema: + type: string + in: header + name: kbn-xsrf + description: Cross-site request forgery protection + required: true + examples: + export_objects_request: + summary: Export a specific saved object. + value: + objects: + - type: index-pattern + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + includeReferencesDeep: false + export_objects_response: + summary: The export objects API response contains a JSON record for each exported object and an export result details record. + value: | + {"attributes":{"fieldFormatMap":"{\"hour_of_day\":{}}","name":"Kibana Sample Data Logs","runtimeFieldMap":"{\"hour_of_day\":{\"type\":\"long\",\"script\":{\"source\":\"emit(doc['timestamp'].value.getHour());\"}}}","timeFieldName":"timestamp","title":"kibana_sample_data_logs"},"coreMigrationVersion":"8.8.0","created_at":"2023-07-25T19:36:36.695Z","id":"90943e30-9a47-11e8-b64d-95841ca0b247","managed":false,"references":[],"type":"index-pattern","typeMigrationVersion":"8.0.0","updated_at":"2023-07-25T19:36:36.695Z","version":"WzM5LDJd"} + {"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":1,"missingRefCount":0,"missingReferences":[]} + import_objects_response: + summary: The import objects API response indicates a successful import and the objects are created. Since these objects are created as new copies, each entry in the successResults array includes a destinationId attribute. + value: + successCount: 1 + success: true + warnings: [] + successResults: + - type: index-pattern + id: 90943e30-9a47-11e8-b64d-95841ca0b247 + meta: + title: Kibana Sample Data Logs + icon: indexPatternApp + managed: false + destinationId: 82d2760c-468f-49cf-83aa-b9a35b6a8943 diff --git a/docs/developer/architecture/core/application_service.asciidoc b/docs/developer/architecture/core/application_service.asciidoc index 2aa50ebafad8d..31b0a3d2a4356 100644 --- a/docs/developer/architecture/core/application_service.asciidoc +++ b/docs/developer/architecture/core/application_service.asciidoc @@ -29,7 +29,7 @@ export class MyPlugin implements Plugin { } } ---- -<1> See {kib-repo}blob/{branch}/docs/development/core/public/kibana-plugin-core-public.applicationsetup.register.md[application.register interface] +<1> Refer to {kib-repo}/blob/8.9/packages/core/application/core-application-browser/src/contracts.ts[application.register interface] <2> Application specific URL. <3> `mount` callback is invoked when a user navigates to the application-specific URL. <4> `core.getStartServices` method provides API available during `start` lifecycle. diff --git a/docs/developer/architecture/core/configuration-service.asciidoc b/docs/developer/architecture/core/configuration-service.asciidoc index fdc4ad9b0a922..570bea37ddf09 100644 --- a/docs/developer/architecture/core/configuration-service.asciidoc +++ b/docs/developer/architecture/core/configuration-service.asciidoc @@ -17,7 +17,7 @@ const basePath = core.http.basePath.get(request); To have access to your plugin config, you _should_: * Declare plugin-specific `configPath` (will fallback to plugin `id` -if not specified) in {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md[`kibana.json`] manifest file. +if not specified) in your plugin definition. * Export schema validation for the config from plugin's main file. Schema is mandatory. If a plugin reads from the config without schema declaration, `ConfigService` will throw an error. diff --git a/docs/developer/architecture/core/http-service.asciidoc b/docs/developer/architecture/core/http-service.asciidoc index 6cc171aa7969a..da4f0a3f7f5e1 100644 --- a/docs/developer/architecture/core/http-service.asciidoc +++ b/docs/developer/architecture/core/http-service.asciidoc @@ -12,7 +12,7 @@ The service allows plugins to: * to execute custom logic on an incoming request or server response. * implement custom authentication and authorization strategy. -See {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md[HTTP service API docs] +Refer to {kib-repo}/blob/8.9/packages/core/http/core-http-server/src/http_contract.ts[HTTP service contract types]. [source,typescript] ---- @@ -64,4 +64,4 @@ async function fetchData(core: CoreStart) { ); } ---- -See {kib-repo}blob/{branch}/docs/development/core/public/kibana-plugin-core-public.httpsetup.md[for all available API]. +Refer to {kib-repo}/blob/8.9/packages/core/http/core-http-browser/src/types.ts[the client-side APIs]. diff --git a/docs/developer/architecture/core/index.asciidoc b/docs/developer/architecture/core/index.asciidoc index b03e98ffbb57d..e866fefb38530 100644 --- a/docs/developer/architecture/core/index.asciidoc +++ b/docs/developer/architecture/core/index.asciidoc @@ -27,6 +27,8 @@ export class MyPlugin { } ---- + + The services that core provides are: * <> @@ -36,3 +38,5 @@ The services that core provides are: * <> * <> * <> + +NOTE: Core provides the {kib} building blocks for plugins and is implemented as a collection of <>. diff --git a/docs/developer/architecture/core/packages.asciidoc b/docs/developer/architecture/core/packages.asciidoc new file mode 100644 index 0000000000000..bc544e3540d2e --- /dev/null +++ b/docs/developer/architecture/core/packages.asciidoc @@ -0,0 +1,26 @@ +[[core-packages]] +== Core packages + +experimental[] + +Core packages have well defined boundaries, have a single responsibility, and are organized by domain. Core packages follow a specific naming schema, according to what they contain: + +For example, core capapability packages are: + +* `core-capabilities-browser-internal` +* `core-capabilities-browser-mocks` +* `core-capabilities-common` +* `core-capabilities-server` +* `core-capabilities-server-internal` +* `core-capabilities-server-mocks` + +Each domain has a specific package for public types, which can be imported and used throughout the Kibana codebase including in its implementation and unit tests. These packages are internal to core and not intended for public use, but they can be used by plugins to create mock versions for unit testing. + +In addition, domains contain separate packages for the client-side and server-side and, in some cases, a base, that +supports both client and server needs. When a domain shares code between the server and client, that code lives in +a `common` package. Mocks have their own dedicated package. + +All of core's public API's have inline `jsdocs` that include examples as nescessary. + + + diff --git a/docs/developer/architecture/core/patterns-scoped-services.asciidoc b/docs/developer/architecture/core/patterns-scoped-services.asciidoc index bfd8b42dbb951..ba993a6da3af3 100644 --- a/docs/developer/architecture/core/patterns-scoped-services.asciidoc +++ b/docs/developer/architecture/core/patterns-scoped-services.asciidoc @@ -7,9 +7,7 @@ should perform a check whether an end-user has access to the data. The Kibana Platform introduced a handler interface on the server-side to perform that association internally. Core services, that require impersonation with an incoming request, are exposed via `context` argument of -{kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.requesthandler.md[the -request handler interface.] -as +{kib-repo}/blob/8.9/packages/core/http/core-http-server/src/router/request_handler.ts[the request handler interface]. [source,js] ---- @@ -18,13 +16,11 @@ async function handler(context, req, res) { } ---- -The -{kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md[request -handler context] exposes the following scoped *core* services: +The {kib-repo}/blob/8.9/packages/core/http/core-http-server/src/router/request_handler.ts[request handler context] exposes the following scoped *core* services: -* {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.md[`context.savedObjects.client`] -* {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md[`context.elasticsearch.client`] -* {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.iuisettingsclient.md[`context.uiSettings.client`] +* {kib-repo}/blob/8.9/packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts[`context.savedObjects.client`] +* {kib-repo}/blob/8.9/packages/core/elasticsearch/core-elasticsearch-server/src/client/scoped_cluster_client.ts[`context.elasticsearch.client`] +* {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts[`context.uiSettings.client`] ==== Declare a custom scoped service diff --git a/docs/developer/architecture/core/uisettings-service.asciidoc b/docs/developer/architecture/core/uisettings-service.asciidoc index 2d24465b69c32..f70180b72d928 100644 --- a/docs/developer/architecture/core/uisettings-service.asciidoc +++ b/docs/developer/architecture/core/uisettings-service.asciidoc @@ -38,9 +38,10 @@ uiSettings: [[client-side-usage]] === Client side usage -On the client, the `uiSettings` service is exposed directly from `core` and the {kib-repo}blob/{branch}/docs/development/core/public/kibana-plugin-core-public.iuisettingsclient.md[client] provides plugins access to the `config` entries stored in {es}. +On the client, the `uiSettings` service is exposed directly from `core` and the {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts[client] +provides plugins access to the `config` entries stored in {es}. -In the interest of performance, `uiSettings` are cached. Any changes that require cache refreshes should register an instruction to reload the page when settings are configured in Advanced Settings using the `requiresPageReload` {kib-repo}blob/{branch}/docs/development/core/public/kibana-plugin-core-public.uisettingsparams.md[parameter]. +In the interest of performance, `uiSettings` are cached. Any changes that require cache refreshes should register an instruction to reload the page when settings are configured in Advanced Settings using the `requiresPageReload` {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts[parameter]. [source,typescript] ---- @@ -77,7 +78,7 @@ export class MyPlugin implements Plugin { === Server side usage On the server, `uiSettings` are exposed directly from `core`. -The following example shows how to {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.uisettingsservicesetup.register.md[register] a new `custom` setting with a default value of '42'. When registering a new setting, you must provide a schema against which validations are performed on read and write. All the other {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-server.uisettingsparams.md[parameters] are optional. +The following example shows how to register a new `custom` setting with a default value of '42'. When registering a new setting, you must provide a schema against which validations are performed on read and write. All the other {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts[parameters] are optional. [source,typescript] ---- @@ -114,7 +115,7 @@ export class MyPlugin implements Plugin { Migrations for 3rd party plugin advanced settings are not currently supported. If a 3rd party plugin registers an advanced setting, the setting is essentially permanent and cannot be fixed without manual intervention. ============================================== -To change or remove a `uiSetting`, the whole `config` Saved Object needs to be migrated. `uiSettings` {kib-repo}blob/{branch}/src/core/server/ui_settings/saved_objects/migrations.ts[migrations] are declared directly in the service. +To change or remove a `uiSetting`, the whole `config` Saved Object needs to be migrated. For example, if we wanted to remove a `custom` setting, or rename `my_setting:fourtyTwo` to `my_other_setting:fourtyTwo`, we'd need two migration entries, one for each change targeting the version in which these changes apply: diff --git a/docs/developer/architecture/index.asciidoc b/docs/developer/architecture/index.asciidoc index 90a0972d65f2f..36be54a384b17 100644 --- a/docs/developer/architecture/index.asciidoc +++ b/docs/developer/architecture/index.asciidoc @@ -48,6 +48,8 @@ include::core/uisettings-service.asciidoc[leveloffset=+1] include::core/patterns-scoped-services.asciidoc[leveloffset=+1] +include::core/packages.asciidoc[leveloffset=+1] + include::security/index.asciidoc[leveloffset=+1] include::add-data-tutorials.asciidoc[leveloffset=+1]