es

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MPL-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INDEX_CREATED int = iota
	INDEX_EXISTS
	INDEX_CREATION_FAILED
)
View Source
const DESTINATION_INDEX = ".opendistro-alerting-config"
View Source
const DESTINATION_NAME_FIELD = "destination.name.keyword"
View Source
const DESTINATION_TYPE = "_doc"

Variables

This section is empty.

Functions

func Provider

func Provider() *schema.Provider

func WithHeader

func WithHeader(rt http.RoundTripper) withHeader

Types

type Destination

type Destination struct {
	ID            string      `json:"id"`
	Type          string      `json:"type"`
	Name          string      `json:"name"`
	Slack         interface{} `json:"slack,omitempty"`
	CustomWebhook interface{} `json:"custom_webhook,omitempty"`
	Chime         interface{} `json:"chime,omitempty"`
	SNS           interface{} `json:"sns,omitempty"`
	Email         interface{} `json:"email,omitempty"`
}

type GetPolicyResponse

type GetPolicyResponse struct {
	PolicyID    string                 `json:"_id"`
	Version     int                    `json:"_version"`
	PrimaryTerm int                    `json:"_primary_term"`
	SeqNo       int                    `json:"_seq_no"`
	Policy      map[string]interface{} `json:"policy"`
}

type IndexPermissions

type IndexPermissions struct {
	IndexPatterns         []string `json:"index_patterns"`
	DocumentLevelSecurity string   `json:"dls"`
	FieldLevelSecurity    []string `json:"fls"`
	MaskedFields          []string `json:"masked_fields"`
	AllowedActions        []string `json:"allowed_actions"`
}

type License

type License struct {
	Status             string `json:"status,omitempty"`
	Uid                string `json:"uid,omitempty"`
	Type               string `json:"type,omitempty"`
	IssueDate          string `json:"issue_date,omitempty"`
	IssueDateInMillis  int    `json:"issue_date_in_millis,omitempty"`
	ExpiryDate         string `json:"expiry_date,omitempty"`
	ExpiryDateInMillis int    `json:"expiry_date_in_millis,omitempty"`
	MaxNodes           int    `json:"max_nodes,omitempty"`
	IssuedTo           string `json:"issued_to,omitempty"`
	Issuer             string `json:"issuer,omitempty"`
	StartDateInMillis  int    `json:"start_date_in_millis,omitempty"`
}

type LicenseResponse

type LicenseResponse struct {
	Acknowledged  bool      `json:"acknowledged,omitempty"`
	LicenseStatus string    `json:"license_status,omitempty"`
	Licenses      []License `json:"licenses,omitempty"`
}

type PolicyMapping

type PolicyMapping struct {
	PolicyID string        `json:"policy_id"`
	State    string        `json:"state"`
	IsSafe   bool          `json:"is_safe"`
	Include  []interface{} `json:"include"`
}

type PolicyMappingResponse

type PolicyMappingResponse struct {
	UpdatedIndices int           `json:"updated_indices"`
	Failures       bool          `json:"failures"`
	FailedIndices  []interface{} `json:"failed_indices"`
}

type ProviderConf

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

type PutPolicyResponse

type PutPolicyResponse struct {
	PolicyID    string `json:"_id"`
	Version     int    `json:"_version"`
	PrimaryTerm int    `json:"_primary_term"`
	SeqNo       int    `json:"_seq_no"`
	Policy      struct {
		Policy map[string]interface{} `json:"policy"`
	} `json:"policy"`
}

type PutRoleApplicationPrivileges

type PutRoleApplicationPrivileges struct {
	Application string   `json:"application"`
	Privileges  []string `json:"privileges,omitempty"`
	Resources   []string `json:"resources,omitempty"`
}

type PutRoleBody

type PutRoleBody struct {
	Cluster      []string                       `json:"cluster"`
	Applications []PutRoleApplicationPrivileges `json:"applications,omitempty"`
	Indices      []PutRoleIndicesPermissions    `json:"indices,omitempty"`
	RunAs        []string                       `json:"run_as,omitempty"`
	Global       interface{}                    `json:"global,omitempty"`
	Metadata     interface{}                    `json:"metadata,omitempty"`
}

type PutRoleIndicesPermissions

type PutRoleIndicesPermissions struct {
	Names         []string            `json:"names"`
	Privileges    []string            `json:"privileges"`
	FieldSecurity map[string][]string `json:"field_security,omitempty"`
	Query         interface{}         `json:"query,omitempty"`
}

type PutRoleMappingBody

type PutRoleMappingBody struct {
	Roles    []string    `json:"roles"`
	Enabled  bool        `json:"enabled"`
	Rules    interface{} `json:"rules"`
	Metadata interface{} `json:"metadata,omitempty"`
}

type RoleBody

type RoleBody struct {
	Description        string              `json:"description"`
	ClusterPermissions []string            `json:"cluster_permissions,omitempty"`
	IndexPermissions   []IndexPermissions  `json:"index_permissions,omitempty"`
	TenantPermissions  []TenantPermissions `json:"tenant_permissions,omitempty"`
}

type RoleMappingResponse

type RoleMappingResponse struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

type RoleResponse

type RoleResponse struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

type RolesMapping

type RolesMapping struct {
	BackendRoles    []string `json:"backend_roles"`
	Hosts           []string `json:"hosts"`
	Users           []string `json:"users"`
	Description     string   `json:"description"`
	AndBackendRoles []string `json:"and_backend_roles"`
}

type Script

type Script struct {
	Name   string     `json:"name"`
	Script ScriptBody `json:"script"`
}

type ScriptBody

type ScriptBody struct {
	Language string `json:"lang"`
	Source   string `json:"source"`
}

type ServerFlavor

type ServerFlavor int64
const (
	Unknown ServerFlavor = iota
	Elasticsearch
	ElasticsearchOpenSource
	OpenSearch
)

e.g. elasticsearch, opensearch, elasticsearch-oss, etc.

type TenantBody

type TenantBody struct {
	Description string `json:"description"`
}

type TenantPermissions

type TenantPermissions struct {
	TenantPatterns []string `json:"tenant_patterns"`
	AllowedActions []string `json:"allowed_actions"`
}

type TenantResponse

type TenantResponse struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

type UserBody

type UserBody struct {
	BackendRoles []interface{}          `json:"backend_roles"`
	Attributes   map[string]interface{} `json:"attributes"`
	Description  string                 `json:"description"`
	Password     string                 `json:"password,omitempty"`
	PasswordHash string                 `json:"hash,omitempty"`
}

UserBody used by the odfe's API

type UserResponse

type UserResponse struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

UserResponse sent by the odfe's API

type XPackSecurityApplicationPrivileges

type XPackSecurityApplicationPrivileges struct {
	Application string   `json:"application"`
	Privileges  []string `json:"privileges"`
	Resources   []string `json:"resources"`
}

XPackSecurityApplicationPrivileges is the application privileges object of Elasticsearch

type XPackSecurityIndicesPermissions

type XPackSecurityIndicesPermissions struct {
	Names         []string                 `json:"names"`
	Privileges    []string                 `json:"privileges"`
	FieldSecurity []map[string]interface{} `json:"field_security"`
	Query         string                   `json:"query"`
}

XPackSecurityIndicesPermissions is the indices permission object of Elasticsearch

type XPackSecurityRole

type XPackSecurityRole struct {
	Name         string                               `json:"name"`
	Cluster      []string                             `json:"cluster"`
	Indices      []XPackSecurityIndicesPermissions    `json:"indices"`
	Applications []XPackSecurityApplicationPrivileges `json:"applications"`
	RunAs        []string                             `json:"run_as"`
	Global       string                               `json:"global"`
	Metadata     string                               `json:"metadata"`
}

type XPackSecurityRoleMapping

type XPackSecurityRoleMapping struct {
	Name     string   `json:"name"`
	Roles    []string `json:"roles"`
	Enabled  bool     `json:"enabled"`
	Rules    string   `json:"rules"`
	Metadata string   `json:"metadata"`
}

type XPackSecurityUser

type XPackSecurityUser struct {
	Username     string      `json:"username"`
	Roles        []string    `json:"roles"`
	Fullname     string      `json:"full_name,omitempty"`
	Email        string      `json:"email,omitempty"`
	Metadata     interface{} `json:"metadata,omitempty"`
	Enabled      bool        `json:"enabled,omitempty"`
	Password     string      `json:"password,omitempty"`
	PasswordHash string      `json:"password_hash,omitempty"`
}

XPackSecurityUser is the user object.

we want to define a new struct as the one from elastic has metadata as a map[string]interface{} but we want to manage string only

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL