Documentation ¶
Overview ¶
Create a service account token.
Create a service accounts token for access without requiring basic authentication.
Index ¶
- Variables
- type CreateServiceToken
- func (r CreateServiceToken) Do(providedCtx context.Context) (*Response, error)
- func (r *CreateServiceToken) ErrorTrace(errortrace bool) *CreateServiceToken
- func (r *CreateServiceToken) FilterPath(filterpaths ...string) *CreateServiceToken
- func (r *CreateServiceToken) Header(key, value string) *CreateServiceToken
- func (r *CreateServiceToken) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *CreateServiceToken) Human(human bool) *CreateServiceToken
- func (r CreateServiceToken) IsSuccess(providedCtx context.Context) (bool, error)
- func (r *CreateServiceToken) Name(name string) *CreateServiceToken
- func (r CreateServiceToken) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *CreateServiceToken) Pretty(pretty bool) *CreateServiceToken
- func (r *CreateServiceToken) Refresh(refresh refresh.Refresh) *CreateServiceToken
- type NewCreateServiceToken
- type Response
Constants ¶
This section is empty.
Variables ¶
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 CreateServiceToken ¶
type CreateServiceToken struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *CreateServiceToken
Create a service account token.
Create a service accounts token for access without requiring basic authentication.
func (CreateServiceToken) Do ¶
func (r CreateServiceToken) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a createservicetoken.Response
func (*CreateServiceToken) ErrorTrace ¶ added in v8.14.0
func (r *CreateServiceToken) ErrorTrace(errortrace bool) *CreateServiceToken
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*CreateServiceToken) FilterPath ¶ added in v8.14.0
func (r *CreateServiceToken) FilterPath(filterpaths ...string) *CreateServiceToken
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*CreateServiceToken) Header ¶
func (r *CreateServiceToken) Header(key, value string) *CreateServiceToken
Header set a key, value pair in the CreateServiceToken headers map.
func (*CreateServiceToken) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*CreateServiceToken) Human ¶ added in v8.14.0
func (r *CreateServiceToken) Human(human bool) *CreateServiceToken
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 (CreateServiceToken) IsSuccess ¶
func (r CreateServiceToken) IsSuccess(providedCtx context.Context) (bool, error)
IsSuccess allows to run a query with a context and retrieve the result as a boolean. This only exists for endpoints without a request payload and allows for quick control flow.
func (*CreateServiceToken) Name ¶
func (r *CreateServiceToken) Name(name string) *CreateServiceToken
Name An identifier for the token name API Name: name
func (CreateServiceToken) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*CreateServiceToken) Pretty ¶ added in v8.14.0
func (r *CreateServiceToken) Pretty(pretty bool) *CreateServiceToken
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*CreateServiceToken) Refresh ¶
func (r *CreateServiceToken) Refresh(refresh refresh.Refresh) *CreateServiceToken
Refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. API name: refresh
type NewCreateServiceToken ¶
type NewCreateServiceToken func(namespace, service string) *CreateServiceToken
NewCreateServiceToken type alias for index.
func NewCreateServiceTokenFunc ¶
func NewCreateServiceTokenFunc(tp elastictransport.Interface) NewCreateServiceToken
NewCreateServiceTokenFunc returns a new instance of CreateServiceToken with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Response ¶ added in v8.7.0
type Response struct { Created bool `json:"created"` Token types.ServiceToken `json:"token"` }
Response holds the response body struct for the package createservicetoken