putrolemapping

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: 4

Documentation

Overview

Create or update role mappings.

Role mappings define which roles are assigned to each user. Each mapping has rules that identify users and a list of roles that are granted to those users. The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The create or update role mappings API cannot update role mappings that are defined in role mapping files.

This API does not create roles. Rather, it maps users to existing roles. Roles can be created by using the create or update roles API or 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 NewPutRoleMapping

type NewPutRoleMapping func(name string) *PutRoleMapping

NewPutRoleMapping type alias for index.

func NewPutRoleMappingFunc

func NewPutRoleMappingFunc(tp elastictransport.Interface) NewPutRoleMapping

NewPutRoleMappingFunc returns a new instance of PutRoleMapping with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type PutRoleMapping

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

func New

Create or update role mappings.

Role mappings define which roles are assigned to each user. Each mapping has rules that identify users and a list of roles that are granted to those users. The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The create or update role mappings API cannot update role mappings that are defined in role mapping files.

This API does not create roles. Rather, it maps users to existing roles. Roles can be created by using the create or update roles API or roles files.

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

func (PutRoleMapping) Do

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

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

func (*PutRoleMapping) Enabled added in v8.9.0

func (r *PutRoleMapping) Enabled(enabled bool) *PutRoleMapping

API name: enabled

func (*PutRoleMapping) ErrorTrace added in v8.14.0

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

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

func (*PutRoleMapping) FilterPath added in v8.14.0

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

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

func (*PutRoleMapping) Header

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

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

func (*PutRoleMapping) HttpRequest

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

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

func (*PutRoleMapping) Human added in v8.14.0

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

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 (*PutRoleMapping) Metadata added in v8.9.0

func (r *PutRoleMapping) Metadata(metadata types.Metadata) *PutRoleMapping

API name: metadata

func (PutRoleMapping) Perform added in v8.7.0

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

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

func (*PutRoleMapping) Pretty added in v8.14.0

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

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

func (*PutRoleMapping) Raw

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

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

func (*PutRoleMapping) Refresh

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

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

func (r *PutRoleMapping) Request(req *Request) *PutRoleMapping

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

func (*PutRoleMapping) RoleTemplates added in v8.12.0

func (r *PutRoleMapping) RoleTemplates(roletemplates ...types.RoleTemplate) *PutRoleMapping

API name: role_templates

func (*PutRoleMapping) Roles added in v8.9.0

func (r *PutRoleMapping) Roles(roles ...string) *PutRoleMapping

API name: roles

func (*PutRoleMapping) Rules added in v8.9.0

API name: rules

func (*PutRoleMapping) RunAs added in v8.9.0

func (r *PutRoleMapping) RunAs(runas ...string) *PutRoleMapping

API name: run_as

type Request

type Request struct {
	Enabled       *bool                  `json:"enabled,omitempty"`
	Metadata      types.Metadata         `json:"metadata,omitempty"`
	RoleTemplates []types.RoleTemplate   `json:"role_templates,omitempty"`
	Roles         []string               `json:"roles,omitempty"`
	Rules         *types.RoleMappingRule `json:"rules,omitempty"`
	RunAs         []string               `json:"run_as,omitempty"`
}

Request holds the request body struct for the package putrolemapping

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts#L25-L56

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

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

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON added in v8.12.1

func (s *Request) UnmarshalJSON(data []byte) error

type Response added in v8.7.0

type Response struct {
	Created     *bool               `json:"created,omitempty"`
	RoleMapping types.CreatedStatus `json:"role_mapping"`
}

Response holds the response body struct for the package putrolemapping

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/security/put_role_mapping/SecurityPutRoleMappingResponse.ts#L22-L24

func NewResponse added in v8.7.0

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