-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command to spin up a mock server for ingest endpoints (#49259)
- Loading branch information
Showing
14 changed files
with
929 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"author": "Elastic", | ||
"name": "fleet", | ||
"version": "8.0.0", | ||
"private": true, | ||
"license": "Elastic-License", | ||
"devDependencies": { | ||
"@stoplight/prism-cli": "^3.1.1" | ||
}, | ||
"workspaces": { | ||
"nohoist": [ | ||
"@stoplight/**" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
require('../../../../../../src/setup_node_env'); | ||
require('./script'); |
16 changes: 16 additions & 0 deletions
16
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/asset.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"title": "Asset", | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"$ref": "./asset_type.v1.json" | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"type" | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/asset_type.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "string", | ||
"title": "AssetType", | ||
"description": "Types of assets which can be installed/removed", | ||
"enum": [ | ||
"index-template", | ||
"ingest-pipeline", | ||
"ilm-policy", | ||
"rollup-job", | ||
"ml-job", | ||
"data-frame-transform" | ||
] | ||
} |
33 changes: 33 additions & 0 deletions
33
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/datasource.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"title": "Datasource", | ||
"type": "object", | ||
"description": "A package with a use case (eg prod_west). The use case ID must be unique. A datasource can have multiple streams.", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"example": "prod_west", | ||
"description": "Should be unique" | ||
}, | ||
"package": { | ||
"$ref": "./package.v1.json" | ||
}, | ||
"streams": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "./stream.v1.json" | ||
} | ||
}, | ||
"id": { | ||
"type": "string", | ||
"format": "uuid" | ||
}, | ||
"read_alias": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"name", | ||
"package", | ||
"streams" | ||
] | ||
} |
50 changes: 50 additions & 0 deletions
50
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/input.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"title": "Input", | ||
"type": "object", | ||
"description": "Where the data comes from", | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"enum": [ | ||
"log", | ||
"metric/system", | ||
"metric/docker", | ||
"etc" | ||
] | ||
}, | ||
"config": { | ||
"type": "object", | ||
"example": "{paths: \"/var/log/*.log\"} or {metricsets: [\"container\", \"cpu\"]} or {username: \"elastic\", password: \"changeme\"}", | ||
"description": "Mix of configurable and required properties still TBD. Object for now might become string" | ||
}, | ||
"ingest_pipelines": { | ||
"type": "array", | ||
"description": "Need a distinction for \"main\" ingest pipeline. Should be handled during install. Likely by package/manifest format", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"id": { | ||
"type": "string", | ||
"format": "uuid" | ||
}, | ||
"index_template": { | ||
"type": "string" | ||
}, | ||
"ilm_policy": { | ||
"type": "string" | ||
}, | ||
"fields": { | ||
"type": "array", | ||
"description": "", | ||
"items": { | ||
"type": "object", | ||
"description": "contents from fields.yml" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"config" | ||
] | ||
} |
47 changes: 47 additions & 0 deletions
47
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/output.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"title": "Output", | ||
"type": "object", | ||
"description": "Where to send the data", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string", | ||
"example": "\"default\" or \"infosec1\"" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"enum": [ | ||
"elasticsearch", | ||
"something", | ||
"else" | ||
] | ||
}, | ||
"url": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"api_token": { | ||
"type": "string" | ||
}, | ||
"index_name": { | ||
"type": "string", | ||
"example": "metrics-mysql-prod_west-access", | ||
"description": "unique alias with write index" | ||
}, | ||
"ingest_pipeline": { | ||
"type": "string", | ||
"example": "metrics-mysql-prod_west-access" | ||
}, | ||
"config": { | ||
"type": "object", | ||
"description": "contains everything not otherwise specified (e.g. TLS, etc)" | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"name", | ||
"type" | ||
] | ||
} |
34 changes: 34 additions & 0 deletions
34
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/package.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"title": "Package", | ||
"type": "object", | ||
"description": "Multiple dashboard templates and multiple input templates, eg access log, error log, metrics, consisting of index template, ingest pipeline, ML jobs.", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"example": "coredns" | ||
}, | ||
"version": { | ||
"type": "string", | ||
"example": "1.0.1, 1.3.1" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"example": "CoreDNS logs and metrics integration.\nThe CoreDNS integrations allows to gather logs and metrics from the CoreDNS DNS server to get better insights.\n" | ||
}, | ||
"title": { | ||
"type": "string", | ||
"example": "CoreDNS" | ||
}, | ||
"assets": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "./asset.v1.json" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"name", | ||
"version", | ||
"assets" | ||
] | ||
} |
51 changes: 51 additions & 0 deletions
51
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/policy.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"title": "Policy", | ||
"type": "object", | ||
"description": "Has config from zero or more datasources.", | ||
"x-examples": { | ||
"example-1": { | ||
"value": { | ||
"id": "policy_example", | ||
"name": "Example Policy", | ||
"datasources": [ | ||
{ | ||
"use_case": "prod_west", | ||
"packcage": {}, | ||
"streams": [ | ||
{} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"datasources": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"$ref": "./datasource.v1.json" | ||
} | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"status": { | ||
"type": "string", | ||
"enum": [ | ||
"active", | ||
"inactive" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"status" | ||
] | ||
} |
31 changes: 31 additions & 0 deletions
31
x-pack/legacy/plugins/fleet/scripts/mock_spec/models/stream.v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"title": "Stream", | ||
"type": "object", | ||
"description": "A combination of an input type, the required config, an output, and any processors", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"input": { | ||
"$ref": "./input.v1.json" | ||
}, | ||
"config": { | ||
"type": "object", | ||
"example": "{paths: \"/var/log/*.log\"} or {metricsets: [\"container\", \"cpu\"]} or {username: \"elastic\", password: \"changeme\"}" | ||
}, | ||
"output": { | ||
"$ref": "./output.v1.json" | ||
}, | ||
"processors": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"input", | ||
"output" | ||
] | ||
} |
Oops, something went wrong.