From 9f95815e14b2fce9a2fce796990d9d60a0f93cf3 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Tue, 13 Oct 2020 09:00:31 -0400 Subject: [PATCH] [Ingest Manager] Split up OpenAPI spec file (#80107) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary replaces https://github.com/elastic/kibana/pull/77378 fixes https://github.com/elastic/kibana/issues/77290 * Replace the 4000+ line `spec_oas3.json` file with one ~75 line overview file `entrypoint.yaml` which imports the various pieces from other directories. * Switched from JSON to YAML for "source" files because they're less noisy & more human-friendly. `package-registry` & `package-spec` both define specs in YAML as well. We can always convert them to JS for any library that needs it. ## Dev docs ### New structure ``` openapi/ ├── README.md ├── bundled.json ├── bundled.yaml ├── components/ ├── entrypoint.yaml └── paths/ ``` There are `README.md` files in `openapi`, `openapi/components`, & `openapi/paths` with information about the purpose, conventions, decisions, etc for that directory * `entrypoint.yaml` is the overview file which links to the various files on disk. * `bundled.{yaml,json}` is the resolved output of that entry & other files in a single file.
how these were generated (requires node 12+) ``` nvm use 12; npx @redocly/openapi-cli bundle entrypoint.yaml -o bundled.json npx @redocly/openapi-cli bundle entrypoint.yaml -o bundled.yaml ```
How to generate with node 10+ ``` npx swagger-cli bundle -o bundled.json -t json entrypoint.yaml npx swagger-cli bundle -o bundled.yaml -t yaml entrypoint.yaml ```
* [Paths](paths/README.md): Started with a flat `paths` directory with each path in a separate file. We can move on to a nested file-per-operation like https://github.com/elastic/kibana/pull/77378 or any other approach later
tree ./paths ``` paths/ ├── README.md ├── agent_policies.yaml ├── agent_policies@delete.yaml ├── agent_policies@{agent_policy_id}.yaml ├── agent_policies@{agent_policy_id}@copy.yaml ├── agent_status.yaml ├── agents.yaml ├── agents@bulk_upgrade.yaml ├── agents@enroll.yaml ├── agents@setup.yaml ├── agents@{agent_id}.yaml ├── agents@{agent_id}@acks.yaml ├── agents@{agent_id}@checkin.yaml ├── agents@{agent_id}@events.yaml ├── agents@{agent_id}@unenroll.yaml ├── agents@{agent_id}@upgrade.yaml ├── enrollment_api_keys.yaml ├── enrollment_api_keys@{key_id}.yaml ├── epm@categories.yaml ├── epm@packages.yaml ├── epm@packages@{pkgkey}.yaml ├── install@{os_type}.yaml ├── package_policies.yaml ├── package_policies@{package_policy_id}.yaml └── setup.yaml ```
* [Components](components/README.md): Reusable components like [`schemas`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject), [`responses`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject) [`parameters`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject), etc
tree ./components ``` components/ ├── README.md ├── callbacks ├── examples ├── headers │   └── kbn_xsrf.yaml ├── links ├── parameters │   ├── kuery.yaml │   ├── page_index.yaml │   └── page_size.yaml ├── request_bodies ├── responses ├── schemas │   ├── access_api_key.yaml │   ├── agent.yaml │   ├── agent_event.yaml │   ├── agent_metadata.yaml │   ├── agent_policy.yaml │   ├── agent_status.yaml │   ├── agent_type.yaml │   ├── bulk_upgrade_agents.yaml │   ├── enrollment_api_key.yaml │   ├── new_agent_event.yaml │   ├── new_agent_policy.yaml │   ├── new_package_policy.yaml │   ├── package_info.yaml │   ├── package_policy.yaml │   ├── search_result.yaml │   └── upgrade_agent.yaml └── security_schemes ```
--- .../ingest_manager/common/openapi/README.md | 14 + .../common/openapi/bundled.json | 2088 ++++++++ .../common/openapi/bundled.yaml | 1327 +++++ .../common/openapi/components/README.md | 13 + .../openapi/components/headers/kbn_xsrf.yaml | 5 + .../openapi/components/parameters/kuery.yaml | 5 + .../components/parameters/page_index.yaml | 6 + .../components/parameters/page_size.yaml | 7 + .../components/schemas/access_api_key.yaml | 3 + .../openapi/components/schemas/agent.yaml | 48 + .../components/schemas/agent_event.yaml | 9 + .../components/schemas/agent_metadata.yaml | 2 + .../components/schemas/agent_policy.yaml | 30 + .../components/schemas/agent_status.yaml | 8 + .../components/schemas/agent_type.yaml | 6 + .../schemas/bulk_upgrade_agents.yaml | 37 + .../schemas/enrollment_api_key.yaml | 3 + .../components/schemas/new_agent_event.yaml | 44 + .../components/schemas/new_agent_policy.yaml | 9 + .../schemas/new_package_policy.yaml | 58 + .../components/schemas/package_info.yaml | 118 + .../components/schemas/package_policy.yaml | 15 + .../components/schemas/search_result.yaml | 33 + .../components/schemas/upgrade_agent.yaml | 16 + .../common/openapi/entrypoint.yaml | 77 + .../common/openapi/paths/README.md | 130 + .../common/openapi/paths/agent_policies.yaml | 54 + .../openapi/paths/agent_policies@delete.yaml | 33 + .../agent_policies@{agent_policy_id}.yaml | 47 + ...agent_policies@{agent_policy_id}@copy.yaml | 35 + .../common/openapi/paths/agent_status.yaml | 11 + .../common/openapi/paths/agents.yaml | 29 + .../openapi/paths/agents@bulk_upgrade.yaml | 25 + .../common/openapi/paths/agents@enroll.yaml | 47 + .../common/openapi/paths/agents@setup.yaml | 48 + .../openapi/paths/agents@{agent_id}.yaml | 36 + .../openapi/paths/agents@{agent_id}@acks.yaml | 32 + .../paths/agents@{agent_id}@checkin.yaml | 60 + .../paths/agents@{agent_id}@events.yaml | 11 + .../paths/agents@{agent_id}@unenroll.yaml | 21 + .../paths/agents@{agent_id}@upgrade.yaml | 32 + .../openapi/paths/enrollment_api_keys.yaml | 13 + .../paths/enrollment_api_keys@{key_id}.yaml | 18 + .../common/openapi/paths/epm@categories.yaml | 24 + .../common/openapi/paths/epm@packages.yaml | 14 + .../openapi/paths/epm@packages@{pkgkey}.yaml | 91 + .../openapi/paths/install@{os_type}.yaml | 11 + .../openapi/paths/package_policies.yaml | 40 + .../package_policies@{package_policy_id}.yaml | 42 + .../common/openapi/paths/setup.yaml | 25 + .../common/openapi/spec_oas3.json | 4538 ----------------- 51 files changed, 4910 insertions(+), 4538 deletions(-) create mode 100644 x-pack/plugins/ingest_manager/common/openapi/README.md create mode 100644 x-pack/plugins/ingest_manager/common/openapi/bundled.json create mode 100644 x-pack/plugins/ingest_manager/common/openapi/bundled.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/README.md create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/headers/kbn_xsrf.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/parameters/kuery.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_index.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_size.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/access_api_key.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_event.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_metadata.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_policy.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_status.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_type.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/bulk_upgrade_agents.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/enrollment_api_key.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_event.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_policy.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_package_policy.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_info.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_policy.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/search_result.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/components/schemas/upgrade_agent.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/entrypoint.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/README.md create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@delete.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}@copy.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agent_status.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@bulk_upgrade.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@enroll.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@setup.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@acks.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@checkin.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@events.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@unenroll.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@upgrade.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys@{key_id}.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/epm@categories.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages@{pkgkey}.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/install@{os_type}.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/package_policies.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/package_policies@{package_policy_id}.yaml create mode 100644 x-pack/plugins/ingest_manager/common/openapi/paths/setup.yaml delete mode 100644 x-pack/plugins/ingest_manager/common/openapi/spec_oas3.json diff --git a/x-pack/plugins/ingest_manager/common/openapi/README.md b/x-pack/plugins/ingest_manager/common/openapi/README.md new file mode 100644 index 0000000000000..72204d483b120 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/README.md @@ -0,0 +1,14 @@ +## The `openapi` folder + +* `entrypoint.yaml` is the overview file which links to the various files on disk. +* `bundled.{yaml,json}` is the resolved output of that entry & other files in a single file. It's currently generated with: + + ``` + npx swagger-cli bundle -o bundled.json -t json entrypoint.yaml + npx swagger-cli bundle -o bundled.yaml -t yaml entrypoint.yaml + ``` +* [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method. +* [Components](components/README.md): Reusable components like [`schemas`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject), + [`responses`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject) + [`parameters`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject), etc + \ No newline at end of file diff --git a/x-pack/plugins/ingest_manager/common/openapi/bundled.json b/x-pack/plugins/ingest_manager/common/openapi/bundled.json new file mode 100644 index 0000000000000..1d00855de8935 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/bundled.json @@ -0,0 +1,2088 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Ingest Manager", + "version": "0.2", + "contact": { + "name": "Ingest Team" + }, + "license": { + "name": "Elastic" + } + }, + "servers": [ + { + "url": "http://localhost:5601/api/fleet", + "description": "local" + } + ], + "paths": { + "/agent_policies": { + "get": { + "summary": "Agent policy - List", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/agent_policy" + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "perPage": { + "type": "number" + } + }, + "required": [ + "items", + "total", + "page", + "perPage" + ] + } + } + } + } + }, + "operationId": "agent-policy-list", + "parameters": [ + { + "$ref": "#/components/parameters/page_size" + }, + { + "$ref": "#/components/parameters/page_index" + }, + { + "$ref": "#/components/parameters/kuery" + } + ], + "description": "" + }, + "post": { + "summary": "Agent policy - Create", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/agent_policy" + } + } + } + } + } + } + }, + "operationId": "post-agent-policy", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/new_agent_policy" + } + } + } + }, + "security": [], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/agent_policies/{agentPolicyId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentPolicyId", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Agent policy - Info", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/agent_policy" + } + }, + "required": [ + "item" + ] + } + } + } + } + }, + "operationId": "agent-policy-info", + "description": "Get one agent policy", + "parameters": [] + }, + "put": { + "summary": "Agent policy - Update", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/agent_policy" + } + }, + "required": [ + "item" + ] + } + } + } + } + }, + "operationId": "put-agent-policy-agentPolicyId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/new_agent_policy" + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/agent_policies/{agentPolicyId}/copy": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentPolicyId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Agent policy - copy one policy", + "operationId": "agent-policy-copy", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/agent_policy" + } + }, + "required": [ + "item" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + } + }, + "description": "" + }, + "description": "Copies one agent policy" + } + }, + "/agent_policies/delete": { + "post": { + "summary": "Agent policy - Delete", + "operationId": "post-agent-policy-delete", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "success": { + "type": "boolean" + } + }, + "required": [ + "id", + "success" + ] + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agentPolicyIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + }, + "parameters": [] + }, + "/agent-status": { + "get": { + "summary": "Fleet - Agent - Status for policy", + "tags": [], + "responses": {}, + "operationId": "get-fleet-agent-status", + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "policyId", + "in": "query", + "required": false + } + ] + } + }, + "/agents": { + "get": { + "summary": "Fleet - Agent - List", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "object" + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "perPage": { + "type": "number" + } + }, + "required": [ + "list", + "total", + "page", + "perPage" + ] + } + } + } + } + }, + "operationId": "get-fleet-agents", + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/agents/{agentId}/acks": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Fleet - Agent - Acks", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "acks" + ] + } + }, + "required": [ + "action" + ] + } + } + } + } + }, + "operationId": "post-fleet-agents-agentId-acks", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + } + } + } + }, + "/agents/{agentId}/checkin": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Fleet - Agent - Check In", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "checkin" + ] + }, + "actions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "data": { + "type": "object" + }, + "id": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + } + }, + "required": [ + "agent_id", + "data", + "id", + "created_at", + "type" + ] + } + } + } + } + } + } + } + }, + "operationId": "post-fleet-agents-agentId-checkin", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "security": [ + { + "Access API Key": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "local_metadata": { + "$ref": "#/components/schemas/agent_metadata" + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/new_agent_event" + } + } + } + } + } + } + } + } + }, + "/agents/{agentId}/events": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentId", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Fleet - Agent - Events", + "tags": [], + "responses": {}, + "operationId": "get-fleet-agents-agentId-events" + } + }, + "/agents/{agentId}/unenroll": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Fleet - Agent - Unenroll", + "tags": [], + "responses": {}, + "operationId": "post-fleet-agents-unenroll", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "/agents/{agentId}/upgrade": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Fleet - Agent - Upgrade", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/upgrade_agent" + } + } + } + }, + "400": { + "description": "BAD REQUEST", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/upgrade_agent" + } + } + } + } + }, + "operationId": "post-fleet-agents-upgrade", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/upgrade_agent" + } + } + } + } + } + }, + "/agents/bulk_upgrade": { + "post": { + "summary": "Fleet - Agent - Bulk Upgrade", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bulk_upgrade_agents" + } + } + } + }, + "400": { + "description": "BAD REQUEST", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/upgrade_agent" + } + } + } + } + }, + "operationId": "post-fleet-agents-bulk-upgrade", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bulk_upgrade_agents" + } + } + } + } + } + }, + "/agents/enroll": { + "post": { + "summary": "Fleet - Agent - Enroll", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "item": { + "$ref": "#/components/schemas/agent" + } + } + } + } + } + } + }, + "operationId": "post-fleet-agents-enroll", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PERMANENT", + "EPHEMERAL", + "TEMPORARY" + ] + }, + "shared_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "required": [ + "local", + "user_provided" + ], + "properties": { + "local": { + "$ref": "#/components/schemas/agent_metadata" + }, + "user_provided": { + "$ref": "#/components/schemas/agent_metadata" + } + } + } + }, + "required": [ + "type", + "metadata" + ] + } + } + } + }, + "security": [ + { + "Enrollment API Key": [] + } + ] + } + }, + "/agents/setup": { + "get": { + "summary": "Agents setup - Info", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "isInitialized": { + "type": "boolean" + } + }, + "required": [ + "isInitialized" + ] + } + } + } + } + }, + "operationId": "get-agents-setup", + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "summary": "Agents setup - Create", + "operationId": "post-agents-setup", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "isInitialized": { + "type": "boolean" + } + }, + "required": [ + "isInitialized" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "admin_username": { + "type": "string" + }, + "admin_password": { + "type": "string" + } + }, + "required": [ + "admin_username", + "admin_password" + ] + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/enrollment-api-keys": { + "get": { + "summary": "Enrollment - List", + "tags": [], + "responses": {}, + "operationId": "get-fleet-enrollment-api-keys", + "parameters": [] + }, + "post": { + "summary": "Enrollment - Create", + "tags": [], + "responses": {}, + "operationId": "post-fleet-enrollment-api-keys", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/enrollment-api-keys/{keyId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "keyId", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Enrollment - Info", + "tags": [], + "responses": {}, + "operationId": "get-fleet-enrollment-api-keys-keyId" + }, + "delete": { + "summary": "Enrollment - Delete", + "tags": [], + "responses": {}, + "operationId": "delete-fleet-enrollment-api-keys-keyId", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/epm/categories": { + "get": { + "summary": "EPM - Categories", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "count": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "count" + ] + } + } + } + } + } + }, + "operationId": "get-epm-categories" + } + }, + "/epm/packages": { + "get": { + "summary": "EPM - Packages - List", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/search_result" + } + } + } + } + } + }, + "operationId": "get-epm-list" + }, + "parameters": [] + }, + "/epm/packages/{pkgkey}": { + "get": { + "summary": "EPM - Packages - Info", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "allOf": [ + { + "properties": { + "response": { + "$ref": "#/components/schemas/package_info" + } + } + }, + { + "properties": { + "status": { + "type": "string", + "enum": [ + "installed", + "not_installed" + ] + }, + "savedObject": { + "type": "string" + } + }, + "required": [ + "status", + "savedObject" + ] + } + ] + } + } + } + } + }, + "operationId": "get-epm-package-pkgkey", + "security": [ + { + "basicAuth": [] + } + ] + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "pkgkey", + "in": "path", + "required": true + } + ], + "post": { + "summary": "EPM - Packages - Install", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "response": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "type" + ] + } + } + }, + "required": [ + "response" + ] + } + } + } + } + }, + "operationId": "post-epm-install-pkgkey", + "description": "", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + }, + "delete": { + "summary": "EPM - Packages - Delete", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "response": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "type" + ] + } + } + }, + "required": [ + "response" + ] + } + } + } + } + }, + "operationId": "post-epm-delete-pkgkey", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/agents/{agentId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentId", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Fleet - Agent - Info", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "type": "object" + } + }, + "required": [ + "item" + ] + } + } + } + } + }, + "operationId": "get-fleet-agents-agentId" + }, + "put": { + "summary": "Fleet - Agent - Update", + "tags": [], + "responses": {}, + "operationId": "put-fleet-agents-agentId", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + }, + "delete": { + "summary": "Fleet - Agent - Delete", + "tags": [], + "responses": {}, + "operationId": "delete-fleet-agents-agentId", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/install/{osType}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "osType", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Fleet - Get OS install script", + "tags": [], + "responses": {}, + "operationId": "get-fleet-install-osType" + } + }, + "/package_policies": { + "get": { + "summary": "PackagePolicies - List", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/package_policy" + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "perPage": { + "type": "number" + } + }, + "required": [ + "items" + ] + } + } + } + } + }, + "operationId": "get-packagePolicies", + "security": [], + "parameters": [] + }, + "parameters": [], + "post": { + "summary": "PackagePolicies - Create", + "operationId": "post-packagePolicies", + "responses": { + "200": { + "description": "OK" + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/new_package_policy" + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/package_policies/{packagePolicyId}": { + "get": { + "summary": "PackagePolicies - Info", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/package_policy" + } + }, + "required": [ + "item" + ] + } + } + } + } + }, + "operationId": "get-packagePolicies-packagePolicyId" + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "packagePolicyId", + "in": "path", + "required": true + } + ], + "put": { + "summary": "PackagePolicies - Update", + "operationId": "put-packagePolicies-packagePolicyId", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/package_policy" + }, + "sucess": { + "type": "boolean" + } + }, + "required": [ + "item", + "sucess" + ] + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/setup": { + "post": { + "summary": "Ingest Manager - Setup", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "isInitialized": { + "type": "boolean" + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + }, + "operationId": "post-setup", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + } + }, + "components": { + "securitySchemes": { + "basicAuth": { + "type": "http", + "scheme": "basic" + }, + "Enrollment API Key": { + "name": "Authorization", + "type": "apiKey", + "in": "header", + "description": "e.g. Authorization: ApiKey base64EnrollmentApiKey" + }, + "Access API Key": { + "name": "Authorization", + "type": "apiKey", + "in": "header", + "description": "e.g. Authorization: ApiKey base64AccessApiKey" + } + }, + "parameters": { + "page_size": { + "name": "perPage", + "in": "query", + "description": "The number of items to return", + "required": false, + "schema": { + "type": "integer", + "default": 50 + } + }, + "page_index": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + "kuery": { + "name": "kuery", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "kbn_xsrf": { + "schema": { + "type": "string" + }, + "in": "header", + "name": "kbn-xsrf", + "required": true + } + }, + "schemas": { + "new_agent_policy": { + "title": "NewAgentPolicy", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "new_package_policy": { + "title": "NewPackagePolicy", + "type": "object", + "description": "", + "properties": { + "enabled": { + "type": "boolean" + }, + "package": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "name", + "version", + "title" + ] + }, + "namespace": { + "type": "string" + }, + "output_id": { + "type": "string" + }, + "inputs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "processors": { + "type": "array", + "items": { + "type": "string" + } + }, + "streams": { + "type": "array", + "items": {} + }, + "config": { + "type": "object" + }, + "vars": { + "type": "object" + } + }, + "required": [ + "type", + "enabled", + "streams" + ] + } + }, + "policy_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "output_id", + "inputs", + "policy_id", + "name" + ] + }, + "package_policy": { + "title": "PackagePolicy", + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "revision": { + "type": "number" + }, + "inputs": { + "type": "array", + "items": {} + } + }, + "required": [ + "id", + "revision" + ] + }, + { + "$ref": "#/components/schemas/new_package_policy" + } + ] + }, + "agent_policy": { + "allOf": [ + { + "$ref": "#/components/schemas/new_agent_policy" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "packagePolicies": { + "oneOf": [ + { + "items": { + "type": "string" + } + }, + { + "items": { + "$ref": "#/components/schemas/package_policy" + } + } + ], + "type": "array" + }, + "updated_on": { + "type": "string", + "format": "date-time" + }, + "updated_by": { + "type": "string" + }, + "revision": { + "type": "number" + }, + "agents": { + "type": "number" + } + }, + "required": [ + "id", + "status" + ] + } + ] + }, + "agent_metadata": { + "title": "AgentMetadata", + "type": "object" + }, + "new_agent_event": { + "title": "NewAgentEvent", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "STATE", + "ERROR", + "ACTION_RESULT", + "ACTION" + ] + }, + "subtype": { + "type": "string", + "enum": [ + "RUNNING", + "STARTING", + "IN_PROGRESS", + "CONFIG", + "FAILED", + "STOPPING", + "STOPPED", + "DEGRADED", + "DATA_DUMP", + "ACKNOWLEDGED", + "UNKNOWN" + ] + }, + "timestamp": { + "type": "string" + }, + "message": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "agent_id": { + "type": "string" + }, + "policy_id": { + "type": "string" + }, + "stream_id": { + "type": "string" + }, + "action_id": { + "type": "string" + } + }, + "required": [ + "type", + "subtype", + "timestamp", + "message", + "agent_id" + ] + }, + "upgrade_agent": { + "title": "UpgradeAgent", + "oneOf": [ + { + "type": "object", + "properties": { + "version": { + "type": "string" + } + }, + "required": [ + "version" + ] + }, + { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "source_uri": { + "type": "string" + } + }, + "required": [ + "version" + ] + } + ] + }, + "bulk_upgrade_agents": { + "title": "BulkUpgradeAgents", + "oneOf": [ + { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "agents": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "version", + "agents" + ] + }, + { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "source_uri": { + "type": "string" + }, + "agents": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "version", + "agents" + ] + }, + { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "source_uri": { + "type": "string" + }, + "agents": { + "type": "string" + } + }, + "required": [ + "version", + "agents" + ] + } + ] + }, + "agent_type": { + "type": "string", + "title": "AgentType", + "enum": [ + "PERMANENT", + "EPHEMERAL", + "TEMPORARY" + ] + }, + "agent_event": { + "title": "AgentEvent", + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + { + "$ref": "#/components/schemas/new_agent_event" + } + ] + }, + "agent_status": { + "type": "string", + "title": "AgentStatus", + "enum": [ + "offline", + "error", + "online", + "inactive", + "warning" + ] + }, + "agent": { + "title": "Agent", + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/agent_type" + }, + "active": { + "type": "boolean" + }, + "enrolled_at": { + "type": "string" + }, + "unenrolled_at": { + "type": "string" + }, + "unenrollment_started_at": { + "type": "string" + }, + "shared_id": { + "type": "string" + }, + "access_api_key_id": { + "type": "string" + }, + "default_api_key_id": { + "type": "string" + }, + "policy_id": { + "type": "string" + }, + "policy_revision": { + "type": "number" + }, + "last_checkin": { + "type": "string" + }, + "user_provided_metadata": { + "$ref": "#/components/schemas/agent_metadata" + }, + "local_metadata": { + "$ref": "#/components/schemas/agent_metadata" + }, + "id": { + "type": "string" + }, + "current_error_events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/agent_event" + } + }, + "access_api_key": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/agent_status" + }, + "default_api_key": { + "type": "string" + } + }, + "required": [ + "type", + "active", + "enrolled_at", + "id", + "current_error_events", + "status" + ] + }, + "search_result": { + "title": "SearchResult", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "download": { + "type": "string" + }, + "icons": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + }, + "status": { + "type": "string" + }, + "savedObject": { + "type": "object" + } + }, + "required": [ + "description", + "download", + "icons", + "name", + "path", + "title", + "type", + "version", + "status" + ] + }, + "package_info": { + "title": "PackageInfo", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "version": { + "type": "string" + }, + "readme": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "requirement": { + "oneOf": [ + { + "properties": { + "kibana": { + "type": "object", + "properties": { + "versions": { + "type": "string" + } + } + } + } + }, + { + "properties": { + "elasticsearch": { + "type": "object", + "properties": { + "versions": { + "type": "string" + } + } + } + } + } + ], + "type": "object" + }, + "screenshots": { + "type": "array", + "items": { + "type": "object", + "properties": { + "src": { + "type": "string" + }, + "path": { + "type": "string" + }, + "title": { + "type": "string" + }, + "size": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "src", + "path" + ] + } + }, + "icons": { + "type": "array", + "items": { + "type": "string" + } + }, + "assets": { + "type": "array", + "items": { + "type": "string" + } + }, + "internal": { + "type": "boolean" + }, + "format_version": { + "type": "string" + }, + "data_streams": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "name": { + "type": "string" + }, + "release": { + "type": "string" + }, + "ingeset_pipeline": { + "type": "string" + }, + "vars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "default": { + "type": "string" + } + }, + "required": [ + "name", + "default" + ] + } + }, + "type": { + "type": "string" + }, + "package": { + "type": "string" + } + }, + "required": [ + "title", + "name", + "release", + "ingeset_pipeline", + "type", + "package" + ] + } + }, + "download": { + "type": "string" + }, + "path": { + "type": "string" + }, + "removable": { + "type": "boolean" + } + }, + "required": [ + "name", + "title", + "version", + "description", + "type", + "categories", + "requirement", + "assets", + "format_version", + "download", + "path" + ] + } + } + }, + "security": [ + { + "basicAuth": [] + } + ] +} \ No newline at end of file diff --git a/x-pack/plugins/ingest_manager/common/openapi/bundled.yaml b/x-pack/plugins/ingest_manager/common/openapi/bundled.yaml new file mode 100644 index 0000000000000..9ab85ab2b8232 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/bundled.yaml @@ -0,0 +1,1327 @@ +openapi: 3.0.0 +info: + title: Ingest Manager + version: '0.2' + contact: + name: Ingest Team + license: + name: Elastic +servers: + - url: 'http://localhost:5601/api/fleet' + description: local +paths: + /agent_policies: + get: + summary: Agent policy - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/agent_policy' + total: + type: number + page: + type: number + perPage: + type: number + required: + - items + - total + - page + - perPage + operationId: agent-policy-list + parameters: + - $ref: '#/components/parameters/page_size' + - $ref: '#/components/parameters/page_index' + - $ref: '#/components/parameters/kuery' + description: '' + post: + summary: Agent policy - Create + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/agent_policy' + operationId: post-agent-policy + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/new_agent_policy' + security: [] + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + '/agent_policies/{agentPolicyId}': + parameters: + - schema: + type: string + name: agentPolicyId + in: path + required: true + get: + summary: Agent policy - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/agent_policy' + required: + - item + operationId: agent-policy-info + description: Get one agent policy + parameters: [] + put: + summary: Agent policy - Update + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/agent_policy' + required: + - item + operationId: put-agent-policy-agentPolicyId + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/new_agent_policy' + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + '/agent_policies/{agentPolicyId}/copy': + parameters: + - schema: + type: string + name: agentPolicyId + in: path + required: true + post: + summary: Agent policy - copy one policy + operationId: agent-policy-copy + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/agent_policy' + required: + - item + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: + type: string + required: + - name + description: '' + description: Copies one agent policy + /agent_policies/delete: + post: + summary: Agent policy - Delete + operationId: post-agent-policy-delete + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + success: + type: boolean + required: + - id + - success + requestBody: + content: + application/json: + schema: + type: object + properties: + agentPolicyIds: + type: array + items: + type: string + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + parameters: [] + /agent-status: + get: + summary: Fleet - Agent - Status for policy + tags: [] + responses: {} + operationId: get-fleet-agent-status + parameters: + - schema: + type: string + name: policyId + in: query + required: false + /agents: + get: + summary: Fleet - Agent - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + list: + type: array + items: + type: object + total: + type: number + page: + type: number + perPage: + type: number + required: + - list + - total + - page + - perPage + operationId: get-fleet-agents + security: + - basicAuth: [] + '/agents/{agentId}/acks': + parameters: + - schema: + type: string + name: agentId + in: path + required: true + post: + summary: Fleet - Agent - Acks + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + action: + type: string + enum: + - acks + required: + - action + operationId: post-fleet-agents-agentId-acks + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + content: + application/json: + schema: + type: object + properties: {} + '/agents/{agentId}/checkin': + parameters: + - schema: + type: string + name: agentId + in: path + required: true + post: + summary: Fleet - Agent - Check In + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + action: + type: string + enum: + - checkin + actions: + type: array + items: + type: object + properties: + agent_id: + type: string + data: + type: object + id: + type: string + created_at: + type: string + format: date-time + type: + type: string + required: + - agent_id + - data + - id + - created_at + - type + operationId: post-fleet-agents-agentId-checkin + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + security: + - Access API Key: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + local_metadata: + $ref: '#/components/schemas/agent_metadata' + events: + type: array + items: + $ref: '#/components/schemas/new_agent_event' + '/agents/{agentId}/events': + parameters: + - schema: + type: string + name: agentId + in: path + required: true + get: + summary: Fleet - Agent - Events + tags: [] + responses: {} + operationId: get-fleet-agents-agentId-events + '/agents/{agentId}/unenroll': + parameters: + - schema: + type: string + name: agentId + in: path + required: true + post: + summary: Fleet - Agent - Unenroll + tags: [] + responses: {} + operationId: post-fleet-agents-unenroll + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + content: + application/json: + schema: + type: object + properties: + force: + type: boolean + '/agents/{agentId}/upgrade': + parameters: + - schema: + type: string + name: agentId + in: path + required: true + post: + summary: Fleet - Agent - Upgrade + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/upgrade_agent' + '400': + description: BAD REQUEST + content: + application/json: + schema: + $ref: '#/components/schemas/upgrade_agent' + operationId: post-fleet-agents-upgrade + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/upgrade_agent' + /agents/bulk_upgrade: + post: + summary: Fleet - Agent - Bulk Upgrade + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/bulk_upgrade_agents' + '400': + description: BAD REQUEST + content: + application/json: + schema: + $ref: '#/components/schemas/upgrade_agent' + operationId: post-fleet-agents-bulk-upgrade + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/bulk_upgrade_agents' + /agents/enroll: + post: + summary: Fleet - Agent - Enroll + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + action: + type: string + item: + $ref: '#/components/schemas/agent' + operationId: post-fleet-agents-enroll + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - PERMANENT + - EPHEMERAL + - TEMPORARY + shared_id: + type: string + metadata: + type: object + required: + - local + - user_provided + properties: + local: + $ref: '#/components/schemas/agent_metadata' + user_provided: + $ref: '#/components/schemas/agent_metadata' + required: + - type + - metadata + security: + - Enrollment API Key: [] + /agents/setup: + get: + summary: Agents setup - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + isInitialized: + type: boolean + required: + - isInitialized + operationId: get-agents-setup + security: + - basicAuth: [] + post: + summary: Agents setup - Create + operationId: post-agents-setup + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + isInitialized: + type: boolean + required: + - isInitialized + requestBody: + content: + application/json: + schema: + type: object + properties: + admin_username: + type: string + admin_password: + type: string + required: + - admin_username + - admin_password + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + /enrollment-api-keys: + get: + summary: Enrollment - List + tags: [] + responses: {} + operationId: get-fleet-enrollment-api-keys + parameters: [] + post: + summary: Enrollment - Create + tags: [] + responses: {} + operationId: post-fleet-enrollment-api-keys + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + '/enrollment-api-keys/{keyId}': + parameters: + - schema: + type: string + name: keyId + in: path + required: true + get: + summary: Enrollment - Info + tags: [] + responses: {} + operationId: get-fleet-enrollment-api-keys-keyId + delete: + summary: Enrollment - Delete + tags: [] + responses: {} + operationId: delete-fleet-enrollment-api-keys-keyId + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + /epm/categories: + get: + summary: EPM - Categories + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + title: + type: string + count: + type: number + required: + - id + - title + - count + operationId: get-epm-categories + /epm/packages: + get: + summary: EPM - Packages - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/search_result' + operationId: get-epm-list + parameters: [] + '/epm/packages/{pkgkey}': + get: + summary: EPM - Packages - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + allOf: + - properties: + response: + $ref: '#/components/schemas/package_info' + - properties: + status: + type: string + enum: + - installed + - not_installed + savedObject: + type: string + required: + - status + - savedObject + operationId: get-epm-package-pkgkey + security: + - basicAuth: [] + parameters: + - schema: + type: string + name: pkgkey + in: path + required: true + post: + summary: EPM - Packages - Install + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + response: + type: array + items: + type: object + properties: + id: + type: string + type: + type: string + required: + - id + - type + required: + - response + operationId: post-epm-install-pkgkey + description: '' + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + delete: + summary: EPM - Packages - Delete + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + response: + type: array + items: + type: object + properties: + id: + type: string + type: + type: string + required: + - id + - type + required: + - response + operationId: post-epm-delete-pkgkey + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + '/agents/{agentId}': + parameters: + - schema: + type: string + name: agentId + in: path + required: true + get: + summary: Fleet - Agent - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + type: object + required: + - item + operationId: get-fleet-agents-agentId + put: + summary: Fleet - Agent - Update + tags: [] + responses: {} + operationId: put-fleet-agents-agentId + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + delete: + summary: Fleet - Agent - Delete + tags: [] + responses: {} + operationId: delete-fleet-agents-agentId + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + '/install/{osType}': + parameters: + - schema: + type: string + name: osType + in: path + required: true + get: + summary: Fleet - Get OS install script + tags: [] + responses: {} + operationId: get-fleet-install-osType + /package_policies: + get: + summary: PackagePolicies - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/package_policy' + total: + type: number + page: + type: number + perPage: + type: number + required: + - items + operationId: get-packagePolicies + security: [] + parameters: [] + parameters: [] + post: + summary: PackagePolicies - Create + operationId: post-packagePolicies + responses: + '200': + description: OK + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/new_package_policy' + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + '/package_policies/{packagePolicyId}': + get: + summary: PackagePolicies - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/package_policy' + required: + - item + operationId: get-packagePolicies-packagePolicyId + parameters: + - schema: + type: string + name: packagePolicyId + in: path + required: true + put: + summary: PackagePolicies - Update + operationId: put-packagePolicies-packagePolicyId + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: '#/components/schemas/package_policy' + sucess: + type: boolean + required: + - item + - sucess + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + /setup: + post: + summary: Ingest Manager - Setup + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + isInitialized: + type: boolean + '500': + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + message: + type: string + operationId: post-setup + parameters: + - $ref: '#/components/parameters/kbn_xsrf' +components: + securitySchemes: + basicAuth: + type: http + scheme: basic + Enrollment API Key: + name: Authorization + type: apiKey + in: header + description: 'e.g. Authorization: ApiKey base64EnrollmentApiKey' + Access API Key: + name: Authorization + type: apiKey + in: header + description: 'e.g. Authorization: ApiKey base64AccessApiKey' + parameters: + page_size: + name: perPage + in: query + description: The number of items to return + required: false + schema: + type: integer + default: 50 + page_index: + name: page + in: query + required: false + schema: + type: integer + default: 1 + kuery: + name: kuery + in: query + required: false + schema: + type: string + kbn_xsrf: + schema: + type: string + in: header + name: kbn-xsrf + required: true + schemas: + new_agent_policy: + title: NewAgentPolicy + type: object + properties: + name: + type: string + namespace: + type: string + description: + type: string + new_package_policy: + title: NewPackagePolicy + type: object + description: '' + properties: + enabled: + type: boolean + package: + type: object + properties: + name: + type: string + version: + type: string + title: + type: string + required: + - name + - version + - title + namespace: + type: string + output_id: + type: string + inputs: + type: array + items: + type: object + properties: + type: + type: string + enabled: + type: boolean + processors: + type: array + items: + type: string + streams: + type: array + items: {} + config: + type: object + vars: + type: object + required: + - type + - enabled + - streams + policy_id: + type: string + name: + type: string + description: + type: string + required: + - output_id + - inputs + - policy_id + - name + package_policy: + title: PackagePolicy + allOf: + - type: object + properties: + id: + type: string + revision: + type: number + inputs: + type: array + items: {} + required: + - id + - revision + - $ref: '#/components/schemas/new_package_policy' + agent_policy: + allOf: + - $ref: '#/components/schemas/new_agent_policy' + - type: object + properties: + id: + type: string + status: + type: string + enum: + - active + - inactive + packagePolicies: + oneOf: + - items: + type: string + - items: + $ref: '#/components/schemas/package_policy' + type: array + updated_on: + type: string + format: date-time + updated_by: + type: string + revision: + type: number + agents: + type: number + required: + - id + - status + agent_metadata: + title: AgentMetadata + type: object + new_agent_event: + title: NewAgentEvent + type: object + properties: + type: + type: string + enum: + - STATE + - ERROR + - ACTION_RESULT + - ACTION + subtype: + type: string + enum: + - RUNNING + - STARTING + - IN_PROGRESS + - CONFIG + - FAILED + - STOPPING + - STOPPED + - DEGRADED + - DATA_DUMP + - ACKNOWLEDGED + - UNKNOWN + timestamp: + type: string + message: + type: string + payload: + type: string + agent_id: + type: string + policy_id: + type: string + stream_id: + type: string + action_id: + type: string + required: + - type + - subtype + - timestamp + - message + - agent_id + upgrade_agent: + title: UpgradeAgent + oneOf: + - type: object + properties: + version: + type: string + required: + - version + - type: object + properties: + version: + type: string + source_uri: + type: string + required: + - version + bulk_upgrade_agents: + title: BulkUpgradeAgents + oneOf: + - type: object + properties: + version: + type: string + agents: + type: array + items: + type: string + required: + - version + - agents + - type: object + properties: + version: + type: string + source_uri: + type: string + agents: + type: array + items: + type: string + required: + - version + - agents + - type: object + properties: + version: + type: string + source_uri: + type: string + agents: + type: string + required: + - version + - agents + agent_type: + type: string + title: AgentType + enum: + - PERMANENT + - EPHEMERAL + - TEMPORARY + agent_event: + title: AgentEvent + allOf: + - type: object + properties: + id: + type: string + required: + - id + - $ref: '#/components/schemas/new_agent_event' + agent_status: + type: string + title: AgentStatus + enum: + - offline + - error + - online + - inactive + - warning + agent: + title: Agent + type: object + properties: + type: + $ref: '#/components/schemas/agent_type' + active: + type: boolean + enrolled_at: + type: string + unenrolled_at: + type: string + unenrollment_started_at: + type: string + shared_id: + type: string + access_api_key_id: + type: string + default_api_key_id: + type: string + policy_id: + type: string + policy_revision: + type: number + last_checkin: + type: string + user_provided_metadata: + $ref: '#/components/schemas/agent_metadata' + local_metadata: + $ref: '#/components/schemas/agent_metadata' + id: + type: string + current_error_events: + type: array + items: + $ref: '#/components/schemas/agent_event' + access_api_key: + type: string + status: + $ref: '#/components/schemas/agent_status' + default_api_key: + type: string + required: + - type + - active + - enrolled_at + - id + - current_error_events + - status + search_result: + title: SearchResult + type: object + properties: + description: + type: string + download: + type: string + icons: + type: string + name: + type: string + path: + type: string + title: + type: string + type: + type: string + version: + type: string + status: + type: string + savedObject: + type: object + required: + - description + - download + - icons + - name + - path + - title + - type + - version + - status + package_info: + title: PackageInfo + type: object + properties: + name: + type: string + title: + type: string + version: + type: string + readme: + type: string + description: + type: string + type: + type: string + categories: + type: array + items: + type: string + requirement: + oneOf: + - properties: + kibana: + type: object + properties: + versions: + type: string + - properties: + elasticsearch: + type: object + properties: + versions: + type: string + type: object + screenshots: + type: array + items: + type: object + properties: + src: + type: string + path: + type: string + title: + type: string + size: + type: string + type: + type: string + required: + - src + - path + icons: + type: array + items: + type: string + assets: + type: array + items: + type: string + internal: + type: boolean + format_version: + type: string + data_streams: + type: array + items: + type: object + properties: + title: + type: string + name: + type: string + release: + type: string + ingeset_pipeline: + type: string + vars: + type: array + items: + type: object + properties: + name: + type: string + default: + type: string + required: + - name + - default + type: + type: string + package: + type: string + required: + - title + - name + - release + - ingeset_pipeline + - type + - package + download: + type: string + path: + type: string + removable: + type: boolean + required: + - name + - title + - version + - description + - type + - categories + - requirement + - assets + - format_version + - download + - path +security: + - basicAuth: [] diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/README.md b/x-pack/plugins/ingest_manager/common/openapi/components/README.md new file mode 100644 index 0000000000000..1579c2d2b6eb5 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/README.md @@ -0,0 +1,13 @@ +Reusable components +=========== + +* Created the following folders for the various OpenAPI component types: + - `schemas` - reusable [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) + - `responses` - reusable [Response Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject) + - `parameters` - reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject) + - `examples` - reusable [Example Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) + - `headers` - reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject) + - `request_bodies` - reusable [Request Body Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject) + - `links` - reusable [Link Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#linkObject) + - `callbacks` - reusable [Callback Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject) + - `security_schemes` - reusable [Security Scheme Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject) diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/headers/kbn_xsrf.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/headers/kbn_xsrf.yaml new file mode 100644 index 0000000000000..3d8dfae634e68 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/headers/kbn_xsrf.yaml @@ -0,0 +1,5 @@ +schema: + type: string +in: header +name: kbn-xsrf +required: true diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/parameters/kuery.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/parameters/kuery.yaml new file mode 100644 index 0000000000000..b96ffd54d37ce --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/parameters/kuery.yaml @@ -0,0 +1,5 @@ +name: kuery +in: query +required: false +schema: + type: string diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_index.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_index.yaml new file mode 100644 index 0000000000000..908c19583045b --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_index.yaml @@ -0,0 +1,6 @@ +name: page +in: query +required: false +schema: + type: integer + default: 1 diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_size.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_size.yaml new file mode 100644 index 0000000000000..698491def3b39 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/parameters/page_size.yaml @@ -0,0 +1,7 @@ +name: perPage +in: query +description: The number of items to return +required: false +schema: + type: integer + default: 50 diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/access_api_key.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/access_api_key.yaml new file mode 100644 index 0000000000000..31e2072ddefbe --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/access_api_key.yaml @@ -0,0 +1,3 @@ +type: string +title: AccessApiKey +format: byte diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent.yaml new file mode 100644 index 0000000000000..df106093a8d8d --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent.yaml @@ -0,0 +1,48 @@ +title: Agent +type: object +properties: + type: + $ref: ./agent_type.yaml + active: + type: boolean + enrolled_at: + type: string + unenrolled_at: + type: string + unenrollment_started_at: + type: string + shared_id: + type: string + access_api_key_id: + type: string + default_api_key_id: + type: string + policy_id: + type: string + policy_revision: + type: number + last_checkin: + type: string + user_provided_metadata: + $ref: ./agent_metadata.yaml + local_metadata: + $ref: ./agent_metadata.yaml + id: + type: string + current_error_events: + type: array + items: + $ref: ./agent_event.yaml + access_api_key: + type: string + status: + $ref: ./agent_status.yaml + default_api_key: + type: string +required: + - type + - active + - enrolled_at + - id + - current_error_events + - status diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_event.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_event.yaml new file mode 100644 index 0000000000000..ada709378a9b1 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_event.yaml @@ -0,0 +1,9 @@ +title: AgentEvent +allOf: + - type: object + properties: + id: + type: string + required: + - id + - $ref: ./new_agent_event.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_metadata.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_metadata.yaml new file mode 100644 index 0000000000000..d37321f59a58b --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_metadata.yaml @@ -0,0 +1,2 @@ +title: AgentMetadata +type: object diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_policy.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_policy.yaml new file mode 100644 index 0000000000000..7395e45365ea9 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_policy.yaml @@ -0,0 +1,30 @@ +allOf: + - $ref: ./new_agent_policy.yaml + - type: object + properties: + id: + type: string + status: + type: string + enum: + - active + - inactive + packagePolicies: + oneOf: + - items: + type: string + - items: + $ref: ./package_policy.yaml + type: array + updated_on: + type: string + format: date-time + updated_by: + type: string + revision: + type: number + agents: + type: number + required: + - id + - status diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_status.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_status.yaml new file mode 100644 index 0000000000000..076a7cc5036bb --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_status.yaml @@ -0,0 +1,8 @@ +type: string +title: AgentStatus +enum: + - offline + - error + - online + - inactive + - warning diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_type.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_type.yaml new file mode 100644 index 0000000000000..da42f95c9e1d9 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/agent_type.yaml @@ -0,0 +1,6 @@ +type: string +title: AgentType +enum: + - PERMANENT + - EPHEMERAL + - TEMPORARY diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/bulk_upgrade_agents.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/bulk_upgrade_agents.yaml new file mode 100644 index 0000000000000..da06aa6fa8252 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/bulk_upgrade_agents.yaml @@ -0,0 +1,37 @@ +title: BulkUpgradeAgents +oneOf: + - type: object + properties: + version: + type: string + agents: + type: array + items: + type: string + required: + - version + - agents + - type: object + properties: + version: + type: string + source_uri: + type: string + agents: + type: array + items: + type: string + required: + - version + - agents + - type: object + properties: + version: + type: string + source_uri: + type: string + agents: + type: string + required: + - version + - agents diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/enrollment_api_key.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/enrollment_api_key.yaml new file mode 100644 index 0000000000000..3efe77b3bd606 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/enrollment_api_key.yaml @@ -0,0 +1,3 @@ +type: string +title: EnrollmentApiKey +format: byte diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_event.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_event.yaml new file mode 100644 index 0000000000000..ee4ddfb5f004d --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_event.yaml @@ -0,0 +1,44 @@ +title: NewAgentEvent +type: object +properties: + type: + type: string + enum: + - STATE + - ERROR + - ACTION_RESULT + - ACTION + subtype: + type: string + enum: + - RUNNING + - STARTING + - IN_PROGRESS + - CONFIG + - FAILED + - STOPPING + - STOPPED + - DEGRADED + - DATA_DUMP + - ACKNOWLEDGED + - UNKNOWN + timestamp: + type: string + message: + type: string + payload: + type: string + agent_id: + type: string + policy_id: + type: string + stream_id: + type: string + action_id: + type: string +required: + - type + - subtype + - timestamp + - message + - agent_id diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_policy.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_policy.yaml new file mode 100644 index 0000000000000..7070876cbea59 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_agent_policy.yaml @@ -0,0 +1,9 @@ +title: NewAgentPolicy +type: object +properties: + name: + type: string + namespace: + type: string + description: + type: string diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_package_policy.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_package_policy.yaml new file mode 100644 index 0000000000000..61b1fa678d407 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/new_package_policy.yaml @@ -0,0 +1,58 @@ +title: NewPackagePolicy +type: object +description: '' +properties: + enabled: + type: boolean + package: + type: object + properties: + name: + type: string + version: + type: string + title: + type: string + required: + - name + - version + - title + namespace: + type: string + output_id: + type: string + inputs: + type: array + items: + type: object + properties: + type: + type: string + enabled: + type: boolean + processors: + type: array + items: + type: string + streams: + type: array + items: {} + config: + type: object + vars: + type: object + required: + - type + - enabled + - streams + policy_id: + type: string + name: + type: string + description: + type: string +required: + - output_id + - inputs + - policy_id + - name diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_info.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_info.yaml new file mode 100644 index 0000000000000..3e0742c1879cb --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_info.yaml @@ -0,0 +1,118 @@ +title: PackageInfo +type: object +properties: + name: + type: string + title: + type: string + version: + type: string + readme: + type: string + description: + type: string + type: + type: string + categories: + type: array + items: + type: string + requirement: + oneOf: + - properties: + kibana: + type: object + properties: + versions: + type: string + - properties: + elasticsearch: + type: object + properties: + versions: + type: string + type: object + screenshots: + type: array + items: + type: object + properties: + src: + type: string + path: + type: string + title: + type: string + size: + type: string + type: + type: string + required: + - src + - path + icons: + type: array + items: + type: string + assets: + type: array + items: + type: string + internal: + type: boolean + format_version: + type: string + data_streams: + type: array + items: + type: object + properties: + title: + type: string + name: + type: string + release: + type: string + ingeset_pipeline: + type: string + vars: + type: array + items: + type: object + properties: + name: + type: string + default: + type: string + required: + - name + - default + type: + type: string + package: + type: string + required: + - title + - name + - release + - ingeset_pipeline + - type + - package + download: + type: string + path: + type: string + removable: + type: boolean +required: + - name + - title + - version + - description + - type + - categories + - requirement + - assets + - format_version + - download + - path diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_policy.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_policy.yaml new file mode 100644 index 0000000000000..99bc64f793379 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/package_policy.yaml @@ -0,0 +1,15 @@ +title: PackagePolicy +allOf: + - type: object + properties: + id: + type: string + revision: + type: number + inputs: + type: array + items: {} + required: + - id + - revision + - $ref: ./new_package_policy.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/search_result.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/search_result.yaml new file mode 100644 index 0000000000000..b67ff61c5ab60 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/search_result.yaml @@ -0,0 +1,33 @@ +title: SearchResult +type: object +properties: + description: + type: string + download: + type: string + icons: + type: string + name: + type: string + path: + type: string + title: + type: string + type: + type: string + version: + type: string + status: + type: string + savedObject: + type: object +required: + - description + - download + - icons + - name + - path + - title + - type + - version + - status diff --git a/x-pack/plugins/ingest_manager/common/openapi/components/schemas/upgrade_agent.yaml b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/upgrade_agent.yaml new file mode 100644 index 0000000000000..11a2b5846ba1e --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/components/schemas/upgrade_agent.yaml @@ -0,0 +1,16 @@ +title: UpgradeAgent +oneOf: + - type: object + properties: + version: + type: string + required: + - version + - type: object + properties: + version: + type: string + source_uri: + type: string + required: + - version diff --git a/x-pack/plugins/ingest_manager/common/openapi/entrypoint.yaml b/x-pack/plugins/ingest_manager/common/openapi/entrypoint.yaml new file mode 100644 index 0000000000000..791d3da56783e --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/entrypoint.yaml @@ -0,0 +1,77 @@ +openapi: 3.0.0 +info: + title: Ingest Manager + version: '0.2' + contact: + name: Ingest Team + license: + name: Elastic +servers: + - url: 'http://localhost:5601/api/fleet' + description: local +paths: + /agent_policies: + $ref: paths/agent_policies.yaml + '/agent_policies/{agentPolicyId}': + $ref: 'paths/agent_policies@{agent_policy_id}.yaml' + '/agent_policies/{agentPolicyId}/copy': + $ref: 'paths/agent_policies@{agent_policy_id}@copy.yaml' + /agent_policies/delete: + $ref: paths/agent_policies@delete.yaml + /agent-status: + $ref: paths/agent_status.yaml + /agents: + $ref: paths/agents.yaml + '/agents/{agentId}/acks': + $ref: 'paths/agents@{agent_id}@acks.yaml' + '/agents/{agentId}/checkin': + $ref: 'paths/agents@{agent_id}@checkin.yaml' + '/agents/{agentId}/events': + $ref: 'paths/agents@{agent_id}@events.yaml' + '/agents/{agentId}/unenroll': + $ref: 'paths/agents@{agent_id}@unenroll.yaml' + '/agents/{agentId}/upgrade': + $ref: 'paths/agents@{agent_id}@upgrade.yaml' + /agents/bulk_upgrade: + $ref: paths/agents@bulk_upgrade.yaml + /agents/enroll: + $ref: paths/agents@enroll.yaml + /agents/setup: + $ref: paths/agents@setup.yaml + /enrollment-api-keys: + $ref: paths/enrollment_api_keys.yaml + '/enrollment-api-keys/{keyId}': + $ref: 'paths/enrollment_api_keys@{key_id}.yaml' + /epm/categories: + $ref: paths/epm@categories.yaml + /epm/packages: + $ref: paths/epm@packages.yaml + '/epm/packages/{pkgkey}': + $ref: 'paths/epm@packages@{pkgkey}.yaml' + '/agents/{agentId}': + $ref: 'paths/agents@{agent_id}.yaml' + '/install/{osType}': + $ref: 'paths/install@{os_type}.yaml' + /package_policies: + $ref: paths/package_policies.yaml + '/package_policies/{packagePolicyId}': + $ref: 'paths/package_policies@{package_policy_id}.yaml' + /setup: + $ref: paths/setup.yaml +components: + securitySchemes: + basicAuth: + type: http + scheme: basic + Enrollment API Key: + name: Authorization + type: apiKey + in: header + description: 'e.g. Authorization: ApiKey base64EnrollmentApiKey' + Access API Key: + name: Authorization + type: apiKey + in: header + description: 'e.g. Authorization: ApiKey base64AccessApiKey' +security: + - basicAuth: [] diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/README.md b/x-pack/plugins/ingest_manager/common/openapi/paths/README.md new file mode 100644 index 0000000000000..f5003e3e3473b --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/README.md @@ -0,0 +1,130 @@ +Paths +===== + +Organize our path definitions within this folder. We will reference our paths from our main `openapi.json` entrypoint file. + +It may help us to adopt some conventions: + +* path separator token (e.g. `@`) or subfolders +* path parameter (e.g. `{example}`) +* file-per-path or file-per-operation + +There are different benefits and drawbacks to each decision. + +We can adopt any organization we wish. We have some tips for organizing paths based on common practices. + +## Each path in a separate file + +Use a predefined "path separator" and keep all of our path files in the top level of the `paths` folder. + +``` +paths/ +├── README.md +├── agent_policies.yaml +├── agent_policies@delete.yaml +├── agent_policies@{agent_policy_id}.yaml +├── agent_policies@{agent_policy_id}@copy.yaml +├── agent_status.yaml +├── agents.yaml +├── agents@bulk_upgrade.yaml +├── agents@enroll.yaml +├── agents@setup.yaml +├── agents@{agent_id}.yaml +├── agents@{agent_id}@acks.yaml +├── agents@{agent_id}@checkin.yaml +├── agents@{agent_id}@events.yaml +├── agents@{agent_id}@unenroll.yaml +├── agents@{agent_id}@upgrade.yaml +├── enrollment_api_keys.yaml +├── enrollment_api_keys@{key_id}.yaml +├── epm@categories.yaml +├── epm@packages.yaml +├── epm@packages@{pkgkey}.yaml +├── install@{os_type}.yaml +├── package_policies.yaml +├── package_policies@{package_policy_id}.yaml +└── setup.yaml +``` + +Redocly recommends using the `@` character for this case. + +In addition, Redocly recommends placing path parameters within `{}` curly braces if we adopt this style. + +#### Motivations + +* Quickly see a list of all paths. Many people think in terms of the "number" of "endpoints" (paths), and not the "number" of "operations" (paths * http methods). + +* Only the "file-per-path" option is semantically correct with the OpenAPI Specification 3.0.2. However, Redocly's openapi-cli will build valid bundles for any of the other options too. + + +#### Drawbacks + +* This may require multiple definitions per http method within a single file. +* It requires settling on a path separator (that is allowed to be used in filenames) and sticking to that convention. + +## Each operation in a separate file + +We may also place each operation in a separate file. + +In this case, if we want all paths at the top-level, we can concatenate the http method to the path name. Similar to the above option, we can + +### Files at top-level of `paths` + +We may name our files with some concatenation for the http method. For example, following a convention such as: `-.json`. + +#### Motivations + +* Quickly see all operations without needing to navigate subfolders. + +#### Drawbacks + +* Adopting an unusual path separator convention, instead of using subfolders. + +### Use subfolders to mirror API path structure + +Example: +``` +GET /customers + +/paths/customers/get.json +``` + +In this case, the path id defined within subfolders which mirror the API URL structure. + +Example with path parameter: +``` +GET /customers/{id} + +/paths/customers/{id}/get.json +``` + +#### Motivations + +It matches the URL structure. + +It is pretty easy to reference: + +```json +paths: + '/customers/{id}': + get: + $ref: ./paths/customers/{id}/get.json + put: + $ref: ./paths/customers/{id}/put.json +``` + +#### Drawbacks + +If we have a lot of nested folders, it may be confusing to reference our schemas. + +Example +``` +file: /paths/customers/{id}/timeline/{messageId}/get.json + +# excerpt of file + headers: + Rate-Limit-Remaining: + $ref: ../../../../../components/headers/Rate-Limit-Remaining.json + +``` +Notice the `../../../../../` in the ref which requires some attention to formulate correctly. While openapi-cli has a linter which suggests possible refs when there is a mistake, this is still a net drawback for APIs with deep paths. diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies.yaml new file mode 100644 index 0000000000000..2ba14fba7232b --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies.yaml @@ -0,0 +1,54 @@ +get: + summary: Agent policy - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: ../components/schemas/agent_policy.yaml + total: + type: number + page: + type: number + perPage: + type: number + required: + - items + - total + - page + - perPage + operationId: agent-policy-list + parameters: + - $ref: ../components/parameters/page_size.yaml + - $ref: ../components/parameters/page_index.yaml + - $ref: ../components/parameters/kuery.yaml + description: '' +post: + summary: Agent policy - Create + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: ../components/schemas/agent_policy.yaml + operationId: post-agent-policy + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/new_agent_policy.yaml + security: [] + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@delete.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@delete.yaml new file mode 100644 index 0000000000000..ae975274d80e5 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@delete.yaml @@ -0,0 +1,33 @@ +post: + summary: Agent policy - Delete + operationId: post-agent-policy-delete + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + success: + type: boolean + required: + - id + - success + requestBody: + content: + application/json: + schema: + type: object + properties: + agentPolicyIds: + type: array + items: + type: string + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml +parameters: [] diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}.yaml new file mode 100644 index 0000000000000..15910b0116b7f --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}.yaml @@ -0,0 +1,47 @@ +parameters: + - schema: + type: string + name: agentPolicyId + in: path + required: true +get: + summary: Agent policy - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: ../components/schemas/agent_policy.yaml + required: + - item + operationId: agent-policy-info + description: Get one agent policy + parameters: [] +put: + summary: Agent policy - Update + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: ../components/schemas/agent_policy.yaml + required: + - item + operationId: put-agent-policy-agentPolicyId + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/new_agent_policy.yaml + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}@copy.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}@copy.yaml new file mode 100644 index 0000000000000..4b42f8cab0677 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_policies@{agent_policy_id}@copy.yaml @@ -0,0 +1,35 @@ +parameters: + - schema: + type: string + name: agentPolicyId + in: path + required: true +post: + summary: Agent policy - copy one policy + operationId: agent-policy-copy + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: ../components/schemas/agent_policy.yaml + required: + - item + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: + type: string + required: + - name + description: '' + description: Copies one agent policy diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agent_status.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_status.yaml new file mode 100644 index 0000000000000..77ec9e85069a2 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agent_status.yaml @@ -0,0 +1,11 @@ +get: + summary: Fleet - Agent - Status for policy + tags: [] + responses: {} + operationId: get-fleet-agent-status + parameters: + - schema: + type: string + name: policyId + in: query + required: false diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents.yaml new file mode 100644 index 0000000000000..e5039bc2caccf --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents.yaml @@ -0,0 +1,29 @@ +get: + summary: Fleet - Agent - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + list: + type: array + items: + type: object + total: + type: number + page: + type: number + perPage: + type: number + required: + - list + - total + - page + - perPage + operationId: get-fleet-agents + security: + - basicAuth: [] diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@bulk_upgrade.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@bulk_upgrade.yaml new file mode 100644 index 0000000000000..2092fbf000ab8 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@bulk_upgrade.yaml @@ -0,0 +1,25 @@ +post: + summary: Fleet - Agent - Bulk Upgrade + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/bulk_upgrade_agents.yaml + '400': + description: BAD REQUEST + content: + application/json: + schema: + $ref: ../components/schemas/upgrade_agent.yaml + operationId: post-fleet-agents-bulk-upgrade + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + required: true + content: + application/json: + schema: + $ref: ../components/schemas/bulk_upgrade_agents.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@enroll.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@enroll.yaml new file mode 100644 index 0000000000000..a0c1c8c28e721 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@enroll.yaml @@ -0,0 +1,47 @@ +post: + summary: Fleet - Agent - Enroll + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + action: + type: string + item: + $ref: ../components/schemas/agent.yaml + operationId: post-fleet-agents-enroll + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - PERMANENT + - EPHEMERAL + - TEMPORARY + shared_id: + type: string + metadata: + type: object + required: + - local + - user_provided + properties: + local: + $ref: ../components/schemas/agent_metadata.yaml + user_provided: + $ref: ../components/schemas/agent_metadata.yaml + required: + - type + - metadata + security: + - Enrollment API Key: [] diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@setup.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@setup.yaml new file mode 100644 index 0000000000000..87556dca0afbb --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@setup.yaml @@ -0,0 +1,48 @@ +get: + summary: Agents setup - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + isInitialized: + type: boolean + required: + - isInitialized + operationId: get-agents-setup + security: + - basicAuth: [] +post: + summary: Agents setup - Create + operationId: post-agents-setup + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + isInitialized: + type: boolean + required: + - isInitialized + requestBody: + content: + application/json: + schema: + type: object + properties: + admin_username: + type: string + admin_password: + type: string + required: + - admin_username + - admin_password + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}.yaml new file mode 100644 index 0000000000000..e65c80d8fae88 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}.yaml @@ -0,0 +1,36 @@ +parameters: + - schema: + type: string + name: agentId + in: path + required: true +get: + summary: Fleet - Agent - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + type: object + required: + - item + operationId: get-fleet-agents-agentId +put: + summary: Fleet - Agent - Update + tags: [] + responses: {} + operationId: put-fleet-agents-agentId + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml +delete: + summary: Fleet - Agent - Delete + tags: [] + responses: {} + operationId: delete-fleet-agents-agentId + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@acks.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@acks.yaml new file mode 100644 index 0000000000000..6728554bf542e --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@acks.yaml @@ -0,0 +1,32 @@ +parameters: + - schema: + type: string + name: agentId + in: path + required: true +post: + summary: Fleet - Agent - Acks + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + action: + type: string + enum: + - acks + required: + - action + operationId: post-fleet-agents-agentId-acks + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: {} diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@checkin.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@checkin.yaml new file mode 100644 index 0000000000000..cc797c7356603 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@checkin.yaml @@ -0,0 +1,60 @@ +parameters: + - schema: + type: string + name: agentId + in: path + required: true +post: + summary: Fleet - Agent - Check In + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + action: + type: string + enum: + - checkin + actions: + type: array + items: + type: object + properties: + agent_id: + type: string + data: + type: object + id: + type: string + created_at: + type: string + format: date-time + type: + type: string + required: + - agent_id + - data + - id + - created_at + - type + operationId: post-fleet-agents-agentId-checkin + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + security: + - Access API Key: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + local_metadata: + $ref: ../components/schemas/agent_metadata.yaml + events: + type: array + items: + $ref: ../components/schemas/new_agent_event.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@events.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@events.yaml new file mode 100644 index 0000000000000..db8d28f72b5a2 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@events.yaml @@ -0,0 +1,11 @@ +parameters: + - schema: + type: string + name: agentId + in: path + required: true +get: + summary: Fleet - Agent - Events + tags: [] + responses: {} + operationId: get-fleet-agents-agentId-events diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@unenroll.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@unenroll.yaml new file mode 100644 index 0000000000000..00c9cdfbcf4ae --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@unenroll.yaml @@ -0,0 +1,21 @@ +parameters: + - schema: + type: string + name: agentId + in: path + required: true +post: + summary: Fleet - Agent - Unenroll + tags: [] + responses: {} + operationId: post-fleet-agents-unenroll + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + force: + type: boolean diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@upgrade.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@upgrade.yaml new file mode 100644 index 0000000000000..ce871cac0d068 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/agents@{agent_id}@upgrade.yaml @@ -0,0 +1,32 @@ +parameters: + - schema: + type: string + name: agentId + in: path + required: true +post: + summary: Fleet - Agent - Upgrade + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/upgrade_agent.yaml + '400': + description: BAD REQUEST + content: + application/json: + schema: + $ref: ../components/schemas/upgrade_agent.yaml + operationId: post-fleet-agents-upgrade + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + required: true + content: + application/json: + schema: + $ref: ../components/schemas/upgrade_agent.yaml + diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys.yaml new file mode 100644 index 0000000000000..22d27c0596d68 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys.yaml @@ -0,0 +1,13 @@ +get: + summary: Enrollment - List + tags: [] + responses: {} + operationId: get-fleet-enrollment-api-keys + parameters: [] +post: + summary: Enrollment - Create + tags: [] + responses: {} + operationId: post-fleet-enrollment-api-keys + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys@{key_id}.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys@{key_id}.yaml new file mode 100644 index 0000000000000..3b43950427e82 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/enrollment_api_keys@{key_id}.yaml @@ -0,0 +1,18 @@ +parameters: + - schema: + type: string + name: keyId + in: path + required: true +get: + summary: Enrollment - Info + tags: [] + responses: {} + operationId: get-fleet-enrollment-api-keys-keyId +delete: + summary: Enrollment - Delete + tags: [] + responses: {} + operationId: delete-fleet-enrollment-api-keys-keyId + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/epm@categories.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/epm@categories.yaml new file mode 100644 index 0000000000000..0fc26a4e5c826 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/epm@categories.yaml @@ -0,0 +1,24 @@ +get: + summary: EPM - Categories + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + title: + type: string + count: + type: number + required: + - id + - title + - count + operationId: get-epm-categories diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages.yaml new file mode 100644 index 0000000000000..afbe8ee2dc321 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages.yaml @@ -0,0 +1,14 @@ +get: + summary: EPM - Packages - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: ../components/schemas/search_result.yaml + operationId: get-epm-list +parameters: [] diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages@{pkgkey}.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages@{pkgkey}.yaml new file mode 100644 index 0000000000000..43937aa153f50 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/epm@packages@{pkgkey}.yaml @@ -0,0 +1,91 @@ +get: + summary: EPM - Packages - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + allOf: + - properties: + response: + $ref: ../components/schemas/package_info.yaml + - properties: + status: + type: string + enum: + - installed + - not_installed + savedObject: + type: string + required: + - status + - savedObject + operationId: get-epm-package-pkgkey + security: + - basicAuth: [] +parameters: + - schema: + type: string + name: pkgkey + in: path + required: true +post: + summary: EPM - Packages - Install + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + response: + type: array + items: + type: object + properties: + id: + type: string + type: + type: string + required: + - id + - type + required: + - response + operationId: post-epm-install-pkgkey + description: '' + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml +delete: + summary: EPM - Packages - Delete + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + response: + type: array + items: + type: object + properties: + id: + type: string + type: + type: string + required: + - id + - type + required: + - response + operationId: post-epm-delete-pkgkey + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/install@{os_type}.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/install@{os_type}.yaml new file mode 100644 index 0000000000000..80351aa7ae119 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/install@{os_type}.yaml @@ -0,0 +1,11 @@ +parameters: + - schema: + type: string + name: osType + in: path + required: true +get: + summary: Fleet - Get OS install script + tags: [] + responses: {} + operationId: get-fleet-install-osType diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/package_policies.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/package_policies.yaml new file mode 100644 index 0000000000000..47eca50f0524b --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/package_policies.yaml @@ -0,0 +1,40 @@ +get: + summary: PackagePolicies - List + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: ../components/schemas/package_policy.yaml + total: + type: number + page: + type: number + perPage: + type: number + required: + - items + operationId: get-packagePolicies + security: [] + parameters: [] +parameters: [] +post: + summary: PackagePolicies - Create + operationId: post-packagePolicies + responses: + '200': + description: OK + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/new_package_policy.yaml + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/package_policies@{package_policy_id}.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/package_policies@{package_policy_id}.yaml new file mode 100644 index 0000000000000..3b177be3d032e --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/package_policies@{package_policy_id}.yaml @@ -0,0 +1,42 @@ +get: + summary: PackagePolicies - Info + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: ../components/schemas/package_policy.yaml + required: + - item + operationId: get-packagePolicies-packagePolicyId +parameters: + - schema: + type: string + name: packagePolicyId + in: path + required: true +put: + summary: PackagePolicies - Update + operationId: put-packagePolicies-packagePolicyId + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + item: + $ref: ../components/schemas/package_policy.yaml + sucess: + type: boolean + required: + - item + - sucess + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/paths/setup.yaml b/x-pack/plugins/ingest_manager/common/openapi/paths/setup.yaml new file mode 100644 index 0000000000000..62ad2cb66dacb --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/openapi/paths/setup.yaml @@ -0,0 +1,25 @@ +post: + summary: Ingest Manager - Setup + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + isInitialized: + type: boolean + '500': + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + message: + type: string + operationId: post-setup + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/ingest_manager/common/openapi/spec_oas3.json b/x-pack/plugins/ingest_manager/common/openapi/spec_oas3.json deleted file mode 100644 index 69974a87434a1..0000000000000 --- a/x-pack/plugins/ingest_manager/common/openapi/spec_oas3.json +++ /dev/null @@ -1,4538 +0,0 @@ -{ - "openapi": "3.0.0", - "info": { - "title": "Ingest Manager", - "version": "0.2", - "contact": { - "name": "Ingest Team" - }, - "license": { - "name": "Elastic" - } - }, - "servers": [ - { - "url": "http://localhost:5601/api/fleet", - "description": "local" - } - ], - "paths": { - "/agent_policies": { - "get": { - "summary": "Agent policy - List", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AgentPolicy" - } - }, - "total": { - "type": "number" - }, - "page": { - "type": "number" - }, - "perPage": { - "type": "number" - } - }, - "required": ["items", "total", "page", "perPage"] - }, - "examples": { - "success": { - "value": { - "items": [ - { - "id": "82da1fc0-8fbf-11ea-b2ce-01c4a6127154", - "name": "Default policy", - "namespace": "default", - "description": "Default agent policy created by Kibana", - "status": "active", - "packagePolicies": ["8a5679b0-8fbf-11ea-b2ce-01c4a6127154"], - "is_default": true, - "monitoring_enabled": ["logs", "metrics"], - "revision": 2, - "updated_on": "2020-05-06T17:32:21.905Z", - "updated_by": "system", - "agents": 0 - } - ], - "total": 1, - "page": 1, - "perPage": 50 - } - } - } - } - } - } - }, - "operationId": "agent-policy-list", - "parameters": [ - { - "$ref": "#/components/parameters/pageSizeParam" - }, - { - "$ref": "#/components/parameters/pageIndexParam" - }, - { - "$ref": "#/components/parameters/kueryParam" - } - ], - "description": "" - }, - "post": { - "summary": "Agent policy - Create", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "item": { - "$ref": "#/components/schemas/AgentPolicy" - } - } - } - } - } - } - }, - "operationId": "post-agent-policy", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewAgentPolicy" - } - } - } - }, - "security": [], - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/agent_policies/{agentPolicyId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentPolicyId", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Agent policy - Info", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "item": { - "$ref": "#/components/schemas/AgentPolicy" - } - }, - "required": ["item"] - }, - "examples": { - "success": { - "value": { - "item": { - "id": "82da1fc0-8fbf-11ea-b2ce-01c4a6127154", - "name": "Default policy", - "namespace": "default", - "description": "Default agent policy created by Kibana", - "status": "active", - "packagePolicies": [ - { - "id": "8a5679b0-8fbf-11ea-b2ce-01c4a6127154", - "name": "system-1", - "namespace": "default", - "package": { - "name": "system", - "title": "System", - "version": "0.0.3" - }, - "enabled": true, - "policy_id": "82da1fc0-8fbf-11ea-b2ce-01c4a6127154", - "output_id": "08adc51c-69f3-4294-80e2-24527c6ff73d", - "inputs": [ - { - "type": "logs", - "enabled": true, - "streams": [ - { - "id": "logs-system.auth", - "enabled": true, - "dataset": "system.auth", - "vars": { - "paths": { - "value": ["/var/log/auth.log*", "/var/log/secure*"], - "type": "text" - } - }, - "agent_stream": { - "paths": ["/var/log/auth.log*", "/var/log/secure*"], - "exclude_files": [".gz$"], - "multiline": { - "pattern": "^\\s", - "match": "after" - }, - "processors": [ - { - "add_locale": null - }, - { - "add_fields": { - "target": "", - "fields": { - "ecs.version": "1.5.0" - } - } - } - ] - } - }, - { - "id": "logs-system.syslog", - "enabled": true, - "dataset": "system.syslog", - "vars": { - "paths": { - "value": ["/var/log/messages*", "/var/log/syslog*"], - "type": "text" - } - }, - "agent_stream": { - "paths": ["/var/log/messages*", "/var/log/syslog*"], - "exclude_files": [".gz$"], - "multiline": { - "pattern": "^\\s", - "match": "after" - }, - "processors": [ - { - "add_locale": null - }, - { - "add_fields": { - "target": "", - "fields": { - "ecs.version": "1.5.0" - } - } - } - ] - } - } - ] - }, - { - "type": "system/metrics", - "enabled": true, - "streams": [ - { - "id": "system/metrics-system.core", - "enabled": true, - "dataset": "system.core", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["core"], - "core.metrics": "percentages" - } - }, - { - "id": "system/metrics-system.cpu", - "enabled": true, - "dataset": "system.cpu", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "process.include_top_n.by_cpu": { - "value": 5, - "type": "integer" - }, - "process.include_top_n.by_memory": { - "value": 5, - "type": "integer" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["cpu"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - } - }, - { - "id": "system/metrics-system.diskio", - "enabled": true, - "dataset": "system.diskio", - "agent_stream": { - "metricsets": ["diskio"] - } - }, - { - "id": "system/metrics-system.entropy", - "enabled": true, - "dataset": "system.entropy", - "agent_stream": { - "metricsets": ["entropy"] - } - }, - { - "id": "system/metrics-system.filesystem", - "enabled": true, - "dataset": "system.filesystem", - "vars": { - "period": { - "value": "1m", - "type": "text" - }, - "processors": { - "value": "- drop_event.when.regexp:\n system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)\n", - "type": "yaml" - } - }, - "agent_stream": { - "metricsets": ["filesystem"], - "period": "1m", - "processors": [ - { - "drop_event.when.regexp": { - "system.filesystem.mount_point": "^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)" - } - } - ] - } - }, - { - "id": "system/metrics-system.fsstat", - "enabled": true, - "dataset": "system.fsstat", - "vars": { - "period": { - "value": "1m", - "type": "text" - }, - "processors": { - "value": "- drop_event.when.regexp:\n system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)\n", - "type": "yaml" - } - }, - "agent_stream": { - "metricsets": ["fsstat"], - "period": "1m", - "processors": [ - { - "drop_event.when.regexp": { - "system.filesystem.mount_point": "^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)" - } - } - ] - } - }, - { - "id": "system/metrics-system.load", - "enabled": true, - "dataset": "system.load", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "process.include_top_n.by_cpu": { - "value": 5, - "type": "integer" - }, - "process.include_top_n.by_memory": { - "value": 5, - "type": "integer" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["load"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - } - }, - { - "id": "system/metrics-system.memory", - "enabled": true, - "dataset": "system.memory", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "process.include_top_n.by_cpu": { - "value": 5, - "type": "integer" - }, - "process.include_top_n.by_memory": { - "value": 5, - "type": "integer" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["memory"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - } - }, - { - "id": "system/metrics-system.network", - "enabled": true, - "dataset": "system.network", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "process.include_top_n.by_cpu": { - "value": 5, - "type": "integer" - }, - "process.include_top_n.by_memory": { - "value": 5, - "type": "integer" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["network"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - } - }, - { - "id": "system/metrics-system.network_summary", - "enabled": true, - "dataset": "system.network_summary", - "agent_stream": { - "metricsets": ["network_summary"] - } - }, - { - "id": "system/metrics-system.process", - "enabled": true, - "dataset": "system.process", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "process.include_top_n.by_cpu": { - "value": 5, - "type": "integer" - }, - "process.include_top_n.by_memory": { - "value": 5, - "type": "integer" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["process"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - } - }, - { - "id": "system/metrics-system.process_summary", - "enabled": true, - "dataset": "system.process_summary", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "process.include_top_n.by_cpu": { - "value": 5, - "type": "integer" - }, - "process.include_top_n.by_memory": { - "value": 5, - "type": "integer" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["process_summary"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - } - }, - { - "id": "system/metrics-system.raid", - "enabled": true, - "dataset": "system.raid", - "agent_stream": { - "metricsets": ["raid"] - } - }, - { - "id": "system/metrics-system.service", - "enabled": true, - "dataset": "system.service", - "agent_stream": { - "metricsets": ["service"] - } - }, - { - "id": "system/metrics-system.socket", - "enabled": true, - "dataset": "system.socket", - "agent_stream": { - "metricsets": ["socket"] - } - }, - { - "id": "system/metrics-system.socket_summary", - "enabled": true, - "dataset": "system.socket_summary", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "process.include_top_n.by_cpu": { - "value": 5, - "type": "integer" - }, - "process.include_top_n.by_memory": { - "value": 5, - "type": "integer" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["socket_summary"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - } - }, - { - "id": "system/metrics-system.uptime", - "enabled": true, - "dataset": "system.uptime", - "vars": { - "core.metrics": { - "value": ["percentages"], - "type": "text" - }, - "cpu.metrics": { - "value": ["percentages", "normalized_percentages"], - "type": "text" - }, - "period": { - "value": "10s", - "type": "text" - }, - "processes": { - "value": [".*"], - "type": "text" - } - }, - "agent_stream": { - "metricsets": ["uptime"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "processes": ".*" - } - }, - { - "id": "system/metrics-system.users", - "enabled": true, - "dataset": "system.users", - "agent_stream": { - "metricsets": ["users"] - } - } - ] - } - ], - "revision": 1 - } - ], - "is_default": true, - "monitoring_enabled": ["logs", "metrics"], - "revision": 2, - "updated_on": "2020-05-06T17:32:21.905Z", - "updated_by": "system" - } - } - } - } - } - } - } - }, - "operationId": "agent-policy-info", - "description": "Get one agent policy", - "parameters": [] - }, - "put": { - "summary": "Agent policy - Update", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "item": { - "$ref": "#/components/schemas/AgentPolicy" - } - }, - "required": ["item"] - }, - "examples": { - "example-1": { - "value": { - "item": { - "id": "0b7130d0-5a37-11ea-ac2c-25e9ab4ecb2a", - "name": "UPDATED name", - "description": "UPDATED description", - "namespace": "UPDATED namespace", - "updated_on": "Fri Feb 28 2020 16:22:31 GMT-0500 (Eastern Standard Time)", - "updated_by": "elastic", - "packagePolicies": [] - } - } - } - } - } - } - } - }, - "operationId": "put-agent-policy-agentPolicyId", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewAgentPolicy" - }, - "examples": { - "example-1": { - "value": { - "name": "UPDATED name", - "description": "UPDATED description", - "namespace": "UPDATED namespace" - } - } - } - } - } - }, - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/agent_policies/{agentPolicyId}/copy": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentPolicyId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Agent policy - copy one policy", - "operationId": "agent-policy-copy", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "item": { - "$ref": "#/components/schemas/AgentPolicy" - } - }, - "required": ["item"] - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": ["name"] - }, - "examples": {} - } - }, - "description": "" - }, - "description": "Copies one agent policy" - } - }, - "/agent_policies/delete": { - "post": { - "summary": "Agent policy - Delete", - "operationId": "post-agent-policy-delete", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "success": { - "type": "boolean" - } - }, - "required": ["id", "success"] - } - }, - "examples": { - "success": { - "value": [ - { - "id": "df7d2540-5a47-11ea-80da-89b5a66da347", - "success": true - } - ] - }, - "fail": { - "value": [ - { - "id": "df7d2540-5a47-11ea-80da-89b5a66da347", - "success": false - } - ] - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "agentPolicyIds": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "examples": { - "example-1": { - "value": { - "agentPolicyIds": ["df7d2540-5a47-11ea-80da-89b5a66da347"] - } - } - } - } - } - }, - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - }, - "parameters": [] - }, - "/package_policies": { - "get": { - "summary": "PackagePolicies - List", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PackagePolicy" - } - }, - "total": { - "type": "number" - }, - "page": { - "type": "number" - }, - "perPage": { - "type": "number" - } - }, - "required": ["items"] - }, - "examples": { - "example-1": { - "value": { - "items": [ - { - "id": "5d273cf0-5a44-11ea-80da-89b5a66da347", - "use_output": "default", - "inputs": [ - { - "type": "docker/metrics", - "streams": [ - { - "metricset": "status", - "dataset": "docker.status" - } - ] - }, - { - "type": "logs", - "streams": [ - { - "paths": ["/var/log/hello1.log", "/var/log/hello2.log"] - } - ] - } - ] - }, - { - "id": "66490980-5a44-11ea-80da-89b5a66da347", - "namespace": "testing", - "use_output": "default", - "inputs": [ - { - "type": "apache/metrics", - "streams": [ - { - "enabled": true, - "metricset": "info" - } - ] - } - ] - }, - { - "id": "df1ccae0-5a49-11ea-94a6-81affd263f47", - "enabled": true, - "title": "This is a nice title for human", - "package": { - "name": "epm/nginx", - "version": "1.7.0" - }, - "namespace": "prod", - "use_output": "long_term_storage", - "inputs": [ - { - "type": "logs", - "streams": [ - { - "enabled": true, - "dataset": "nginx.acccess", - "paths": ["/var/log/nginx/access.log"] - }, - { - "enabled": true, - "dataset": "nginx.error", - "paths": ["/var/log/nginx/error.log"] - } - ] - }, - { - "type": "nginx/metrics", - "streams": [ - { - "id": "id string", - "enabled": true, - "dataset": "nginx.stub_status", - "metricset": "stub_status" - } - ] - } - ] - }, - { - "id": "f96a09d0-5a49-11ea-94a6-81affd263f47", - "enabled": true, - "title": "This is a nice title for human", - "package": { - "name": "epm/nginx", - "version": "1.7.0" - }, - "namespace": "prod", - "use_output": "long_term_storage", - "inputs": [ - { - "type": "logs", - "streams": [ - { - "enabled": true, - "dataset": "nginx.acccess", - "paths": ["/var/log/nginx/access.log"] - }, - { - "enabled": true, - "dataset": "nginx.error", - "paths": ["/var/log/nginx/error.log"] - } - ] - }, - { - "type": "nginx/metrics", - "streams": [ - { - "id": "id string", - "enabled": true, - "dataset": "nginx.stub_status", - "metricset": "stub_status" - } - ] - } - ] - }, - { - "id": "9ca403a0-5a66-11ea-9468-c911a41ab4f5", - "enabled": true, - "title": "This is a nice title for human", - "package": { - "name": "epm/nginx", - "version": "1.7.0" - }, - "namespace": "prod", - "use_output": "long_term_storage", - "inputs": [ - { - "type": "logs", - "streams": [ - { - "enabled": true, - "dataset": "nginx.acccess", - "paths": ["/var/log/nginx/access.log"] - }, - { - "enabled": true, - "dataset": "nginx.error", - "paths": ["/var/log/nginx/error.log"] - } - ] - }, - { - "type": "nginx/metrics", - "streams": [ - { - "id": "id string", - "enabled": true, - "dataset": "nginx.stub_status", - "metricset": "stub_status" - } - ] - } - ] - }, - { - "id": "27925980-5a44-11ea-80da-89b5a66da347", - "enabled": true, - "title": "UPDATED title for human", - "package": { - "name": "epm/nginx", - "version": "1.7.0" - }, - "namespace": "prod", - "use_output": "long_term_storage", - "inputs": [ - { - "streams": [ - { - "paths": ["/var/log/nginx/access.log"], - "dataset": "nginx.acccess", - "enabled": true - }, - { - "paths": ["/var/log/nginx/error.log"], - "dataset": "nginx.error", - "enabled": true - } - ], - "type": "logs" - }, - { - "streams": [ - { - "metricset": "stub_status", - "id": "id string", - "dataset": "nginx.stub_status", - "enabled": true - } - ], - "type": "nginx/metrics" - } - ] - } - ], - "total": 6, - "page": 1, - "perPage": 20 - } - } - } - } - } - } - }, - "operationId": "get-packagePolicies", - "security": [], - "parameters": [] - }, - "parameters": [], - "post": { - "summary": "PackagePolicies - Create", - "operationId": "post-packagePolicies", - "responses": { - "200": { - "description": "OK" - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewPackagePolicy" - }, - "examples": { - "example-1": { - "value": { - "enabled": true, - "title": "This is a nice title for human", - "package": { - "name": "epm/nginx", - "version": "1.7.0" - }, - "namespace": "prod", - "use_output": "long_term_storage", - "inputs": [ - { - "type": "logs", - "streams": [ - { - "enabled": true, - "dataset": "nginx.acccess", - "paths": ["/var/log/nginx/access.log"] - }, - { - "enabled": true, - "dataset": "nginx.error", - "paths": ["/var/log/nginx/error.log"] - } - ] - }, - { - "type": "nginx/metrics", - "streams": [ - { - "id": "id string", - "enabled": true, - "dataset": "nginx.stub_status", - "metricset": "stub_status" - } - ] - } - ] - } - } - } - } - } - }, - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/package_policies/{packagePolicyId}": { - "get": { - "summary": "PackagePolicies - Info", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "item": { - "$ref": "#/components/schemas/PackagePolicy" - } - }, - "required": ["item"] - } - } - } - } - }, - "operationId": "get-packagePolicies-packagePolicyId" - }, - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "packagePolicyId", - "in": "path", - "required": true - } - ], - "put": { - "summary": "PackagePolicies - Update", - "operationId": "put-packagePolicies-packagePolicyId", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "item": { - "$ref": "#/components/schemas/PackagePolicy" - }, - "sucess": { - "type": "boolean" - } - }, - "required": ["item", "sucess"] - } - } - } - } - }, - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/agents/setup": { - "get": { - "summary": "Agents setup - Info", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "isInitialized": { - "type": "boolean" - } - }, - "required": ["isInitialized"] - }, - "examples": { - "success": { - "value": { - "isInitialized": true - } - }, - "failure": { - "value": { - "isInitialized": false - } - } - } - } - } - } - }, - "operationId": "get-agents-setup", - "security": [ - { - "basicAuth": [] - } - ] - }, - "post": { - "summary": "Agents setup - Create", - "operationId": "post-agents-setup", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "isInitialized": { - "type": "boolean" - } - }, - "required": ["isInitialized"] - }, - "examples": { - "success": { - "value": { - "isInitialized": true - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "admin_username": { - "type": "string" - }, - "admin_password": { - "type": "string" - } - }, - "required": ["admin_username", "admin_password"] - } - } - } - }, - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/epm/packages/{pkgkey}": { - "get": { - "summary": "EPM - Packages - Info", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "allOf": [ - { - "properties": { - "response": { - "$ref": "#/components/schemas/PackageInfo" - } - } - }, - { - "properties": { - "status": { - "type": "string", - "enum": ["installed", "not_installed"] - }, - "savedObject": { - "type": "string" - } - }, - "required": ["status", "savedObject"] - } - ] - }, - "examples": { - "example-1": { - "value": { - "response": { - "name": "coredns", - "title": "CoreDNS", - "version": "1.0.1", - "readme": "/package/coredns-1.0.1/docs/README.md", - "description": "CoreDNS logs and metrics integration.\nThe CoreDNS integrations allows to gather logs and metrics from the CoreDNS DNS server to get better insights.\n", - "type": "integration", - "categories": ["logs", "metrics"], - "requirement": { - "kibana": { - "versions": ">6.7.0" - } - }, - "icons": [ - { - "path": "/package/coredns-1.0.1/img/icon.png", - "src": "/img/icon.png", - "size": "1800x1800" - }, - { - "path": "/package/coredns-1.0.1/img/icon.svg", - "src": "/img/icon.svg", - "size": "255x144", - "type": "image/svg+xml" - } - ], - "assets": { - "kibana": { - "dashboard": [ - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "dashboard", - "file": "53aa1f70-443e-11e9-8548-ab7fbe04f038.json", - "path": "coredns-1.0.1/kibana/dashboard/53aa1f70-443e-11e9-8548-ab7fbe04f038.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "dashboard", - "file": "Metricbeat-CoreDNS-Dashboard-ecs.json", - "path": "coredns-1.0.1/kibana/dashboard/Metricbeat-CoreDNS-Dashboard-ecs.json" - } - ], - "visualization": [ - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "277fc650-67a9-11e9-a534-715561d0bf42.json", - "path": "coredns-1.0.1/kibana/visualization/277fc650-67a9-11e9-a534-715561d0bf42.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "27da53f0-53d5-11e9-b466-9be470bbd327-ecs.json", - "path": "coredns-1.0.1/kibana/visualization/27da53f0-53d5-11e9-b466-9be470bbd327-ecs.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "36e08510-53c4-11e9-b466-9be470bbd327-ecs.json", - "path": "coredns-1.0.1/kibana/visualization/36e08510-53c4-11e9-b466-9be470bbd327-ecs.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "3ad75810-4429-11e9-8548-ab7fbe04f038.json", - "path": "coredns-1.0.1/kibana/visualization/3ad75810-4429-11e9-8548-ab7fbe04f038.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "4804eaa0-7315-11e9-b0d0-414c3011ddbb.json", - "path": "coredns-1.0.1/kibana/visualization/4804eaa0-7315-11e9-b0d0-414c3011ddbb.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "57c74300-7308-11e9-b0d0-414c3011ddbb.json", - "path": "coredns-1.0.1/kibana/visualization/57c74300-7308-11e9-b0d0-414c3011ddbb.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "75743f70-443c-11e9-8548-ab7fbe04f038.json", - "path": "coredns-1.0.1/kibana/visualization/75743f70-443c-11e9-8548-ab7fbe04f038.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "86177430-728d-11e9-b0d0-414c3011ddbb.json", - "path": "coredns-1.0.1/kibana/visualization/86177430-728d-11e9-b0d0-414c3011ddbb.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "9dc640e0-4432-11e9-8548-ab7fbe04f038.json", - "path": "coredns-1.0.1/kibana/visualization/9dc640e0-4432-11e9-8548-ab7fbe04f038.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "a19df590-53c4-11e9-b466-9be470bbd327-ecs.json", - "path": "coredns-1.0.1/kibana/visualization/a19df590-53c4-11e9-b466-9be470bbd327-ecs.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "a58345f0-7298-11e9-b0d0-414c3011ddbb.json", - "path": "coredns-1.0.1/kibana/visualization/a58345f0-7298-11e9-b0d0-414c3011ddbb.json" - }, - { - "pkgkey": "coredns-1.0.1", - "service": "kibana", - "type": "visualization", - "file": "cfde7fb0-443d-11e9-8548-ab7fbe04f038.json", - "path": "coredns-1.0.1/kibana/visualization/cfde7fb0-443d-11e9-8548-ab7fbe04f038.json" - } - ] - } - }, - "format_version": "1.0.0", - "data_streams": [ - { - "title": "CoreDNS logs", - "name": "log", - "release": "ga", - "type": "logs", - "ingest_pipeline": "pipeline-entry", - "vars": [ - { - "default": ["/var/log/coredns.log"], - "name": "paths", - "type": "textarea" - }, - { - "default": ["coredns"], - "name": "tags", - "type": "text" - } - ], - "package": "coredns" - }, - { - "title": "CoreDNS stats metrics", - "name": "stats", - "release": "ga", - "type": "metrics", - "vars": [ - { - "default": ["http://localhost:9153"], - "description": "CoreDNS hosts", - "name": "hosts", - "required": true - }, - { - "default": "10s", - "description": "Collection period. Valid values: 10s, 5m, 2h", - "name": "period" - }, - { - "name": "username", - "type": "text" - }, - { - "name": "password", - "type": "password" - } - ], - "package": "coredns" - } - ], - "download": "/epr/coredns/coredns-1.0.1.tar.gz", - "path": "/package/coredns-1.0.1", - "status": "installed", - "savedObject": { - "id": "coredns-1.0.1", - "type": "epm-package", - "updated_at": "2020-02-27T16:25:43.652Z", - "version": "WzU2LDFd", - "attributes": { - "installed": [ - { - "id": "53aa1f70-443e-11e9-8548-ab7fbe04f038", - "type": "dashboard" - }, - { - "id": "Metricbeat-CoreDNS-Dashboard-ecs", - "type": "dashboard" - }, - { - "id": "75743f70-443c-11e9-8548-ab7fbe04f038", - "type": "visualization" - }, - { - "id": "36e08510-53c4-11e9-b466-9be470bbd327-ecs", - "type": "visualization" - }, - { - "id": "277fc650-67a9-11e9-a534-715561d0bf42", - "type": "visualization" - }, - { - "id": "cfde7fb0-443d-11e9-8548-ab7fbe04f038", - "type": "visualization" - }, - { - "id": "a19df590-53c4-11e9-b466-9be470bbd327-ecs", - "type": "visualization" - }, - { - "id": "a58345f0-7298-11e9-b0d0-414c3011ddbb", - "type": "visualization" - }, - { - "id": "9dc640e0-4432-11e9-8548-ab7fbe04f038", - "type": "visualization" - }, - { - "id": "3ad75810-4429-11e9-8548-ab7fbe04f038", - "type": "visualization" - }, - { - "id": "57c74300-7308-11e9-b0d0-414c3011ddbb", - "type": "visualization" - }, - { - "id": "27da53f0-53d5-11e9-b466-9be470bbd327-ecs", - "type": "visualization" - }, - { - "id": "86177430-728d-11e9-b0d0-414c3011ddbb", - "type": "visualization" - }, - { - "id": "4804eaa0-7315-11e9-b0d0-414c3011ddbb", - "type": "visualization" - }, - { - "id": "logs-log-1.0.1-pipeline-plaintext", - "type": "ingest-pipeline" - }, - { - "id": "logs-log-1.0.1-pipeline-json", - "type": "ingest-pipeline" - }, - { - "id": "logs-log-1.0.1", - "type": "ingest-pipeline" - }, - { - "id": "logs-log", - "type": "index-template" - }, - { - "id": "metrics-stats", - "type": "index-template" - } - ] - }, - "references": [] - } - } - } - }, - "required-package": { - "value": { - "response": { - "format_version": "1.0.0", - "name": "endpoint", - "title": "Elastic Endpoint", - "version": "0.3.0", - "readme": "/package/endpoint/0.3.0/docs/README.md", - "license": "basic", - "description": "This is the Elastic Endpoint package.", - "type": "solution", - "categories": ["security"], - "release": "beta", - "requirement": { - "kibana": { - "versions": ">7.4.0" - } - }, - "icons": [ - { - "path": "/package/endpoint/0.3.0/img/logo-endpoint-64-color.svg", - "src": "/img/logo-endpoint-64-color.svg", - "size": "16x16", - "type": "image/svg+xml" - } - ], - "assets": { - "kibana": { - "dashboard": [ - { - "pkgkey": "endpoint-0.3.0", - "service": "kibana", - "type": "dashboard", - "file": "826759f0-7074-11ea-9bc8-6b38f4d29a16.json", - "path": "endpoint-0.3.0/kibana/dashboard/826759f0-7074-11ea-9bc8-6b38f4d29a16.json" - } - ], - "map": [ - { - "pkgkey": "endpoint-0.3.0", - "service": "kibana", - "type": "map", - "file": "a3a3bd10-706b-11ea-9bc8-6b38f4d29a16.json", - "path": "endpoint-0.3.0/kibana/map/a3a3bd10-706b-11ea-9bc8-6b38f4d29a16.json" - } - ], - "visualization": [ - { - "pkgkey": "endpoint-0.3.0", - "service": "kibana", - "type": "visualization", - "file": "1cfceda0-728b-11ea-9bc8-6b38f4d29a16.json", - "path": "endpoint-0.3.0/kibana/visualization/1cfceda0-728b-11ea-9bc8-6b38f4d29a16.json" - }, - { - "pkgkey": "endpoint-0.3.0", - "service": "kibana", - "type": "visualization", - "file": "1e525190-7074-11ea-9bc8-6b38f4d29a16.json", - "path": "endpoint-0.3.0/kibana/visualization/1e525190-7074-11ea-9bc8-6b38f4d29a16.json" - }, - { - "pkgkey": "endpoint-0.3.0", - "service": "kibana", - "type": "visualization", - "file": "55387750-729c-11ea-9bc8-6b38f4d29a16.json", - "path": "endpoint-0.3.0/kibana/visualization/55387750-729c-11ea-9bc8-6b38f4d29a16.json" - }, - { - "pkgkey": "endpoint-0.3.0", - "service": "kibana", - "type": "visualization", - "file": "92b1edc0-706a-11ea-9bc8-6b38f4d29a16.json", - "path": "endpoint-0.3.0/kibana/visualization/92b1edc0-706a-11ea-9bc8-6b38f4d29a16.json" - } - ] - } - }, - "data_streams": [ - { - "id": "endpoint", - "title": "Endpoint Events", - "release": "experimental", - "type": "events", - "package": "endpoint", - "path": "events" - }, - { - "id": "endpoint.metadata", - "title": "Endpoint Metadata", - "release": "experimental", - "type": "metrics", - "package": "endpoint", - "path": "metadata" - }, - { - "id": "endpoint.policy", - "title": "Endpoint Policy Response", - "release": "experimental", - "type": "metrics", - "package": "endpoint", - "path": "policy" - }, - { - "id": "endpoint.telemetry", - "title": "Endpoint Telemetry", - "release": "experimental", - "type": "metrics", - "package": "endpoint", - "path": "telemetry" - } - ], - "packagePolicies": [ - { - "name": "endpoint", - "title": "Endpoint package policy", - "description": "Interact with the endpoint.", - "inputs": null, - "multiple": false - } - ], - "download": "/epr/endpoint/endpoint-0.3.0.tar.gz", - "path": "/package/endpoint/0.3.0", - "latestVersion": "0.3.0", - "removable": false, - "status": "installed", - "savedObject": { - "id": "endpoint", - "type": "epm-packages", - "updated_at": "2020-06-23T21:44:59.319Z", - "version": "Wzk4LDFd", - "attributes": { - "installed": [ - { - "id": "826759f0-7074-11ea-9bc8-6b38f4d29a16", - "type": "dashboard" - }, - { - "id": "1cfceda0-728b-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "1e525190-7074-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "55387750-729c-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "92b1edc0-706a-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "a3a3bd10-706b-11ea-9bc8-6b38f4d29a16", - "type": "map" - }, - { - "id": "events-endpoint", - "type": "index-template" - }, - { - "id": "metrics-endpoint.metadata", - "type": "index-template" - }, - { - "id": "metrics-endpoint.policy", - "type": "index-template" - }, - { - "id": "metrics-endpoint.telemetry", - "type": "index-template" - } - ], - "es_index_patterns": { - "events": "events-endpoint-*", - "metadata": "metrics-endpoint.metadata-*", - "policy": "metrics-endpoint.policy-*", - "telemetry": "metrics-endpoint.telemetry-*" - }, - "name": "endpoint", - "version": "0.3.0", - "internal": false, - "removable": false - }, - "references": [] - } - } - } - } - } - } - } - } - }, - "operationId": "get-epm-package-pkgkey", - "security": [ - { - "basicAuth": [] - } - ] - }, - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "pkgkey", - "in": "path", - "required": true - } - ], - "post": { - "summary": "EPM - Packages - Install", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "response": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": ["id", "type"] - } - } - }, - "required": ["response"] - } - } - } - } - }, - "operationId": "post-epm-install-pkgkey", - "description": "", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - }, - "delete": { - "summary": "EPM - Packages - Delete", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "response": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": ["id", "type"] - } - } - }, - "required": ["response"] - } - } - } - } - }, - "operationId": "post-epm-delete-pkgkey", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/epm/packages": { - "get": { - "summary": "EPM - Packages - List", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SearchResult" - } - }, - "examples": { - "success": { - "value": { - "response": [ - { - "description": "aws Integration", - "download": "/epr/aws/aws-0.0.3.tar.gz", - "icons": [ - { - "path": "/package/aws/0.0.3/img/logo_aws.svg", - "src": "/img/logo_aws.svg", - "title": "logo aws", - "size": "32x32", - "type": "image/svg+xml" - } - ], - "name": "aws", - "path": "/package/aws/0.0.3", - "title": "aws", - "type": "integration", - "version": "0.0.3", - "status": "not_installed" - }, - { - "description": "This is the Elastic Endpoint package.", - "download": "/epr/endpoint/endpoint-0.1.0.tar.gz", - "icons": [ - { - "path": "/package/endpoint/0.1.0/img/logo-endpoint-64-color.svg", - "src": "/img/logo-endpoint-64-color.svg", - "size": "16x16", - "type": "image/svg+xml" - } - ], - "name": "endpoint", - "path": "/package/endpoint/0.1.0", - "title": "Elastic Endpoint", - "type": "solution", - "version": "0.1.0", - "status": "installed", - "savedObject": { - "type": "epm-packages", - "id": "endpoint", - "attributes": { - "installed": [ - { - "id": "826759f0-7074-11ea-9bc8-6b38f4d29a16", - "type": "dashboard" - }, - { - "id": "55387750-729c-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "92b1edc0-706a-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "1cfceda0-728b-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "1e525190-7074-11ea-9bc8-6b38f4d29a16", - "type": "visualization" - }, - { - "id": "a3a3bd10-706b-11ea-9bc8-6b38f4d29a16", - "type": "map" - }, - { - "id": "events-endpoint", - "type": "index-template" - }, - { - "id": "metrics-endpoint", - "type": "index-template" - } - ], - "es_index_patterns": { - "events": "events-endpoint-*", - "metadata": "metrics-endpoint-*" - }, - "name": "endpoint", - "version": "0.1.0", - "internal": false, - "removable": false - }, - "references": [], - "updated_at": "2020-05-15T20:08:11.739Z", - "version": "WzEwOCwxXQ==" - } - }, - { - "description": "The log package should be used to create package policies for all type of logs for which an package doesn't exist yet.\n", - "download": "/epr/log/log-0.9.0.tar.gz", - "icons": [ - { - "path": "/package/log/0.9.0/img/icon.svg", - "src": "/img/icon.svg", - "type": "image/svg+xml" - } - ], - "name": "log", - "path": "/package/log/0.9.0", - "title": "Log Package", - "type": "integration", - "version": "0.9.0", - "status": "not_installed" - }, - { - "description": "This integration contains pretty long documentation.\nIt is used to show the different visualisations inside a documentation to test how we handle it.\nThe integration does not contain any assets except the documentation page.\n", - "download": "/epr/longdocs/longdocs-1.0.4.tar.gz", - "icons": [ - { - "path": "/package/longdocs/1.0.4/img/icon.svg", - "src": "/img/icon.svg", - "type": "image/svg+xml" - } - ], - "name": "longdocs", - "path": "/package/longdocs/1.0.4", - "title": "Long Docs", - "type": "integration", - "version": "1.0.4", - "status": "not_installed" - }, - { - "description": "This is an integration with only the metrics category.\n", - "download": "/epr/metricsonly/metricsonly-2.0.1.tar.gz", - "icons": [ - { - "path": "/package/metricsonly/2.0.1/img/icon.svg", - "src": "/img/icon.svg", - "type": "image/svg+xml" - } - ], - "name": "metricsonly", - "path": "/package/metricsonly/2.0.1", - "title": "Metrics Only", - "type": "integration", - "version": "2.0.1", - "status": "not_installed" - }, - { - "description": "Multiple versions of this integration exist.\n", - "download": "/epr/multiversion/multiversion-1.1.0.tar.gz", - "icons": [ - { - "path": "/package/multiversion/1.1.0/img/icon.svg", - "src": "/img/icon.svg", - "type": "image/svg+xml" - } - ], - "name": "multiversion", - "path": "/package/multiversion/1.1.0", - "title": "Multi Version", - "type": "integration", - "version": "1.1.0", - "status": "not_installed" - }, - { - "description": "MySQL Integration", - "download": "/epr/mysql/mysql-0.1.0.tar.gz", - "icons": [ - { - "path": "/package/mysql/0.1.0/img/logo_mysql.svg", - "src": "/img/logo_mysql.svg", - "title": "logo mysql", - "size": "32x32", - "type": "image/svg+xml" - } - ], - "name": "mysql", - "path": "/package/mysql/0.1.0", - "title": "MySQL", - "type": "integration", - "version": "0.1.0", - "status": "not_installed" - }, - { - "description": "Nginx Integration", - "download": "/epr/nginx/nginx-0.1.0.tar.gz", - "icons": [ - { - "path": "/package/nginx/0.1.0/img/logo_nginx.svg", - "src": "/img/logo_nginx.svg", - "title": "logo nginx", - "size": "32x32", - "type": "image/svg+xml" - } - ], - "name": "nginx", - "path": "/package/nginx/0.1.0", - "title": "Nginx", - "type": "integration", - "version": "0.1.0", - "status": "not_installed" - }, - { - "description": "Redis Integration", - "download": "/epr/redis/redis-0.1.0.tar.gz", - "icons": [ - { - "path": "/package/redis/0.1.0/img/logo_redis.svg", - "src": "/img/logo_redis.svg", - "title": "logo redis", - "size": "32x32", - "type": "image/svg+xml" - } - ], - "name": "redis", - "path": "/package/redis/0.1.0", - "title": "Redis", - "type": "integration", - "version": "0.1.0", - "status": "not_installed" - }, - { - "description": "This package is used for defining all the properties of a package, the possible assets etc. It serves as a reference on all the config options which are possible.\n", - "download": "/epr/reference/reference-1.0.0.tar.gz", - "icons": [ - { - "path": "/package/reference/1.0.0/img/icon.svg", - "src": "/img/icon.svg", - "size": "32x32", - "type": "image/svg+xml" - } - ], - "name": "reference", - "path": "/package/reference/1.0.0", - "title": "Reference package", - "type": "integration", - "version": "1.0.0", - "status": "not_installed" - }, - { - "description": "System Integration", - "download": "/epr/system/system-0.1.0.tar.gz", - "icons": [ - { - "path": "/package/system/0.1.0/img/system.svg", - "src": "/img/system.svg", - "title": "system", - "size": "1000x1000", - "type": "image/svg+xml" - } - ], - "name": "system", - "path": "/package/system/0.1.0", - "title": "System", - "type": "integration", - "version": "0.1.0", - "status": "installed", - "savedObject": { - "type": "epm-packages", - "id": "system", - "attributes": { - "installed": [ - { - "id": "c431f410-f9ac-11e9-90e8-1fb18e796788", - "type": "dashboard" - }, - { - "id": "Metricbeat-system-overview-ecs", - "type": "dashboard" - }, - { - "id": "277876d0-fa2c-11e6-bbd3-29c986c96e5a-ecs", - "type": "dashboard" - }, - { - "id": "0d3f2380-fa78-11e6-ae9b-81e5311e8cab-ecs", - "type": "dashboard" - }, - { - "id": "CPU-slash-Memory-per-container-ecs", - "type": "dashboard" - }, - { - "id": "79ffd6e0-faa0-11e6-947f-177f697178b8-ecs", - "type": "dashboard" - }, - { - "id": "Filebeat-syslog-dashboard-ecs", - "type": "dashboard" - }, - { - "id": "5517a150-f9ce-11e6-8115-a7c18106d86a-ecs", - "type": "dashboard" - }, - { - "id": "9c69cad0-f9b0-11e9-90e8-1fb18e796788", - "type": "visualization" - }, - { - "id": "855899e0-1b1c-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "a30871f0-f98f-11e9-90e8-1fb18e796788", - "type": "visualization" - }, - { - "id": "e121b140-fa78-11e6-a1df-a78bd7504d38-ecs", - "type": "visualization" - }, - { - "id": "f398d2f0-fa77-11e6-ae9b-81e5311e8cab-ecs", - "type": "visualization" - }, - { - "id": "c5e3cf90-4d60-11e7-9a4c-ed99bbcaa42b-ecs", - "type": "visualization" - }, - { - "id": "d3166e80-1b91-11e7-bec4-a5e9ec5cab8b-ecs", - "type": "visualization" - }, - { - "id": "346bb290-fa80-11e6-a1df-a78bd7504d38-ecs", - "type": "visualization" - }, - { - "id": "Container-Block-IO-ecs", - "type": "visualization" - }, - { - "id": "590a60f0-5d87-11e7-8884-1bb4c3b890e4-ecs", - "type": "visualization" - }, - { - "id": "341ffe70-f9ce-11e6-8115-a7c18106d86a-ecs", - "type": "visualization" - }, - { - "id": "System-Navigation-ecs", - "type": "visualization" - }, - { - "id": "089b85d0-1b16-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "99381c80-4d60-11e7-9a4c-ed99bbcaa42b-ecs", - "type": "visualization" - }, - { - "id": "c6f2ffd0-4d17-11e7-a196-69b9a7a020a9-ecs", - "type": "visualization" - }, - { - "id": "d56ee420-fa79-11e6-a1df-a78bd7504d38-ecs", - "type": "visualization" - }, - { - "id": "1aae9140-1b93-11e7-8ada-3df93aab833e-ecs", - "type": "visualization" - }, - { - "id": "e0f001c0-1b18-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "dc589770-fa2b-11e6-bbd3-29c986c96e5a-ecs", - "type": "visualization" - }, - { - "id": "96976150-4d5d-11e7-aa29-87a97a796de6-ecs", - "type": "visualization" - }, - { - "id": "8c071e20-f999-11e9-90e8-1fb18e796788", - "type": "visualization" - }, - { - "id": "d3f51850-f9b6-11e9-90e8-1fb18e796788", - "type": "visualization" - }, - { - "id": "5c7af030-fa2a-11e6-bbd3-29c986c96e5a-ecs", - "type": "visualization" - }, - { - "id": "e6e639e0-f992-11e9-90e8-1fb18e796788", - "type": "visualization" - }, - { - "id": "bfa5e400-1b16-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "7cdb1330-4d1a-11e7-a196-69b9a7a020a9-ecs", - "type": "visualization" - }, - { - "id": "78b74f30-f9cd-11e6-8115-a7c18106d86a-ecs", - "type": "visualization" - }, - { - "id": "Syslog-events-by-hostname-ecs", - "type": "visualization" - }, - { - "id": "3d65d450-a9c3-11e7-af20-67db8aecb295-ecs", - "type": "visualization" - }, - { - "id": "ab2d1e90-1b1a-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "825fdb80-4d1d-11e7-b5f2-2b7c1895bf32-ecs", - "type": "visualization" - }, - { - "id": "26732e20-1b91-11e7-bec4-a5e9ec5cab8b-ecs", - "type": "visualization" - }, - { - "id": "Syslog-hostnames-and-processes-ecs", - "type": "visualization" - }, - { - "id": "522ee670-1b92-11e7-bec4-a5e9ec5cab8b-ecs", - "type": "visualization" - }, - { - "id": "51164310-fa2b-11e6-bbd3-29c986c96e5a-ecs", - "type": "visualization" - }, - { - "id": "bb3a8720-f991-11e9-90e8-1fb18e796788", - "type": "visualization" - }, - { - "id": "Container-Memory-stats-ecs", - "type": "visualization" - }, - { - "id": "5dd15c00-fa78-11e6-ae9b-81e5311e8cab-ecs", - "type": "visualization" - }, - { - "id": "327417e0-8462-11e7-bab8-bd2f0fb42c54-ecs", - "type": "visualization" - }, - { - "id": "d2e80340-4d5c-11e7-aa29-87a97a796de6-ecs", - "type": "visualization" - }, - { - "id": "19e123b0-4d5a-11e7-aee5-fdc812cc3bec-ecs", - "type": "visualization" - }, - { - "id": "3cec3eb0-f9d3-11e6-8a3e-2b904044ea1d-ecs", - "type": "visualization" - }, - { - "id": "2e224660-1b19-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "12667040-fa80-11e6-a1df-a78bd7504d38-ecs", - "type": "visualization" - }, - { - "id": "d16bb400-f9cc-11e6-8115-a7c18106d86a-ecs", - "type": "visualization" - }, - { - "id": "34f97ee0-1b96-11e7-8ada-3df93aab833e-ecs", - "type": "visualization" - }, - { - "id": "fe064790-1b1f-11e7-bec4-a5e9ec5cab8b-ecs", - "type": "visualization" - }, - { - "id": "83e12df0-1b91-11e7-bec4-a5e9ec5cab8b-ecs", - "type": "visualization" - }, - { - "id": "4e4bb1e0-1b1b-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "4b254630-f998-11e9-90e8-1fb18e796788", - "type": "visualization" - }, - { - "id": "6b7b9a40-faa1-11e6-86b1-cd7735ff7e23-ecs", - "type": "visualization" - }, - { - "id": "4d546850-1b15-11e7-b09e-037021c4f8df-ecs", - "type": "visualization" - }, - { - "id": "Container-CPU-usage-ecs", - "type": "visualization" - }, - { - "id": "b6f321e0-fa25-11e6-bbd3-29c986c96e5a-ecs", - "type": "search" - }, - { - "id": "62439dc0-f9c9-11e6-a747-6121780e0414-ecs", - "type": "search" - }, - { - "id": "8030c1b0-fa77-11e6-ae9b-81e5311e8cab-ecs", - "type": "search" - }, - { - "id": "Syslog-system-logs-ecs", - "type": "search" - }, - { - "id": "eb0039f0-fa7f-11e6-a1df-a78bd7504d38-ecs", - "type": "search" - }, - { - "id": "logs-system.auth-0.1.0", - "type": "ingest-pipeline" - }, - { - "id": "logs-system.auth-0.1.0", - "type": "ingest-pipeline" - }, - { - "id": "logs-system.syslog-0.1.0", - "type": "ingest-pipeline" - }, - { - "id": "logs-system.syslog-0.1.0", - "type": "ingest-pipeline" - }, - { - "id": "logs-system.auth", - "type": "index-template" - }, - { - "id": "metrics-system.core", - "type": "index-template" - }, - { - "id": "metrics-system.cpu", - "type": "index-template" - }, - { - "id": "metrics-system.diskio", - "type": "index-template" - }, - { - "id": "metrics-system.entropy", - "type": "index-template" - }, - { - "id": "metrics-system.filesystem", - "type": "index-template" - }, - { - "id": "metrics-system.fsstat", - "type": "index-template" - }, - { - "id": "metrics-system.load", - "type": "index-template" - }, - { - "id": "metrics-system.memory", - "type": "index-template" - }, - { - "id": "metrics-system.network", - "type": "index-template" - }, - { - "id": "metrics-system.network_summary", - "type": "index-template" - }, - { - "id": "metrics-system.process", - "type": "index-template" - }, - { - "id": "metrics-system.process_summary", - "type": "index-template" - }, - { - "id": "metrics-system.raid", - "type": "index-template" - }, - { - "id": "metrics-system.service", - "type": "index-template" - }, - { - "id": "metrics-system.socket", - "type": "index-template" - }, - { - "id": "metrics-system.socket_summary", - "type": "index-template" - }, - { - "id": "logs-system.syslog", - "type": "index-template" - }, - { - "id": "metrics-system.uptime", - "type": "index-template" - }, - { - "id": "metrics-system.users", - "type": "index-template" - } - ], - "es_index_patterns": { - "auth": "logs-system.auth-*", - "core": "metrics-system.core-*", - "cpu": "metrics-system.cpu-*", - "diskio": "metrics-system.diskio-*", - "entropy": "metrics-system.entropy-*", - "filesystem": "metrics-system.filesystem-*", - "fsstat": "metrics-system.fsstat-*", - "load": "metrics-system.load-*", - "memory": "metrics-system.memory-*", - "network": "metrics-system.network-*", - "network_summary": "metrics-system.network_summary-*", - "process": "metrics-system.process-*", - "process_summary": "metrics-system.process_summary-*", - "raid": "metrics-system.raid-*", - "service": "metrics-system.service-*", - "socket": "metrics-system.socket-*", - "socket_summary": "metrics-system.socket_summary-*", - "syslog": "logs-system.syslog-*", - "uptime": "metrics-system.uptime-*", - "users": "metrics-system.users-*" - }, - "name": "system", - "version": "0.1.0", - "internal": false, - "removable": false - }, - "references": [], - "updated_at": "2020-05-15T20:08:08.708Z", - "version": "Wzk4LDFd" - } - }, - { - "description": "This package contains a yaml pipeline.\n", - "download": "/epr/yamlpipeline/yamlpipeline-1.0.0.tar.gz", - "name": "yamlpipeline", - "path": "/package/yamlpipeline/1.0.0", - "title": "Yaml Pipeline package", - "type": "integration", - "version": "1.0.0", - "status": "not_installed" - } - ] - } - } - } - } - } - } - }, - "operationId": "get-epm-list" - }, - "parameters": [] - }, - "/epm/categories": { - "get": { - "summary": "EPM - Categories", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "title": { - "type": "string" - }, - "count": { - "type": "number" - } - }, - "required": ["id", "title", "count"] - } - } - } - } - } - }, - "operationId": "get-epm-categories" - } - }, - "/fleet/agents": { - "get": { - "summary": "Fleet - Agent - List", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "type": "object" - } - }, - "total": { - "type": "number" - }, - "page": { - "type": "number" - }, - "perPage": { - "type": "number" - } - }, - "required": ["list", "total", "page", "perPage"] - }, - "examples": { - "example-1": { - "value": { - "list": [ - { - "id": "205661d0-5e53-11ea-ad31-4f31c06bd9a4", - "active": true, - "policy_id": "ae556400-5e39-11ea-8b49-f9747e466f7b", - "type": "PERMANENT", - "enrolled_at": "2020-03-04T20:02:50.605Z", - "user_provided_metadata": { - "dev_agent_version": "0.0.1", - "region": "us-east" - }, - "local_metadata": { - "host": "localhost", - "ip": "127.0.0.1", - "system": "Darwin 18.7.0", - "memory": 34359738368 - }, - "actions": [ - { - "data": "{\"config\":{\"id\":\"ae556400-5e39-11ea-8b49-f9747e466f7b\",\"outputs\":{\"default\":{\"type\":\"elasticsearch\",\"hosts\":[\"http://localhost:9200\"],\"api_key\":\"\",\"api_token\":\"6ckkp3ABz7e_XRqr3LM8:gQuDfUNSRgmY0iziYqP9Hw\"}},\"packagePolicies\":[]}}", - "created_at": "2020-03-04T20:02:56.149Z", - "id": "6a95c00a-d76d-4931-97c3-0bf935272d7d", - "type": "POLICY_CHANGE" - } - ], - "access_api_key_id": "6Mkkp3ABz7e_XRqrzLNJ", - "default_api_key": "6ckkp3ABz7e_XRqr3LM8:gQuDfUNSRgmY0iziYqP9Hw", - "current_error_events": [], - "last_checkin": "2020-03-04T20:03:05.700Z", - "status": "online" - } - ], - "total": 1, - "page": 1, - "perPage": 20 - } - } - } - } - } - } - }, - "operationId": "get-fleet-agents", - "security": [ - { - "basicAuth": [] - } - ] - } - }, - "/fleet/agents/{agentId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentId", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Fleet - Agent - Info", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "item": { - "type": "object" - } - }, - "required": ["item"] - } - } - } - } - }, - "operationId": "get-fleet-agents-agentId" - }, - "put": { - "summary": "Fleet - Agent - Update", - "tags": [], - "responses": {}, - "operationId": "put-fleet-agents-agentId", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - }, - "delete": { - "summary": "Fleet - Agent - Delete", - "tags": [], - "responses": {}, - "operationId": "delete-fleet-agents-agentId", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/fleet/agents/{agentId}/events": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentId", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Fleet - Agent - Events", - "tags": [], - "responses": {}, - "operationId": "get-fleet-agents-agentId-events" - } - }, - "/fleet/agents/{agentId}/checkin": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Fleet - Agent - Check In", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": ["checkin"] - }, - "actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "agent_id": { - "type": "string" - }, - "data": { - "type": "object" - }, - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "type": { - "type": "string" - } - }, - "required": ["agent_id", "data", "id", "created_at", "type"] - } - } - } - }, - "examples": { - "success": { - "value": { - "action": "checkin", - "actions": [ - { - "agent_id": "a6f14bd2-1a2a-481c-9212-9494d064ffdf", - "type": "POLICY_CHANGE", - "data": { - "config": { - "id": "2fe89350-a5e0-11ea-a587-5f886c8a849f", - "outputs": { - "default": { - "type": "elasticsearch", - "hosts": ["http://localhost:9200"], - "api_key": "Z-XkgHIBvwtjzIKtSCTh:AejRqdKpQx6z-6dqSI1LHg" - } - }, - "packagePolicies": [ - { - "id": "33d6bd70-a5e0-11ea-a587-5f886c8a849f", - "name": "system-1", - "namespace": "default", - "enabled": true, - "use_output": "default", - "inputs": [ - { - "type": "logs", - "enabled": true, - "streams": [ - { - "id": "logs-system.auth", - "enabled": true, - "dataset": "system.auth", - "paths": ["/var/log/auth.log*", "/var/log/secure*"], - "exclude_files": [".gz$"], - "multiline": { - "pattern": "^\\s", - "match": "after" - }, - "processors": [ - { - "add_locale": null - }, - { - "add_fields": { - "target": "", - "fields": { - "ecs.version": "1.5.0" - } - } - } - ] - }, - { - "id": "logs-system.syslog", - "enabled": true, - "dataset": "system.syslog", - "paths": ["/var/log/messages*", "/var/log/syslog*"], - "exclude_files": [".gz$"], - "multiline": { - "pattern": "^\\s", - "match": "after" - }, - "processors": [ - { - "add_locale": null - }, - { - "add_fields": { - "target": "", - "fields": { - "ecs.version": "1.5.0" - } - } - } - ] - } - ] - }, - { - "type": "system/metrics", - "enabled": true, - "streams": [ - { - "id": "system/metrics-system.core", - "enabled": true, - "dataset": "system.core", - "metricsets": ["core"], - "core.metrics": "percentages" - }, - { - "id": "system/metrics-system.cpu", - "enabled": true, - "dataset": "system.cpu", - "metricsets": ["cpu"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - }, - { - "id": "system/metrics-system.diskio", - "enabled": true, - "dataset": "system.diskio", - "metricsets": ["diskio"] - }, - { - "id": "system/metrics-system.entropy", - "enabled": true, - "dataset": "system.entropy", - "metricsets": ["entropy"] - }, - { - "id": "system/metrics-system.filesystem", - "enabled": true, - "dataset": "system.filesystem", - "metricsets": ["filesystem"], - "period": "1m", - "processors": [ - { - "drop_event.when.regexp": { - "system.filesystem.mount_point": "^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)" - } - } - ] - }, - { - "id": "system/metrics-system.fsstat", - "enabled": true, - "dataset": "system.fsstat", - "metricsets": ["fsstat"], - "period": "1m", - "processors": [ - { - "drop_event.when.regexp": { - "system.filesystem.mount_point": "^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)" - } - } - ] - }, - { - "id": "system/metrics-system.load", - "enabled": true, - "dataset": "system.load", - "metricsets": ["load"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - }, - { - "id": "system/metrics-system.memory", - "enabled": true, - "dataset": "system.memory", - "metricsets": ["memory"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - }, - { - "id": "system/metrics-system.network", - "enabled": true, - "dataset": "system.network", - "metricsets": ["network"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - }, - { - "id": "system/metrics-system.network_summary", - "enabled": true, - "dataset": "system.network_summary", - "metricsets": ["network_summary"] - }, - { - "id": "system/metrics-system.process", - "enabled": true, - "dataset": "system.process", - "metricsets": ["process"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - }, - { - "id": "system/metrics-system.process_summary", - "enabled": true, - "dataset": "system.process_summary", - "metricsets": ["process_summary"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - }, - { - "id": "system/metrics-system.raid", - "enabled": true, - "dataset": "system.raid", - "metricsets": ["raid"] - }, - { - "id": "system/metrics-system.service", - "enabled": true, - "dataset": "system.service", - "metricsets": ["service"] - }, - { - "id": "system/metrics-system.socket", - "enabled": true, - "dataset": "system.socket", - "metricsets": ["socket"] - }, - { - "id": "system/metrics-system.socket_summary", - "enabled": true, - "dataset": "system.socket_summary", - "metricsets": ["socket_summary"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "process.include_top_n.by_cpu": 5, - "process.include_top_n.by_memory": 5, - "processes": ".*" - }, - { - "id": "system/metrics-system.uptime", - "enabled": true, - "dataset": "system.uptime", - "metricsets": ["uptime"], - "core.metrics": "percentages", - "cpu.metrics": "percentages,normalized_percentages", - "period": "10s", - "processes": ".*" - }, - { - "id": "system/metrics-system.users", - "enabled": true, - "dataset": "system.users", - "metricsets": ["users"] - } - ] - } - ], - "package": { - "name": "system", - "version": "0.1.0" - } - }, - { - "id": "fdb1fea0-a5f6-11ea-ad52-534e35d3cd6f", - "name": "endpoint-1", - "namespace": "default", - "enabled": true, - "use_output": "default", - "inputs": [], - "package": { - "name": "endpoint", - "version": "0.2.0" - } - }, - { - "id": "2d792280-a5f7-11ea-ad52-534e35d3cd6f", - "name": "endpoint-2", - "namespace": "default", - "enabled": true, - "use_output": "default", - "inputs": [], - "package": { - "name": "endpoint", - "version": "0.2.0" - } - } - ], - "revision": 4, - "settings": { - "monitoring": { - "use_output": "default", - "enabled": true, - "logs": true, - "metrics": true - } - } - } - }, - "id": "51c6ad1e-a9c0-4c70-80da-99a5c51eedaf", - "created_at": "2020-06-04T19:52:24.667Z" - } - ] - } - } - } - } - } - } - }, - "operationId": "post-fleet-agents-agentId-checkin", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ], - "security": [ - { - "Access API Key": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "local_metadata": { - "$ref": "#/components/schemas/AgentMetadata" - }, - "events": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NewAgentEvent" - } - } - } - }, - "examples": { - "stoped to starting": { - "value": { - "events": [ - { - "type": "STATE", - "subtype": "STARTING", - "message": "state changed from STOPPED to STARTING", - "timestamp": "2019-10-01T13:42:54.323Z", - "payload": {}, - "agent_id": "bee40627-8cbd-45df-add9-98c390f9db10" - } - ] - } - }, - "running": { - "value": { - "events": [ - { - "type": "STATE", - "subtype": "RUNNING", - "message": "state changed from STOPPED to RUNNING", - "timestamp": "2020-05-26T20:44:57.480Z", - "payload": { - "random": "data", - "state": "RUNNING", - "previous_state": "STOPPED" - }, - "agent_id": "bee40627-8cbd-45df-add9-98c390f9db10" - } - ] - } - } - } - } - } - } - } - }, - "/fleet/agents/{agentId}/acks": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Fleet - Agent - Acks", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": ["acks"] - } - }, - "required": ["action"] - }, - "examples": { - "success": { - "value": { - "action": "checkin" - } - } - } - } - } - } - }, - "operationId": "post-fleet-agents-agentId-acks", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - }, - "examples": { - "example-1": { - "value": { - "events": [ - { - "type": "ACTION_RESULT", - "subtype": "CONFIG", - "timestamp": "2019-01-04T14:32:03.36764-05:00", - "action_id": "51c6ad1e-a9c0-4c70-80da-99a5c51eedaf", - "agent_id": "a6f14bd2-1a2a-481c-9212-9494d064ffdf", - "message": "acknowledge" - } - ] - } - } - } - } - } - } - } - }, - "/fleet/agents/enroll": { - "post": { - "summary": "Fleet - Agent - Enroll", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "item": { - "$ref": "#/components/schemas/Agent" - } - } - }, - "examples": { - "success": { - "value": { - "action": "created", - "item": { - "id": "8086fb1a-72ca-4a67-8533-09300c1639fa", - "active": true, - "policy_id": "2fe89350-a5e0-11ea-a587-5f886c8a849f", - "type": "PERMANENT", - "enrolled_at": "2020-06-04T13:03:57.856Z", - "user_provided_metadata": { - "dev_agent_version": "0.0.1", - "region": "us-east" - }, - "local_metadata": { - "host": "localhost", - "ip": "127.0.0.1", - "system": "Darwin 18.7.0", - "memory": 34359738368 - }, - "current_error_events": [], - "access_api_key": "cU9KdWYzSUJ2d3RqeklLdFdnNF86ZW05ZjFrMThUWW1GRW13OHMwRGZvdw==", - "status": "error" - } - } - } - } - } - } - } - }, - "operationId": "post-fleet-agents-enroll", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["PERMANENT", "EPHEMERAL", "TEMPORARY"] - }, - "shared_id": { - "type": "string" - }, - "metadata": { - "type": "object", - "required": ["local", "user_provided"], - "properties": { - "local": { - "$ref": "#/components/schemas/AgentMetadata" - }, - "user_provided": { - "$ref": "#/components/schemas/AgentMetadata" - } - } - } - }, - "required": ["type", "metadata"] - }, - "examples": { - "good": { - "value": { - "type": "PERMANENT", - "metadata": { - "local": { - "host": "localhost", - "ip": "127.0.0.1", - "system": "Darwin 18.7.0", - "memory": 34359738368 - }, - "user_provided": { - "dev_agent_version": "0.0.1", - "region": "us-east" - } - } - } - } - } - } - } - }, - "security": [ - { - "Enrollment API Key": [] - } - ] - } - }, - "/fleet/agents/{agentId}/unenroll": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Fleet - Agent - Unenroll", - "tags": [], - "responses": {}, - "operationId": "post-fleet-agents-unenroll", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "force": { "type": "boolean" } - } - }, - "examples": { - "example-1": { - "value": { - "force": true - } - } - } - } - } - } - } - }, - "/fleet/agents/{agentId}/upgrade": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "agentId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Fleet - Agent - Upgrade", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpgradeAgent" - }, - "examples": { - "success": { - "value": {} - } - } - } - } - }, - "400": { - "description": "BAD REQUEST", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpgradeAgent" - }, - "examples": { - "bad request not upgradeable": { - "value": { - "statusCode": 400, - "error": "Bad Request", - "message": "agent d133b07d-5c2b-42f0-8e6b-bbae53bdce88 is not upgradeable" - } - }, - "bad request kibana version": { - "value": { - "statusCode": 400, - "error": "Bad Request", - "message": "cannot upgrade agent to 8.0.0 because it is different than the installed kibana version 7.9.10" - } - }, - "bad request agent unenrolling": { - "value": { - "statusCode": 400, - "error": "Bad Request", - "message": "cannot upgrade an unenrolling or unenrolled agent" - } - } - } - } - } - } - }, - "operationId": "post-fleet-agents-upgrade", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpgradeAgent" - }, - "examples":{ - "version":{ - "value": { - "version": "8.0.0" - } - }, - "version and source_uri":{ - "value": { - "version": "8.0.0", - "source_uri": "http://localhost:8000" - } - } - } - } - } - } - } - }, - "/fleet/agents/bulk_upgrade": { - "post": { - "summary": "Fleet - Agent - Bulk Upgrade", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BulkUpgradeAgents" - }, - "examples": { - "success": { - "value": {} - } - } - } - } - }, - "400": { - "description": "BAD REQUEST", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpgradeAgent" - }, - "examples": { - "bad request kibana version": { - "value": { - "statusCode": 400, - "error": "Bad Request", - "message": "cannot upgrade agent to 8.0.0 because it is different than the installed kibana version 7.9.10" - } - } - } - } - } - } - }, - "operationId": "post-fleet-agents-bulk-upgrade", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BulkUpgradeAgents" - }, - "examples":{ - "version":{ - "value": { - "version": "8.0.0" - } - }, - "version and source_uri":{ - "value": { - "version": "8.0.0", - "source_uri": "http://localhost:8000" - } - } - } - } - } - } - } - }, - "/fleet/agent-status": { - "get": { - "summary": "Fleet - Agent - Status for policy", - "tags": [], - "responses": {}, - "operationId": "get-fleet-agent-status", - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "policyId", - "in": "query", - "required": false - } - ] - } - }, - "/fleet/enrollment-api-keys": { - "get": { - "summary": "Enrollment - List", - "tags": [], - "responses": {}, - "operationId": "get-fleet-enrollment-api-keys", - "parameters": [] - }, - "post": { - "summary": "Enrollment - Create", - "tags": [], - "responses": {}, - "operationId": "post-fleet-enrollment-api-keys", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/fleet/enrollment-api-keys/{keyId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "keyId", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Enrollment - Info", - "tags": [], - "responses": {}, - "operationId": "get-fleet-enrollment-api-keys-keyId" - }, - "delete": { - "summary": "Enrollment - Delete", - "tags": [], - "responses": {}, - "operationId": "delete-fleet-enrollment-api-keys-keyId", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/setup": { - "post": { - "summary": "Ingest Manager - Setup", - "tags": [], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "isInitialized": { - "type": "boolean" - } - } - }, - "examples": { - "success": { - "value": { - "isInitialized": true - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "examples": {} - } - } - } - }, - "operationId": "post-setup", - "parameters": [ - { - "$ref": "#/components/parameters/xsrfHeader" - } - ] - } - }, - "/fleet/install/{osType}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "osType", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Fleet - Get OS install script", - "tags": [], - "responses": {}, - "operationId": "get-fleet-install-osType" - } - } - }, - "components": { - "schemas": { - "AgentPolicy": { - "allOf": [ - { - "$ref": "#/components/schemas/NewAgentPolicy" - }, - { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "status": { - "type": "string", - "enum": ["active", "inactive"] - }, - "packagePolicies": { - "oneOf": [ - { - "items": { - "type": "string" - } - }, - { - "items": { - "$ref": "#/components/schemas/PackagePolicy" - } - } - ], - "type": "array" - }, - "updated_on": { - "type": "string", - "format": "date-time" - }, - "updated_by": { - "type": "string" - }, - "revision": { - "type": "number" - }, - "agents": { - "type": "number" - } - }, - "required": ["id", "status"] - } - ] - }, - "PackagePolicy": { - "title": "PackagePolicy", - "allOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "revision": { - "type": "number" - }, - "inputs": { - "type": "array", - "items": {} - } - }, - "required": ["id", "revision"] - }, - { - "$ref": "#/components/schemas/NewPackagePolicy" - } - ], - "x-examples": { - "example-1": {} - } - }, - "NewAgentPolicy": { - "title": "NewAgentPolicy", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "NewPackagePolicy": { - "title": "NewPackagePolicy", - "type": "object", - "x-examples": { - "example-1": { - "enabled": true, - "title": "This is a nice title for human", - "package": { - "name": "epm/nginx", - "version": "1.7.0" - }, - "namespace": "prod", - "use_output": "long_term_storage", - "inputs": [ - { - "type": "logs", - "streams": [ - { - "enabled": true, - "dataset": "nginx.acccess", - "paths": ["/var/log/nginx/access.log"] - }, - { - "enabled": true, - "dataset": "nginx.error", - "paths": ["/var/log/nginx/error.log"] - } - ] - }, - { - "type": "nginx/metrics", - "streams": [ - { - "id": "id string", - "enabled": true, - "dataset": "nginx.stub_status", - "metricset": "stub_status" - } - ] - } - ] - } - }, - "description": "", - "properties": { - "enabled": { - "type": "boolean" - }, - "package": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - }, - "title": { - "type": "string" - } - }, - "required": ["name", "version", "title"] - }, - "namespace": { - "type": "string" - }, - "output_id": { - "type": "string" - }, - "inputs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "processors": { - "type": "array", - "items": { - "type": "string" - } - }, - "streams": { - "type": "array", - "items": {} - }, - "config": { - "type": "object" - }, - "vars": { - "type": "object" - } - }, - "required": ["type", "enabled", "streams"] - } - }, - "policy_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": ["output_id", "inputs", "policy_id", "name"] - }, - "PackageInfo": { - "title": "PackageInfo", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "title": { - "type": "string" - }, - "version": { - "type": "string" - }, - "readme": { - "type": "string" - }, - "description": { - "type": "string" - }, - "type": { - "type": "string" - }, - "categories": { - "type": "array", - "items": { - "type": "string" - } - }, - "requirement": { - "oneOf": [ - { - "properties": { - "kibana": { - "type": "object", - "properties": { - "versions": { - "type": "string" - } - } - } - } - }, - { - "properties": { - "elasticsearch": { - "type": "object", - "properties": { - "versions": { - "type": "string" - } - } - } - } - } - ], - "type": "object" - }, - "screenshots": { - "type": "array", - "items": { - "type": "object", - "properties": { - "src": { - "type": "string" - }, - "path": { - "type": "string" - }, - "title": { - "type": "string" - }, - "size": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": ["src", "path"] - } - }, - "icons": { - "type": "array", - "items": { - "type": "string" - } - }, - "assets": { - "type": "array", - "items": { - "type": "string" - } - }, - "internal": { - "type": "boolean" - }, - "format_version": { - "type": "string" - }, - "data_streams": { - "type": "array", - "items": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "name": { - "type": "string" - }, - "release": { - "type": "string" - }, - "ingeset_pipeline": { - "type": "string" - }, - "vars": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "default": { - "type": "string" - } - }, - "required": ["name", "default"] - } - }, - "type": { - "type": "string" - }, - "package": { - "type": "string" - } - }, - "required": ["title", "name", "release", "ingeset_pipeline", "type", "package"] - } - }, - "download": { - "type": "string" - }, - "path": { - "type": "string" - }, - "removable": { - "type": "boolean" - } - }, - "required": [ - "name", - "title", - "version", - "description", - "type", - "categories", - "requirement", - "assets", - "format_version", - "download", - "path" - ] - }, - "SearchResult": { - "title": "SearchResult", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "download": { - "type": "string" - }, - "icons": { - "type": "string" - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - }, - "status": { - "type": "string" - }, - "savedObject": { - "type": "object" - } - }, - "required": [ - "description", - "download", - "icons", - "name", - "path", - "title", - "type", - "version", - "status" - ] - }, - "AgentStatus": { - "type": "string", - "title": "AgentStatus", - "enum": ["offline", "error", "online", "inactive", "warning"] - }, - "Agent": { - "title": "Agent", - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/AgentType" - }, - "active": { - "type": "boolean" - }, - "enrolled_at": { - "type": "string" - }, - "unenrolled_at": { - "type": "string" - }, - "unenrollment_started_at": { - "type": "string" - }, - "shared_id": { - "type": "string" - }, - "access_api_key_id": { - "type": "string" - }, - "default_api_key_id": { - "type": "string" - }, - "policy_id": { - "type": "string" - }, - "policy_revision": { - "type": ["number", "null"] - }, - "last_checkin": { - "type": "string" - }, - "user_provided_metadata": { - "$ref": "#/components/schemas/AgentMetadata" - }, - "local_metadata": { - "$ref": "#/components/schemas/AgentMetadata" - }, - "id": { - "type": "string" - }, - "current_error_events": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AgentEvent" - } - }, - "access_api_key": { - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/AgentStatus" - }, - "default_api_key": { - "type": "string" - } - }, - "required": ["type", "active", "enrolled_at", "id", "current_error_events", "status"] - }, - "AgentType": { - "type": "string", - "title": "AgentType", - "enum": ["PERMANENT", "EPHEMERAL", "TEMPORARY"] - }, - "AgentMetadata": { - "title": "AgentMetadata", - "type": "object" - }, - "NewAgentEvent": { - "title": "NewAgentEvent", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["STATE", "ERROR", "ACTION_RESULT", "ACTION"] - }, - "subtype": { - "type": "string", - "enum": [ - "RUNNING", - "STARTING", - "IN_PROGRESS", - "CONFIG", - "FAILED", - "STOPPING", - "STOPPED", - "DEGRADED", - "DATA_DUMP", - "ACKNOWLEDGED", - "UNKNOWN" - ] - }, - "timestamp": { - "type": "string" - }, - "message": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "agent_id": { - "type": "string" - }, - "policy_id": { - "type": "string" - }, - "stream_id": { - "type": "string" - }, - "action_id": { - "type": "string" - } - }, - "required": ["type", "subtype", "timestamp", "message", "agent_id"] - }, - "AgentEvent": { - "title": "AgentEvent", - "allOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": ["id"] - }, - { - "$ref": "#/components/schemas/NewAgentEvent" - } - ] - }, - "AccessApiKey": { - "type": "string", - "title": "AccessApiKey", - "format": "byte" - }, - "EnrollmentApiKey": { - "type": "string", - "title": "EnrollmentApiKey", - "format": "byte" - }, - "UpgradeAgent":{ - "title": "UpgradeAgent", - "oneOf": [ - { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"] - }, - { - "type": "object", - "properties": { - "version": { - "type": "string" - }, - "source_uri": { - "type": "string" - } - }, - "required": ["version"] - } - ] - }, - "BulkUpgradeAgents":{ - "title": "BulkUpgradeAgents", - "oneOf": [ - { - "type": "object", - "properties": { - "version": { - "type": "string" - }, - "agents":{ - "type": "array", - "items":{ - "type": "string" - } - } - }, - "required": ["version", "agents"] - }, - { - "type": "object", - "properties": { - "version": { - "type": "string" - }, - "source_uri": { - "type": "string" - }, - "agents":{ - "type": "array", - "items":{ - "type": "string" - } - } - }, - "required": ["version", "agents"] - }, - { - "type": "object", - "properties": { - "version": { - "type": "string" - }, - "source_uri": { - "type": "string" - }, - "agents":{ - "type": "string" - } - }, - "required": ["version", "agents"] - } - ] - } - }, - - "parameters": { - "pageSizeParam": { - "name": "perPage", - "in": "query", - "description": "The number of items to return", - "required": false, - "schema": { - "type": "integer", - "default": 50 - } - }, - "pageIndexParam": { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - "kueryParam": { - "name": "kuery", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - "xsrfHeader": { - "schema": { - "type": "string" - }, - "in": "header", - "name": "kbn-xsrf", - "required": true - } - }, - "securitySchemes": { - "basicAuth": { - "type": "http", - "scheme": "basic" - }, - "Enrollment API Key": { - "name": "Authorization", - "type": "apiKey", - "in": "header", - "description": "e.g. Authorization: ApiKey base64EnrollmentApiKey" - }, - "Access API Key": { - "name": "Authorization", - "type": "apiKey", - "in": "header", - "description": "e.g. Authorization: ApiKey base64AccessApiKey" - } - } - }, - "security": [ - { - "basicAuth": [] - } - ] -}