Skip to content

Commit dfa2b12

Browse files
committed
Enforce all requests to have URLs (#5626)
* requests to have urls * undo prettier * async query urls * fix violations (cherry picked from commit 696e252)
1 parent 67ec463 commit dfa2b12

File tree

14 files changed

+291
-1
lines changed

14 files changed

+291
-1
lines changed

specification/eslint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default defineConfig({
3535
'es-spec-validator/dictionary-key-is-string': 'error',
3636
'es-spec-validator/no-native-types': 'error',
3737
'es-spec-validator/invalid-node-types': 'error',
38-
'es-spec-validator/no-generic-number': 'error'
38+
'es-spec-validator/no-generic-number': 'error',
39+
'es-spec-validator/request-must-have-urls': 'error'
3940
}
4041
})

specification/esql/async_query/AsyncQueryRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ import { Dictionary } from '@spec_utils/Dictionary'
3737
* @index_privileges read
3838
*/
3939
export interface Request extends RequestBase {
40+
urls: [
41+
{
42+
path: '/_query/async'
43+
methods: ['POST']
44+
}
45+
]
4046
query_parameters: {
4147
/**
4248
* If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.

specification/esql/async_query_delete/AsyncQueryDeleteRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ import { Id } from '@_types/common'
3535
* @ext_doc_id esql
3636
*/
3737
export interface Request extends RequestBase {
38+
urls: [
39+
{
40+
path: '/_query/async/{id}'
41+
methods: ['DELETE']
42+
}
43+
]
3844
path_parts: {
3945
/**
4046
* The unique identifier of the query.

specification/esql/async_query_get/AsyncQueryGetRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ import { EsqlFormat } from '@esql/_types/QueryParameters'
3232
* @ext_doc_id esql
3333
*/
3434
export interface Request extends RequestBase {
35+
urls: [
36+
{
37+
path: '/_query/async/{id}'
38+
methods: ['GET']
39+
}
40+
]
3541
path_parts: {
3642
/**
3743
* The unique identifier of the query.

specification/esql/async_query_stop/AsyncQueryStopRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ import { Id } from '@_types/common'
3131
* @ext_doc_id esql
3232
*/
3333
export interface Request extends RequestBase {
34+
urls: [
35+
{
36+
path: '/_query/async/{id}/stop'
37+
methods: ['POST']
38+
}
39+
]
3440
path_parts: {
3541
/**
3642
* The unique identifier of the query.

specification/indices/cancel_migrate_reindex/MigrateCancelReindexRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ import { Indices } from '@_types/common'
3131
* @doc_tag migration
3232
*/
3333
export interface Request extends RequestBase {
34+
urls: [
35+
{
36+
path: '/_migration/reindex/{index}/_cancel'
37+
methods: ['POST']
38+
}
39+
]
3440
path_parts: {
3541
/** The index or data stream name */
3642
index: Indices

specification/indices/create_from/MigrateCreateFromRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ import { IndexSettings } from '@indices/_types/IndexSettings'
3333
* @doc_tag migration
3434
*/
3535
export interface Request extends RequestBase {
36+
urls: [
37+
{
38+
path: '/_create_from/{source}/{dest}'
39+
methods: ['PUT', 'POST']
40+
}
41+
]
3642
path_parts: {
3743
/** The source index or data stream name */
3844
source: IndexName

specification/indices/get_migrate_reindex_status/MigrateGetReindexStatusRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ import { Indices } from '@_types/common'
3131
* @doc_tag migration
3232
*/
3333
export interface Request extends RequestBase {
34+
urls: [
35+
{
36+
path: '/_migration/reindex/{index}/_status'
37+
methods: ['GET']
38+
}
39+
]
3440
path_parts: {
3541
/** The index or data stream name. */
3642
index: Indices

specification/indices/migrate_reindex/MigrateReindexRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ import { IndexName } from '@_types/common'
3232
* @doc_tag migration
3333
*/
3434
export interface Request extends RequestBase {
35+
urls: [
36+
{
37+
path: '/_migration/reindex'
38+
methods: ['POST']
39+
}
40+
]
3541
/** @codegen_name reindex */
3642
body: MigrateReindex
3743
}

specification/snapshot/repository_analyze/SnapshotAnalyzeRepositoryRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ import { Duration } from '@_types/Time'
133133
* @doc_id analyze-repository
134134
*/
135135
export interface Request extends RequestBase {
136+
urls: [
137+
{
138+
path: '/_snapshot/{repository}/_analyze'
139+
methods: ['POST']
140+
}
141+
]
136142
path_parts: {
137143
/**
138144
* The name of the repository.

0 commit comments

Comments
 (0)