Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ae2c7ae
[Fleet] When removing a inputs type package policy, clean up assets
criamico Apr 17, 2025
5d4af8d
Split tests
criamico Apr 17, 2025
9eedc05
Expand dev doc about input packages
criamico Apr 18, 2025
6525a2e
Add unit tests
criamico Apr 18, 2025
288def9
Add constant instead of magic number
criamico Apr 18, 2025
7f31853
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine Apr 18, 2025
0c568ef
fix missing await
criamico Apr 18, 2025
426fc36
Remove assets if last policy for package
jillguyonnet Apr 25, 2025
11e0d0a
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine Apr 28, 2025
0f6df81
update tests
criamico Apr 28, 2025
722c3b8
Add test to packagePolicyService
criamico Apr 28, 2025
1db6c23
Add unit test
criamico Apr 28, 2025
cf5492d
Create new endpoint and move logic to handler
criamico May 6, 2025
8eadaf3
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 6, 2025
fc216bb
Improve assets deletion
criamico May 7, 2025
9212c7a
Update UI to use the new endpoint
criamico May 9, 2025
ff4d371
code review: rename endpoint
criamico May 9, 2025
9b82310
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 13, 2025
1ec8761
Update tests
criamico May 13, 2025
842d35a
[CI] Auto-commit changed files from 'node scripts/capture_oas_snapsho…
kibanamachine May 13, 2025
712746d
More unit tests
criamico May 13, 2025
34bfbfc
Fix linter errors
criamico May 14, 2025
7d1665b
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine May 14, 2025
1c8e5c2
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine May 14, 2025
35ff58c
Add more tests and fix broken ones
criamico May 14, 2025
893185f
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 14, 2025
919801e
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine May 14, 2025
5c5fe99
fix type
criamico May 15, 2025
57ba1b6
fix package policy test
criamico May 15, 2025
e494590
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 15, 2025
33950a4
Fix broken unit test
criamico May 16, 2025
5664fd8
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 16, 2025
04ba40f
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 19, 2025
36b2d31
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 19, 2025
378838f
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 20, 2025
e9f683e
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 21, 2025
b531c9e
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 23, 2025
68044fd
fix runtime error
criamico May 23, 2025
faea016
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 26, 2025
75f5b2d
Merge main and fix conflicts with 214216
criamico May 27, 2025
417f6ee
apply changes from 214216
criamico May 27, 2025
9b02913
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 27, 2025
8bba3d0
Move all logic to backend per code review and fix tests
criamico May 29, 2025
e68fb62
add unit test
criamico May 29, 2025
147e0a8
Merge branch 'main' into 209789_inputs_package_assets_cleanup
elasticmachine May 29, 2025
c835c0e
Revert changes not needed anymore
criamico May 29, 2025
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
96 changes: 96 additions & 0 deletions oas_docs/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -27957,6 +27957,102 @@
]
}
},
"/api/fleet/epm/packages/{pkgName}/{pkgVersion}/datastream_assets": {
"delete": {
"description": "[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.",
"operationId": "delete-fleet-epm-packages-pkgname-pkgversion-datastream-assets",
"parameters": [
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
},
{
"in": "path",
"name": "pkgName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "pkgVersion",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "packagePolicyId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"success": {
"type": "boolean"
}
},
"required": [
"success"
],
"type": "object"
}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"description": "Generic Error",
"properties": {
"attributes": {},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
},
"message": {
"type": "string"
},
"statusCode": {
"type": "number"
}
},
"required": [
"message",
"attributes"
],
"type": "object"
}
}
}
}
},
"summary": "Delete assets for an input package",
"tags": [
"Elastic Package Manager (EPM)"
]
}
},
"/api/fleet/epm/packages/{pkgName}/{pkgVersion}/kibana_assets": {
"delete": {
"description": "[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.",
Expand Down
96 changes: 96 additions & 0 deletions oas_docs/bundle.serverless.json
Original file line number Diff line number Diff line change
Expand Up @@ -27957,6 +27957,102 @@
]
}
},
"/api/fleet/epm/packages/{pkgName}/{pkgVersion}/datastream_assets": {
"delete": {
"description": "[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.",
"operationId": "delete-fleet-epm-packages-pkgname-pkgversion-datastream-assets",
"parameters": [
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
},
{
"in": "path",
"name": "pkgName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "pkgVersion",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "packagePolicyId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"success": {
"type": "boolean"
}
},
"required": [
"success"
],
"type": "object"
}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"description": "Generic Error",
"properties": {
"attributes": {},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
},
"message": {
"type": "string"
},
"statusCode": {
"type": "number"
}
},
"required": [
"message",
"attributes"
],
"type": "object"
}
}
}
}
},
"summary": "Delete assets for an input package",
"tags": [
"Elastic Package Manager (EPM)"
]
}
},
"/api/fleet/epm/packages/{pkgName}/{pkgVersion}/kibana_assets": {
"delete": {
"description": "[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.",
Expand Down
62 changes: 62 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28092,6 +28092,68 @@ paths:
summary: Get a package file
tags:
- Elastic Package Manager (EPM)
/api/fleet/epm/packages/{pkgName}/{pkgVersion}/datastream_assets:
delete:
description: '[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.'
operationId: delete-fleet-epm-packages-pkgname-pkgversion-datastream-assets
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- in: path
name: pkgName
required: true
schema:
type: string
- in: path
name: pkgVersion
required: true
schema:
type: string
- in: query
name: packagePolicyId
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
additionalProperties: false
type: object
properties:
success:
type: boolean
required:
- success
'400':
content:
application/json:
schema:
additionalProperties: false
description: Generic Error
type: object
properties:
attributes: {}
error:
type: string
errorType:
type: string
message:
type: string
statusCode:
type: number
required:
- message
- attributes
summary: Delete assets for an input package
tags:
- Elastic Package Manager (EPM)
/api/fleet/epm/packages/{pkgName}/{pkgVersion}/kibana_assets:
delete:
description: '[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.'
Expand Down
62 changes: 62 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30334,6 +30334,68 @@ paths:
summary: Get a package file
tags:
- Elastic Package Manager (EPM)
/api/fleet/epm/packages/{pkgName}/{pkgVersion}/datastream_assets:
delete:
description: '[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.'
operationId: delete-fleet-epm-packages-pkgname-pkgversion-datastream-assets
parameters:
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- in: path
name: pkgName
required: true
schema:
type: string
- in: path
name: pkgVersion
required: true
schema:
type: string
- in: query
name: packagePolicyId
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
additionalProperties: false
type: object
properties:
success:
type: boolean
required:
- success
'400':
content:
application/json:
schema:
additionalProperties: false
description: Generic Error
type: object
properties:
attributes: {}
error:
type: string
errorType:
type: string
message:
type: string
statusCode:
type: number
required:
- message
- attributes
summary: Delete assets for an input package
tags:
- Elastic Package Manager (EPM)
/api/fleet/epm/packages/{pkgName}/{pkgVersion}/kibana_assets:
delete:
description: '[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const EPM_API_ROUTES = {
STATS_PATTERN: `${EPM_PACKAGES_MANY}/{pkgName}/stats`,
BULK_ASSETS_PATTERN: `${EPM_API_ROOT}/bulk_assets`,
INPUTS_PATTERN: `${EPM_API_ROOT}/templates/{pkgName}/{pkgVersion}/inputs`,
PACKAGES_DATASTREAM_ASSETS: `${EPM_API_ROOT}/packages/{pkgName}/{pkgVersion}/datastream_assets`,

REAUTHORIZE_TRANSFORMS: `${EPM_PACKAGES_ONE}/transforms/authorize`,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ export const epmRouteService = {
getUpdateCustomIntegrationsPath: (pkgName: string) => {
return EPM_API_ROUTES.UPDATE_CUSTOM_INTEGRATIONS_PATTERN.replace('{pkgName}', pkgName);
},
getDeletePackageDatastreamAssets: (pkgName: string, pkgVersion: string) => {
return EPM_API_ROUTES.PACKAGES_DATASTREAM_ASSETS.replace('{pkgName}', pkgName).replace(
'{pkgVersion}',
pkgVersion
);
},
};

export const packagePolicyRouteService = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface PackagePolicyPackage {
version: string;
experimental_data_stream_features?: ExperimentalDataStreamFeature[];
requires_root?: boolean;
type?: string;
}

export interface PackagePolicyConfigRecordEntry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,17 @@ export type GetInputsTemplatesResponse =
| {
inputs: any;
};

export interface DeletePackageDatastreamAssetsRequest {
params: {
pkgName: string;
pkgVersion: string;
};
query: {
packagePolicyId: string;
};
}

export interface DeletePackageDatastreamAssetsResponse {
success: boolean;
}
Loading
Loading