specification/snapshot/create/SnapshotCreateRequest.ts (28 lines of code) (raw):
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { RequestBase } from '@_types/Base'
import { ExpandWildcards, Indices, Metadata, Name } from '@_types/common'
import { Duration } from '@_types/Time'
/**
* Create a snapshot.
* Take a snapshot of a cluster or of data streams and indices.
* @rest_spec_name snapshot.create
* @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 {
urls: [
{
path: '/_snapshot/{repository}/{snapshot}'
methods: ['PUT', 'POST']
}
]
path_parts: {
/**
* The name of the repository for the snapshot.
*/
repository: Name
/**
* The name of the snapshot.
* It supportes date math.
* It must be unique in the repository.
*/
snapshot: Name
}
query_parameters: {
/**
* The period to wait for a connection to the master node.
* If no response is received before the timeout expires, the request fails and returns an error.
* @server_default 30s
*/
master_timeout?: Duration
/**
* If `true`, the request returns a response when the snapshot is complete.
* If `false`, the request returns a response when the snapshot initializes.
* @server_default false
*/
wait_for_completion?: boolean
}
body: {
/**
* Determines how wildcard patterns in the `indices` parameter match data streams and indices.
* It supports comma-separated values such as `open,hidden`.
* @server_default all
*/
expand_wildcards?: ExpandWildcards
/**
* The feature states to include in the snapshot.
* Each feature state includes one or more system indices containing related data.
* You can view a list of eligible features using the get features API.
*
* If `include_global_state` is `true`, all current feature states are included by default.
* If `include_global_state` is `false`, no feature states are included by default.
*
* Note that specifying an empty array will result in the default behavior.
* To exclude all feature states, regardless of the `include_global_state` value, specify an array with only the value `none` (`["none"]`).
* @ext_doc_id snapshot-restore-feature-state
*/
feature_states?: string[]
/**
* If `true`, the request ignores data streams and indices in `indices` that are missing or closed.
* If `false`, the request returns an error for any data stream or index that is missing or closed.
* @server_default false
*/
ignore_unavailable?: boolean
/**
* If `true`, the current cluster state is included in the snapshot.
* The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies.
* It also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`).
* @server_default true
*/
include_global_state?: boolean
/**
* A comma-separated list of data streams and indices to include in the snapshot.
* It supports a multi-target syntax.
* The default is an empty array (`[]`), which includes all regular data streams and regular indices.
* To exclude all data streams and indices, use `-*`.
*
* You can't use this parameter to include or exclude system indices or system data streams from a snapshot.
* Use `feature_states` instead.
*/
indices?: Indices
/**
* Arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data.
* It can have any contents but it must be less than 1024 bytes.
* This information is not automatically generated by Elasticsearch.
*/
metadata?: Metadata
/**
* If `true`, it enables you to restore a partial snapshot of indices with unavailable shards.
* Only shards that were successfully included in the snapshot will be restored.
* All missing shards will be recreated as empty.
*
* If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.
* @server_default false
*/
partial?: boolean
}
}