Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] added format parameter to agent_policies APIs (elastic#191811)
## Summary Closes elastic#161625 Support simplified format in `agent_policies` APIs when the response contains `package_policies`. API endpoints updated: ``` # Get all GET kbn:/api/fleet/agent_policies?full=true&format=simplified # Bulk get POST kbn:/api/fleet/agent_policies/_bulk_get?format=simplified { "ids": ["fleet-server-policy"], "full": true } # Get one GET kbn:/api/fleet/agent_policies/fleet-server-policy?format=simplified # Update PUT kbn:/api/fleet/agent_policies/fleet-server-policy?format=simplified { "name": "Fleet Server Policy", "namespace": "default" } # Copy POST kbn:/api/fleet/agent_policies/fleet-server-policy/copy?format=simplified { "name": "Fleet Server Policy (copy)" } # Example response { "items": [ { "id": "fleet-server-policy", "version": "WzIxMzIsMV0=", "description": "Fleet Server policy generated by Kibana", "is_default_fleet_server": true, "monitoring_enabled": [ "logs", "metrics" ], "inactivity_timeout": 1209600, "schema_version": "1.1.1", "package_policies": [ { "id": "8cb17156-d295-475e-9ec8-44ef138a5d49", "version": "WzIwNzYsMV0=", "name": "system-3", "namespace": "default", "package": { "name": "system", "title": "System", "version": "1.60.3", "requires_root": true }, "enabled": true, "policy_id": "fleet-server-policy", "policy_ids": [ "fleet-server-policy" ], "inputs": { "system-logfile": { "enabled": true, "streams": { "system.auth": { "enabled": true, "vars": { "ignore_older": "72h", "paths": [ "/var/log/auth.log*", "/var/log/secure*" ], "preserve_original_event": false, "tags": [ "system-auth" ] } }, ``` Create and Delete APIs don't return package policies, so didn't change those. Also didn't update the `kbn:/api/fleet/agent_policies/fleet-server-policy/full` path, it has a different format. ### Checklist - [x] [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
- Loading branch information