queryrole

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: 12 Imported by: 0

Documentation

Overview

Find roles with a query.

Get roles in a paginated manner. You can optionally filter the results with a query.

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 NewQueryRole

type NewQueryRole func() *QueryRole

NewQueryRole type alias for index.

func NewQueryRoleFunc

func NewQueryRoleFunc(tp elastictransport.Interface) NewQueryRole

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

type QueryRole

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

func New

Find roles with a query.

Get roles in a paginated manner. You can optionally filter the results with a query.

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

func (QueryRole) Do

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

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

func (*QueryRole) ErrorTrace

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

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

func (*QueryRole) FilterPath

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

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

func (*QueryRole) From

func (r *QueryRole) From(from int) *QueryRole

From Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the `search_after` parameter. API name: from

func (*QueryRole) Header

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

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

func (*QueryRole) HttpRequest

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

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

func (*QueryRole) Human

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

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 (QueryRole) Perform

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

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

func (*QueryRole) Pretty

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

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

func (*QueryRole) Query

func (r *QueryRole) Query(query *types.RoleQueryContainer) *QueryRole

Query A query to filter which roles to return. If the query parameter is missing, it is equivalent to a `match_all` query. The query supports a subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`, `ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`. You can query the following information associated with roles: `name`, `description`, `metadata`, `applications.application`, `applications.privileges`, `applications.resources`. API name: query

func (*QueryRole) Raw

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

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

func (*QueryRole) Request

func (r *QueryRole) Request(req *Request) *QueryRole

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

func (*QueryRole) SearchAfter

func (r *QueryRole) SearchAfter(sortresults ...types.FieldValue) *QueryRole

SearchAfter Search after definition API name: search_after

func (*QueryRole) Size

func (r *QueryRole) Size(size int) *QueryRole

Size The number of hits to return. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter. API name: size

func (*QueryRole) Sort

func (r *QueryRole) Sort(sorts ...types.SortCombinations) *QueryRole

Sort All public fields of a role are eligible for sorting. In addition, sort can also be applied to the `_doc` field to sort by index order. API name: sort

type Request

type Request struct {

	// From Starting document offset.
	// By default, you cannot page through more than 10,000 hits using the from and
	// size parameters.
	// To page through more hits, use the `search_after` parameter.
	From *int `json:"from,omitempty"`
	// Query A query to filter which roles to return.
	// If the query parameter is missing, it is equivalent to a `match_all` query.
	// The query supports a subset of query types, including `match_all`, `bool`,
	// `term`, `terms`, `match`,
	// `ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`.
	// You can query the following information associated with roles: `name`,
	// `description`, `metadata`,
	// `applications.application`, `applications.privileges`,
	// `applications.resources`.
	Query *types.RoleQueryContainer `json:"query,omitempty"`
	// SearchAfter Search after definition
	SearchAfter []types.FieldValue `json:"search_after,omitempty"`
	// Size The number of hits to return.
	// By default, you cannot page through more than 10,000 hits using the `from`
	// and `size` parameters.
	// To page through more hits, use the `search_after` parameter.
	Size *int `json:"size,omitempty"`
	// Sort All public fields of a role are eligible for sorting.
	// In addition, sort can also be applied to the `_doc` field to sort by index
	// order.
	Sort []types.SortCombinations `json:"sort,omitempty"`
}

Request holds the request body struct for the package queryrole

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/security/query_role/QueryRolesRequest.ts#L25-L69

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

func (*Request) UnmarshalJSON

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

type Response

type Response struct {

	// Count The number of roles returned in the response.
	Count int `json:"count"`
	// Roles The list of roles.
	Roles []types.QueryRole `json:"roles"`
	// Total The total number of roles found.
	Total int `json:"total"`
}

Response holds the response body struct for the package queryrole

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/security/query_role/QueryRolesResponse.ts#L23-L38

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