Commit graph

22 commits

Author SHA1 Message Date
Seth Michael Larson
fffabae10a
Add pagination parameters to API spec and docs for 'snapshot.get' API 2022-07-20 06:35:52 -05:00
Armin Braun
b323e8e1db
Add parameter to exclude indices in a snapshot from response (#86269)
Adds a parameter `index_names` to the get snapshots API so that users may exclude the potentially very long index name lists when listing out snapshots.

closes #82937
2022-04-29 15:04:43 +02:00
Joe Gallo
0935485684
Fix get-snapshot-api :docs:integTest (#83273) 2022-01-28 12:24:01 -05:00
James Rodewig
659e0d3fd3
[DOCS] Overhaul snapshot and restore docs (#79081)
Makes several changes to consolidate snapshot and backup-related docs.

Highlights:

* Adds info about supported ESS snapshot repository types
* Adds docs for Kibana's Snapshot and Restore feature
* Combines tutorial pages related to taking and managing snapshots
* Consolidates explanations of the snapshot process
* Incorporates SLM into the snapshot tutorial
* Removes duplicate "back up a cluster" pages
2021-11-15 12:45:07 -05:00
James Rodewig
d65ed5649a
[DOCS] Clarify max_count only counts successful snapshot attempts (#79749)
The create SLM policy API's `max_count` parameter limits the number of
snapshots for a policy. Only successful snapshot attempts count toward
this limit. Failed snapshot attempts do not.
2021-10-26 17:22:50 -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
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
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
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
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
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
James Rodewig
1ea83359bb
[DOCS] Fix case for 'Boolean' (#64299) 2020-10-29 09:04:43 -04:00
Adam Locke
b2beb9c892
[DOCS] Adding get snapshot API docs (#59098)
* Adding page for get snapshot API.

* Adding values for state and cleaning up some other formatting.

* Adding missing forward slash to GET request.

* Updating values for start_time and end_time in TESTRESPONSE.

* Swap "return" for "retrieve"

* Swap "return" for "retrieve" 2

* Change .snapshot to .response

* Adding response parameters and incorporating edits from review.

* Update response example to include repository info

* Change dash to underscore

* Add data type for snapshot in response

* Incorporating review comments and adding missing response definitions.

* Minor rewording in description.
2020-07-08 11:28:24 -04:00