[console] Update snapshot API (#16767)

* snapshot.create_repository.json

* snapshot.create.json

* snapshot.delete.json

* snapshot.delete_repository.json

* snapshot.get.json

* snapshot.get_repository.json

* snapshot.restore.json

* snapshot.status.json

* snapshot.verify_repository.json

* rm snapshot_restore.js
This commit is contained in:
Jonathan Budzenski 2018-03-15 12:45:06 -05:00 committed by GitHub
parent caf7a5701c
commit 7e98e57b1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 220 additions and 130 deletions

View file

@ -13,7 +13,6 @@ let parts = [
require('./es_5_0/percolator'),
require('./es_5_0/query'),
require('./es_5_0/reindex'),
require('./es_5_0/snapshot_restore'),
require('./es_5_0/search'),
];

View file

@ -1,129 +0,0 @@
export default function (api) {
api.addEndpointDescription('restore_snapshot', {
methods: ['POST'],
patterns: [
'_snapshot/{id}/{id}/_restore'
],
url_params: {
wait_for_completion: "__flag__"
},
data_autocomplete_rules: {
indices: "*",
ignore_unavailable: { __one_of: [true, false] },
include_global_state: false,
rename_pattern: "index_(.+)",
rename_replacement: "restored_index_$1"
}
});
api.addEndpointDescription('single_snapshot', {
methods: ['GET', 'DELETE'],
patterns: [
'_snapshot/{id}/{id}'
]
});
api.addEndpointDescription('all_snapshots', {
methods: ['GET'],
patterns: [
'_snapshot/{id}/_all'
]
});
api.addEndpointDescription('put_snapshot', {
methods: ['PUT'],
patterns: [
'_snapshot/{id}/{id}'
],
url_params: {
wait_for_completion: "__flag__"
},
data_autocomplete_rules: {
indices: "*",
ignore_unavailable: { __one_of: [true, false] },
include_global_state: { __one_of: [true, false] },
partial: { __one_of: [true, false] }
}
});
api.addEndpointDescription('_snapshot_status', {
methods: ['GET'],
patterns: [
'_snapshot/_status',
'_snapshot/{id}/_status',
'_snapshot/{id}/{ids}/_status'
]
});
api.addEndpointDescription('put_repository', {
methods: ['PUT'],
patterns: [
'_snapshot/{id}'
],
data_autocomplete_rules: {
__template: { "type": "" },
"type": {
__one_of: ["fs", "url", "s3", "hdfs"]
},
"settings": {
__one_of: [{
//fs
__condition: {
lines_regex: String.raw`type["']\s*:\s*["']fs`
},
__template: {
location: "path"
},
location: "path",
compress: { __one_of: [true, false] },
concurrent_streams: 5,
chunk_size: "10m",
max_restore_bytes_per_sec: "20mb",
max_snapshot_bytes_per_sec: "20mb"
},
{// url
__condition: {
lines_regex: String.raw`type["']\s*:\s*["']url`
},
__template: {
url: ""
},
url: "",
concurrent_streams: 5
},
{ //s3
__condition: {
lines_regex: String.raw`type["']\s*:\s*["']s3`
},
__template: {
bucket: ""
},
bucket: "",
region: "",
base_path: "",
concurrent_streams: 5,
chunk_size: "10m",
compress: { __one_of: [true, false] }
},
{// hdfs
__condition: {
lines_regex: String.raw`type["']\s*:\s*["']hdfs`
},
__template: {
path: ""
},
uri: "",
path: "some/path",
load_defaults: { __one_of: [true, false] },
conf_location: "cfg.xml",
concurrent_streams: 5,
compress: { __one_of: [true, false] },
chunk_size: "10m"
}
]
}
}
});
}

View file

@ -0,0 +1,15 @@
{
"snapshot.create": {
"url_params": {
"master_timeout": "",
"wait_for_completion": "__flag__"
},
"methods": [
"PUT",
"POST"
],
"patterns": [
"_snapshot/{repository}/{snapshot}"
]
}
}

View file

@ -0,0 +1,16 @@
{
"snapshot.create_repository": {
"url_params": {
"master_timeout": "",
"timeout": "",
"verify": "__flag__"
},
"methods": [
"PUT",
"POST"
],
"patterns": [
"_snapshot/{repository}"
]
}
}

View file

@ -0,0 +1,13 @@
{
"snapshot.delete": {
"url_params": {
"master_timeout": ""
},
"methods": [
"DELETE"
],
"patterns": [
"_snapshot/{repository}/{snapshot}"
]
}
}

View file

@ -0,0 +1,14 @@
{
"snapshot.delete_repository": {
"url_params": {
"master_timeout": "",
"timeout": ""
},
"methods": [
"DELETE"
],
"patterns": [
"_snapshot/{repository}"
]
}
}

View file

@ -0,0 +1,15 @@
{
"snapshot.get": {
"url_params": {
"master_timeout": "",
"ignore_unavailable": "__flag__",
"verbose": "__flag__"
},
"methods": [
"GET"
],
"patterns": [
"_snapshot/{repository}/{snapshot}"
]
}
}

View file

@ -0,0 +1,15 @@
{
"snapshot.get_repository": {
"url_params": {
"master_timeout": "",
"local": "__flag__"
},
"methods": [
"GET"
],
"patterns": [
"_snapshot",
"_snapshot/{repository}"
]
}
}

View file

@ -0,0 +1,14 @@
{
"snapshot.restore": {
"url_params": {
"master_timeout": "",
"wait_for_completion": "__flag__"
},
"methods": [
"POST"
],
"patterns": [
"_snapshot/{repository}/{snapshot}/_restore"
]
}
}

View file

@ -0,0 +1,16 @@
{
"snapshot.status": {
"url_params": {
"master_timeout": "",
"ignore_unavailable": "__flag__"
},
"methods": [
"GET"
],
"patterns": [
"_snapshot/_status",
"_snapshot/{repository}/_status",
"_snapshot/{repository}/{snapshot}/_status"
]
}
}

View file

@ -0,0 +1,14 @@
{
"snapshot.verify_repository": {
"url_params": {
"master_timeout": "",
"timeout": ""
},
"methods": [
"POST"
],
"patterns": [
"_snapshot/{repository}/_verify"
]
}
}

View file

@ -0,0 +1,10 @@
{
"snapshot.create": {
"data_autocomplete_rules": {
"indices": "*",
"ignore_unavailable": { "__one_of": [true, false] },
"include_global_state": { "__one_of": [true, false] },
"partial": { "__one_of": [true, false] }
}
}
}

View file

@ -0,0 +1,67 @@
{
"snapshot.create_repository": {
"data_autocomplete_rules": {
"__template": { "type": "" },
"type": {
"__one_of": ["fs", "url", "s3", "hdfs"]
},
"settings": {
"__one_of": [{
"__condition": {
"lines_regex": "type[\"']\\s*:\\s*[\"']fs`"
},
"__template": {
"location": "path"
},
"location": "path",
"compress": { "__one_of": [true, false] },
"concurrent_streams": 5,
"chunk_size": "10m",
"max_restore_bytes_per_sec": "20mb",
"max_snapshot_bytes_per_sec": "20mb"
},
{
"__condition": {
"lines_regex": "type[\"']\\s*:\\s*[\"']url"
},
"__template": {
"url": ""
},
"url": "",
"concurrent_streams": 5
},
{
"__condition": {
"lines_regex": "type[\"']\\s*:\\s*[\"']s3"
},
"__template": {
"bucket": ""
},
"bucket": "",
"region": "",
"base_path": "",
"concurrent_streams": 5,
"chunk_size": "10m",
"compress": { "__one_of": [true, false] }
},
{
"__condition": {
"lines_regex": "type[\"']\\s*:\\s*[\"']hdfs"
},
"__template": {
"path": ""
},
"uri": "",
"path": "some/path",
"load_defaults": { "__one_of": [true, false] },
"conf_location": "cfg.xml",
"concurrent_streams": 5,
"compress": { "__one_of": [true, false] },
"chunk_size": "10m"
}
]
}
}
}
}

View file

@ -0,0 +1,11 @@
{
"snapshot.restore": {
"data_autocomplete_rules": {
"indices": "*",
"ignore_unavailable": { "__one_of": [true, false] },
"include_global_state": false,
"rename_pattern": "index_(.+)",
"rename_replacement": "restored_index_$1"
}
}
}