bulkdeleterole

package
v8.17.0 Latest Latest
Warning

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

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

Documentation

Overview

Bulk delete roles.

The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk delete roles API cannot delete 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 BulkDeleteRole

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

func New

Bulk delete roles.

The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk delete roles API cannot delete roles that are defined in roles files.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html

func (BulkDeleteRole) Do

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

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

func (*BulkDeleteRole) ErrorTrace

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

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

func (*BulkDeleteRole) FilterPath

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

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

func (*BulkDeleteRole) Header

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

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

func (*BulkDeleteRole) HttpRequest

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

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

func (*BulkDeleteRole) Human

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

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 (*BulkDeleteRole) Names

func (r *BulkDeleteRole) Names(names ...string) *BulkDeleteRole

Names An array of role names to delete API name: names

func (BulkDeleteRole) Perform

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

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

func (*BulkDeleteRole) Pretty

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

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

func (*BulkDeleteRole) Raw

func (r *BulkDeleteRole) Raw(raw io.Reader) *BulkDeleteRole

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*BulkDeleteRole) Refresh

func (r *BulkDeleteRole) Refresh(refresh refresh.Refresh) *BulkDeleteRole

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 (*BulkDeleteRole) Request

func (r *BulkDeleteRole) Request(req *Request) *BulkDeleteRole

Request allows to set the request property with the appropriate payload.

type NewBulkDeleteRole

type NewBulkDeleteRole func() *BulkDeleteRole

NewBulkDeleteRole type alias for index.

func NewBulkDeleteRoleFunc

func NewBulkDeleteRoleFunc(tp elastictransport.Interface) NewBulkDeleteRole

NewBulkDeleteRoleFunc returns a new instance of BulkDeleteRole 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 {

	// Names An array of role names to delete
	Names []string `json:"names"`
}

Request holds the request body struct for the package bulkdeleterole

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/security/bulk_delete_role/SecurityBulkDeleteRoleRequest.ts#L23-L43

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 {

	// Deleted Array of deleted roles
	Deleted []string `json:"deleted,omitempty"`
	// Errors Present if any deletes resulted in errors
	Errors *types.BulkError `json:"errors,omitempty"`
	// NotFound Array of roles that could not be found
	NotFound []string `json:"not_found,omitempty"`
}

Response holds the response body struct for the package bulkdeleterole

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/security/bulk_delete_role/SecurityBulkDeleteRoleResponse.ts#L22-L37

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