client

package
v0.0.0-...-97f813d Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodGet    = "GET"
	MethodPost   = "POST"
	MethodPut    = "PUT"
	MethodPatch  = "PATCH"
	MethodDelete = "DELETE"
)

Declare constants for service package

Variables

This section is empty.

Functions

func NewSplunkdHTTPClient

func NewSplunkdHTTPClient(timeout time.Duration, skipValidateTLS bool) *http.Client

NewSplunkdHTTPClient returns a HTTP Client with timeout and tls validation setup

Types

type Client

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

A Client is used to communicate with Splunkd endpoints

func NewDefaultSplunkdClient

func NewDefaultSplunkdClient() *Client

NewDefaultSplunkdClient creates a Client with default values

func NewSplunkdClient

func NewSplunkdClient(sessionKey string, auth [2]string, host string, httpClient *http.Client) *Client

NewSplunkdClient creates a Client with custom values passed in

func NewSplunkdClientWithAuthToken

func NewSplunkdClientWithAuthToken(authToken string, auth [2]string, host string, httpClient *http.Client) *Client

NewSplunkdClient creates a Client with custom values passed in

func (*Client) BuildSplunkURL

func (c *Client) BuildSplunkURL(queryValues url.Values, urlPathParts ...string) url.URL

func (*Client) CreateAdminSAMLGroups

func (client *Client) CreateAdminSAMLGroups(name string, adminSAMLGroupsObject *models.AdminSAMLGroupsObject) error

func (*Client) CreateAppsLocalObject

func (client *Client) CreateAppsLocalObject(app string, localAppObject *models.AppsLocalObject) error

func (*Client) CreateAuthenticationUser

func (client *Client) CreateAuthenticationUser(name string, authenticationUserObject *models.AuthenticationUserObject) error

func (*Client) CreateAuthorizationRoles

func (client *Client) CreateAuthorizationRoles(name string, authorizationRolesObject *models.AuthorizationRolesObject) error

func (*Client) CreateClusterManager

func (client *Client) CreateClusterManager(name string, clusterManagerObj *models.ClusterManagerObject) error

func (*Client) CreateConfigsConfObject

func (client *Client) CreateConfigsConfObject(name string, owner string, app string, configsConfConfigObj *models.ConfigsConfObject) error

func (*Client) CreateGlobalHttpEventCollectorObject

func (client *Client) CreateGlobalHttpEventCollectorObject(httpInputConfigObj models.GlobalHttpEventCollectorObject) error

func (*Client) CreateHttpEventCollectorObject

func (client *Client) CreateHttpEventCollectorObject(name string, owner string, app string, httpInputConfigObj *models.HttpEventCollectorObject) error

func (*Client) CreateIndexObject

func (client *Client) CreateIndexObject(name string, owner string, app string, indexConfigObj *models.IndexObject) error

func (*Client) CreateMonitorInput

func (client *Client) CreateMonitorInput(name string, owner string, app string, inputsMonitorObject *models.InputsMonitorObject) error

func (*Client) CreateSavedSearches

func (client *Client) CreateSavedSearches(name, owner, app string, savedSearchObject *models.SavedSearchObject) error

func (*Client) CreateScriptedInput

func (client *Client) CreateScriptedInput(name string, owner string, app string, inputsScriptObject *models.InputsScriptObject) error

func (*Client) CreateSplunkTCPTokenInput

func (client *Client) CreateSplunkTCPTokenInput(owner string, app string, inputsSplunkTCPTokenObject *models.InputsSplunkTCPTokenObject) error

func (*Client) CreateTCPCookedInput

func (client *Client) CreateTCPCookedInput(name string, owner string, app string, inputsTCPCookedObject *models.InputsTCPCookedObject) error

func (*Client) CreateTCPDefaultOutput

func (client *Client) CreateTCPDefaultOutput(name string, owner string, app string, outputsTCPDefaultObject *models.OutputsTCPDefaultObject) error

func (*Client) CreateTCPGroupOutput

func (client *Client) CreateTCPGroupOutput(name string, owner string, app string, outputsTCPGroupObject *models.OutputsTCPGroupObject) error

func (*Client) CreateTCPRawInput

func (client *Client) CreateTCPRawInput(name string, owner string, app string, inputsTCPRawObject *models.InputsTCPRawObject) error

func (*Client) CreateTCPSSLInput

func (client *Client) CreateTCPSSLInput(inputsTCPSSLObject *models.InputsTCPSSLObject) error

func (*Client) CreateTCPServerOutput

func (client *Client) CreateTCPServerOutput(name string, owner string, app string, outputsTCPServerObject *models.OutputsTCPServerObject) error

func (*Client) CreateTCPSyslogOutput

func (client *Client) CreateTCPSyslogOutput(name string, owner string, app string, outputsTCPSyslogObject *models.OutputsTCPSyslogObject) error

func (*Client) CreateUDPInput

func (client *Client) CreateUDPInput(name string, owner string, app string, inputsUDPObject *models.InputsUDPObject) error

func (*Client) Delete

func (c *Client) Delete(deleteURL url.URL) (*http.Response, error)

Delete implements HTTP DELETE call

func (*Client) DeleteAdminSAMLGroups

func (client *Client) DeleteAdminSAMLGroups(name string) (*http.Response, error)

func (*Client) DeleteAppsLocalObject

func (client *Client) DeleteAppsLocalObject(app string) (*http.Response, error)

func (*Client) DeleteAuthenticationUser

func (client *Client) DeleteAuthenticationUser(name string) (*http.Response, error)

func (*Client) DeleteAuthorizationRoles

func (client *Client) DeleteAuthorizationRoles(name string) (*http.Response, error)

func (*Client) DeleteClusterManager

func (client *Client) DeleteClusterManager(name string) (*http.Response, error)

func (*Client) DeleteConfigsConfObject

func (client *Client) DeleteConfigsConfObject(name, owner, app string) (*http.Response, error)

func (*Client) DeleteHttpEventCollectorObject

func (client *Client) DeleteHttpEventCollectorObject(name, owner, app string) (*http.Response, error)

func (*Client) DeleteIndexObject

func (client *Client) DeleteIndexObject(name, owner, app string) (*http.Response, error)

func (*Client) DeleteMonitorInput

func (client *Client) DeleteMonitorInput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteSavedSearches

func (client *Client) DeleteSavedSearches(name, owner, app string) (*http.Response, error)

func (*Client) DeleteScriptedInput

func (client *Client) DeleteScriptedInput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteSplunkTCPTokenInput

func (client *Client) DeleteSplunkTCPTokenInput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteTCPCookedInput

func (client *Client) DeleteTCPCookedInput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteTCPDefaultOutput

func (client *Client) DeleteTCPDefaultOutput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteTCPGroupOutput

func (client *Client) DeleteTCPGroupOutput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteTCPRawInput

func (client *Client) DeleteTCPRawInput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteTCPServerOutput

func (client *Client) DeleteTCPServerOutput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteTCPSyslogOutput

func (client *Client) DeleteTCPSyslogOutput(name, owner, app string) (*http.Response, error)

func (*Client) DeleteUDPInput

func (client *Client) DeleteUDPInput(name, owner, app string) (*http.Response, error)

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do sends out request and returns HTTP response

func (*Client) DoRequest

func (c *Client) DoRequest(method string, requestURL url.URL, body interface{}) (*http.Response, error)

DoRequest creates and execute a new request

func (*Client) EncodeObject

func (c *Client) EncodeObject(content interface{}) ([]byte, error)

EncodeObject encodes an object into url-encoded string

func (*Client) EncodeRequestBody

func (c *Client) EncodeRequestBody(content interface{}) ([]byte, error)

EncodeRequestBody takes a json string or object and serializes it to be used in request body

func (*Client) Get

func (c *Client) Get(getURL url.URL) (*http.Response, error)

Get implements HTTP Get call

func (*Client) Login

func (c *Client) Login() (e error)

func (*Client) Move

func (client *Client) Move(owner, app, name string, acl *models.ACLObject, resources ...string) error

func (*Client) NewRequest

func (c *Client) NewRequest(httpMethod, url string, body io.Reader) (*http.Request, error)

NewRequest creates a new HTTP Request and set proper header

func (*Client) Patch

func (c *Client) Patch(patchURL url.URL, body interface{}) (*http.Response, error)

Patch implements HTTP Patch call

func (*Client) Post

func (c *Client) Post(postURL url.URL, body interface{}) (*http.Response, error)

Post implements HTTP POST call

func (*Client) Put

func (c *Client) Put(putURL url.URL, body interface{}) (*http.Response, error)

Put implements HTTP PUT call

func (*Client) ReadAdminSAMLGroups

func (client *Client) ReadAdminSAMLGroups(name string) (*http.Response, error)

func (*Client) ReadAllAppsLocalObject

func (client *Client) ReadAllAppsLocalObject() (*http.Response, error)

func (*Client) ReadAllAuthorizationRoles

func (client *Client) ReadAllAuthorizationRoles() (*http.Response, error)

services/authorization/roles

func (*Client) ReadAllConfigsConfObject

func (client *Client) ReadAllConfigsConfObject(name string) (*http.Response, error)

func (*Client) ReadAllHttpEventCollectorObject

func (client *Client) ReadAllHttpEventCollectorObject() (*http.Response, error)

services/data/inputs/http

func (*Client) ReadAllIndexObject

func (client *Client) ReadAllIndexObject() (*http.Response, error)

func (*Client) ReadAllSavedSearches

func (client *Client) ReadAllSavedSearches() (*http.Response, error)

services/saved/searches

func (*Client) ReadAppsLocalObject

func (client *Client) ReadAppsLocalObject(app string) (*http.Response, error)

func (*Client) ReadAuthenticationUser

func (client *Client) ReadAuthenticationUser(name, owner, app string) (*http.Response, error)

func (*Client) ReadAuthenticationUsers

func (client *Client) ReadAuthenticationUsers() (*http.Response, error)

services/authentication/users

func (*Client) ReadAuthorizationRoles

func (client *Client) ReadAuthorizationRoles(name, owner, app string) (*http.Response, error)

func (*Client) ReadClusterManager

func (client *Client) ReadClusterManager(name string) (*http.Response, error)

func (*Client) ReadConfigsConfObject

func (client *Client) ReadConfigsConfObject(name, owner, app string) (*http.Response, error)

func (*Client) ReadGlobalHttpEventCollectorObject

func (client *Client) ReadGlobalHttpEventCollectorObject() (*http.Response, error)

func (*Client) ReadHttpEventCollectorObject

func (client *Client) ReadHttpEventCollectorObject(name, owner, app string) (*http.Response, error)

func (*Client) ReadIndexObject

func (client *Client) ReadIndexObject(name, owner, app string) (*http.Response, error)

func (*Client) ReadMonitorInput

func (client *Client) ReadMonitorInput(name, owner, app string) (*http.Response, error)

func (*Client) ReadMonitorInputs

func (client *Client) ReadMonitorInputs() (*http.Response, error)

services/data/inputs/monitor

func (*Client) ReadSavedSearches

func (client *Client) ReadSavedSearches(name, owner, app string) (*http.Response, error)

func (*Client) ReadScriptedInput

func (client *Client) ReadScriptedInput(name, owner, app string) (*http.Response, error)

func (*Client) ReadScriptedInputs

func (client *Client) ReadScriptedInputs() (*http.Response, error)

services/data/inputs/script

func (*Client) ReadSplunkTCPTokenInput

func (client *Client) ReadSplunkTCPTokenInput(name, owner, app string) (*http.Response, error)

func (*Client) ReadSplunkTCPTokenInputs

func (client *Client) ReadSplunkTCPTokenInputs() (*http.Response, error)

services/data/inputs/tcp/splunktcptoken

func (*Client) ReadTCPCookedInput

func (client *Client) ReadTCPCookedInput(name, owner, app string) (*http.Response, error)

func (*Client) ReadTCPCookedInputs

func (client *Client) ReadTCPCookedInputs() (*http.Response, error)

services/data/inputs/tcp/cooked

func (*Client) ReadTCPDefaultOutput

func (client *Client) ReadTCPDefaultOutput(name, owner, app string) (*http.Response, error)

func (*Client) ReadTCPDefaultOutputs

func (client *Client) ReadTCPDefaultOutputs() (*http.Response, error)

services/data/outputs/tcp/default

func (*Client) ReadTCPGroupOutput

func (client *Client) ReadTCPGroupOutput(name, owner, app string) (*http.Response, error)

func (*Client) ReadTCPGroupOutputs

func (client *Client) ReadTCPGroupOutputs() (*http.Response, error)

services/data/outputs/tcp/group

func (*Client) ReadTCPRawInput

func (client *Client) ReadTCPRawInput(name, owner, app string) (*http.Response, error)

func (*Client) ReadTCPRawInputs

func (client *Client) ReadTCPRawInputs() (*http.Response, error)

services/data/inputs/tcp/raw

func (*Client) ReadTCPSSLInput

func (client *Client) ReadTCPSSLInput() (*http.Response, error)

func (*Client) ReadTCPSSLInputs

func (client *Client) ReadTCPSSLInputs() (*http.Response, error)

func (*Client) ReadTCPServerOutput

func (client *Client) ReadTCPServerOutput(name, owner, app string) (*http.Response, error)

func (*Client) ReadTCPServerOutputs

func (client *Client) ReadTCPServerOutputs() (*http.Response, error)

services/data/outputs/tcp/server

func (*Client) ReadTCPSyslogOutput

func (client *Client) ReadTCPSyslogOutput(name, owner, app string) (*http.Response, error)

func (*Client) ReadTCPSyslogOutputs

func (client *Client) ReadTCPSyslogOutputs() (*http.Response, error)

services/data/outputs/tcp/syslog

func (*Client) ReadUDPInput

func (client *Client) ReadUDPInput(name, owner, app string) (*http.Response, error)

func (*Client) ReadUDPInputs

func (client *Client) ReadUDPInputs() (*http.Response, error)

services/data/inputs/udp

func (*Client) SplitConfStanza

func (client *Client) SplitConfStanza(name string) (conf string, stanza string)

Takes a '/' separated string and returns the 0, 1 indexed strings from the split

func (*Client) UpdateAcl

func (client *Client) UpdateAcl(owner, app, name string, acl *models.ACLObject, resources ...string) error

func (*Client) UpdateAdminSAMLGroups

func (client *Client) UpdateAdminSAMLGroups(name string, adminSAMLGroupsObject *models.AdminSAMLGroupsObject) error

func (*Client) UpdateAppsLocalObject

func (client *Client) UpdateAppsLocalObject(app string, localAppObject *models.AppsLocalObject) error

func (*Client) UpdateAuthenticationUser

func (client *Client) UpdateAuthenticationUser(name string, authenticationUserObject *models.AuthenticationUserObject) error

func (*Client) UpdateAuthorizationRoles

func (client *Client) UpdateAuthorizationRoles(name string, authorizationRolesObject *models.AuthorizationRolesObject) error

func (*Client) UpdateClusterManager

func (client *Client) UpdateClusterManager(name string, ClusterManagerObject *models.ClusterManagerObject) error

func (*Client) UpdateConfigsConfObject

func (client *Client) UpdateConfigsConfObject(name string, owner string, app string, configsConfConfigObj *models.ConfigsConfObject) error

func (*Client) UpdateGlobalHttpEventCollectorObject

func (client *Client) UpdateGlobalHttpEventCollectorObject(httpInputConfigObj models.GlobalHttpEventCollectorObject) error

func (*Client) UpdateHttpEventCollectorObject

func (client *Client) UpdateHttpEventCollectorObject(name string, owner string, app string, httpInputConfigObj *models.HttpEventCollectorObject) error

func (*Client) UpdateIndexObject

func (client *Client) UpdateIndexObject(name string, owner string, app string, indexConfigObj *models.IndexObject) error

func (*Client) UpdateMonitorInput

func (client *Client) UpdateMonitorInput(name string, owner string, app string, inputsMonitorObject *models.InputsMonitorObject) error

func (*Client) UpdateSavedSearches

func (client *Client) UpdateSavedSearches(name string, owner string, app string, savedSearchObject *models.SavedSearchObject) error

func (*Client) UpdateScriptedInput

func (client *Client) UpdateScriptedInput(name string, owner string, app string, inputsScriptObject *models.InputsScriptObject) error

func (*Client) UpdateSplunkTCPTokenInput

func (client *Client) UpdateSplunkTCPTokenInput(name string, owner string, app string, inputsSplunkTCPTokenObject *models.InputsSplunkTCPTokenObject) error

func (*Client) UpdateTCPCookedInput

func (client *Client) UpdateTCPCookedInput(name string, owner string, app string, inputsTCPCookedObject *models.InputsTCPCookedObject) error

func (*Client) UpdateTCPDefaultOutput

func (client *Client) UpdateTCPDefaultOutput(name string, owner string, app string, outputsTCPDefaultObject *models.OutputsTCPDefaultObject) error

func (*Client) UpdateTCPGroupOutput

func (client *Client) UpdateTCPGroupOutput(name string, owner string, app string, outputsTCPGroupObject *models.OutputsTCPGroupObject) error

func (*Client) UpdateTCPRawInput

func (client *Client) UpdateTCPRawInput(name string, owner string, app string, inputsTCPRawObject *models.InputsTCPRawObject) error

func (*Client) UpdateTCPSSLInput

func (client *Client) UpdateTCPSSLInput(name string, inputsTCPSSLObject *models.InputsTCPSSLObject) error

func (*Client) UpdateTCPServerOutput

func (client *Client) UpdateTCPServerOutput(name string, owner string, app string, outputsTCPServerObject *models.OutputsTCPServerObject) error

func (*Client) UpdateTCPSyslogOutput

func (client *Client) UpdateTCPSyslogOutput(name string, owner string, app string, outputsTCPSyslogObject *models.OutputsTCPSyslogObject) error

func (*Client) UpdateUDPInput

func (client *Client) UpdateUDPInput(name string, owner string, app string, inputsUDPObject *models.InputsUDPObject) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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