Commit graph

69 commits

Author SHA1 Message Date
James Rodewig
2fc3d40a13
[DOCS] Convert 'Restore a snapshot' to tutorial (#76929)
Updates the 'Restore a snapshot' guide to be more tutorial-focused.
Adds a tutorial for restoring an entire cluster.

Closes #72497.
2021-09-20 13:17:24 -04:00
edh-oss
62a471aefe
Update JSON parser and snippets (#77983)
Related to issue  #77823

This does the following:

- Updates several asciidoc files that contained code snippets with
  invalid JSON, most involving unnecessary trailing commas.

- Makes the switch from the Groovy JSON parser to the Jackson parser,
  pursuant to the general goal of eliminating Groovy dependence.

- Makes testing of JSON validity at build time more strict.

Note that this update still allows backslash escaping for any
character. Currently that matters because of the file
"docs/reference/ml/anomaly-detection/apis/get-datafeed-stats.asciidoc",
specifically this part:

    "attributes" : {
      "ml.machine_memory" :
        "$body.datafeeds.0.node.attributes.ml\.machine_memory",
      "ml.max_open_jobs" : "512"
    }

It's not clear to me what change, if any, is appropriate there. So,
I've left in the escaped period and configured the parser to ignore
it for the time being.
2021-09-20 11:08:26 +01:00
Armin Braun
2544d913cf
Implement from_sort_value Parameter in Get Snapshots API (#77618)
Add `from_sort_value` parameter to allow for filtering snapshots by comparing to concrete sort column
values similar to the existing after parameter`.
2021-09-15 13:37:22 +02:00
Armin Braun
f1a4551e93
Implement Exclude Patterns for Snapshot- and Repository Names in Get Snapshots API (#77308)
It's in the title. Adds support for exclude patterns combined with wildcard requests
similar to what we support for index names.
2021-09-10 15:00:44 +02:00
Armin Braun
7508720fe5
Add Filtering by SLM Policy to Get Snapshots API (#77321)
It's in the title, add new `slm_policy_filter` param as a filter to the get snapshots API.
2021-09-07 18:24:09 +02:00
Armin Braun
0920e21445
Implement Sort By Repository Name in Get Snapshots API (#77049)
This one is the last sort column not yet implemented but used by Kibana.
2021-09-01 13:01:58 +02:00
Armin Braun
48f3784a6d
Add Sort By Shard Count and Failed Shard Count to Get Snapshots API (#77011)
It's in the title. As requested by the Kibana team, adding these two additional sort columns.

relates #74350
2021-08-30 13:39:51 +02:00
James Rodewig
38fe33a870 [DOCS] Fix whitespace to hide attribute 2021-08-22 21:18:51 -04:00
James Rodewig
1c355bfda9
[DOCS] Reuse snapshot config in put SLM policy API docs (#76712)
Updates the put SLM policy API's `config` parameter to reuse the create snapshot API's request body parameters.
Previously, the `config` parameter was missing the `feature_states` parameter. This change should keep the two docs in sync.
2021-08-20 08:29:16 -04:00
James Rodewig
5c954df521
[DOCS] Fix data type for create snapshot API's metadata param (#76465) 2021-08-12 16:38:56 -04:00
James Rodewig
20f000e95a
[DOCS] Fix query params for create snapshot API (#76436)
Moves the `master_timeout` and `wait_for_completion` parameters to a query parameters section.
2021-08-12 13:11:12 -04:00
Armin Braun
ffaa0f2742
Implement Numeric Offset Parameter in Get Snapshots API (#76233)
Add numeric offset parameter to this API.

Relates #74350
2021-08-09 16:23:43 +02:00
Armin Braun
a4983f5ab9
Return Total Result Count and Remaining Count in Get Snapshots Response (#76150)
Add total result count and remaining count to get snapshots response.
2021-08-09 11:34:24 +02:00
Mincong Huang
dc70bd6092
[DOCS] Fix missing word for snapshot API (#74657) 2021-06-29 08:07:17 +01:00
Armin Braun
5f89f8be3f
Introduce Next Field in Paginated GetSnapshots Response (#74236)
Follow up to #73952 adding documentation for the `after` query parameter
and the related `next` response field.
2021-06-28 22:28:30 +02:00
Armin Braun
939c4c6c3f
Remove Repository Size Limit Default (#74592)
Now that we actively improve the scalability there is no point
of having a `500` limit in `master`.
2021-06-27 21:14:56 +02:00
Armin Braun
cbf48e0633
Flatten Get Snapshots Response (#74451)
This PR returns the get snapshots API to the 7.x format (and transport client behavior) and enhances it for requests that ask for multiple repositories.
The changes for requests that target multiple repositories are:
* Add `repository` field to `SnapshotInfo` and REST response
* Add `failures` map alongside `snapshots` list instead of returning just an exception response as done for single repo requests
* Pagination now works across repositories instead of being per repository for multi-repository requests

closes #69108
closes #43462
2021-06-24 16:58:33 +02:00
Armin Braun
c1e9590a69
Pagination and Sorting for Get Snapshots API (#73952)
Pagination and snapshots for get snapshots API, build on top of the current implementation to enable work that needs this API for testing. A follow-up will leverage the changes to make things more efficient via pagination.

Relates https://github.com/elastic/elasticsearch/pull/73570 which does part of the under-the-hood changes required to efficiently implement this API on the repository layer.
2021-06-17 09:00:11 +02:00
Armin Braun
e8662e3cc0
Fix Snapshot Docs Listing Query Params in Body Incorrectly (#74196)
Both of these APIs don't parse request bodies, the parameters are all taken
from the query string. Also, included the master timeout param include
as it was missing here also.
2021-06-16 20:07:25 +02:00
James Rodewig
51ec860b48
[DOCS] Clarify criteria for restore completion (#74094)
A restore operation is complete when all attempts to recover primary shards have finished, even if unsuccessful.

Closes #70854
2021-06-15 08:30:51 -04:00
James Rodewig
68bb763343
[DOCS] Note include_aliases supports data stream aliases (#73687)
With #73595, data stream aliases now support the restore snapshot API's
`include_aliases` option.
2021-06-03 08:43:14 -04:00
James Rodewig
2fca666b47
[DOCS] Update snapshot/restore for data stream aliases (#73438)
In 7.14+, you can now create data stream aliases. This updates the related
snapshot/restore documentation.
2021-05-27 10:57:06 -04:00
James Rodewig
81de369635
[DOCS] Fix query parameters for restore API (#73015) 2021-05-20 08:38:37 -04:00
David Turner
8170376bf0
Restore global state does not merge (#73226)
Today the docs indicate that restoring a snapshot with
`include_global_state` set will merge the ingest pipelines, ILM
policies, settings etc in the snapshot with those already in the
cluster. This isn't the case, we simply replace all the things. This
commit corrects the docs.
2021-05-19 16:16:41 +01:00
James Rodewig
15e42fd748 [DOCS] Fix <repository> param 2021-05-05 15:56:28 -04:00
David Turner
1c4791e398
Abort writes in repo analyzer (#72077)
We rely on the repository implementation correctly handling the case where a
write is aborted before it completes. This is not guaranteed for third-party
repositories.

This commit adds a rare action during analysis which aborts the write
just before it completes and verifies that the target blob is not found
by any node.
2021-04-27 14:13:22 +01:00
David Turner
c8fb9aad40
Track index details in SnapshotInfo (#71754)
This commit adds some per-index statistics to the `SnapshotInfo` blob:

- number of shards
- total size in bytes
- maximum number of segments per shard

It also exposes these statistics in the get snapshot API.
2021-04-19 14:57:32 +01:00
James Rodewig
693807a6d3
[DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
Martijn van Groningen
9089e45173
Update docs that closing a data stream's write index is allowed (#71039)
This was forgotten as part of #70908
2021-03-30 11:49:09 +02:00
James Rodewig
7bddd7db5c
[DOCS] Fix collapsible properties role (#70756) 2021-03-23 11:14:46 -04:00
James Rodewig
5c75d004fa
[DOCS] Replace put with create or update in API names (#70330)
Co-authored-by: debadair <debadair@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-03-15 14:49:44 -04:00
James Rodewig
d51a04cd8c
[DOCS] Add operator privileges to APIs and settings (#69903) 2021-03-15 09:20:09 -04:00
Gordon Brown
ce8a0c0cea
Change Get Snapshottable Features endpoint to _features (#69755)
The endpoint `_snapshottable_features` is long and implies incorrect
things about this API - it is used not just for snapshots, but also for
the upcoming reset API. Following discussions on the team, this commit
changes the endpoint to `_features` and removes the connection between
this API and snapshots, as snapshots are not the only use for the output
of this API.
2021-03-02 11:30:02 -07:00
James Rodewig
9b88ae92e6
[DOCS] Fix typos for duplicate words (#69125) 2021-02-17 10:34:20 -05:00
David Turner
0ca9f6a4f0
Adjust repository analyzer docs (#69107)
Fixes a handful of typos/wording issues, and adds the new human-readable
fields to the response format docs.

Relates #67247
2021-02-17 13:50:42 +00:00
David Turner
92d13a3f7d
Introduce repository test kit/analyser (#67247)
Today we rely on blob stores behaving in a certain way so that they can be used
as a snapshot repository. There are an increasing number of third-party blob
stores that claim to be S3-compatible, but which may not offer a suitably
correct or performant implementation of the S3 API. We rely on somesubtle
semantics with concurrent readers and writers, but some blob stores may not
implement it correctly. Hitting a corner case in the implementation may be rare
in normal use, and may be hard to reproduce or to distinguish from an
Elasticsearch bug.

This commit introduces a new `POST /_snapshot/.../_analyse` API which exercises
the more problematic corners of the repository implementation looking for
correctness bugs and measures the details of the performance of the repository
under concurrent load.
2021-02-16 14:24:40 +00:00
Gordon Brown
3f6472de74
Introduce "Feature States" for managing snapshots of system indices (#63513)
This PR expands the meaning of `include_global_state` for snapshots to include system indices. If `include_global_state` is `true` on creation, system indices will be included in the snapshot regardless of the contents of the `indices` field. If `include_global_state` is `true` on restoration, system indices will be restored (if included in the snapshot), regardless of the contents of the `indices` field. Index renaming is not applied to system indices, as system indices rely on their names matching certain patterns. If restored system indices are already present, they are automatically deleted prior to restoration from the snapshot to avoid conflicts.

This behavior can be overridden to an extent by including a new field in the snapshot creation or restoration call, `feature_states`, which contains an array of strings indicating the "feature" for which system indices should be snapshotted or restored. For example, this call will only restore the `watcher` and `security` system indices (in addition to `index_1`):

```
POST /_snapshot/my_repository/snapshot_2/_restore
{
  "indices": "index_1",
  "include_global_state": true,
  "feature_states": ["watcher", "security"]
}
```

If `feature_states` is present, the system indices associated with those features will be snapshotted or restored regardless of the value of `include_global_state`. All system indices can be omitted by providing a special value of `none` (`"feature_states": ["none"]`), or included by omitting the field or explicitly providing an empty array (`"feature_states": []`), similar to the `indices` field.

The list of currently available features can be retrieved via a new "Get Snapshottable Features" API:
```
GET /_snapshottable_features
```

which returns a response of the form:
```
{
    "features": [
        {
            "name": "tasks",
            "description": "Manages task results"
        },
        {
            "name": "kibana",
            "description": "Manages Kibana configuration and reports"
        }
    ]
}
```

Features currently map one-to-one with `SystemIndexPlugin`s, but this should be considered an implementation detail. The Get Snapshottable Features API and snapshot creation rely upon all relevant plugins being installed on the master node.

Further, the list of feature states included in a given snapshot is exposed by the Get Snapshot API, which now includes a new field, `feature_states`, which contains a list of the feature states and their associated system indices which are included in the snapshot. All system indices in feature states are also included in the `indices` array for backwards compatibility, although explicitly requesting system indices included in a feature state is deprecated. For example, an excerpt from the Get Snapshot API showing `feature_states`:
```
"feature_states": [
    {
        "feature_name": "tasks",
        "indices": [
            ".tasks"
        ]
    }
],
"indices": [
    ".tasks",
    "test1",
    "test2"
]
```

Co-authored-by: William Brafford <william.brafford@elastic.co>
2021-02-11 11:55:14 -07:00
James Rodewig
b49576fabf
[DOCS] Add security privileges to snapshot/restore API docs (#67955) 2021-02-02 09:34:35 -05:00
David Turner
e5a15d4fcb
Introduce repository UUIDs (#67829)
Today a snapshot repository does not have a well-defined identity. It
can be reregistered with a different cluster under a different name, and
can even be registered with multiple clusters in readonly mode.

This presents problems for cases where we need to refer to a specific
snapshot in a globally-unique fashion. Today we rely on the repository
being registered under the same name on every cluster, but this is not a
safe assumption.

This commit adds a UUID that can be used to uniquely identify a
repository. The UUID is stored in the top-level index blob, represented
by `RepositoryData`, and is also usually copied into the
`RepositoryMetadata` that represents the repository in the cluster
state. The repository UUID is exposed in the get-repositories API; other
more meaningful consumers will be added in due course.
2021-01-25 12:17:52 +00:00
Dan Hermann
83a5256dc2
Include date in data stream backing index names (#65205) 2020-12-14 16:46:54 -06:00
bellengao
80df5fe2f3
[DOCS] Correct restore snapshot API request example (#65525) 2020-11-30 13:55:37 -05:00
James Rodewig
b31a8ff244
[DOCS] Fix put repository API docs (#64811) 2020-11-09 14:20:08 -05:00
James Rodewig
1ea83359bb
[DOCS] Fix case for 'Boolean' (#64299) 2020-10-29 09:04:43 -04:00
Adam Locke
954d6eeeba
Move clone snapshot API page. (#63902) 2020-10-20 08:45:38 -04:00
Adam Locke
789ee2d73e
[DOCS] Combining important config settings into a single page (#63849)
* Combining important config settings into a single page.

* Updating ids for two pages causing link errors and implementing redirects.
2020-10-19 10:02:22 -04:00
Armin Braun
f7f239d39a
Clone Snapshot API (#61839)
Adds clone snapshot API to clone part of a snapshot into a new snapshot.
2020-10-02 21:28:44 +02:00
Adam Locke
186feaa437
Adding ignore_unavailable param. (#61368) 2020-08-20 09:39:25 -04:00
Adam Locke
396dcffe39
[DOCS] Adding new page for restore snapshot API (#59937)
* Adding new page for restore snapshot API.

* Improving test cases, lots of edits, and streamlining content.

* Incorporating review suggestions and feedback.

* Specify `index alias` vs `alias`

* Change parameter order

* Provide clarity around regular expression

* Add link to SLM parameters

* Split sentences in example

* Adding link to master node page.
2020-07-22 11:42:17 -04:00
Armin Braun
9b155d9201
Fix Snapshot Status API Docs Test (#59902)
The clock resolution for this API is our default 200ms. It is unlikely but
possible that a shard snapshot starts and ends on separate clock ticks and that breaks the test.
Just allowing any value here seems fine to me (seems we can't match for integer specifically).
2020-07-20 18:26:05 +02:00
Adam Locke
c143bb56cb
[DOCS] Updating snapshot/restore pages to align with API changes (#59730)
* Updating snapshot/restore pages to align with API changes.

* Fixing texts in delete snapshot page.

* Removing duplicate code sample and making editorial changes.

* Change "deleted" to "delete"

* Incorporating review feedback and making minor editorial changes.

* Remove titleabbrev

* Add paragraph break

* Remove titleabbrev from restore page

* Remove titleabbrev from create page

* Change "Create" to lowercase

* Change API names to lowercase

* Remove extraneous delimiters

* Change "Delete" to lowercase

* Single-sourcing warning and clarifying warning text.
2020-07-17 13:08:13 -04:00