Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0741439
rolled up route start
baileycash-elastic Apr 8, 2025
b440d48
purge policy
baileycash-elastic Apr 14, 2025
09c531a
add baseline test, cleanup api
baileycash-elastic Apr 14, 2025
4181771
fix tests
baileycash-elastic Apr 15, 2025
94fb94c
fix logic
baileycash-elastic Apr 15, 2025
2478f75
move code to service
baileycash-elastic Apr 15, 2025
a88e2ba
more tests
baileycash-elastic Apr 16, 2025
4e4a247
tweaks and tests
baileycash-elastic Apr 16, 2025
0a9e8ad
add unit tests
baileycash-elastic Apr 16, 2025
7ce07fe
update sp
baileycash-elastic Apr 16, 2025
a3949db
Merge branch 'main' into slo-210025
baileycash-elastic Apr 16, 2025
d2884b0
code improvements
baileycash-elastic Apr 16, 2025
850b70e
Update index.ts
baileycash-elastic Apr 16, 2025
b3cbd7b
fixing linter issue(?)
baileycash-elastic Apr 16, 2025
52e8535
address comments
baileycash-elastic Apr 17, 2025
27b2b1d
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Apr 17, 2025
7631481
add docs and fix linting issue
baileycash-elastic Apr 17, 2025
0ed369b
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine Apr 17, 2025
94d8f0a
rename route
baileycash-elastic Apr 17, 2025
7e2bdf3
attempt to fix typing issue
baileycash-elastic Apr 17, 2025
e57f802
Merge branch 'main' into slo-210025
baileycash-elastic Apr 21, 2025
3f53168
improve tests
baileycash-elastic Apr 21, 2025
61cc24d
cleanup
baileycash-elastic Apr 21, 2025
425480f
remove int tests
baileycash-elastic Apr 21, 2025
b123612
types bp
baileycash-elastic Apr 21, 2025
112f133
update docs
baileycash-elastic Apr 21, 2025
39ab846
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine Apr 21, 2025
8e9d4c7
Merge branch 'main' into slo-210025
baileycash-elastic Apr 22, 2025
237a24c
uae scoped clients
baileycash-elastic Apr 22, 2025
6fea364
Merge branch 'main' into slo-210025
baileycash-elastic Apr 22, 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: 95 additions & 1 deletion oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49743,6 +49743,48 @@ paths:
summary: Create an SLO
tags:
- slo
/s/{spaceId}/api/observability/slos/_bulk_purge_rollup:
post:
description: |
The deletion occurs for the specified list of `sloId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
operationId: deleteRollupDataOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_bulk_purge_rollup_request'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_bulk_purge_rollup_response'
description: Successful request
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Unauthorized response
summary: Batch delete rollup and summary data
tags:
- slo
/s/{spaceId}/api/observability/slos/_delete_instances:
post:
description: |
Expand Down Expand Up @@ -50051,7 +50093,7 @@ paths:
name: includeOutdatedOnly
schema:
type: boolean
- description: Specify which SLO tags to query by (comma-separated list)
- description: Filters the SLOs by tag
in: query
name: tags
schema:
Expand Down Expand Up @@ -65575,6 +65617,58 @@ components:
example: occurrences
title: Budgeting method
type: string
SLOs_bulk_purge_rollup_request:
description: |
The bulk purge rollup data request takes a list of SLO ids and a purge policy, then deletes the rollup data according to the purge policy. This API can be used to remove the staled data of an instance SLO that no longer get updated.
properties:
list:
description: An array of slo ids
items:
description: The SLO Definition id
example: 8853df00-ae2e-11ed-90af-09bb6422b258
type: string
type: array
purgePolicy:
description: Policy that dictates which SLI documents to purge based on age
oneOf:
- type: object
properties:
age:
description: The duration to determine which documents to purge, formatted as {duration}{unit}. This value should be greater than or equal to the time window of every SLO provided.
example: 7d
type: string
purgeType:
description: Specifies whether documents will be purged based on a specific age or on a timestamp
enum:
- fixed-age
type: string
- type: object
properties:
purgeType:
description: Specifies whether documents will be purged based on a specific age or on a timestamp
enum:
- fixed-time
type: string
timestamp:
description: The timestamp to determine which documents to purge, formatted in ISO. This value should be older than the applicable time window of every SLO provided.
example: '2024-12-31T00:00:00.000Z'
type: string
type: object
required:
- list
- purgePolicy
title: Bulk Purge Rollup data request
type: object
SLOs_bulk_purge_rollup_response:
description: |
The bulk purge rollup data response returns a task id from the elasticsearch deleteByQuery response.
properties:
taskId:
description: The task id of the purge operation
example: 8853df00-ae2e-11ed-90af-09bb6422b258
type: string
title: Bulk Purge Rollup data response
type: object
SLOs_create_slo_request:
description: |
The create SLO API request body varies depending on the type of indicator, time window and budgeting method.
Expand Down
96 changes: 95 additions & 1 deletion oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54383,6 +54383,48 @@ paths:
summary: Create an SLO
tags:
- slo
/s/{spaceId}/api/observability/slos/_bulk_purge_rollup:
post:
description: |
The deletion occurs for the specified list of `sloId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
operationId: deleteRollupDataOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_bulk_purge_rollup_request'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_bulk_purge_rollup_response'
description: Successful request
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Unauthorized response
summary: Batch delete rollup and summary data
tags:
- slo
/s/{spaceId}/api/observability/slos/_delete_instances:
post:
description: |
Expand Down Expand Up @@ -54691,7 +54733,7 @@ paths:
name: includeOutdatedOnly
schema:
type: boolean
- description: Specify which SLO tags to query by (comma-separated list)
- description: Filters the SLOs by tag
in: query
name: tags
schema:
Expand Down Expand Up @@ -75088,6 +75130,58 @@ components:
example: occurrences
title: Budgeting method
type: string
SLOs_bulk_purge_rollup_request:
description: |
The bulk purge rollup data request takes a list of SLO ids and a purge policy, then deletes the rollup data according to the purge policy. This API can be used to remove the staled data of an instance SLO that no longer get updated.
properties:
list:
description: An array of slo ids
items:
description: The SLO Definition id
example: 8853df00-ae2e-11ed-90af-09bb6422b258
type: string
type: array
purgePolicy:
description: Policy that dictates which SLI documents to purge based on age
oneOf:
- type: object
properties:
age:
description: The duration to determine which documents to purge, formatted as {duration}{unit}. This value should be greater than or equal to the time window of every SLO provided.
example: 7d
type: string
purgeType:
description: Specifies whether documents will be purged based on a specific age or on a timestamp
enum:
- fixed-age
type: string
- type: object
properties:
purgeType:
description: Specifies whether documents will be purged based on a specific age or on a timestamp
enum:
- fixed-time
type: string
timestamp:
description: The timestamp to determine which documents to purge, formatted in ISO. This value should be older than the applicable time window of every SLO provided.
example: '2024-12-31T00:00:00.000Z'
type: string
type: object
required:
- list
- purgePolicy
title: Bulk Purge Rollup data request
type: object
SLOs_bulk_purge_rollup_response:
description: |
The bulk purge rollup data response returns a task id from the elasticsearch deleteByQuery response.
properties:
taskId:
description: The task id of the purge operation
example: 8853df00-ae2e-11ed-90af-09bb6422b258
type: string
title: Bulk Purge Rollup data response
type: object
SLOs_create_slo_request:
description: |
The create SLO API request body varies depending on the type of indicator, time window and budgeting method.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import * as t from 'io-ts';
import { DeleteByQueryResponse } from '@elastic/elasticsearch/lib/api/types';
import { dateType, durationType } from '../../schema';

const fixedAgePurgeVal = t.literal('fixed_age');
const fixedTimePurgeVal = t.literal('fixed_time');

const fixedAgePurge = t.type({
purgeType: fixedAgePurgeVal,
age: durationType,
});

const fixedTimePurge = t.type({
purgeType: fixedTimePurgeVal,
timestamp: dateType,
});

const bulkPurgePolicy = t.union([fixedAgePurge, fixedTimePurge]);

const bulkPurgeRollupSchema = t.type({
body: t.intersection([
t.type({
list: t.array(t.string),
purgePolicy: bulkPurgePolicy,
}),
t.partial({
force: t.boolean,
}),
]),
});

interface BulkPurgeRollupResponse {
taskId?: DeleteByQueryResponse['task'];
}

type BulkPurgePolicyType = t.TypeOf<typeof bulkPurgePolicy>;
type BulkPurgeRollupParams = t.TypeOf<typeof bulkPurgeRollupSchema.props.body>;

export type { BulkPurgeRollupResponse, BulkPurgePolicyType, BulkPurgeRollupParams };
export { bulkPurgeRollupSchema };
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from './find_group';
export * from './find_definition';
export * from './get';
export * from './get_burn_rates';
export * from './bulk_purge_rollup';
export * from './get_slo_groupings';
export * from './get_slo_stats_overview';
export * from './get_preview_data';
Expand Down
Loading