updatesettings

package
v9.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Update security index settings.

Update the user-configurable settings for the security internal index (`.security` and associated indices). Only a subset of settings are allowed to be modified. This includes `index.auto_expand_replicas` and `index.number_of_replicas`.

NOTE: If `index.auto_expand_replicas` is set, `index.number_of_replicas` will be ignored during updates.

If a specific index is not in use on the system and settings are provided for it, the request will be rejected. This API does not yet support configuring the settings for indices before they are in use.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type NewUpdateSettings

type NewUpdateSettings func() *UpdateSettings

NewUpdateSettings type alias for index.

func NewUpdateSettingsFunc

func NewUpdateSettingsFunc(tp elastictransport.Interface) NewUpdateSettings

NewUpdateSettingsFunc returns a new instance of UpdateSettings with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Request

type Request struct {

	// Security Settings for the index used for most security configuration, including native
	// realm users and roles configured with the API.
	Security *types.SecuritySettings `json:"security,omitempty"`
	// SecurityProfile Settings for the index used to store profile information.
	SecurityProfile *types.SecuritySettings `json:"security-profile,omitempty"`
	// SecurityTokens Settings for the index used to store tokens.
	SecurityTokens *types.SecuritySettings `json:"security-tokens,omitempty"`
}

Request holds the request body struct for the package updatesettings

https://github.com/elastic/elasticsearch-specification/blob/52c473efb1fb5320a5bac12572d0b285882862fb/specification/security/update_settings/SecurityUpdateSettingsRequest.ts#L24-L71

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response

type Response struct {
	Acknowledged bool `json:"acknowledged"`
}

Response holds the response body struct for the package updatesettings

https://github.com/elastic/elasticsearch-specification/blob/52c473efb1fb5320a5bac12572d0b285882862fb/specification/security/update_settings/SecurityUpdateSettingsResponse.ts#L20-L24

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

type UpdateSettings

type UpdateSettings struct {
	// contains filtered or unexported fields
}

func New

Update security index settings.

Update the user-configurable settings for the security internal index (`.security` and associated indices). Only a subset of settings are allowed to be modified. This includes `index.auto_expand_replicas` and `index.number_of_replicas`.

NOTE: If `index.auto_expand_replicas` is set, `index.number_of_replicas` will be ignored during updates.

If a specific index is not in use on the system and settings are provided for it, the request will be rejected. This API does not yet support configuring the settings for indices before they are in use.

https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-update-settings

func (UpdateSettings) Do

func (r UpdateSettings) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a updatesettings.Response

func (*UpdateSettings) ErrorTrace

func (r *UpdateSettings) ErrorTrace(errortrace bool) *UpdateSettings

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*UpdateSettings) FilterPath

func (r *UpdateSettings) FilterPath(filterpaths ...string) *UpdateSettings

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*UpdateSettings) Header

func (r *UpdateSettings) Header(key, value string) *UpdateSettings

Header set a key, value pair in the UpdateSettings headers map.

func (*UpdateSettings) HttpRequest

func (r *UpdateSettings) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*UpdateSettings) Human

func (r *UpdateSettings) Human(human bool) *UpdateSettings

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (*UpdateSettings) MasterTimeout

func (r *UpdateSettings) MasterTimeout(duration string) *UpdateSettings

MasterTimeout 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. API name: master_timeout

func (UpdateSettings) Perform

func (r UpdateSettings) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*UpdateSettings) Pretty

func (r *UpdateSettings) Pretty(pretty bool) *UpdateSettings

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*UpdateSettings) Raw

func (r *UpdateSettings) Raw(raw io.Reader) *UpdateSettings

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*UpdateSettings) Request

func (r *UpdateSettings) Request(req *Request) *UpdateSettings

Request allows to set the request property with the appropriate payload.

func (*UpdateSettings) Security

Settings for the index used for most security configuration, including native realm users and roles configured with the API. API name: security

func (*UpdateSettings) SecurityProfile

func (r *UpdateSettings) SecurityProfile(securityprofile types.SecuritySettingsVariant) *UpdateSettings

Settings for the index used to store profile information. API name: security-profile

func (*UpdateSettings) SecurityTokens

func (r *UpdateSettings) SecurityTokens(securitytokens types.SecuritySettingsVariant) *UpdateSettings

Settings for the index used to store tokens. API name: security-tokens

func (*UpdateSettings) Timeout

func (r *UpdateSettings) Timeout(duration string) *UpdateSettings

Timeout The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. API name: timeout

Jump to

Keyboard shortcuts

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