[OAS] Lint SLO APIs (#186339)

This commit is contained in:
Lisa Cawley 2024-06-20 13:37:58 -07:00 committed by GitHub
parent 548301d6a9
commit ac58b908de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 170 additions and 35 deletions

View file

@ -118,7 +118,7 @@
]
},
"get": {
"summary": "Retrieves a paginated list of SLOs",
"summary": "Get a paginated list of SLOs",
"operationId": "findSlosOp",
"description": "You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.\n",
"tags": [
@ -256,7 +256,7 @@
},
"/s/{spaceId}/api/observability/slos/{sloId}": {
"get": {
"summary": "Retrieves a SLO",
"summary": "Get a SLO",
"operationId": "getSloOp",
"description": "You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.\n",
"tags": [
@ -688,7 +688,7 @@
},
"/s/{spaceId}/internal/observability/slos/_historical_summary": {
"post": {
"summary": "Retrieves the historical summary for a list of SLOs",
"summary": "Get a historical summary for SLOs",
"operationId": "historicalSummaryOp",
"description": "You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.\n",
"tags": [
@ -856,9 +856,9 @@
},
"/s/{spaceId}/api/observability/slos/_delete_instances": {
"post": {
"summary": "Batch delete rollup and summary data for the matching list of sloId and instanceId",
"summary": "Batch delete rollup and summary data",
"operationId": "deleteSloInstancesOp",
"description": "You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.\n",
"description": "The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.\n",
"tags": [
"slo"
],
@ -1066,6 +1066,9 @@
},
"value": {
"type": "string"
},
"field": {
"type": "string"
}
}
},
@ -1107,6 +1110,56 @@
}
]
},
"kql_with_filters_good": {
"title": "KQL with filters",
"description": "The KQL query used to define the good events.",
"oneOf": [
{
"description": "the KQL query to filter the documents with.",
"type": "string",
"example": "request.latency <= 150 and request.status_code : \"2xx\""
},
{
"type": "object",
"properties": {
"kqlQuery": {
"type": "string"
},
"filters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/filter"
}
}
}
}
]
},
"kql_with_filters_total": {
"title": "KQL with filters",
"description": "The KQL query used to define all events.",
"oneOf": [
{
"description": "the KQL query to filter the documents with.",
"type": "string",
"example": "field.environment : \"production\" and service.name : \"my-service\""
},
{
"type": "object",
"properties": {
"kqlQuery": {
"type": "string"
},
"filters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/filter"
}
}
}
}
]
},
"indicator_properties_custom_kql": {
"title": "Custom Query",
"required": [
@ -1132,19 +1185,19 @@
"type": "string",
"example": "my-service-*"
},
"dataViewId": {
"description": "The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.",
"type": "string",
"example": "03b80ab3-003d-498b-881c-3beedbaf1162"
},
"filter": {
"description": "the KQL query to filter the documents with.",
"$ref": "#/components/schemas/kql_with_filters"
},
"good": {
"description": "the KQL query used to define the good events.",
"$ref": "#/components/schemas/kql_with_filters",
"example": "request.latency <= 150 and request.status_code : \"2xx\""
"$ref": "#/components/schemas/kql_with_filters_good"
},
"total": {
"description": "the KQL query used to define all events.",
"$ref": "#/components/schemas/kql_with_filters",
"example": ""
"$ref": "#/components/schemas/kql_with_filters_total"
},
"timestampField": {
"description": "The timestamp field used in the source indice.\n",
@ -1251,6 +1304,11 @@
"type": "string",
"example": "my-service-*"
},
"dataViewId": {
"description": "The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.",
"type": "string",
"example": "03b80ab3-003d-498b-881c-3beedbaf1162"
},
"filter": {
"description": "the KQL query to filter the documents with.",
"type": "string",
@ -1401,6 +1459,11 @@
"type": "string",
"example": "my-service-*"
},
"dataViewId": {
"description": "The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.",
"type": "string",
"example": "03b80ab3-003d-498b-881c-3beedbaf1162"
},
"filter": {
"description": "the KQL query to filter the documents with.",
"type": "string",
@ -1633,6 +1696,11 @@
"type": "string",
"example": "my-service-*"
},
"dataViewId": {
"description": "The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.",
"type": "string",
"example": "03b80ab3-003d-498b-881c-3beedbaf1162"
},
"filter": {
"description": "the KQL query to filter the documents with.",
"type": "string",

View file

@ -69,7 +69,7 @@ paths:
servers:
- url: https://localhost:5601
get:
summary: Retrieves a paginated list of SLOs
summary: Get a paginated list of SLOs
operationId: findSlosOp
description: |
You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
@ -159,7 +159,7 @@ paths:
$ref: '#/components/schemas/404_response'
/s/{spaceId}/api/observability/slos/{sloId}:
get:
summary: Retrieves a SLO
summary: Get a SLO
operationId: getSloOp
description: |
You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
@ -415,7 +415,7 @@ paths:
$ref: '#/components/schemas/404_response'
/s/{spaceId}/internal/observability/slos/_historical_summary:
post:
summary: Retrieves the historical summary for a list of SLOs
summary: Get a historical summary for SLOs
operationId: historicalSummaryOp
description: |
You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
@ -519,10 +519,10 @@ paths:
$ref: '#/components/schemas/403_response'
/s/{spaceId}/api/observability/slos/_delete_instances:
post:
summary: Batch delete rollup and summary data for the matching list of sloId and instanceId
summary: Batch delete rollup and summary data
operationId: deleteSloInstancesOp
description: |
You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
tags:
- slo
parameters:
@ -667,6 +667,8 @@ components:
type: object
value:
type: string
field:
type: string
filter:
title: Filter
description: Defines properties for a filter
@ -691,6 +693,36 @@ components:
type: array
items:
$ref: '#/components/schemas/filter'
kql_with_filters_good:
title: KQL with filters
description: The KQL query used to define the good events.
oneOf:
- description: the KQL query to filter the documents with.
type: string
example: 'request.latency <= 150 and request.status_code : "2xx"'
- type: object
properties:
kqlQuery:
type: string
filters:
type: array
items:
$ref: '#/components/schemas/filter'
kql_with_filters_total:
title: KQL with filters
description: The KQL query used to define all events.
oneOf:
- description: the KQL query to filter the documents with.
type: string
example: 'field.environment : "production" and service.name : "my-service"'
- type: object
properties:
kqlQuery:
type: string
filters:
type: array
items:
$ref: '#/components/schemas/filter'
indicator_properties_custom_kql:
title: Custom Query
required:
@ -713,17 +745,16 @@ components:
description: The index or index pattern to use
type: string
example: my-service-*
dataViewId:
description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
type: string
example: 03b80ab3-003d-498b-881c-3beedbaf1162
filter:
description: the KQL query to filter the documents with.
$ref: '#/components/schemas/kql_with_filters'
good:
description: the KQL query used to define the good events.
$ref: '#/components/schemas/kql_with_filters'
example: 'request.latency <= 150 and request.status_code : "2xx"'
$ref: '#/components/schemas/kql_with_filters_good'
total:
description: the KQL query used to define all events.
$ref: '#/components/schemas/kql_with_filters'
example: ''
$ref: '#/components/schemas/kql_with_filters_total'
timestampField:
description: |
The timestamp field used in the source indice.
@ -807,6 +838,10 @@ components:
description: The index or index pattern to use
type: string
example: my-service-*
dataViewId:
description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
type: string
example: 03b80ab3-003d-498b-881c-3beedbaf1162
filter:
description: the KQL query to filter the documents with.
type: string
@ -924,6 +959,10 @@ components:
description: The index or index pattern to use
type: string
example: my-service-*
dataViewId:
description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
type: string
example: 03b80ab3-003d-498b-881c-3beedbaf1162
filter:
description: the KQL query to filter the documents with.
type: string
@ -1107,6 +1146,10 @@ components:
description: The index or index pattern to use
type: string
example: my-service-*
dataViewId:
description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
type: string
example: 03b80ab3-003d-498b-881c-3beedbaf1162
filter:
description: the KQL query to filter the documents with.
type: string

View file

@ -25,16 +25,11 @@ properties:
type: string
example: 03b80ab3-003d-498b-881c-3beedbaf1162
filter:
description: the KQL query to filter the documents with.
$ref: "kql_with_filters.yaml"
good:
description: the KQL query used to define the good events.
$ref: "kql_with_filters.yaml"
example: 'request.latency <= 150 and request.status_code : "2xx"'
$ref: "kql_with_filters_good.yaml"
total:
description: the KQL query used to define all events.
$ref: "kql_with_filters.yaml"
example: ''
$ref: "kql_with_filters_total.yaml"
timestampField:
description: >
The timestamp field used in the source indice.

View file

@ -0,0 +1,14 @@
title: KQL with filters
description: The KQL query used to define the good events.
oneOf:
- description: the KQL query to filter the documents with.
type: string
example: 'request.latency <= 150 and request.status_code : "2xx"'
- type: object
properties:
kqlQuery:
type: string
filters:
type: array
items:
$ref: "filter.yaml"

View file

@ -0,0 +1,14 @@
title: KQL with filters
description: The KQL query used to define all events.
oneOf:
- description: the KQL query to filter the documents with.
type: string
example: 'field.environment : "production" and service.name : "my-service"'
- type: object
properties:
kqlQuery:
type: string
filters:
type: array
items:
$ref: "filter.yaml"

View file

@ -50,7 +50,7 @@ post:
- url: https://localhost:5601
get:
summary: Retrieves a paginated list of SLOs
summary: Get a paginated list of SLOs
operationId: findSlosOp
description: >
You must have the `read` privileges for the **SLOs** feature in the

View file

@ -1,7 +1,8 @@
post:
summary: Batch delete rollup and summary data for the matching list of sloId and instanceId
summary: Batch delete rollup and summary data
operationId: deleteSloInstancesOp
description: >
The deletion occurs for the specified list of `sloId` and `instanceId`.
You must have `all` privileges for the **SLOs** feature in the
**Observability** section of the Kibana feature privileges.
tags:

View file

@ -1,5 +1,5 @@
post:
summary: Retrieves the historical summary for a list of SLOs
summary: Get a historical summary for SLOs
operationId: historicalSummaryOp
description: >
You must have the `read` privileges for the **SLOs** feature in the

View file

@ -1,5 +1,5 @@
get:
summary: Retrieves a SLO
summary: Get a SLO
operationId: getSloOp
description: >
You must have the `read` privileges for the **SLOs** feature in the