Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CloseIndices(indices []string) error
- func (c *Client) ClusterHealth() (ClusterHealthResponse, error)
- func (c *Client) ListIndices() ([]string, error)
- func (c *Client) ListRepositories() ([]Repository, error)
- func (c *Client) ListSnapshots(repositoryName string) ([]Snapshot, error)
- func (c *Client) RegisterS3Repository(name, arn string) error
- func (c *Client) RestoreSnapshot(repositoryName, snapshotName string, opts RestoreSnapshotOpts) error
- func (c *Client) SnapshotIndicesRecovery(indices []string) ([]SnapshotIndexShardRecovery, error)
- type ClusterHealthResponse
- type DialContextF
- type Repository
- type RestoreSnapshotOpts
- type Snapshot
- type SnapshotIndexShardRecovery
Constants ¶
const ( ClusterStatusGreen = "green" ClusterStatusYellow = "yellow" ClusterStatusRed = "red" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper on top of the official opensearch client, implementing a custom transport that modifies the request in two ways:
- Requests are signed using AWS Signature Version 4 before passing them to the underlying transport
- The transport is tunneled through the provided SSH client using its Dial function
func New ¶
New builds a new Client for the AWS OpenSearch Domain pointed to by esEndoint, using the AWS profile to sign requests and tunneling those requests through the SSH connection provided by the SSH client.
func (*Client) CloseIndices ¶
CloseIndices close the indices specified. This is used so that a snapshot containing indices with the same names as the ones provided can be restored; otherwise, the restored indices would need to be renamed.
func (*Client) ClusterHealth ¶
func (c *Client) ClusterHealth() (ClusterHealthResponse, error)
func (*Client) ListIndices ¶
ListIndices returns the names of the indices already present in the server as a plain slice of strings
func (*Client) ListRepositories ¶
func (c *Client) ListRepositories() ([]Repository, error)
ListRepositories returns the list of repositories registered in the server
func (*Client) ListSnapshots ¶
ListSnapshots returns the list of snapshots included in the repository specified by repositoryName
func (*Client) RegisterS3Repository ¶
RegisterS3Repository registers a repository of type S3, identified by its name, using the role ARN provided
func (*Client) RestoreSnapshot ¶
func (c *Client) RestoreSnapshot(repositoryName, snapshotName string, opts RestoreSnapshotOpts) error
RestoreSnapshot restores a snapshot from a repository using the options provided.
func (*Client) SnapshotIndicesRecovery ¶
func (c *Client) SnapshotIndicesRecovery(indices []string) ([]SnapshotIndexShardRecovery, error)
SnapshotIndicesRecovery returns status information for each index shard in the server of type SNAPSHOT. This is useful to track the completion of a snapshot restoration process.
type ClusterHealthResponse ¶
type Repository ¶
Repository represents a snapshot repository, with a Name and a Type (for now only S3 is supported)
type RestoreSnapshotOpts ¶
type RestoreSnapshotOpts struct { WithIndices []string WithoutIndices []string NumberOfReplicas int }
RestoreSnapshotOpts exposes three options for configuring the RestoreSnapshot request:
- WithIndices, a list of the indices from the snapshot that need to be restored.
- WithoutIndices, a list of the indices from the snapshot that need to be skipped.
- NumberOfReplicas, the number of replicas each primary shard has. Defaults to 1.
func (RestoreSnapshotOpts) IsValid ¶
func (r RestoreSnapshotOpts) IsValid() error
func (RestoreSnapshotOpts) MarshalJSON ¶
func (r RestoreSnapshotOpts) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaler interface so that RestoreSnapshotOpts can be easily marshalled.
type Snapshot ¶
Snapshot represents a snapshot in one of the repositories registered in the server, identified by its name, specifying the list of indices within it and the total number of shards shared among them.
type SnapshotIndexShardRecovery ¶
SnapshotIndexShardRecovery represents the information returned by the IndicesRecovery request for a single index shard, specifying:
- Index: the name of the index where this shard lives.
- Type: the type of the shard, normally "SNAPSHOT" for shards that are being restored from a snapshot.
- Stage: the current status of the shard. For SNAPSHOT shards, this is either "INDEX", meaning the shard is still being restored, or "DONE", meaning the shard has already been restored.
- Percent: the percentage of bytes already restored. Note this is not the percentage of files already restored.