Skip to content

Commit ca73cb9

Browse files
authored
Fix snapshot.status Response (#317)
1 parent 733f3a3 commit ca73cb9

File tree

6 files changed

+228
-6
lines changed

6 files changed

+228
-6
lines changed

output/schema/schema.json

Lines changed: 141 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10495,7 +10495,7 @@
1049510495
"name": "SnapshotStatusResponse",
1049610496
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
1049710497
},
10498-
"since": "0.0.0",
10498+
"since": "7.8.0",
1049910499
"stability": "stable",
1050010500
"urls": [
1050110501
{
@@ -111942,7 +111942,7 @@
111942111942
"value": {
111943111943
"kind": "instance_of",
111944111944
"type": {
111945-
"name": "SnapshotShardsStats",
111945+
"name": "SnapshotShardsStatus",
111946111946
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
111947111947
}
111948111948
}
@@ -113257,6 +113257,145 @@
113257113257
}
113258113258
]
113259113259
},
113260+
{
113261+
"kind": "enum",
113262+
"members": [
113263+
{
113264+
"name": "DONE"
113265+
},
113266+
{
113267+
"name": "FAILURE"
113268+
},
113269+
{
113270+
"name": "FINALIZE"
113271+
},
113272+
{
113273+
"name": "INIT"
113274+
},
113275+
{
113276+
"name": "STARTED"
113277+
}
113278+
],
113279+
"name": {
113280+
"name": "SnapshotShardsStatsStage",
113281+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113282+
}
113283+
},
113284+
{
113285+
"kind": "interface",
113286+
"name": {
113287+
"name": "SnapshotShardsStatsSummary",
113288+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113289+
},
113290+
"properties": [
113291+
{
113292+
"name": "incremental",
113293+
"required": true,
113294+
"type": {
113295+
"kind": "instance_of",
113296+
"type": {
113297+
"name": "SnapshotShardsStatsSummaryItem",
113298+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113299+
}
113300+
}
113301+
},
113302+
{
113303+
"name": "total",
113304+
"required": true,
113305+
"type": {
113306+
"kind": "instance_of",
113307+
"type": {
113308+
"name": "SnapshotShardsStatsSummaryItem",
113309+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113310+
}
113311+
}
113312+
},
113313+
{
113314+
"name": "start_time_in_millis",
113315+
"required": true,
113316+
"type": {
113317+
"kind": "instance_of",
113318+
"type": {
113319+
"name": "long",
113320+
"namespace": "internal"
113321+
}
113322+
}
113323+
},
113324+
{
113325+
"name": "time_in_millis",
113326+
"required": true,
113327+
"type": {
113328+
"kind": "instance_of",
113329+
"type": {
113330+
"name": "long",
113331+
"namespace": "internal"
113332+
}
113333+
}
113334+
}
113335+
]
113336+
},
113337+
{
113338+
"kind": "interface",
113339+
"name": {
113340+
"name": "SnapshotShardsStatsSummaryItem",
113341+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113342+
},
113343+
"properties": [
113344+
{
113345+
"name": "file_count",
113346+
"required": true,
113347+
"type": {
113348+
"kind": "instance_of",
113349+
"type": {
113350+
"name": "long",
113351+
"namespace": "internal"
113352+
}
113353+
}
113354+
},
113355+
{
113356+
"name": "size_in_bytes",
113357+
"required": true,
113358+
"type": {
113359+
"kind": "instance_of",
113360+
"type": {
113361+
"name": "long",
113362+
"namespace": "internal"
113363+
}
113364+
}
113365+
}
113366+
]
113367+
},
113368+
{
113369+
"kind": "interface",
113370+
"name": {
113371+
"name": "SnapshotShardsStatus",
113372+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113373+
},
113374+
"properties": [
113375+
{
113376+
"name": "stage",
113377+
"required": true,
113378+
"type": {
113379+
"kind": "instance_of",
113380+
"type": {
113381+
"name": "SnapshotShardsStatsStage",
113382+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113383+
}
113384+
}
113385+
},
113386+
{
113387+
"name": "stats",
113388+
"required": true,
113389+
"type": {
113390+
"kind": "instance_of",
113391+
"type": {
113392+
"name": "SnapshotShardsStatsSummary",
113393+
"namespace": "modules.snapshot_and_restore.snapshot.snapshot_status"
113394+
}
113395+
}
113396+
}
113397+
]
113398+
},
113260113399
{
113261113400
"kind": "interface",
113262113401
"name": {

output/typescript/types.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11741,7 +11741,7 @@ export interface SmoothingModelContainer {
1174111741
}
1174211742

1174311743
export interface SnapshotIndexStats {
11744-
shards: Record<string, SnapshotShardsStats>
11744+
shards: Record<string, SnapshotShardsStatus>
1174511745
shards_stats: SnapshotShardsStats
1174611746
stats: SnapshotStats
1174711747
}
@@ -11897,6 +11897,25 @@ export interface SnapshotShardsStats {
1189711897
total: long
1189811898
}
1189911899

11900+
export type SnapshotShardsStatsStage = 'DONE' | 'FAILURE' | 'FINALIZE' | 'INIT' | 'STARTED'
11901+
11902+
export interface SnapshotShardsStatsSummary {
11903+
incremental: SnapshotShardsStatsSummaryItem
11904+
total: SnapshotShardsStatsSummaryItem
11905+
start_time_in_millis: long
11906+
time_in_millis: long
11907+
}
11908+
11909+
export interface SnapshotShardsStatsSummaryItem {
11910+
file_count: long
11911+
size_in_bytes: long
11912+
}
11913+
11914+
export interface SnapshotShardsStatus {
11915+
stage: SnapshotShardsStatsStage
11916+
stats: SnapshotShardsStatsSummary
11917+
}
11918+
1190011919
export interface SnapshotStats {
1190111920
incremental: FileCountSnapshotStats
1190211921
start_time_in_millis: long

specification/specs/modules/snapshot_and_restore/snapshot/snapshot_status/SnapshotIndexStats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
class SnapshotIndexStats {
21-
shards: Dictionary<string, SnapshotShardsStats>
21+
shards: Dictionary<string, SnapshotShardsStatus>
2222
shards_stats: SnapshotShardsStats
2323
stats: SnapshotStats
2424
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/**
21+
* @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/7.8/get-snapshot-status-api.html
22+
*/
23+
enum SnapshotShardsStatsStage {
24+
DONE = 0,
25+
FAILURE = 1,
26+
FINALIZE = 2,
27+
INIT = 3,
28+
STARTED = 4
29+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
class SnapshotShardsStatus {
21+
stage: SnapshotShardsStatsStage
22+
stats: SnapshotShardsStatsSummary
23+
}
24+
25+
class SnapshotShardsStatsSummary {
26+
incremental: SnapshotShardsStatsSummaryItem
27+
total: SnapshotShardsStatsSummaryItem
28+
start_time_in_millis: long
29+
time_in_millis: long
30+
}
31+
32+
class SnapshotShardsStatsSummaryItem {
33+
file_count: long
34+
size_in_bytes: long
35+
}

specification/specs/modules/snapshot_and_restore/snapshot/snapshot_status/SnapshotStatusRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/**
2121
* @rest_spec_name snapshot.status
22-
* @since 0.0.0
22+
* @since 7.8.0
2323
* @stability TODO
2424
*/
2525
interface SnapshotStatusRequest extends RequestBase {
@@ -28,7 +28,7 @@ interface SnapshotStatusRequest extends RequestBase {
2828
snapshot?: Names
2929
}
3030
query_parameters?: {
31-
ignore_unavailable?: boolean
31+
ignore_unavailable?: boolean // default: false
3232
master_timeout?: Time
3333
}
3434
body?: {}

0 commit comments

Comments
 (0)