Documentation
¶
Overview ¶
Create or update application privileges.
To use this API, you must have one of the following privileges:
* The `manage_security` cluster privilege (or a greater privilege such as `all`). * The "Manage Application Privileges" global privilege for the application being referenced in the request.
Application names are formed from a prefix, with an optional suffix that conform to the following rules:
* The prefix must begin with a lowercase ASCII letter. * The prefix must contain only ASCII letters or digits. * The prefix must be at least 3 characters long. * If the suffix exists, it must begin with either a dash `-` or `_`. * The suffix cannot contain any of the following characters: `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `*`. * No part of the name can contain whitespace.
Privilege names must begin with a lowercase ASCII letter and must contain only ASCII letters and digits along with the characters `_`, `-`, and `.`.
Action names can contain any number of printable ASCII characters and must contain at least one of the following characters: `/`, `*`, `:`.
Index ¶
- Variables
- type NewPutPrivileges
- type PutPrivileges
- func (r PutPrivileges) Do(providedCtx context.Context) (Response, error)
- func (r *PutPrivileges) ErrorTrace(errortrace bool) *PutPrivileges
- func (r *PutPrivileges) FilterPath(filterpaths ...string) *PutPrivileges
- func (r *PutPrivileges) Header(key, value string) *PutPrivileges
- func (r *PutPrivileges) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutPrivileges) Human(human bool) *PutPrivileges
- func (r PutPrivileges) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PutPrivileges) Pretty(pretty bool) *PutPrivileges
- func (r *PutPrivileges) Raw(raw io.Reader) *PutPrivileges
- func (r *PutPrivileges) Refresh(refresh refresh.Refresh) *PutPrivileges
- func (r *PutPrivileges) Request(req *Request) *PutPrivileges
- type Request
- 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 NewPutPrivileges ¶
type NewPutPrivileges func() *PutPrivileges
NewPutPrivileges type alias for index.
func NewPutPrivilegesFunc ¶
func NewPutPrivilegesFunc(tp elastictransport.Interface) NewPutPrivileges
NewPutPrivilegesFunc returns a new instance of PutPrivileges with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PutPrivileges ¶
type PutPrivileges struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PutPrivileges
Create or update application privileges.
To use this API, you must have one of the following privileges:
* The `manage_security` cluster privilege (or a greater privilege such as `all`). * The "Manage Application Privileges" global privilege for the application being referenced in the request.
Application names are formed from a prefix, with an optional suffix that conform to the following rules:
* The prefix must begin with a lowercase ASCII letter. * The prefix must contain only ASCII letters or digits. * The prefix must be at least 3 characters long. * If the suffix exists, it must begin with either a dash `-` or `_`. * The suffix cannot contain any of the following characters: `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `*`. * No part of the name can contain whitespace.
Privilege names must begin with a lowercase ASCII letter and must contain only ASCII letters and digits along with the characters `_`, `-`, and `.`.
Action names can contain any number of printable ASCII characters and must contain at least one of the following characters: `/`, `*`, `:`.
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html
func (PutPrivileges) Do ¶
func (r PutPrivileges) Do(providedCtx context.Context) (Response, error)
Do runs the request through the transport, handle the response and returns a putprivileges.Response
func (*PutPrivileges) ErrorTrace ¶ added in v8.14.0
func (r *PutPrivileges) ErrorTrace(errortrace bool) *PutPrivileges
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PutPrivileges) FilterPath ¶ added in v8.14.0
func (r *PutPrivileges) FilterPath(filterpaths ...string) *PutPrivileges
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*PutPrivileges) Header ¶
func (r *PutPrivileges) Header(key, value string) *PutPrivileges
Header set a key, value pair in the PutPrivileges headers map.
func (*PutPrivileges) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PutPrivileges) Human ¶ added in v8.14.0
func (r *PutPrivileges) Human(human bool) *PutPrivileges
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 (PutPrivileges) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PutPrivileges) Pretty ¶ added in v8.14.0
func (r *PutPrivileges) Pretty(pretty bool) *PutPrivileges
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*PutPrivileges) Raw ¶
func (r *PutPrivileges) Raw(raw io.Reader) *PutPrivileges
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PutPrivileges) Refresh ¶
func (r *PutPrivileges) Refresh(refresh refresh.Refresh) *PutPrivileges
Refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. API name: refresh
func (*PutPrivileges) Request ¶
func (r *PutPrivileges) Request(req *Request) *PutPrivileges
Request allows to set the request property with the appropriate payload.
type Request ¶ added in v8.11.0
type Request = map[string]map[string]types.PrivilegesActions
Request holds the request body struct for the package putprivileges