-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add models for the /_remotestore/_restore
API endpoint
#70
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
75b51a5
Add models for the `/_remotestore/_restore` API endpoint
Xtansia 3331109
Flag as unstable
Xtansia 8b453fb
Fix `test/scripts/operation-filter.py` to work with multiline ops list
Xtansia c613964
Add example to PostRemoteStoreRestore operation
Xtansia d874905
Create test for `/_remotestore/_restore` endpoint
Xtansia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// The OpenSearch Contributors require contributions made to | ||
// this file be licensed under the Apache-2.0 license or a | ||
// compatible open source license. | ||
|
||
$version: "2" | ||
namespace OpenSearch | ||
|
||
@unstable | ||
@externalDocumentation( | ||
"OpenSearch Documentation": "https://opensearch.org/docs/latest/opensearch/remote/#restoring-from-a-backup" | ||
) | ||
|
||
@suppress(["HttpUriConflict"]) | ||
@http(method: "POST", uri: "/_remotestore/_restore") | ||
@documentation("Restore one or more indices from a remote backup.") | ||
operation PostRemoteStoreRestore{ | ||
input: PostRemoteStoreRestoreInput, | ||
output: PostRemoteStoreRestoreOutput | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// The OpenSearch Contributors require contributions made to | ||
// this file be licensed under the Apache-2.0 license or a | ||
// compatible open source license. | ||
|
||
$version: "2" | ||
namespace OpenSearch | ||
|
||
@unstable | ||
structure PostRemoteStoreRestoreInput { | ||
@httpQuery("cluster_manager_timeout") | ||
cluster_manager_timeout: Time, | ||
|
||
@httpQuery("wait_for_completion") | ||
wait_for_completion: Boolean, | ||
|
||
@required | ||
indices: IndexNameList | ||
} | ||
|
||
@unstable | ||
structure PostRemoteStoreRestoreOutput { | ||
accepted: Boolean, | ||
remote_store: RemoteStoreRestoreInfo | ||
} | ||
|
||
@unstable | ||
structure RemoteStoreRestoreInfo { | ||
snapshot: String, | ||
indices: IndexNameList, | ||
shards: RemoteStoreRestoreShardsInfo | ||
} | ||
|
||
@unstable | ||
structure RemoteStoreRestoreShardsInfo { | ||
total: Integer, | ||
failed: Integer, | ||
successful: Integer | ||
} | ||
|
||
apply PostRemoteStoreRestore @examples([ | ||
{ | ||
title: "Examples for Post Remote Storage Restore Operation.", | ||
input: { | ||
indices: ["books"] | ||
}, | ||
output: { | ||
remote_store: { | ||
indices: ["books"], | ||
shards: { | ||
total: 1, | ||
failed: 0, | ||
successful: 1 | ||
} | ||
} | ||
} | ||
} | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "OpenSearch", | ||
"version": "2021-11-23" | ||
}, | ||
"paths": { | ||
"/_remotestore/_restore": { | ||
"post": { | ||
"description": "Restore one or more indices from a remote backup.", | ||
"operationId": "PostRemoteStoreRestore", | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/PostRemoteStoreRestoreRequestContent" | ||
}, | ||
"examples": { | ||
"PostRemoteStoreRestore_example1": { | ||
"summary": "Examples for Post Remote Storage Restore Operation.", | ||
"description": "", | ||
"value": { | ||
"indices": [ | ||
"books" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"parameters": [ | ||
{ | ||
"name": "cluster_manager_timeout", | ||
"in": "query", | ||
"schema": { | ||
"type": "string", | ||
"pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$" | ||
} | ||
}, | ||
{ | ||
"name": "wait_for_completion", | ||
"in": "query", | ||
"schema": { | ||
"type": "boolean" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "PostRemoteStoreRestore 200 response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/PostRemoteStoreRestoreResponseContent" | ||
}, | ||
"examples": { | ||
"PostRemoteStoreRestore_example1": { | ||
"summary": "Examples for Post Remote Storage Restore Operation.", | ||
"description": "", | ||
"value": { | ||
"remote_store": { | ||
"indices": [ | ||
"books" | ||
], | ||
"shards": { | ||
"total": 1, | ||
"failed": 0, | ||
"successful": 1 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"PostRemoteStoreRestoreRequestContent": { | ||
"type": "object", | ||
"properties": { | ||
"indices": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[^+_\\-\\.][^\\\\, /*?\"<>| ,#\\nA-Z]+$" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"indices" | ||
] | ||
}, | ||
"PostRemoteStoreRestoreResponseContent": { | ||
"type": "object", | ||
"properties": { | ||
"accepted": { | ||
"type": "boolean" | ||
}, | ||
"remote_store": { | ||
"$ref": "#/components/schemas/RemoteStoreRestoreInfo" | ||
} | ||
}, | ||
"example": { | ||
"remote_store": { | ||
"indices": [ | ||
"books" | ||
], | ||
"shards": { | ||
"total": 1, | ||
"failed": 0, | ||
"successful": 1 | ||
} | ||
} | ||
} | ||
}, | ||
"RemoteStoreRestoreInfo": { | ||
"type": "object", | ||
"properties": { | ||
"snapshot": { | ||
"type": "string" | ||
}, | ||
"indices": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[^+_\\-\\.][^\\\\, /*?\"<>| ,#\\nA-Z]+$" | ||
} | ||
}, | ||
"shards": { | ||
"$ref": "#/components/schemas/RemoteStoreRestoreShardsInfo" | ||
} | ||
} | ||
}, | ||
"RemoteStoreRestoreShardsInfo": { | ||
"type": "object", | ||
"properties": { | ||
"total": { | ||
"type": "number" | ||
}, | ||
"failed": { | ||
"type": "number" | ||
}, | ||
"successful": { | ||
"type": "number" | ||
} | ||
} | ||
} | ||
}, | ||
"securitySchemes": { | ||
"smithy.api.httpBasicAuth": { | ||
"type": "http", | ||
"description": "HTTP Basic authentication", | ||
"scheme": "Basic" | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"smithy.api.httpBasicAuth": [] | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the names of the operation and structures inline with what we would want in the generated code? Or do they need to be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're named to match the naming scheme of the rest of the specs in the repo. Naming (or encoding friendly names as metadata similar to #73) will likely be a bigger issue, but hard to solve in advance until we get to the point of actually generating parts of a client from these.