-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from kuzzleio/0.28.1-proposal
Release 0.28.1
- Loading branch information
Showing
6 changed files
with
109 additions
and
35 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "kourou", | ||
"description": "The CLI that helps you manage your Kuzzle instances", | ||
"version": "0.28.0", | ||
"version": "0.28.1", | ||
"author": "The Kuzzle Team <[email protected]>", | ||
"bin": { | ||
"kourou": "./bin/run" | ||
|
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,47 @@ | ||
import { flags } from "@oclif/command"; | ||
import { Client } from "@elastic/elasticsearch"; | ||
|
||
import { Kommand } from "../../../common"; | ||
|
||
export default class EsSnapshotsRestore extends Kommand { | ||
static initSdk = false; | ||
|
||
static description = "Restore a snapshot repository inside an ES instance"; | ||
|
||
static flags = { | ||
node: flags.string({ | ||
char: "n", | ||
description: "Elasticsearch server URL", | ||
default: "http://localhost:9200", | ||
}), | ||
help: flags.help(), | ||
}; | ||
|
||
static args = [ | ||
{ name: "repository", description: "ES repository name", required: true }, | ||
{ name: "name", description: "ES snapshot name", required: true }, | ||
]; | ||
|
||
async runSafe() { | ||
const esClient = new Client({ node: this.flags.node }); | ||
|
||
await esClient.indices.close({ | ||
index: "*", | ||
expand_wildcards: "all", | ||
}); | ||
|
||
const esRequest = { | ||
repository: this.args.repository, | ||
snapshot: this.args.name, | ||
body: { | ||
feature_states: ["none"], | ||
include_global_state: false, | ||
indices: "*", | ||
}, | ||
}; | ||
|
||
const response = await esClient.snapshot.restore(esRequest); | ||
|
||
this.logOk(`Success ${JSON.stringify(response.body)}`); | ||
} | ||
} |