bulkputrole

package
v8.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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

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 BulkPutRole

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

func New

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

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

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

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

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

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/security/bulk_put_role/SecurityBulkPutRoleRequest.ts#L25-L45

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

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

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/security/bulk_put_role/SecurityBulkPutRoleResponse.ts#L22-L41

func NewResponse

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