Skip to content

Commit

Permalink
[UII] Add types to return content packages correctly (elastic#195505)
Browse files Browse the repository at this point in the history
## Summary

Related to elastic#192484. This PR adding [new content package types and
schemas](elastic/package-spec#777) so that
content packages can be returned correctly from EPR to unblock
development of those packages.

The only current content package is `kubernetes_otel`. You will need to
bump up the max allowed spec version and search with beta (prerelease)
packages enabled to find it:
```
xpack.fleet.internal.registry.spec.max: '3.4'
```

Tests will come with the rest of work for elastic#192484

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit bd6533f)

# Conflicts:
#	oas_docs/bundle.json
#	oas_docs/bundle.serverless.json
#	oas_docs/output/kibana.serverless.staging.yaml
#	oas_docs/output/kibana.serverless.yaml
#	oas_docs/output/kibana.staging.yaml
#	oas_docs/output/kibana.yaml
#	x-pack/plugins/fleet/server/types/rest_spec/epm.ts
  • Loading branch information
jen-huang committed Oct 9, 2024
1 parent a3da125 commit 9c594d1
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 4 deletions.
87 changes: 85 additions & 2 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -6700,7 +6700,12 @@
"type": "string"
},
"type": {
"type": "string"
"type": "string",
"enum": [
"integration",
"input",
"content"
]
},
"categories": {
"type": "array",
Expand Down Expand Up @@ -6853,6 +6858,83 @@
}
}
}
},
"owner": {
"type": "object",
"properties": {
"github": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"elastic",
"partner",
"community"
]
}
},
"required": [
"github"
]
},
"agent": {
"type": "object",
"properties": {
"privileges": {
"type": "object",
"properties": {
"root": {
"type": "boolean"
}
}
}
}
},
"asset_tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string"
},
"asset_types": {
"type": "array",
"items": {
"type": "string"
}
},
"asset_ids": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"text"
]
}
},
"discovery": {
"type": "object",
"properties": {
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
}
}
}
}
},
"required": [
Expand All @@ -6866,7 +6948,8 @@
"assets",
"format_version",
"download",
"path"
"path",
"owner"
]
},
"package_usage_stats": {
Expand Down
55 changes: 55 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4233,6 +4233,10 @@ components:
type: string
type:
type: string
enum:
- integration
- input
- content
categories:
type: array
items:
Expand Down Expand Up @@ -4335,6 +4339,56 @@ components:
type: array
items:
type: string
owner:
type: object
properties:
github:
type: string
type:
type: string
enum:
- elastic
- partner
- community
required:
- github
agent:
type: object
properties:
privileges:
type: object
properties:
root:
type: boolean
asset_tags:
type: array
items:
type: object
properties:
text:
type: string
asset_types:
type: array
items:
type: string
asset_ids:
type: array
items:
type: string
required:
- text
discovery:
type: object
properties:
fields:
type: array
items:
type: object
properties:
name:
type: string
required:
- name
required:
- name
- title
Expand All @@ -4347,6 +4401,7 @@ components:
- format_version
- download
- path
- owner
package_usage_stats:
title: Package usage stats
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ properties:
type: string
type:
type: string
enum:
- integration
- input
- content
categories:
type: array
items:
Expand Down Expand Up @@ -131,6 +135,56 @@ properties:
type: array
items:
type: string
owner:
type: object
properties:
github:
type: string
type:
type: string
enum:
- elastic
- partner
- community
required:
- github
agent:
type: object
properties:
privileges:
type: object
properties:
root:
type: boolean
asset_tags:
type: array
items:
type: object
properties:
text:
type: string
asset_types:
type: array
items:
type: string
asset_ids:
type: array
items:
type: string
required:
- text
discovery:
type: object
properties:
fields:
type: array
items:
type: object
properties:
name:
type: string
required:
- name
required:
- name
- title
Expand All @@ -143,3 +197,4 @@ required:
- format_version
- download
- path
- owner
9 changes: 7 additions & 2 deletions x-pack/plugins/fleet/common/types/models/package_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface PackageSpecManifest {
source?: {
license: string;
};
type?: 'integration' | 'input';
type?: PackageSpecPackageType;
release?: 'experimental' | 'beta' | 'ga';
categories?: Array<PackageSpecCategory | undefined>;
conditions?: PackageSpecConditions;
Expand All @@ -35,14 +35,19 @@ export interface PackageSpecManifest {
privileges?: { root?: boolean };
};
asset_tags?: PackageSpecTags[];
discovery?: {
fields?: Array<{
name: string;
}>;
};
}
export interface PackageSpecTags {
text: string;
asset_types?: string[];
asset_ids?: string[];
}

export type PackageSpecPackageType = 'integration' | 'input';
export type PackageSpecPackageType = 'integration' | 'input' | 'content';

export type PackageSpecCategory =
| 'advanced_analytics_ueba'
Expand Down

0 comments on commit 9c594d1

Please sign in to comment.