post

package
v8.13.1 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: 13 Imported by: 0

Documentation

Overview

Updates the license for the cluster.

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

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

API name: license

func (*Post) Licenses

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

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

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) 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.

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/5fb8f1ce9c4605abcaa44aa0f17dbfc60497a757/specification/license/post/PostLicenseRequest.ts#L23-L43

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/5fb8f1ce9c4605abcaa44aa0f17dbfc60497a757/specification/license/post/PostLicenseResponse.ts#L23-L29

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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