Documentation ¶
Index ¶
- func EncodeURLParams(url string, params url.Values) string
- func MakeURL(defaultScheme string, defaultPath string, rawURL string, defaultPort int) (string, error)
- func ParseURL(raw string, hints ...ParseHint) (*url.URL, error)
- type Agent
- type Client
- func NewClientWithConfig(config *ClientConfig, binaryName, version, commit, buildtime string) (*Client, error)
- func NewClientWithConfigDefault(config *ClientConfig, defaultPort int, ...) (*Client, error)
- func NewKibanaClient(cfg *config.C, binaryName, version, commit, buildtime string) (*Client, error)
- func (client *Client) Close() error
- func (client *Client) CreateEnrollmentAPIKey(request CreateEnrollmentAPIKeyRequest) (*CreateEnrollmentAPIKeyResponse, error)
- func (client *Client) CreatePolicy(request CreatePolicyRequest) (*CreatePolicyResponse, error)
- func (client *Client) GetVersion() version.V
- func (client *Client) ImportMultiPartFormFile(url string, params url.Values, filename string, contents string) error
- func (client *Client) ListAgents(request ListAgentsRequest) (*ListAgentsResponse, error)
- func (client *Client) UnEnrollAgent(request UnEnrollAgentRequest) (*UnEnrollAgentResponse, error)
- func (client *Client) UpgradeAgent(request UpgradeAgentRequest) (*UpgradeAgentResponse, error)
- type ClientConfig
- type Connection
- func (conn *Connection) Request(method, extraPath string, params url.Values, headers http.Header, ...) (int, []byte, error)
- func (conn *Connection) RoundTrip(r *http.Request) (*http.Response, error)
- func (conn *Connection) Send(method, extraPath string, params url.Values, headers http.Header, ...) (*http.Response, error)
- func (conn *Connection) SendWithContext(ctx context.Context, method, extraPath string, params url.Values, ...) (*http.Response, error)
- type CreateEnrollmentAPIKeyRequest
- type CreateEnrollmentAPIKeyResponse
- type CreatePolicyRequest
- type CreatePolicyResponse
- type ListAgentsRequest
- type ListAgentsResponse
- type MonitoringEnabledOption
- type ParseHint
- type UnEnrollAgentRequest
- type UnEnrollAgentResponse
- type UpgradeAgentRequest
- type UpgradeAgentResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Connection // contains filtered or unexported fields }
func NewClientWithConfig ¶
func NewClientWithConfig(config *ClientConfig, binaryName, version, commit, buildtime string) (*Client, error)
NewClientWithConfig creates and returns a kibana client using the given config
func NewClientWithConfigDefault ¶
func NewClientWithConfigDefault(config *ClientConfig, defaultPort int, binaryName, version, commit, buildtime string) (*Client, error)
NewClientWithConfig creates and returns a kibana client using the given config
func NewKibanaClient ¶
NewKibanaClient builds and returns a new Kibana client
func (*Client) CreateEnrollmentAPIKey ¶ added in v0.3.8
func (client *Client) CreateEnrollmentAPIKey(request CreateEnrollmentAPIKeyRequest) (*CreateEnrollmentAPIKeyResponse, error)
func (*Client) CreatePolicy ¶ added in v0.3.8
func (client *Client) CreatePolicy(request CreatePolicyRequest) (*CreatePolicyResponse, error)
func (*Client) GetVersion ¶
GetVersion returns the version read from kibana. The version is not set if IgnoreVersion was set when creating the client.
func (*Client) ImportMultiPartFormFile ¶
func (*Client) ListAgents ¶ added in v0.3.8
func (client *Client) ListAgents(request ListAgentsRequest) (*ListAgentsResponse, error)
func (*Client) UnEnrollAgent ¶ added in v0.3.8
func (client *Client) UnEnrollAgent(request UnEnrollAgentRequest) (*UnEnrollAgentResponse, error)
func (*Client) UpgradeAgent ¶ added in v0.3.8
func (client *Client) UpgradeAgent(request UpgradeAgentRequest) (*UpgradeAgentResponse, error)
type ClientConfig ¶
type ClientConfig struct { Protocol string `config:"protocol" yaml:"protocol,omitempty"` Host string `config:"host" yaml:"host,omitempty"` Path string `config:"path" yaml:"path,omitempty"` SpaceID string `config:"space.id" yaml:"space.id,omitempty"` Username string `config:"username" yaml:"username,omitempty"` Password string `config:"password" yaml:"password,omitempty"` APIKey string `config:"api_key" yaml:"api_key,omitempty"` ServiceToken string `config:"service_token" yaml:"service_token,omitempty"` // Headers holds headers to include in every request sent to Kibana. Headers map[string]string `config:"headers" yaml:"headers,omitempty"` IgnoreVersion bool Transport httpcommon.HTTPTransportSettings `config:",inline" yaml:",inline"` }
ClientConfig to connect to Kibana
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
DefaultClientConfig connects to a locally running kibana over HTTP
func (*ClientConfig) Validate ¶
func (c *ClientConfig) Validate() error
type Connection ¶
type Connection struct { URL string Username string Password string APIKey string ServiceToken string Headers http.Header HTTP *http.Client Version version.V }
func (*Connection) Send ¶
func (conn *Connection) Send(method, extraPath string, params url.Values, headers http.Header, body io.Reader) (*http.Response, error)
Sends an application/json request to Kibana with appropriate kbn headers
func (*Connection) SendWithContext ¶
func (conn *Connection) SendWithContext(ctx context.Context, method, extraPath string, params url.Values, headers http.Header, body io.Reader) (*http.Response, error)
SendWithContext sends an application/json request to Kibana with appropriate kbn headers and the given context.
type CreateEnrollmentAPIKeyRequest ¶ added in v0.3.8
type CreateEnrollmentAPIKeyResponse ¶ added in v0.3.8
type CreatePolicyRequest ¶ added in v0.3.8
type CreatePolicyRequest struct { ID string `json:"id"` Name string `json:"name"` Namespace string `json:"namespace"` Description string `json:"description"` MonitoringEnabled []MonitoringEnabledOption `json:"monitoring_enabled"` }
type CreatePolicyResponse ¶ added in v0.3.8
type CreatePolicyResponse struct { ID string `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description"` Namespace string `json:"namespace"` IsManaged bool `json:"is_managed"` Status string `json:"status"` MonitoringEnabled []MonitoringEnabledOption `json:"monitoring_enabled"` }
type ListAgentsRequest ¶ added in v0.3.8
type ListAgentsRequest struct { }
type ListAgentsResponse ¶ added in v0.3.8
type ListAgentsResponse struct {
Items []Agent `json:"items"`
}
type MonitoringEnabledOption ¶ added in v0.3.8
type MonitoringEnabledOption string
const ( MonitoringEnabledLogs MonitoringEnabledOption = "logs" MonitoringEnabledMetrics MonitoringEnabledOption = "metrics" )
type ParseHint ¶
func WithDefaultScheme ¶
type UnEnrollAgentRequest ¶ added in v0.3.8
type UnEnrollAgentResponse ¶ added in v0.3.8
type UnEnrollAgentResponse struct { }
type UpgradeAgentRequest ¶ added in v0.3.8
type UpgradeAgentResponse ¶ added in v0.3.8
type UpgradeAgentResponse struct { }
Click to show internal directories.
Click to hide internal directories.