Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions specification/_doc_ids/table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,11 @@ project-create-routing,,https://www.elastic.co/docs/api/doc/elasticsearch-server
project-delete-routing,,https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-routing-delete,,About deleting project routing
project-get-many-routing,,https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-routing-get-many,,About retrieving project routing
project-get-routing,,https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-routing-get,,About retrieving project routing
prometheus-labels,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,[use-doc-url],,Get label names
prometheus-query,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,[use-doc-url],,Execute a PromQL instant query
prometheus-query-range,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,[use-doc-url],,Execute a PromQL range query
prometheus-remote-write,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,[use-doc-url],,Ingest Prometheus remote write data
prometheus-series,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,[use-doc-url],,Find matching time series
put-analytics-collection,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put-behavioral-analytics,https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-search-application-put-behavioral-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-analytics-collection.html,Creating an analytics collection
put-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-data-frame-analytics,https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-ml-put-data-frame-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-dfanalytics.html,Creating data frame analytics
put-enrich-policy-api,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy,https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-enrich-put-policy,https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-enrich-policy-api.html,About creating an enrich policy
Expand Down
70 changes: 70 additions & 0 deletions specification/prometheus/labels/PrometheusLabelsRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RequestBase } from '@_types/Base'
import { IndexName, MediaType } from '@_types/common'
import { integer } from '@_types/Numeric'

/**
* Get label names.
*
* Return a list of label names that match a certain set of selectors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Return a list of label names that match a certain set of selectors.
* Return a sorted list of label names that match a certain set of selectors.

since the endpoint java doc in the server code specifies that the list is sorted we can also add it here

* @rest_spec_name prometheus.labels
* @availability stack since=9.4.0 stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We've now got "tech_preview" available per #6312

Suggested change
* @availability stack since=9.4.0 stability=experimental visibility=public
* @availability stack since=9.4.0 stability=tech_preview visibility=public

* @availability serverless stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @availability serverless stability=experimental visibility=public
* @availability serverless stability=tech_preview visibility=public

* @doc_id prometheus-labels
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_prometheus/api/v1/labels'
methods: ['GET']
},
{
path: '/_prometheus/{index}/api/v1/labels'
methods: ['GET']
}
]
path_parts: {
/**
* An index pattern that restricts the query to a specific index.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

server default "metrics-*" server code

*/
index?: IndexName
}
response_media_type: MediaType.Json
query_parameters: {
/**
* Series selectors used to filter the returned label names.
* @codegen_name match
*/
'match[]'?: string[]
/**
* The start of the time range. Defaults to `now - 24h`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use the server default annotation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

from the server code it looks like it's "end-24h" (which yes it's "now-24h" in case both are empty, but still)

*/
start?: string
/**
* The end of the time range. Defaults to now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use the server default annotation

*/
end?: string
/**
* The maximum number of results to return. `0` means no limit.
*/
limit?: integer
}
}
25 changes: 25 additions & 0 deletions specification/prometheus/labels/PrometheusLabelsResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class Response {
/** @codegen_name body */
body: UserDefinedValue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is it really completely unmappable? I'm looking at the server code and it seems like there is some structure, there's also the error case which we could map using the exceptions field.

}
65 changes: 65 additions & 0 deletions specification/prometheus/query/PrometheusQueryRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RequestBase } from '@_types/Base'
import { IndexName, MediaType } from '@_types/common'
import { integer } from '@_types/Numeric'

/**
* Execute a PromQL instant query.
*
* Evaluate a PromQL expression at a single point in time.
* @rest_spec_name prometheus.query
* @availability stack since=9.4.0 stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @availability stack since=9.4.0 stability=experimental visibility=public
* @availability stack since=9.4.0 stability=tech_preview visibility=public

* @availability serverless stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @availability serverless stability=experimental visibility=public
* @availability serverless stability=tech_preview visibility=public

* @doc_id prometheus-query
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_prometheus/api/v1/query'
methods: ['GET']
},
{
path: '/_prometheus/{index}/api/v1/query'
methods: ['GET']
}
]
path_parts: {
/**
* An index pattern that restricts the query to a specific index.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

*/
index?: IndexName
}
response_media_type: MediaType.Json
query_parameters: {
/**
* The PromQL expression to evaluate.
*/
query: string
/**
* The evaluation timestamp. Defaults to the current server time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use the server default annotation (default to now)

*/
time?: string
/**
* The maximum number of results to return. `0` means no limit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

server default 0

*/
limit?: integer
}
}
25 changes: 25 additions & 0 deletions specification/prometheus/query/PrometheusQueryResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class Response {
/** @codegen_name body */
body: UserDefinedValue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above, server code hints to a structure

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RequestBase } from '@_types/Base'
import { IndexName, MediaType } from '@_types/common'
import { integer } from '@_types/Numeric'

/**
* Execute a PromQL range query.
*
* Evaluate a PromQL expression over a time range.
* @rest_spec_name prometheus.query_range
* @availability stack since=9.4.0 stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @availability stack since=9.4.0 stability=experimental visibility=public
* @availability stack since=9.4.0 stability=tech_preview visibility=public

* @availability serverless stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @availability serverless stability=experimental visibility=public
* @availability serverless stability=tech_preview visibility=public

* @doc_id prometheus-query-range
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_prometheus/api/v1/query_range'
methods: ['GET']
},
{
path: '/_prometheus/{index}/api/v1/query_range'
methods: ['GET']
}
]
path_parts: {
/**
* An index pattern that restricts the query to a specific index.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

*/
index?: IndexName
}
response_media_type: MediaType.Json
query_parameters: {
/**
* The PromQL expression to evaluate.
*/
query: string
/**
* The start of the time range (inclusive).
*/
start: string
/**
* The end of the time range (inclusive).
*/
end: string
/**
* The query resolution step.
*/
step: string
/**
* The maximum number of results to return. `0` means no limit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

*/
limit?: integer
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class Response {
/** @codegen_name body */
body: UserDefinedValue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above, probably the same structure as the instant query

}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is likely missing the body, the request_media_type and the response_media_type. from the server code it's not immediately clear what's expecting, let's gather more info first.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RequestBase } from '@_types/Base'

/**
* Ingest Prometheus remote write data.
*
* Accepts a Prometheus remote write request (protobuf-encoded) and indexes the
* time series data into Elasticsearch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not mandatory, but might be nice to link to the narrative docs:

Suggested change
* time series data into Elasticsearch.
* time series data into Elasticsearch. For an overview, refer to [Prometheus remote write endpoint](https://www.elastic.co/docs/manage-data/data-store/data-streams/tsds-ingest-prometheus-remote-write).

* @rest_spec_name prometheus.remote_write
* @availability stack since=9.4.0 stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @availability stack since=9.4.0 stability=experimental visibility=public
* @availability stack since=9.4.0 stability=tech_preview visibility=public

* @availability serverless stability=experimental visibility=public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @availability serverless stability=experimental visibility=public
* @availability serverless stability=tech_preview visibility=public

* @doc_id prometheus-remote-write
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_prometheus/api/v1/write'
methods: ['POST']
},
{
path: '/_prometheus/metrics/{dataset}/api/v1/write'
methods: ['POST']
},
{
path: '/_prometheus/metrics/{dataset}/{namespace}/api/v1/write'
methods: ['POST']
}
]
path_parts: {
/**
* The Prometheus dataset name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

server default "generic", server code

*/
dataset?: string
/**
* The Prometheus namespace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

server default "default", server code a line below the other one

*/
namespace?: string
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export class Response {
/** @codegen_name body */
body: UserDefinedValue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this one just returns and empty response, from reading the server code, but again, not super clear, need more info.

}
Loading
Loading