Spaces method and path for this operation:
Refer to Spaces for more information.
Create a new agent policy.
[Required authorization] Route required privileges: fleet-agent-policies-all.
Body
-
Additional properties are NOT allowed.
-
Not more than
100elements. -
Additional properties are NOT allowed.
-
Minimum value is
0. Default value is1209600. -
Indicates this is a short-lived verifier policy used for OTel permission verification.
-
When set to true, monitoring will be enabled but logs/metrics collection will be disabled
Default value is
false. -
Additional properties are NOT allowed.
-
Not more than
3elements. Values arelogs,metrics, ortraces. -
Additional properties are NOT allowed.
-
Minimum length is
1. -
Minimum length is
1. -
Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure.
-
Not more than
100elements. -
Not more than
100elements. -
Indicates whether the agent policy supports agentless integrations. Deprecated in favor of the Fleet agentless policies API.
Default value is
false. -
Minimum value is
0.
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/agent_policies' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"description":"A sample agent policy","monitoring_enabled":["logs","metrics"],"name":"My agent policy","namespace":"default"}'
{
"description": "A sample agent policy",
"monitoring_enabled": [
"logs",
"metrics"
],
"name": "My agent policy",
"namespace": "default"
}
{
"item": {
"description": "A sample agent policy",
"id": "agent-policy-id-2",
"is_managed": false,
"is_protected": false,
"name": "My agent policy",
"namespace": "default",
"revision": 1,
"status": "active",
"updated_at": "2024-01-15T10:00:00.000Z",
"updated_by": "user1"
}
}
{
"error": "Bad Request",
"message": "An error message describing what went wrong",
"statusCode": 400
}