Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write input package spec #328

Merged
merged 27 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/go/pkg/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func TestValidateFile(t *testing.T) {
"deploy_terraform": {},
"time_series": {},
"missing_data_stream": {},
"custom_logs": {},
"httpjson_input": {},
"sql_input": {},
"bad_additional_content": {
"bad-bad",
[]string{
Expand Down
2 changes: 1 addition & 1 deletion spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"io/fs"
)

//go:embed versions/1 versions/1/integration/_dev versions/1/integration/data_stream/_dev
//go:embed versions/1 versions/1/integration/_dev versions/1/integration/data_stream/_dev versions/1/input
var content embed.FS

// FS returns an io/fs.FS for accessing the "package-spec/version" contents.
Expand Down
2 changes: 1 addition & 1 deletion test/packages/custom_logs/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# newer versions go on top
- version: "0.0.1"
- version: "1.2.3"
changes:
- description: Initial draft of the package
type: enhancement
Expand Down
1 change: 0 additions & 1 deletion test/packages/custom_logs/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ description: >-
Read lines from active log files with Elastic Agent.
type: input
version: 1.2.3
release: ga
license: basic
categories:
- custom
Expand Down
2 changes: 1 addition & 1 deletion test/packages/httpjson_input/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# newer versions go on top
- version: "0.0.1"
- version: "1.2.0"
changes:
- description: Initial draft of the package
type: enhancement
Expand Down
1 change: 0 additions & 1 deletion test/packages/httpjson_input/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ description: >-
Ingest data from custom RESTful API's that do not currently have an existing integration.
type: input
version: 1.2.0
release: ga
categories:
- custom
conditions:
Expand Down
2 changes: 1 addition & 1 deletion test/packages/sql_input/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# newer versions go on top
- version: "0.0.1"
- version: "1.0.1"
changes:
- description: Initial draft of the package
type: enhancement
Expand Down
1 change: 0 additions & 1 deletion test/packages/sql_input/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ description: >-
Execute custom queries against an SQL database and store the results in Elasticsearch.
type: input
version: 1.0.1
release: ga
license: basic
categories:
- custom
Expand Down
3 changes: 3 additions & 0 deletions versions/1/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
- description: Prepare for support of multiple, independent package types. Require "type" to be present in manifest.
type: enhancement
link: https://github.com/elastic/package-spec/pull/323
- description: Write "input" package spec (beta)
type: enhancement
link: https://github.com/elastic/package-spec/pull/328
- version: 1.7.0
changes:
- description: Add kibana/osquery-pack-asset
Expand Down
44 changes: 44 additions & 0 deletions versions/1/input/changelog.spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
##
## Describes the specification for the package's CHANGELOG file
##
spec:
jsoriano marked this conversation as resolved.
Show resolved Hide resolved
# Everything under here follows JSON schema (https://json-schema.org/), written as YAML for readability
type: array
items:
type: object
additionalProperties: false
properties:
version:
description: Package version.
$ref: "../integration/manifest.spec.yml#/definitions/version"
changes:
description: List of changes in package version.
type: array
items:
type: object
additionalProperties: false
properties:
description:
description: Description of change.
type: string
examples:
- "Fix broken template"
type:
description: Type of change.
type: string
enum:
- "breaking-change"
- "bugfix"
- "enhancement"
link:
description: Link to issue or PR describing change in detail.
type: string
examples:
- "https://github.com/elastic/integrations/pull/550"
required:
- description
- type
- link
required:
- version
- changes
131 changes: 131 additions & 0 deletions versions/1/input/manifest.spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
##
## Describes the specification for the input package's main manifest.yml file
##
spec:
# Everything under here follows JSON schema (https://json-schema.org/), written as YAML for readability
type: object
additionalProperties: false
properties:
format_version:
description: The version of the package specification format used by this package.
$ref: "../integration/manifest.spec.yml#/definitions/version"
name:
description: The name of the package.
type: string
pattern: '^[a-z0-9_]+$'
examples:
- apache
title:
description: The title of the package.
type: string
examples:
- Apache
description:
description: A longer description of the package.
type: string
examples:
- Apache Integration
version:
description: The version of the package.
$ref: "../integration/manifest.spec.yml#/definitions/version"
license:
description: The license under which the package is being released.
type: string
enum:
- basic
default: basic
examples:
- basic
type:
description: The type of package.
type: string
enum:
- input
examples:
- input
categories:
$ref: "../integration/manifest.spec.yml#/definitions/categories"
conditions:
description: Conditions under which this package can be installed.
type: object
additionalProperties: false
properties:
kibana:
description: Kibana conditions
type: object
additionalProperties: false
properties:
version:
type: string
description: Kibana versions compatible with this package.
examples:
- ">=7.9.0"
policy_templates:
jsoriano marked this conversation as resolved.
Show resolved Hide resolved
description: List of policy templates offered by this package.
type: array
items:
type: object
additionalProperties: false
properties:
name:
description: Name of policy template.
type: string
examples:
- apache
type:
description: Type of data stream
type: string
enum:
- metrics
- logs
- synthetics
- traces
examples:
- metrics
title:
description: Title of policy template.
type: string
examples:
- Apache logs and metrics
description:
description: Longer description of policy template.
type: string
examples:
- Collect logs and metrics from Apache instances
icons:
$ref: "../integration/manifest.spec.yml#/definitions/icons"
screenshots:
$ref: "../integration/manifest.spec.yml#/definitions/screenshots"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What screenshots would we ship for an input package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like rather leave an option to place any picture here, even for instruction purposes. If you consider this to be useless, I can drop the field.

vars:
$ref: "../integration/data_stream/manifest.spec.yml#/definitions/vars"
input:
type: string
examples:
- aws/metrics
- s3
- file
template_path:
description: "Path to Elasticsearch index template for stream."
type: string
required:
- name
- title
- description
- type
- input
icons:
$ref: "../integration/manifest.spec.yml#/definitions/icons"
screenshots:
$ref: "../integration/manifest.spec.yml#/definitions/screenshots"
vars:
$ref: "../integration/data_stream/manifest.spec.yml#/definitions/vars"
owner:
$ref: "../integration/manifest.spec.yml#/definitions/owner"
required:
- format_version
- name
- title
- description
- version
- type
- owner
42 changes: 42 additions & 0 deletions versions/1/input/spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
##
## Entrypoint of "input packages" specification.
## The specification is considered "beta" at the moment, so it may change until we release it as GA.
##
## Describes the folders and files that make up a package.
##
spec:
additionalContents: true
totalContentsLimit: 65535
totalSizeLimit: 250MB
sizeLimit: 150MB
jsoriano marked this conversation as resolved.
Show resolved Hide resolved
configurationSizeLimit: 5MB
relativePathSizeLimit: 3MB
contents:
- description: The main package manifest file
type: file
contentMediaType: "application/x-yaml"
sizeLimit: 5MB
name: "manifest.yml"
required: true
$ref: "./manifest.spec.yml"
- description: The package's CHANGELOG file
type: file
contentMediaType: "application/x-yaml"
name: "changelog.yml"
required: true
$ref: "./changelog.spec.yml"
- description: Folder containing agent-related definitions
type: folder
name: agent
required: true
$ref: "../integration/agent/spec.yml"
- description: Folder containing documentation for the package
type: folder
name: docs
required: true
$ref: "../integration/docs/spec.yml"
- description: Folder containing field definitions
type: folder
name: fields
required: true
$ref: "../integration/data_stream/fields/spec.yml"
Loading