Documentation ¶
Overview ¶
Find roles with a query.
Get roles in a paginated manner. You can optionally filter the results with a query.
Index ¶
- Variables
- type NewQueryRole
- type QueryRole
- func (r QueryRole) Do(providedCtx context.Context) (*Response, error)
- func (r *QueryRole) ErrorTrace(errortrace bool) *QueryRole
- func (r *QueryRole) FilterPath(filterpaths ...string) *QueryRole
- func (r *QueryRole) From(from int) *QueryRole
- func (r *QueryRole) Header(key, value string) *QueryRole
- func (r *QueryRole) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *QueryRole) Human(human bool) *QueryRole
- func (r QueryRole) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *QueryRole) Pretty(pretty bool) *QueryRole
- func (r *QueryRole) Query(query *types.RoleQueryContainer) *QueryRole
- func (r *QueryRole) Raw(raw io.Reader) *QueryRole
- func (r *QueryRole) Request(req *Request) *QueryRole
- func (r *QueryRole) SearchAfter(sortresults ...types.FieldValue) *QueryRole
- func (r *QueryRole) Size(size int) *QueryRole
- func (r *QueryRole) Sort(sorts ...types.SortCombinations) *QueryRole
- 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 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 ¶
func New(tp elastictransport.Interface) *QueryRole
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 ¶
Do runs the request through the transport, handle the response and returns a queryrole.Response
func (*QueryRole) ErrorTrace ¶
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*QueryRole) FilterPath ¶
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*QueryRole) From ¶
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) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*QueryRole) Human ¶
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 ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*QueryRole) Pretty ¶
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 ¶
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 ¶
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
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
func (*Request) UnmarshalJSON ¶
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