Skip to content

Commit d63d521

Browse files
authored
Add initial documentation for SLM (#41510)
* Add initial documentation for SLM This adds the initial documentation for snapshot lifecycle management. It also includes the REST spec API json files since they're sort of documentation. Relates to #38461
1 parent 47b5655 commit d63d521

File tree

9 files changed

+449
-0
lines changed

9 files changed

+449
-0
lines changed

docs/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ integTestCluster {
4242

4343
// enable regexes in painless so our tests don't complain about example snippets that use them
4444
setting 'script.painless.regex.enabled', 'true'
45+
setting 'path.repo', new File(buildDir, "cluster/shared/repo")
4546
Closure configFile = {
4647
extraConfigFile it, "src/test/cluster/config/$it"
4748
}
@@ -1136,3 +1137,13 @@ buildRestTests.setups['seats'] = '''
11361137
{"theatre": "Graye", "cost": 33, "row": 2, "number": 6, "sold": false}
11371138
{"index":{"_id": "4"}}
11381139
{"theatre": "Skyline", "cost": 20, "row": 5, "number": 2, "sold": false}'''
1140+
// Used by snapshot lifecycle management docs
1141+
buildRestTests.setups['setup-repository'] = '''
1142+
- do:
1143+
snapshot.create_repository:
1144+
repository: my_repository
1145+
body:
1146+
type: fs
1147+
settings:
1148+
location: buildDir/cluster/shared/repo
1149+
'''

docs/reference/ilm/apis/slm-api.asciidoc

Lines changed: 346 additions & 0 deletions
Large diffs are not rendered by default.

docs/reference/ilm/index.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ to a single shard.
4747
hardware.
4848
. Delete the index once the required 30 day retention period is reached.
4949

50+
*Snapshot Lifecycle Management*
51+
52+
ILM itself does allow managing indices, however, managing snapshots for a set of
53+
indices is outside of the scope of an index-level policy. Instead, there are
54+
separate APIs for managing snapshot lifecycles. Please see the
55+
<<snapshot-lifecycle-management-api,Snapshot Lifecycle Management>>
56+
documentation for information about configuring snapshots.
57+
5058
[IMPORTANT]
5159
===========================
5260
{ilm} does not support mixed-version cluster usage. Although it

docs/reference/ilm/start-stop-ilm.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ maybe there are scheduled maintenance windows when cluster topology
1010
changes are desired that may impact running ILM actions. For this reason,
1111
ILM has two ways to disable operations.
1212

13+
When stopping ILM, snapshot lifecycle management operations are also stopped,
14+
this means that no scheduled snapshots are created (currently ongoing snapshots
15+
are unaffected).
16+
1317
Normally, ILM will be running by default.
1418
To see the current operating status of ILM, use the <<ilm-get-status,Get Status API>>
1519
to see the current state of ILM.

docs/reference/rest-api/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ directly to configure and access {xpack} features.
1212
* <<graph-explore-api,Graph Explore API>>
1313
* <<freeze-index-api>>, <<unfreeze-index-api>>
1414
* <<index-lifecycle-management-api,Index lifecycle management APIs>>
15+
* <<snapshot-lifecycle-management-api,Snapshot lifecycle management APIs>>
1516
* <<licensing-apis,Licensing APIs>>
1617
* <<ml-apis,Machine Learning APIs>>
1718
* <<security-api,Security APIs>>
@@ -27,6 +28,7 @@ include::{es-repo-dir}/data-frames/apis/index.asciidoc[]
2728
include::{es-repo-dir}/graph/explore.asciidoc[]
2829
include::{es-repo-dir}/indices/apis/freeze.asciidoc[]
2930
include::{es-repo-dir}/ilm/apis/ilm-api.asciidoc[]
31+
include::{es-repo-dir}/ilm/apis/slm-api.asciidoc[]
3032
include::{es-repo-dir}/licensing/index.asciidoc[]
3133
include::{es-repo-dir}/migration/migration.asciidoc[]
3234
include::{es-repo-dir}/ml/apis/ml-api.asciidoc[]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"slm.delete_lifecycle": {
3+
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html",
4+
"methods": [ "DELETE" ],
5+
"url": {
6+
"path": "/_slm/policy/{policy_id}",
7+
"paths": ["/_slm/policy/{policy_id}"],
8+
"parts": {
9+
"policy": {
10+
"type" : "string",
11+
"description" : "The id of the snapshot lifecycle policy to remove"
12+
}
13+
},
14+
"params": {
15+
}
16+
},
17+
"body": null
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"slm.execute_lifecycle": {
3+
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html",
4+
"methods": [ "PUT" ],
5+
"url": {
6+
"path": "/_slm/policy/{policy_id}/_execute",
7+
"paths": ["/_slm/policy/{policy_id}/_execute"],
8+
"parts": {
9+
"policy_id": {
10+
"type" : "string",
11+
"description" : "The id of the snapshot lifecycle policy to be executed"
12+
}
13+
},
14+
"params": {
15+
}
16+
},
17+
"body": null
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"slm.get_lifecycle": {
3+
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html",
4+
"methods": [ "GET" ],
5+
"url": {
6+
"path": "/_slm/policy/{policy_id}",
7+
"paths": ["/_slm/policy/{policy_id}", "/_slm/policy"],
8+
"parts": {
9+
"policy_id": {
10+
"type" : "string",
11+
"description" : "Comma-separated list of snapshot lifecycle policies to retrieve"
12+
}
13+
},
14+
"params": {
15+
}
16+
},
17+
"body": null
18+
}
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"slm.put_lifecycle": {
3+
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html",
4+
"methods": [ "PUT" ],
5+
"url": {
6+
"path": "/_slm/policy/{policy_id}",
7+
"paths": ["/_slm/policy/{policy_id}"],
8+
"parts": {
9+
"policy_id": {
10+
"type" : "string",
11+
"description" : "The id of the snapshot lifecycle policy"
12+
}
13+
},
14+
"params": {
15+
}
16+
},
17+
"body": {
18+
"description": "The snapshot lifecycle policy definition to register"
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)