post

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: 13 Imported by: 0

Documentation

Overview

Update the license.

You can update your license at runtime without shutting down your nodes. License updates take effect immediately. If the license you are installing does not support all of the features that were available with your previous license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true.

NOTE: If Elasticsearch security features are enabled and you are installing a gold or higher license, you must enable TLS on the transport networking layer before you install the license. If the operator privileges feature is enabled, only operator users can use this API.

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 NewPost

type NewPost func() *Post

NewPost type alias for index.

func NewPostFunc

func NewPostFunc(tp elastictransport.Interface) NewPost

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

type Post

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

func New

Update the license.

You can update your license at runtime without shutting down your nodes. License updates take effect immediately. If the license you are installing does not support all of the features that were available with your previous license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true.

NOTE: If Elasticsearch security features are enabled and you are installing a gold or higher license, you must enable TLS on the transport networking layer before you install the license. If the operator privileges feature is enabled, only operator users can use this API.

https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-post

func (*Post) Acknowledge

func (r *Post) Acknowledge(acknowledge bool) *Post

Acknowledge Specifies whether you acknowledge the license changes. API name: acknowledge

func (Post) Do

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

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

func (*Post) ErrorTrace

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

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

func (*Post) FilterPath

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

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

func (*Post) Header

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

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

func (*Post) HttpRequest

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

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

func (*Post) Human

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

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 (*Post) License

func (r *Post) License(license types.LicenseVariant) *Post

API name: license

func (*Post) Licenses

func (r *Post) Licenses(licenses ...types.LicenseVariant) *Post

A sequence of one or more JSON documents containing the license information. API name: licenses

func (*Post) MasterTimeout

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

MasterTimeout The period to wait for a connection to the master node. API name: master_timeout

func (Post) Perform

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

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

func (*Post) Pretty

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

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

func (*Post) Raw

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

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

func (*Post) Request

func (r *Post) Request(req *Request) *Post

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

func (*Post) Timeout

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

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

type Request

type Request struct {
	License *types.License `json:"license,omitempty"`
	// Licenses A sequence of one or more JSON documents containing the license information.
	Licenses []types.License `json:"licenses,omitempty"`
}

Request holds the request body struct for the package post

https://github.com/elastic/elasticsearch-specification/blob/52c473efb1fb5320a5bac12572d0b285882862fb/specification/license/post/PostLicenseRequest.ts#L24-L70

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 {
	Acknowledge   *types.Acknowledgement      `json:"acknowledge,omitempty"`
	Acknowledged  bool                        `json:"acknowledged"`
	LicenseStatus licensestatus.LicenseStatus `json:"license_status"`
}

Response holds the response body struct for the package post

https://github.com/elastic/elasticsearch-specification/blob/52c473efb1fb5320a5bac12572d0b285882862fb/specification/license/post/PostLicenseResponse.ts#L23-L29

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

close