From 124bbd47c2ad924b07956b46ee51eef3c5c59756 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 8 Jan 2025 09:24:01 -0800 Subject: [PATCH 1/2] Add snapshot and restore examples (#3463) (cherry picked from commit 3a4d2572bf2ca12541f049024132cd1df795bd92) --- output/schema/schema.json | 53 ++++++++----- specification/_doc_ids/table.csv | 12 ++- .../SnapshotCleanupRepositoryRequest.ts | 1 + ...shotCleanupRepositoryResponseExample1.yaml | 7 ++ .../snapshot/clone/SnapshotCloneRequest.ts | 1 + .../request/SnapshotCloneRequestExample1.yaml | 5 ++ .../snapshot/create/SnapshotCreateRequest.ts | 1 + .../SnapshotCreateRequestExample1.yaml | 8 ++ .../SnapshotCreateResponseExample1.yaml | 15 ++++ ...apshotCreateRepositoryRequestExample1.yaml | 7 ++ ...apshotCreateRepositoryRequestExample2.yaml | 7 ++ ...apshotCreateRepositoryRequestExample3.yaml | 7 ++ ...apshotCreateRepositoryRequestExample4.yaml | 7 ++ ...apshotCreateRepositoryRequestExample5.yaml | 7 ++ ...apshotCreateRepositoryRequestExample6.yaml | 7 ++ .../snapshot/delete/SnapshotDeleteRequest.ts | 1 + .../SnapshotDeleteResponseExample1.yaml | 7 ++ .../SnapshotDeleteRepositoryRequest.ts | 1 + .../snapshot/get/SnapshotGetRequest.ts | 1 + .../response/SnapshotGetResponseExample1.yaml | 34 ++++++++ .../SnapshotGetRepositoryRequest.ts | 1 + ...SnapshotGetRepositoryResponseExample1.yaml | 8 ++ ...napshotRepositoryVerifyIntegrityRequest.ts | 1 + .../restore/SnapshotRestoreRequest.ts | 1 + .../SnapshotRestoreRequestExample1.yaml | 12 +++ .../SnapshotRestoreRequestExample2.yaml | 8 ++ .../snapshot/status/SnapshotStatusRequest.ts | 1 + .../SnapshotStatusResponseExample1.yaml | 79 +++++++++++++++++++ .../SnapshotVerifyRepositoryRequest.ts | 1 + 29 files changed, 279 insertions(+), 22 deletions(-) create mode 100644 specification/snapshot/cleanup_repository/examples/response/SnapshotCleanupRepositoryResponseExample1.yaml create mode 100644 specification/snapshot/clone/examples/request/SnapshotCloneRequestExample1.yaml create mode 100644 specification/snapshot/create/examples/request/SnapshotCreateRequestExample1.yaml create mode 100644 specification/snapshot/create/examples/response/SnapshotCreateResponseExample1.yaml create mode 100644 specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample1.yaml create mode 100644 specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample2.yaml create mode 100644 specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample3.yaml create mode 100644 specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample4.yaml create mode 100644 specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample5.yaml create mode 100644 specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample6.yaml create mode 100644 specification/snapshot/delete/examples/response/SnapshotDeleteResponseExample1.yaml create mode 100644 specification/snapshot/get/examples/response/SnapshotGetResponseExample1.yaml create mode 100644 specification/snapshot/get_repository/examples/response/SnapshotGetRepositoryResponseExample1.yaml create mode 100644 specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample1.yaml create mode 100644 specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample2.yaml create mode 100644 specification/snapshot/status/examples/response/SnapshotStatusResponseExample1.yaml diff --git a/output/schema/schema.json b/output/schema/schema.json index 7a480ceced..598709d827 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -18716,7 +18716,8 @@ } }, "description": "Clean up the snapshot repository.\nTrigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html", + "docId": "snapshot-repo-cleanup", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clean-up-snapshot-repo-api.html", "extDocId": "clean-up-snapshot-repo", "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/snapshots-register-repository.html#snapshots-repository-cleanup", "name": "snapshot.cleanup_repository", @@ -18758,7 +18759,8 @@ } }, "description": "Clone a snapshot.\nClone part of all of a snapshot into another snapshot in the same repository.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-clone", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clone-snapshot-api.html", "name": "snapshot.clone", "privileges": { "cluster": [ @@ -18801,7 +18803,8 @@ } }, "description": "Create a snapshot.\nTake a snapshot of a cluster or of data streams and indices.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-create-api", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-snapshot-api.html", "extDocId": "snapshot-create", "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/snapshots-take-snapshot.html", "name": "snapshot.create", @@ -18892,7 +18895,8 @@ } }, "description": "Delete snapshots.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-delete", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-snapshot-api.html", "name": "snapshot.delete", "privileges": { "cluster": [ @@ -18932,7 +18936,8 @@ } }, "description": "Delete snapshot repositories.\nWhen a repository is unregistered, Elasticsearch removes only the reference to the location where the repository is storing the snapshots.\nThe snapshots themselves are left untouched and in place.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-repo-delete", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-snapshot-repo-api.html", "name": "snapshot.delete_repository", "privileges": { "cluster": [ @@ -18972,7 +18977,8 @@ } }, "description": "Get snapshot information.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-get", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-snapshot-api.html", "name": "snapshot.get", "privileges": { "cluster": [ @@ -19012,7 +19018,8 @@ } }, "description": "Get snapshot repository information.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-repo-get", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-snapshot-repo-api.html", "name": "snapshot.get_repository", "privileges": { "cluster": [ @@ -19080,7 +19087,8 @@ } }, "description": "Verify the repository integrity.\nVerify the integrity of the contents of a snapshot repository.\n\nThis API enables you to perform a comprehensive check of the contents of a repository, looking for any anomalies in its data or metadata which might prevent you from restoring snapshots from the repository or which might cause future snapshot create or delete operations to fail.\n\nIf you suspect the integrity of the contents of one of your snapshot repositories, cease all write activity to this repository immediately, set its `read_only` option to `true`, and use this API to verify its integrity.\nUntil you do so:\n\n* It may not be possible to restore some snapshots from this repository.\n* Searchable snapshots may report errors when searched or may have unassigned shards.\n* Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.\n* Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.\n* Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.\n\nIf the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage.\nThe only way to bring the repository back into a fully working state after its contents have been damaged is by restoring its contents from a repository backup which was taken before the damage occurred.\nYou must also identify what caused the damage and take action to prevent it from happening again.\n\nIf you cannot restore a repository backup, register a new repository and use this for all future snapshot operations.\nIn some cases it may be possible to recover some of the contents of a damaged repository, either by restoring as many of its snapshots as needed and taking new snapshots of the restored data, or by using the reindex API to copy data from any searchable snapshots mounted from the damaged repository.\n\nAvoid all operations which write to the repository while the verify repository integrity API is running.\nIf something changes the repository contents while an integrity verification is running then Elasticsearch may incorrectly report having detected some anomalies in its contents due to the concurrent writes.\nIt may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.\n\nNOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.\n\nNOTE: This API may not work correctly in a mixed-version cluster.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-repo-verify-integrity", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/verify-repo-integrity-api.html", "name": "snapshot.repository_verify_integrity", "privileges": { "cluster": [ @@ -19120,7 +19128,8 @@ } }, "description": "Restore a snapshot.\nRestore a snapshot of a cluster or data streams and indices.\n\nYou can restore a snapshot only to a running cluster with an elected master node.\nThe snapshot repository must be registered and available to the cluster.\nThe snapshot and cluster versions must be compatible.\n\nTo restore a snapshot, the cluster's global metadata must be writable. Ensure there are't any cluster blocks that prevent writes. The restore operation ignores index blocks.\n\nBefore you restore a data stream, ensure the cluster contains a matching index template with data streams enabled. To check, use the index management feature in Kibana or the get index template API:\n\n```\nGET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream\n```\n\nIf no such template exists, you can create one or restore a cluster state that contains one. Without a matching index template, a data stream can't roll over or create backing indices.\n\nIf your snapshot contains data from App Search or Workplace Search, you must restore the Enterprise Search encryption key before you restore the snapshot.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-restore-api", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/restore-snapshot-api.html", "extDocId": "restore-snapshot", "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/snapshots-restore-snapshot.html", "name": "snapshot.restore", @@ -19165,7 +19174,8 @@ } }, "description": "Get the snapshot status.\nGet a detailed description of the current state for each shard participating in the snapshot.\nNote that this API should be used only to obtain detailed shard-level information for ongoing snapshots.\nIf this detail is not needed or you want to obtain information about one or more existing snapshots, use the get snapshot API.\n\nWARNING: Using the API to return the status of any snapshots other than currently running snapshots can be expensive.\nThe API requires a read from the repository for each shard in each snapshot.\nFor example, if you have 100 snapshots with 1,000 shards each, an API request that includes all snapshots will require 100,000 reads (100 snapshots x 1,000 shards).\n\nDepending on the latency of your storage, such requests can take an extremely long time to return results.\nThese requests can also tax machine resources and, when using cloud storage, incur high processing costs.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-status", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-snapshot-status-api.html", "name": "snapshot.status", "privileges": { "cluster": [ @@ -19217,7 +19227,8 @@ } }, "description": "Verify a snapshot repository.\nCheck for common misconfigurations in a snapshot repository.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "docId": "snapshot-repo-verify", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/verify-snapshot-repo-api.html", "extDocId": "verify-repository", "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/snapshots-register-repository.html#snapshots-repository-verification", "name": "snapshot.verify_repository", @@ -206607,7 +206618,7 @@ } } ], - "specLocation": "snapshot/cleanup_repository/SnapshotCleanupRepositoryRequest.ts#L24-L52" + "specLocation": "snapshot/cleanup_repository/SnapshotCleanupRepositoryRequest.ts#L24-L53" }, { "kind": "response", @@ -206902,7 +206913,7 @@ } } ], - "specLocation": "snapshot/create/SnapshotCreateRequest.ts#L24-L85" + "specLocation": "snapshot/create/SnapshotCreateRequest.ts#L24-L86" }, { "kind": "response", @@ -207106,7 +207117,7 @@ } } ], - "specLocation": "snapshot/delete/SnapshotDeleteRequest.ts#L24-L39" + "specLocation": "snapshot/delete/SnapshotDeleteRequest.ts#L24-L40" }, { "kind": "response", @@ -207186,7 +207197,7 @@ } } ], - "specLocation": "snapshot/delete_repository/SnapshotDeleteRepositoryRequest.ts#L24-L42" + "specLocation": "snapshot/delete_repository/SnapshotDeleteRepositoryRequest.ts#L24-L43" }, { "kind": "response", @@ -207473,7 +207484,7 @@ } } ], - "specLocation": "snapshot/get/SnapshotGetRequest.ts#L27-L129" + "specLocation": "snapshot/get/SnapshotGetRequest.ts#L27-L130" }, { "kind": "response", @@ -207658,7 +207669,7 @@ } } ], - "specLocation": "snapshot/get_repository/SnapshotGetRepositoryRequest.ts#L24-L40" + "specLocation": "snapshot/get_repository/SnapshotGetRepositoryRequest.ts#L24-L41" }, { "kind": "response", @@ -207821,7 +207832,7 @@ } } ], - "specLocation": "snapshot/repository_verify_integrity/SnapshotRepositoryVerifyIntegrityRequest.ts#L24-L72" + "specLocation": "snapshot/repository_verify_integrity/SnapshotRepositoryVerifyIntegrityRequest.ts#L24-L73" }, { "kind": "response", @@ -208026,7 +208037,7 @@ } } ], - "specLocation": "snapshot/restore/SnapshotRestoreRequest.ts#L25-L71" + "specLocation": "snapshot/restore/SnapshotRestoreRequest.ts#L25-L72" }, { "kind": "response", @@ -208180,7 +208191,7 @@ } } ], - "specLocation": "snapshot/status/SnapshotStatusRequest.ts#L24-L50" + "specLocation": "snapshot/status/SnapshotStatusRequest.ts#L24-L51" }, { "kind": "response", @@ -208290,7 +208301,7 @@ } } ], - "specLocation": "snapshot/verify_repository/SnapshotVerifyRepositoryRequest.ts#L24-L42" + "specLocation": "snapshot/verify_repository/SnapshotVerifyRepositoryRequest.ts#L24-L43" }, { "kind": "response", diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index c2cc0b63f2..3dc01b9567 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -64,7 +64,6 @@ ccr-put-follow,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/ ccr-resume-auto-follow-pattern,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/ccr-resume-auto-follow-pattern.html ccs-network-delays,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/modules-cross-cluster-search.html#ccs-network-delays clean-up-snapshot-repo,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/snapshots-register-repository.html#snapshots-repository-cleanup -clean-up-snapshot-repo-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clean-up-snapshot-repo-api.html clear-repositories-metering-archive-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clear-repositories-metering-archive-api.html clear-scroll-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clear-scroll-api.html clear-sql-cursor-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clear-sql-cursor-api.html @@ -654,7 +653,18 @@ slm-api-get-status,https://www.elastic.co/guide/en/elasticsearch/reference/{bran slm-api-put-policy,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/slm-api-put-policy.html slm-api-start,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/slm-api-start.html slm-api-stop,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/slm-api-stop.html +snapshot-clone,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clone-snapshot-api.html snapshot-create,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/snapshots-take-snapshot.html +snapshot-create-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-snapshot-api.html +snapshot-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-snapshot-api.html +snapshot-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-snapshot-api.html +snapshot-restore-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/restore-snapshot-api.html +snapshot-status,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-snapshot-status-api.html +snapshot-repo-cleanup,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/clean-up-snapshot-repo-api.html +snapshot-repo-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-snapshot-repo-api.html +snapshot-repo-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-snapshot-repo-api.html +snapshot-repo-verify,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/verify-snapshot-repo-api.html +snapshot-repo-verify-integrity,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/verify-repo-integrity-api.html sort-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/sort-processor.html sort-search-results,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/sort-search-results.html sort-tiebreaker,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/eql.html#eql-search-specify-a-sort-tiebreaker diff --git a/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryRequest.ts b/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryRequest.ts index 4ad18c81e0..4e325bca62 100644 --- a/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryRequest.ts +++ b/specification/snapshot/cleanup_repository/SnapshotCleanupRepositoryRequest.ts @@ -28,6 +28,7 @@ import { Duration } from '@_types/Time' * @availability stack since=7.4.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges manage + * @doc_id snapshot-repo-cleanup * @ext_doc_id clean-up-snapshot-repo */ export interface Request extends RequestBase { diff --git a/specification/snapshot/cleanup_repository/examples/response/SnapshotCleanupRepositoryResponseExample1.yaml b/specification/snapshot/cleanup_repository/examples/response/SnapshotCleanupRepositoryResponseExample1.yaml new file mode 100644 index 0000000000..152ea0ef9b --- /dev/null +++ b/specification/snapshot/cleanup_repository/examples/response/SnapshotCleanupRepositoryResponseExample1.yaml @@ -0,0 +1,7 @@ +# summary: +description: A successful response from `POST /_snapshot/my_repository/_cleanup`. +# type: response +# response_code: '' +value: + "{\n \"results\": {\n \"deleted_bytes\": 20,\n \"deleted_blobs\": 5\n\ + \ }\n}" diff --git a/specification/snapshot/clone/SnapshotCloneRequest.ts b/specification/snapshot/clone/SnapshotCloneRequest.ts index 4141fb04b6..ebb1b9772e 100644 --- a/specification/snapshot/clone/SnapshotCloneRequest.ts +++ b/specification/snapshot/clone/SnapshotCloneRequest.ts @@ -28,6 +28,7 @@ import { Duration } from '@_types/Time' * @availability stack since=7.10.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges manage + * @doc_id snapshot-clone */ export interface Request extends RequestBase { path_parts: { diff --git a/specification/snapshot/clone/examples/request/SnapshotCloneRequestExample1.yaml b/specification/snapshot/clone/examples/request/SnapshotCloneRequestExample1.yaml new file mode 100644 index 0000000000..dab548715b --- /dev/null +++ b/specification/snapshot/clone/examples/request/SnapshotCloneRequestExample1.yaml @@ -0,0 +1,5 @@ +# summary: +# method_request: PUT /_snapshot/my_repository/source_snapshot/_clone/target_snapshot +description: Run `PUT /_snapshot/my_repository/source_snapshot/_clone/target_snapshot` to clone the `source_snapshot` into a new `target_snapshot`. +# type: request +value: "{\n \"indices\": \"index_a,index_b\"\n}" diff --git a/specification/snapshot/create/SnapshotCreateRequest.ts b/specification/snapshot/create/SnapshotCreateRequest.ts index 86ae28ecc7..670b21f526 100644 --- a/specification/snapshot/create/SnapshotCreateRequest.ts +++ b/specification/snapshot/create/SnapshotCreateRequest.ts @@ -28,6 +28,7 @@ import { Duration } from '@_types/Time' * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges create_snapshot + * @doc_id snapshot-create-api * @ext_doc_id snapshot-create */ export interface Request extends RequestBase { diff --git a/specification/snapshot/create/examples/request/SnapshotCreateRequestExample1.yaml b/specification/snapshot/create/examples/request/SnapshotCreateRequestExample1.yaml new file mode 100644 index 0000000000..5c288023cf --- /dev/null +++ b/specification/snapshot/create/examples/request/SnapshotCreateRequestExample1.yaml @@ -0,0 +1,8 @@ +# summary: +# method_request: PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true +description: Run `PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true` to take a snapshot of `index_1` and `index_2`. +# type: request +value: + "{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n\ + \ \"include_global_state\": false,\n \"metadata\": {\n \"taken_by\": \"user123\"\ + ,\n \"taken_because\": \"backup before upgrading\"\n }\n}" diff --git a/specification/snapshot/create/examples/response/SnapshotCreateResponseExample1.yaml b/specification/snapshot/create/examples/response/SnapshotCreateResponseExample1.yaml new file mode 100644 index 0000000000..86c59b2e8f --- /dev/null +++ b/specification/snapshot/create/examples/response/SnapshotCreateResponseExample1.yaml @@ -0,0 +1,15 @@ +# summary: +description: A successful response from `PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true`. +# type: response +# response_code: '' +value: + "{\n \"snapshot\": {\n \"snapshot\": \"snapshot_2\",\n \"uuid\": \"\ + vdRctLCxSketdKb54xw67g\",\n \"repository\": \"my_repository\",\n \"version_id\"\ + : ,\n \"version\": ,\n \"indices\": [],\n \"data_streams\"\ + : [],\n \"feature_states\": [],\n \"include_global_state\": false,\n \"\ + metadata\": {\n \"taken_by\": \"user123\",\n \"taken_because\": \"backup\ + \ before upgrading\"\n },\n \"state\": \"SUCCESS\",\n \"start_time\": \"\ + 2020-06-25T14:00:28.850Z\",\n \"start_time_in_millis\": 1593093628850,\n \"\ + end_time\": \"2020-06-25T14:00:28.850Z\",\n \"end_time_in_millis\": 1593094752018,\n\ + \ \"duration_in_millis\": 0,\n \"failures\": [],\n \"shards\": {\n \ + \ \"total\": 0,\n \"failed\": 0,\n \"successful\": 0\n }\n }\n}" diff --git a/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample1.yaml b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample1.yaml new file mode 100644 index 0000000000..dd576940c5 --- /dev/null +++ b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample1.yaml @@ -0,0 +1,7 @@ +summary: A shared file system repository +# method_request: PUT /_snapshot/my_repository +description: Run `PUT /_snapshot/my_repository` to create or update a shared file system snapshot repository. +# type: request +value: + "{\n \"type\": \"fs\",\n \"settings\": {\n \"location\": \"my_backup_location\"\ + \n }\n}" diff --git a/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample2.yaml b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample2.yaml new file mode 100644 index 0000000000..f6ea3b085b --- /dev/null +++ b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample2.yaml @@ -0,0 +1,7 @@ +summary: An Azure repository +# method_request: PUT _snapshot/my_backup +description: Run `PUT /_snapshot/my_repository` to create or update an Azure snapshot repository. +# type: request +value: + "{\n \"type\": \"azure\",\n \"settings\": {\n \"client\": \"secondary\"\ + \n }\n}" diff --git a/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample3.yaml b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample3.yaml new file mode 100644 index 0000000000..704df3beb7 --- /dev/null +++ b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample3.yaml @@ -0,0 +1,7 @@ +summary: A Google Cloud Storage repository +# method_request: PUT _snapshot/my_gcs_repository +description: Run `PUT /_snapshot/my_gcs_repository` to create or update a Google Cloud Storage snapshot repository. +# type: request +value: + "{\n \"type\": \"gcs\",\n \"settings\": {\n \"bucket\": \"my_other_bucket\"\ + ,\n \"base_path\": \"dev\"\n }\n}" diff --git a/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample4.yaml b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample4.yaml new file mode 100644 index 0000000000..67f87c3dd6 --- /dev/null +++ b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample4.yaml @@ -0,0 +1,7 @@ +summary: An S3 repository +# method_request: PUT _snapshot/my_s3_repository +description: Run `PUT /_snapshot/my_s3_repository` to create or update an AWS S3 snapshot repository. +# type: request +value: + "{\n \"type\": \"s3\",\n \"settings\": {\n \"bucket\": \"my-bucket\"\n\ + \ }\n}" diff --git a/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample5.yaml b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample5.yaml new file mode 100644 index 0000000000..d891ad0298 --- /dev/null +++ b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample5.yaml @@ -0,0 +1,7 @@ +summary: A source-only repository +# method_request: PUT _snapshot/my_src_only_repository +description: Run `PUT _snapshot/my_src_only_repository` to create or update a source-only snapshot repository. +# type: request +value: + "{\n \"type\": \"source\",\n \"settings\": {\n \"delegate_type\": \"fs\"\ + ,\n \"location\": \"my_backup_repository\"\n }\n}" diff --git a/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample6.yaml b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample6.yaml new file mode 100644 index 0000000000..4dea0a1547 --- /dev/null +++ b/specification/snapshot/create_repository/examples/request/SnapshotCreateRepositoryRequestExample6.yaml @@ -0,0 +1,7 @@ +summary: A read-only URL repository +# method_request: PUT _snapshot/my_read_only_url_repository +description: Run `PUT _snapshot/my_read_only_url_repository` to create or update a read-only URL snapshot repository. +# type: request +value: + "{\n \"type\": \"url\",\n \"settings\": {\n \"url\": \"file:/mount/backups/my_fs_backup_location\"\ + \n }\n}" diff --git a/specification/snapshot/delete/SnapshotDeleteRequest.ts b/specification/snapshot/delete/SnapshotDeleteRequest.ts index 4ba1ed9fc9..b0a022b91d 100644 --- a/specification/snapshot/delete/SnapshotDeleteRequest.ts +++ b/specification/snapshot/delete/SnapshotDeleteRequest.ts @@ -27,6 +27,7 @@ import { Duration } from '@_types/Time' * @availability stack stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges manage + * @doc_id snapshot-delete */ export interface Request extends RequestBase { path_parts: { diff --git a/specification/snapshot/delete/examples/response/SnapshotDeleteResponseExample1.yaml b/specification/snapshot/delete/examples/response/SnapshotDeleteResponseExample1.yaml new file mode 100644 index 0000000000..aadfee7176 --- /dev/null +++ b/specification/snapshot/delete/examples/response/SnapshotDeleteResponseExample1.yaml @@ -0,0 +1,7 @@ +# summary: +description: > + A successful response from `DELETE /_snapshot/my_repository/snapshot_2,snapshot_3`. + The request deletes `snapshot_2` and `snapshot_3` from the repository named `my_repository`. +# type: response +# response_code: '' +value: "{\n \"acknowledged\" : true\n}" diff --git a/specification/snapshot/delete_repository/SnapshotDeleteRepositoryRequest.ts b/specification/snapshot/delete_repository/SnapshotDeleteRepositoryRequest.ts index b5e274a232..3f10a3cb57 100644 --- a/specification/snapshot/delete_repository/SnapshotDeleteRepositoryRequest.ts +++ b/specification/snapshot/delete_repository/SnapshotDeleteRepositoryRequest.ts @@ -29,6 +29,7 @@ import { Duration } from '@_types/Time' * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges manage + * @doc_id snapshot-repo-delete */ export interface Request extends RequestBase { path_parts: { diff --git a/specification/snapshot/get/SnapshotGetRequest.ts b/specification/snapshot/get/SnapshotGetRequest.ts index fd096bb030..4c02547a2c 100644 --- a/specification/snapshot/get/SnapshotGetRequest.ts +++ b/specification/snapshot/get/SnapshotGetRequest.ts @@ -30,6 +30,7 @@ import { Duration } from '@_types/Time' * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges monitor_snapshot + * @doc_id snapshot-get */ export interface Request extends RequestBase { path_parts: { diff --git a/specification/snapshot/get/examples/response/SnapshotGetResponseExample1.yaml b/specification/snapshot/get/examples/response/SnapshotGetResponseExample1.yaml new file mode 100644 index 0000000000..11610e653e --- /dev/null +++ b/specification/snapshot/get/examples/response/SnapshotGetResponseExample1.yaml @@ -0,0 +1,34 @@ +# summary: +description: > + A successful response from `GET /_snapshot/my_repository/snapshot_*?sort=start_time&from_sort_value=1577833200000`. + The response contains information for all snapshots with names starting with `snapshot_` and that started on or after timestamp `1577833200000` (Jan 1st 2020) when sorted by snapshot start time in the default ascending order. +# type: response +# response_code: '' +value: + "{\n \"snapshots\": [\n {\n \"snapshot\": \"snapshot_1\",\n \"\ + uuid\": \"dKb54xw67gvdRctLCxSket\",\n \"repository\": \"my_repository\",\n\ + \ \"version_id\": ,\n \"version\": ,\n \"indices\"\ + : [],\n \"data_streams\": [],\n \"feature_states\": [],\n \"include_global_state\"\ + : true,\n \"state\": \"SUCCESS\",\n \"start_time\": \"2020-07-06T21:55:18.128Z\"\ + ,\n \"start_time_in_millis\": 1593093628849,\n \"end_time\": \"2020-07-06T21:55:18.129Z\"\ + ,\n \"end_time_in_millis\": 1593093628850,\n \"duration_in_millis\": 1,\n\ + \ \"failures\": [],\n \"shards\": {\n \"total\": 0,\n \"\ + failed\": 0,\n \"successful\": 0\n }\n },\n {\n \"snapshot\"\ + : \"snapshot_2\",\n \"uuid\": \"vdRctLCxSketdKb54xw67g\",\n \"repository\"\ + : \"my_repository\",\n \"version_id\": ,\n \"version\": ,\n\ + \ \"indices\": [],\n \"data_streams\": [],\n \"feature_states\":\ + \ [],\n \"include_global_state\": true,\n \"state\": \"SUCCESS\",\n \ + \ \"start_time\": \"2020-07-06T21:55:18.130Z\",\n \"start_time_in_millis\"\ + : 1593093628851,\n \"end_time\": \"2020-07-06T21:55:18.130Z\",\n \"end_time_in_millis\"\ + : 1593093628851,\n \"duration_in_millis\": 0,\n \"failures\": [],\n \ + \ \"shards\": {\n \"total\": 0,\n \"failed\": 0,\n \"successful\"\ + : 0\n }\n },\n {\n \"snapshot\": \"snapshot_3\",\n \"uuid\"\ + : \"dRctdKb54xw67gvLCxSket\",\n \"repository\": \"my_repository\",\n \"\ + version_id\": ,\n \"version\": ,\n \"indices\": [],\n\ + \ \"data_streams\": [],\n \"feature_states\": [],\n \"include_global_state\"\ + : true,\n \"state\": \"SUCCESS\",\n \"start_time\": \"2020-07-06T21:55:18.131Z\"\ + ,\n \"start_time_in_millis\": 1593093628852,\n \"end_time\": \"2020-07-06T21:55:18.135Z\"\ + ,\n \"end_time_in_millis\": 1593093628856,\n \"duration_in_millis\": 4,\n\ + \ \"failures\": [],\n \"shards\": {\n \"total\": 0,\n \"\ + failed\": 0,\n \"successful\": 0\n }\n }\n ],\n \"total\": 3,\n\ + \ \"remaining\": 0\n}" diff --git a/specification/snapshot/get_repository/SnapshotGetRepositoryRequest.ts b/specification/snapshot/get_repository/SnapshotGetRepositoryRequest.ts index 4d42c890c8..1c984091bf 100644 --- a/specification/snapshot/get_repository/SnapshotGetRepositoryRequest.ts +++ b/specification/snapshot/get_repository/SnapshotGetRepositoryRequest.ts @@ -27,6 +27,7 @@ import { Duration } from '@_types/Time' * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges monitor_snapshot + * @doc_id snapshot-repo-get */ export interface Request extends RequestBase { path_parts: { diff --git a/specification/snapshot/get_repository/examples/response/SnapshotGetRepositoryResponseExample1.yaml b/specification/snapshot/get_repository/examples/response/SnapshotGetRepositoryResponseExample1.yaml new file mode 100644 index 0000000000..0a86b84e54 --- /dev/null +++ b/specification/snapshot/get_repository/examples/response/SnapshotGetRepositoryResponseExample1.yaml @@ -0,0 +1,8 @@ +# summary: +description: A successful response from `GET /_snapshot/my_repository`. +# type: response +# response_code: '' +value: + "{\n \"my_repository\" : {\n \"type\" : \"fs\",\n \"uuid\" : \"0JLknrXbSUiVPuLakHjBrQ\"\ + ,\n \"settings\" : {\n \"location\" : \"my_backup_location\"\n }\n }\n\ + }" diff --git a/specification/snapshot/repository_verify_integrity/SnapshotRepositoryVerifyIntegrityRequest.ts b/specification/snapshot/repository_verify_integrity/SnapshotRepositoryVerifyIntegrityRequest.ts index 5e493327d4..9b2e7b48f3 100644 --- a/specification/snapshot/repository_verify_integrity/SnapshotRepositoryVerifyIntegrityRequest.ts +++ b/specification/snapshot/repository_verify_integrity/SnapshotRepositoryVerifyIntegrityRequest.ts @@ -53,6 +53,7 @@ import { integer } from '@_types/Numeric' * @rest_spec_name snapshot.repository_verify_integrity * @availability stack since=8.16.0 stability=experimental visibility=private * @cluster_privileges manage + * @doc_id snapshot-repo-verify-integrity */ export interface Request extends RequestBase { path_parts: { diff --git a/specification/snapshot/restore/SnapshotRestoreRequest.ts b/specification/snapshot/restore/SnapshotRestoreRequest.ts index a982b26fe6..0b76f3409f 100644 --- a/specification/snapshot/restore/SnapshotRestoreRequest.ts +++ b/specification/snapshot/restore/SnapshotRestoreRequest.ts @@ -45,6 +45,7 @@ import { Duration } from '@_types/Time' * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges manage + * @doc_id snapshot-restore-api * @ext_doc_id restore-snapshot */ export interface Request extends RequestBase { diff --git a/specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample1.yaml b/specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample1.yaml new file mode 100644 index 0000000000..6a2fbbb198 --- /dev/null +++ b/specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample1.yaml @@ -0,0 +1,12 @@ +summary: Restore with rename pattern +# method_request: POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true +description: > + Run `POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true`. + It restores `index_1` and `index_2` from `snapshot_2`. + The `rename_pattern` and `rename_replacement` parameters indicate any index matching the regular expression `index_(.+)` will be renamed using the pattern `restored_index_$1`. + For example, `index_1` will be renamed to `restored_index_1`. +# type: request +value: + "{\n \"indices\": \"index_1,index_2\",\n \"ignore_unavailable\": true,\n\ + \ \"include_global_state\": false,\n \"rename_pattern\": \"index_(.+)\",\n \"\ + rename_replacement\": \"restored_index_$1\",\n \"include_aliases\": false\n}" diff --git a/specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample2.yaml b/specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample2.yaml new file mode 100644 index 0000000000..4148a6fa3b --- /dev/null +++ b/specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample2.yaml @@ -0,0 +1,8 @@ +summary: Restore in-place +# method_request: PUT _cluster/settings +description: > + Close `index_1` then run `POST /_snapshot/my_repository/snapshot_2/_restore?wait_for_completion=true` to restore an index in-place. + For example, you might want to perform this type of restore operation when no alternative options surface after the cluster allocation explain API reports `no_valid_shard_copy`. +# type: request +value: + indices: index_1 diff --git a/specification/snapshot/status/SnapshotStatusRequest.ts b/specification/snapshot/status/SnapshotStatusRequest.ts index 44a7f74489..1ec4028cab 100644 --- a/specification/snapshot/status/SnapshotStatusRequest.ts +++ b/specification/snapshot/status/SnapshotStatusRequest.ts @@ -37,6 +37,7 @@ import { Duration } from '@_types/Time' * @availability stack since=7.8.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges monitor_snapshot + * @doc_id snapshot-status */ export interface Request extends RequestBase { path_parts: { diff --git a/specification/snapshot/status/examples/response/SnapshotStatusResponseExample1.yaml b/specification/snapshot/status/examples/response/SnapshotStatusResponseExample1.yaml new file mode 100644 index 0000000000..f32a140a16 --- /dev/null +++ b/specification/snapshot/status/examples/response/SnapshotStatusResponseExample1.yaml @@ -0,0 +1,79 @@ +# summary: +description: > + A successful response from `GET _snapshot/my_repository/snapshot_2/_status`. + The response contains detailed status information for `snapshot_2` in the `my_repository` repository. +# type: response +# response_code: '' +value: |- + { + "snapshots" : [ + { + "snapshot" : "snapshot_2", + "repository" : "my_repository", + "uuid" : "lNeQD1SvTQCqqJUMQSwmGg", + "state" : "SUCCESS", + "include_global_state" : false, + "shards_stats" : { + "initializing" : 0, + "started" : 0, + "finalizing" : 0, + "done" : 1, + "failed" : 0, + "total" : 1 + }, + "stats" : { + "incremental" : { + "file_count" : 3, + "size_in_bytes" : 5969 + }, + "total" : { + "file_count" : 4, + "size_in_bytes" : 6024 + }, + "start_time_in_millis" : 1594829326691, + "time_in_millis" : 205 + }, + "indices" : { + "index_1" : { + "shards_stats" : { + "initializing" : 0, + "started" : 0, + "finalizing" : 0, + "done" : 1, + "failed" : 0, + "total" : 1 + }, + "stats" : { + "incremental" : { + "file_count" : 3, + "size_in_bytes" : 5969 + }, + "total" : { + "file_count" : 4, + "size_in_bytes" : 6024 + }, + "start_time_in_millis" : 1594829326896, + "time_in_millis" : 0 + }, + "shards" : { + "0" : { + "stage" : "DONE", + "stats" : { + "incremental" : { + "file_count" : 3, + "size_in_bytes" : 5969 + }, + "total" : { + "file_count" : 4, + "size_in_bytes" : 6024 + }, + "start_time_in_millis" : 1594829326896, + "time_in_millis" : 0 + } + } + } + } + } + } + ] + } diff --git a/specification/snapshot/verify_repository/SnapshotVerifyRepositoryRequest.ts b/specification/snapshot/verify_repository/SnapshotVerifyRepositoryRequest.ts index 951a55bb5a..45598ca34b 100644 --- a/specification/snapshot/verify_repository/SnapshotVerifyRepositoryRequest.ts +++ b/specification/snapshot/verify_repository/SnapshotVerifyRepositoryRequest.ts @@ -28,6 +28,7 @@ import { Duration } from '@_types/Time' * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=private * @cluster_privileges manage + * @doc_id snapshot-repo-verify * @ext_doc_id verify-repository */ export interface Request extends RequestBase { From 16e9c6e77ab84314dc814551b66559393890c5b4 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 8 Jan 2025 09:46:08 -0800 Subject: [PATCH 2/2] Regenerate output --- output/schema/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 598709d827..68b05a758a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -206740,7 +206740,7 @@ } } ], - "specLocation": "snapshot/clone/SnapshotCloneRequest.ts#L24-L45" + "specLocation": "snapshot/clone/SnapshotCloneRequest.ts#L24-L46" }, { "kind": "response",