Documentation
¶
Overview ¶
Create a service account token.
Create a service accounts token for access without requiring basic authentication.
NOTE: Service account tokens never expire. You must actively delete them if they are no longer needed.
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.
NOTE: Service account tokens never expire. You must actively delete them if they are no longer needed.
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 The name for the service account token. If omitted, a random name will be generated.
Token names must be at least one and no more than 256 characters. They can contain alphanumeric characters (a-z, A-Z, 0-9), dashes (`-`), and underscores (`_`), but cannot begin with an underscore.
NOTE: Token names must be unique in the context of the associated service account. They must also be globally unique with their fully qualified names, which are comprised of the service account principal and token name, such as `<namespace>/<service>/<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