Documentation
¶
Overview ¶
Bulk create or update roles.
The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk create or update roles API cannot update roles that are defined in roles files.
Index ¶
- Variables
- type BulkPutRole
- func (r BulkPutRole) Do(providedCtx context.Context) (*Response, error)
- func (r *BulkPutRole) ErrorTrace(errortrace bool) *BulkPutRole
- func (r *BulkPutRole) FilterPath(filterpaths ...string) *BulkPutRole
- func (r *BulkPutRole) Header(key, value string) *BulkPutRole
- func (r *BulkPutRole) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *BulkPutRole) Human(human bool) *BulkPutRole
- func (r BulkPutRole) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *BulkPutRole) Pretty(pretty bool) *BulkPutRole
- func (r *BulkPutRole) Raw(raw io.Reader) *BulkPutRole
- func (r *BulkPutRole) Refresh(refresh refresh.Refresh) *BulkPutRole
- func (r *BulkPutRole) Request(req *Request) *BulkPutRole
- func (r *BulkPutRole) Roles(roles map[string]types.RoleDescriptor) *BulkPutRole
- type NewBulkPutRole
- 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 BulkPutRole ¶
type BulkPutRole struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *BulkPutRole
Bulk create or update roles.
The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk create or update roles API cannot update roles that are defined in roles files.
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html
func (BulkPutRole) Do ¶
func (r BulkPutRole) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a bulkputrole.Response
func (*BulkPutRole) ErrorTrace ¶
func (r *BulkPutRole) ErrorTrace(errortrace bool) *BulkPutRole
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*BulkPutRole) FilterPath ¶
func (r *BulkPutRole) FilterPath(filterpaths ...string) *BulkPutRole
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*BulkPutRole) Header ¶
func (r *BulkPutRole) Header(key, value string) *BulkPutRole
Header set a key, value pair in the BulkPutRole headers map.
func (*BulkPutRole) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*BulkPutRole) Human ¶
func (r *BulkPutRole) Human(human bool) *BulkPutRole
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 (BulkPutRole) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*BulkPutRole) Pretty ¶
func (r *BulkPutRole) Pretty(pretty bool) *BulkPutRole
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*BulkPutRole) Raw ¶
func (r *BulkPutRole) Raw(raw io.Reader) *BulkPutRole
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*BulkPutRole) Refresh ¶
func (r *BulkPutRole) Refresh(refresh refresh.Refresh) *BulkPutRole
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 (*BulkPutRole) Request ¶
func (r *BulkPutRole) Request(req *Request) *BulkPutRole
Request allows to set the request property with the appropriate payload.
func (*BulkPutRole) Roles ¶
func (r *BulkPutRole) Roles(roles map[string]types.RoleDescriptor) *BulkPutRole
Roles A dictionary of role name to RoleDescriptor objects to add or update API name: roles
type NewBulkPutRole ¶
type NewBulkPutRole func() *BulkPutRole
NewBulkPutRole type alias for index.
func NewBulkPutRoleFunc ¶
func NewBulkPutRoleFunc(tp elastictransport.Interface) NewBulkPutRole
NewBulkPutRoleFunc returns a new instance of BulkPutRole 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 { // Roles A dictionary of role name to RoleDescriptor objects to add or update Roles map[string]types.RoleDescriptor `json:"roles"` }
Request holds the request body struct for the package bulkputrole
type Response ¶
type Response struct { // Created Array of created roles Created []string `json:"created,omitempty"` // Errors Present if any updates resulted in errors Errors *types.BulkError `json:"errors,omitempty"` // Noop Array of role names without any changes Noop []string `json:"noop,omitempty"` // Updated Array of updated roles Updated []string `json:"updated,omitempty"` }
Response holds the response body struct for the package bulkputrole