Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] Deprecate savedObject from Api responses (#159396)
## Summary - Replacing `savedObject` in the following endpoints with a new object `installationInfo` that is more "flattened". `savedObject` is marked as deprecated but not removed for now as it might be used by other stakeholders. - `GET api/fleet/epm/packages/{pkgName}/{version}` - `GET api/fleet/epm/packages` - Replaced all the usages of `savedObject.attributes` in the frontend with `installationInfo` ### Testing - in dev tools, run `GET kbn:/api/fleet/epm/packages` and search for a package that has `savedObject` in it. - For instance `fleet-server` or `endpoint`, verify that has both `savedObject` and `installationInfo`: ``` { name: 'endpoint', title: 'Elastic Defend', version: '8.8.0', release: 'ga', description: 'Protect your hosts and cloud workloads with threat prevention, detection, and deep security data visibility.', type: 'integration', download: '/epr/endpoint/endpoint-8.8.0.zip', path: '/package/endpoint/8.8.0', icons: [ [Object] ], policy_templates: [ [Object] ], conditions: { kibana: [Object] }, owner: { github: 'elastic/security-onboarding-and-lifecycle-mgt' }, categories: [ 'security', 'edr_xdr' ], signature_path: '/epr/endpoint/endpoint-8.8.0.zip.sig', id: 'endpoint', status: 'installed', savedObject: {..}, installationInfo: { created_at: '2023-05-25T10:36:47.450Z', updated_at: '2023-05-25T10:37:05.168Z', version: '8.8.0', installed_kibana: [], installed_kibana_space_id: 'default', installed_es: [Array], package_assets: [Array], es_index_patterns: [Object], name: 'endpoint', install_version: '8.8.0', install_status: 'installed', install_started_at: '2023-05-25T10:36:47.450Z', install_source: 'registry', install_format_schema_version: '1.0.0', verification_status: 'unknown' } }, ``` - Run `GET kbn:/api/fleet/epm/packages/fleet_server/1.3.0` and verifythat has both `savedObject` and `installationInfo`: ``` { "item": { "name": "fleet_server", "title": "Fleet Server", "version": "1.3.0", "release": "ga", "description": "Centrally manage Elastic Agents with the Fleet Server integration.", "type": "integration", "download": "/epr/fleet_server/fleet_server-1.3.0.zip", "path": "/package/fleet_server/1.3.0", "icons": [ { "src": "/img/logo_fleet_server.svg", "path": "/package/fleet_server/1.3.0/img/logo_fleet_server.svg", "title": "logo Fleet Server", "size": "64x64", "type": "image/svg+xml" } ], "conditions": { "kibana": { "version": "^8.8.0" } }, "owner": { "github": "elastic/elastic-agent-control-plane" }, "categories": [ "elastic_stack" ], "signature_path": "/epr/fleet_server/fleet_server-1.3.0.zip.sig", "format_version": "1.0.0", "readme": "/package/fleet_server/1.3.0/docs/README.md", "license": "basic", "assets": {}, "policy_templates": [ { "name": "fleet_server", "title": "Fleet Server", "description": "Fleet Server setup", "inputs": [ { "type": "fleet-server", "vars": [... ], }, "latestVersion": "1.3.0", "licensePath": "/package/fleet_server/1.3.0/LICENSE.txt", "keepPoliciesUpToDate": false, "status": "installed", "savedObject": { "id": "fleet_server", "type": "epm-packages", "namespaces": [], "updated_at": "2023-05-25T10:32:33.033Z", "created_at": "2023-05-25T10:32:32.042Z", "version": "WzEyNCwxXQ==", "attributes": { "installed_kibana": [], "installed_kibana_space_id": "default", "installed_es": [], "package_assets": [...], "es_index_patterns": {}, "name": "fleet_server", "version": "1.3.0", "install_version": "1.3.0", "install_status": "installed", "install_started_at": "2023-05-25T10:32:32.042Z", "install_source": "registry", "install_format_schema_version": "1.0.0", "verification_status": "unknown" }, "references": [], "managed": false, "coreMigrationVersion": "8.8.0", "typeMigrationVersion": "8.6.0" }, "installationInfo": { "created_at": "2023-05-25T10:32:32.042Z", "updated_at": "2023-05-25T10:32:33.033Z", "version": "1.3.0", "namespaces": [], "type": "epm-packages", "installed_kibana": [], "installed_kibana_space_id": "default", "installed_es": [], "package_assets": [...], "es_index_patterns": {}, "name": "fleet_server", "install_version": "1.3.0", "install_status": "installed", "install_started_at": "2023-05-25T10:32:32.042Z", "install_source": "registry", "install_format_schema_version": "1.0.0", "verification_status": "unknown" } } } ``` ### Checklist - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information