Documentation ¶
Overview ¶
Updates attributes of an existing API key.
Index ¶
- Variables
- type NewUpdateApiKey
- type Request
- type Response
- type UpdateApiKey
- func (r UpdateApiKey) Do(providedCtx context.Context) (*Response, error)
- func (r *UpdateApiKey) ErrorTrace(errortrace bool) *UpdateApiKey
- func (r *UpdateApiKey) Expiration(duration types.Duration) *UpdateApiKey
- func (r *UpdateApiKey) FilterPath(filterpaths ...string) *UpdateApiKey
- func (r *UpdateApiKey) Header(key, value string) *UpdateApiKey
- func (r *UpdateApiKey) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *UpdateApiKey) Human(human bool) *UpdateApiKey
- func (r *UpdateApiKey) Metadata(metadata types.Metadata) *UpdateApiKey
- func (r UpdateApiKey) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *UpdateApiKey) Pretty(pretty bool) *UpdateApiKey
- func (r *UpdateApiKey) Raw(raw io.Reader) *UpdateApiKey
- func (r *UpdateApiKey) Request(req *Request) *UpdateApiKey
- func (r *UpdateApiKey) RoleDescriptors(roledescriptors map[string]types.RoleDescriptor) *UpdateApiKey
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 NewUpdateApiKey ¶
type NewUpdateApiKey func(id string) *UpdateApiKey
NewUpdateApiKey type alias for index.
func NewUpdateApiKeyFunc ¶
func NewUpdateApiKeyFunc(tp elastictransport.Interface) NewUpdateApiKey
NewUpdateApiKeyFunc returns a new instance of UpdateApiKey with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { // Expiration Expiration time for the API key. Expiration types.Duration `json:"expiration,omitempty"` // Metadata Arbitrary metadata that you want to associate with the API key. It supports // nested data structure. Within the metadata object, keys beginning with _ are // reserved for system usage. Metadata types.Metadata `json:"metadata,omitempty"` // RoleDescriptors An array of role descriptors for this API key. This parameter is optional. // When it is not specified or is an empty array, then the API key will have a // point in time snapshot of permissions of the authenticated user. If you // supply role descriptors then the resultant permissions would be an // intersection of API keys permissions and authenticated user’s permissions // thereby limiting the access scope for API keys. The structure of role // descriptor is the same as the request for create role API. For more details, // see create or update roles API. RoleDescriptors map[string]types.RoleDescriptor `json:"role_descriptors,omitempty"` }
Request holds the request body struct for the package updateapikey
func (*Request) FromJSON ¶ added in v8.5.0
FromJSON allows to load an arbitrary json into the request structure
func (*Request) UnmarshalJSON ¶ added in v8.12.1
type Response ¶ added in v8.7.0
type Response struct { // Updated If `true`, the API key was updated. // If `false`, the API key didn’t change because no change was detected. Updated bool `json:"updated"` }
Response holds the response body struct for the package updateapikey
type UpdateApiKey ¶
type UpdateApiKey struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *UpdateApiKey
Updates attributes of an existing API key.
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html
func (UpdateApiKey) Do ¶
func (r UpdateApiKey) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a updateapikey.Response
func (*UpdateApiKey) ErrorTrace ¶ added in v8.14.0
func (r *UpdateApiKey) ErrorTrace(errortrace bool) *UpdateApiKey
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*UpdateApiKey) Expiration ¶ added in v8.12.1
func (r *UpdateApiKey) Expiration(duration types.Duration) *UpdateApiKey
Expiration Expiration time for the API key. API name: expiration
func (*UpdateApiKey) FilterPath ¶ added in v8.14.0
func (r *UpdateApiKey) FilterPath(filterpaths ...string) *UpdateApiKey
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*UpdateApiKey) Header ¶
func (r *UpdateApiKey) Header(key, value string) *UpdateApiKey
Header set a key, value pair in the UpdateApiKey headers map.
func (*UpdateApiKey) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*UpdateApiKey) Human ¶ added in v8.14.0
func (r *UpdateApiKey) Human(human bool) *UpdateApiKey
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 (*UpdateApiKey) Metadata ¶ added in v8.9.0
func (r *UpdateApiKey) Metadata(metadata types.Metadata) *UpdateApiKey
Metadata Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage. API name: metadata
func (UpdateApiKey) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*UpdateApiKey) Pretty ¶ added in v8.14.0
func (r *UpdateApiKey) Pretty(pretty bool) *UpdateApiKey
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*UpdateApiKey) Raw ¶
func (r *UpdateApiKey) Raw(raw io.Reader) *UpdateApiKey
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*UpdateApiKey) Request ¶
func (r *UpdateApiKey) Request(req *Request) *UpdateApiKey
Request allows to set the request property with the appropriate payload.
func (*UpdateApiKey) RoleDescriptors ¶ added in v8.9.0
func (r *UpdateApiKey) RoleDescriptors(roledescriptors map[string]types.RoleDescriptor) *UpdateApiKey
RoleDescriptors An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API. API name: role_descriptors