snaprepoapi

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Overview

Package snaprepoapi contains the a set of functions to interact with the platform repositories

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(params DeleteParams) error

Delete removes a specified snapshot repository

func Get

func Get(params GetParams) (*models.RepositoryConfig, error)

Get obtains the specified snapshot repository configuration

func List

func List(params ListParams) (*models.RepositoryConfigs, error)

List obtains all the configured platform snapshot repositories

func Set

func Set(params SetParams) error

Set adds or updates a snapshot repository from a config

Types

type DeleteParams

type DeleteParams struct {
	*api.API
	Region string
	Name   string
}

DeleteParams is used for the Delete call

func (DeleteParams) Validate

func (params DeleteParams) Validate() error

Validate ensures that parameters are correct

type GenericConfig

type GenericConfig map[string]interface{}

GenericConfig wraps a map[string]interface{} type so it implements the common.Validator interface.

func ParseGenericConfig

func ParseGenericConfig(input io.Reader) (GenericConfig, error)

ParseGenericConfig reads the contents of an io.Reader and tries to parse its contents as YAML or JSON, returns an error if parsing fails in both formats.

func (GenericConfig) Validate

func (c GenericConfig) Validate() error

Validate checks that the length of the map is >= 1

type GetParams

type GetParams struct {
	*api.API
	Region string
	Name   string
}

GetParams is used for the Get call

func (GetParams) Validate

func (params GetParams) Validate() error

Validate ensures that parameters are correct

type ListParams

type ListParams struct {
	*api.API
	Region string
}

ListParams is embedded in all of the specific action functions

func (ListParams) Validate

func (params ListParams) Validate() error

Validate ensures that parameters are correct

type S3Config

type S3Config struct {
	// Required settings
	Region    string `json:"region,omitempty"`
	Bucket    string `json:"bucket,omitempty"`
	AccessKey string `json:"access_key,omitempty"`
	SecretKey string `json:"secret_key,omitempty"`

	// Optional settings
	BasePath             string `json:"base_path,omitempty"`
	Compress             bool   `json:"compress,omitempty"`
	ServerSideEncryption bool   `json:"server_side_encryption,omitempty"`

	// Advanced Settings
	ChunkSize    string `json:"chunk_size,omitempty"`
	CannedACL    string `json:"canned_acl,omitempty"`
	StorageClass string `json:"storage_class,omitempty"`

	// Client settings
	// See http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region.
	Endpoint        string        `json:"endpoint,omitempty"`
	Protocol        string        `json:"protocol,omitempty"`
	Timeout         time.Duration `json:"timeout,omitempty"`
	MaxRetries      int           `json:"max_retries,omitempty"`
	ThrottleRetries bool          `json:"throttle_retries,omitempty"`
	PathStyleAccess bool          `json:"path_style_access,omitempty"`
}

S3Config is used to configure an S3 snapshot repository Full list of settings in the Elasticsearch official documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/repository-s3.html#repository-s3-repository https://www.elastic.co/guide/en/elasticsearch/reference/current/repository-s3.html#repository-s3-client nolint

func ParseS3Config

func ParseS3Config(input io.Reader) (S3Config, error)

ParseS3Config reads the contents of an io.Reader and tries to parse its contents as YAML or JSON, returns an error if parsing fails in both formats.

func (S3Config) Validate

func (c S3Config) Validate() error

Validate ensures that S3Config is

type S3TypeConfig

type S3TypeConfig struct {
	Type     string   `json:"type"`
	Settings S3Config `json:"settings"`
}

S3TypeConfig is used by the text formatter to wrwap the S3 config with the type field.

type SetParams

type SetParams struct {
	*api.API
	Region string
	Name   string
	Type   string
	Config util.Validator
}

SetParams is used for the Set Call, which will create or update a snapshot repository

func (SetParams) Validate

func (params SetParams) Validate() error

Validate ensures that parameters are correct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL