Documentation ¶
Overview ¶
Adds and updates roles in the native realm.
Index ¶
- Variables
- type NewPutRole
- type PutRole
- func (r PutRole) Do(ctx context.Context) (*http.Response, error)
- func (r *PutRole) Header(key, value string) *PutRole
- func (r *PutRole) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutRole) Name(v string) *PutRole
- func (r *PutRole) Raw(raw json.RawMessage) *PutRole
- func (r *PutRole) Refresh(enum refresh.Refresh) *PutRole
- func (r *PutRole) Request(req *Request) *PutRole
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) Applications(applications []types.ApplicationPrivilegesBuilder) *RequestBuilder
- func (rb *RequestBuilder) Build() *Request
- func (rb *RequestBuilder) Cluster(cluster ...clusterprivilege.ClusterPrivilege) *RequestBuilder
- func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
- func (rb *RequestBuilder) Global(value map[string]interface{}) *RequestBuilder
- func (rb *RequestBuilder) Indices(indices []types.IndicesPrivilegesBuilder) *RequestBuilder
- func (rb *RequestBuilder) Metadata(metadata *types.MetadataBuilder) *RequestBuilder
- func (rb *RequestBuilder) RunAs(run_as ...string) *RequestBuilder
- func (rb *RequestBuilder) TransientMetadata(transientmetadata *types.TransientMetadataConfigBuilder) *RequestBuilder
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 NewPutRole ¶
NewPutRole type alias for index.
func NewPutRoleFunc ¶
func NewPutRoleFunc(tp elastictransport.Interface) NewPutRole
NewPutRoleFunc returns a new instance of PutRole with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PutRole ¶
type PutRole struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PutRole
Adds and updates roles in the native realm.
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html
func (*PutRole) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PutRole) Raw ¶
func (r *PutRole) Raw(raw json.RawMessage) *PutRole
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
type Request ¶
type Request struct { // Applications A list of application privilege entries. Applications []types.ApplicationPrivileges `json:"applications,omitempty"` // Cluster A list of cluster privileges. These privileges define the cluster-level // actions for users with this role. Cluster []clusterprivilege.ClusterPrivilege `json:"cluster,omitempty"` // Global An object defining global privileges. A global privilege is a form of cluster // privilege that is request-aware. Support for global privileges is currently // limited to the management of application privileges. Global map[string]interface{} `json:"global,omitempty"` // Indices A list of indices permissions entries. Indices []types.IndicesPrivileges `json:"indices,omitempty"` // Metadata Optional metadata. Within the metadata object, keys that begin with an // underscore (`_`) are reserved for system use. Metadata *types.Metadata `json:"metadata,omitempty"` // RunAs A list of users that the owners of this role can impersonate. RunAs []string `json:"run_as,omitempty"` // TransientMetadata Indicates roles that might be incompatible with the current cluster license, // specifically roles with document and field level security. When the cluster // license doesn’t allow certain features for a given role, this parameter is // updated dynamically to list the incompatible features. If `enabled` is // `false`, the role is ignored, but is still listed in the response from the // authenticate API. TransientMetadata *types.TransientMetadataConfig `json:"transient_metadata,omitempty"` }
Request holds the request body struct for the package putrole
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is the builder API for the putrole.Request
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder
func (*RequestBuilder) Applications ¶
func (rb *RequestBuilder) Applications(applications []types.ApplicationPrivilegesBuilder) *RequestBuilder
func (*RequestBuilder) Build ¶
func (rb *RequestBuilder) Build() *Request
Build finalize the chain and returns the Request struct.
func (*RequestBuilder) Cluster ¶
func (rb *RequestBuilder) Cluster(cluster ...clusterprivilege.ClusterPrivilege) *RequestBuilder
func (*RequestBuilder) FromJSON ¶
func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
FromJSON allows to load an arbitrary json into the request structure
func (*RequestBuilder) Global ¶
func (rb *RequestBuilder) Global(value map[string]interface{}) *RequestBuilder
func (*RequestBuilder) Indices ¶
func (rb *RequestBuilder) Indices(indices []types.IndicesPrivilegesBuilder) *RequestBuilder
func (*RequestBuilder) Metadata ¶
func (rb *RequestBuilder) Metadata(metadata *types.MetadataBuilder) *RequestBuilder
func (*RequestBuilder) RunAs ¶
func (rb *RequestBuilder) RunAs(run_as ...string) *RequestBuilder
func (*RequestBuilder) TransientMetadata ¶
func (rb *RequestBuilder) TransientMetadata(transientmetadata *types.TransientMetadataConfigBuilder) *RequestBuilder