getapikey

package
v8.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Overview

Retrieves information for one or more API keys. NOTE: If you have only the `manage_own_api_key` privilege, this API returns only the API keys that you own. If you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership.

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 GetApiKey

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

func New

Retrieves information for one or more API keys. NOTE: If you have only the `manage_own_api_key` privilege, this API returns only the API keys that you own. If you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html

func (*GetApiKey) ActiveOnly added in v8.12.0

func (r *GetApiKey) ActiveOnly(activeonly bool) *GetApiKey

ActiveOnly A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as `owner` or `name`. If `active_only` is false, the response will include both active and inactive (expired or invalidated) keys. API name: active_only

func (GetApiKey) Do

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

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

func (*GetApiKey) ErrorTrace added in v8.14.0

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

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

func (*GetApiKey) FilterPath added in v8.14.0

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

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

func (*GetApiKey) Header

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

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

func (*GetApiKey) HttpRequest

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

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

func (*GetApiKey) Human added in v8.14.0

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

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 (*GetApiKey) Id

func (r *GetApiKey) Id(id string) *GetApiKey

Id An API key id. This parameter cannot be used with any of `name`, `realm_name` or `username`. API name: id

func (GetApiKey) IsSuccess

func (r GetApiKey) 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 (*GetApiKey) Name

func (r *GetApiKey) Name(name string) *GetApiKey

Name An API key name. This parameter cannot be used with any of `id`, `realm_name` or `username`. It supports prefix search with wildcard. API name: name

func (*GetApiKey) Owner

func (r *GetApiKey) Owner(owner bool) *GetApiKey

Owner A boolean flag that can be used to query API keys owned by the currently authenticated user. The `realm_name` or `username` parameters cannot be specified when this parameter is set to `true` as they are assumed to be the currently authenticated ones. API name: owner

func (GetApiKey) Perform added in v8.7.0

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

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

func (*GetApiKey) Pretty added in v8.14.0

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

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

func (*GetApiKey) RealmName

func (r *GetApiKey) RealmName(name string) *GetApiKey

RealmName The name of an authentication realm. This parameter cannot be used with either `id` or `name` or when `owner` flag is set to `true`. API name: realm_name

func (*GetApiKey) Username

func (r *GetApiKey) Username(username string) *GetApiKey

Username The username of a user. This parameter cannot be used with either `id` or `name` or when `owner` flag is set to `true`. API name: username

func (*GetApiKey) WithLimitedBy added in v8.5.0

func (r *GetApiKey) WithLimitedBy(withlimitedby bool) *GetApiKey

WithLimitedBy Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. API name: with_limited_by

func (*GetApiKey) WithProfileUid added in v8.14.0

func (r *GetApiKey) WithProfileUid(withprofileuid bool) *GetApiKey

WithProfileUid Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists. API name: with_profile_uid

type NewGetApiKey

type NewGetApiKey func() *GetApiKey

NewGetApiKey type alias for index.

func NewGetApiKeyFunc

func NewGetApiKeyFunc(tp elastictransport.Interface) NewGetApiKey

NewGetApiKeyFunc returns a new instance of GetApiKey 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 {
	ApiKeys []types.ApiKey `json:"api_keys"`
}

Response holds the response body struct for the package getapikey

https://github.com/elastic/elasticsearch-specification/blob/19027dbdd366978ccae41842a040a636730e7c10/specification/security/get_api_key/SecurityGetApiKeyResponse.ts#L22-L24

func NewResponse added in v8.7.0

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