client

package
v0.8.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2015 License: Apache-2.0 Imports: 21 Imported by: 0

README

Go Pulse Client

Go bindings for Pulse's REST API

Documentation

Index

Constants

View Source
const (
	ContentTypeJSON contentType = iota
	ContentTypeBinary
)

Variables

View Source
var (
	CompressUpload = true

	ErrUnknown     = errors.New("Unknown error calling API")
	ErrNilResponse = errors.New("Nil response from JSON unmarshalling")
	ErrDirNotFile  = errors.New("Provided plugin path is a directory not file")
)
View Source
var (
	ErrAPIResponseMetaType = errors.New("Received an invalid API response (META/TYPE)")
)

Functions

This section is empty.

Types

type AddAgreementResult

type AddAgreementResult struct {
	*rbody.TribeAddAgreement
	Err error
}

type AvailablePlugin

type AvailablePlugin struct {
	*rbody.AvailablePlugin
}

type Client

type Client struct {
	URL     string
	Version string
	// contains filtered or unexported fields
}

func New

func New(url, ver string, insecure bool) *Client

New returns a pointer to a pulse api client if ver is an empty string, v1 is used by default

func (*Client) AddAgreement

func (c *Client) AddAgreement(name string) *AddAgreementResult

func (*Client) CreateTask

func (c *Client) CreateTask(s *Schedule, wf *wmap.WorkflowMap, name string, startTask bool) *CreateTaskResult

func (*Client) DeleteAgreement

func (c *Client) DeleteAgreement(name string) *DeleteAgreementResult

func (*Client) DeletePluginConfig

func (c *Client) DeletePluginConfig(pluginType, name, version string, key string) *DeletePluginConfigResult

DeletePluginConfig removes the plugin config item given the plugin type, name and version.

func (*Client) EnableTask

func (c *Client) EnableTask(id string) *EnableTaskResult

func (*Client) FetchMetrics

func (c *Client) FetchMetrics(ns string, ver int) *GetMetricsResult

func (*Client) GetAgreement

func (c *Client) GetAgreement(name string) *GetAgreementResult

func (*Client) GetMember

func (c *Client) GetMember(name string) *GetMemberResult

func (*Client) GetMetricCatalog

func (c *Client) GetMetricCatalog() *GetMetricsResult

func (*Client) GetPluginConfig

func (c *Client) GetPluginConfig(pluginType, name, version string) *GetPluginConfigResult

GetPluginConfig retrieves the merged plugin config given the type of plugin, name and version. If plugin type, name and version are all empty strings the plugin config for "all" plugins will be returned. If the plugin type is provided and the name and version are empy strings the config for that plugin type will be returned. So on and so forth for the rest of the arguments.

func (*Client) GetPlugins

func (c *Client) GetPlugins(details bool) *GetPluginsResult

func (*Client) GetTask

func (c *Client) GetTask(id string) *GetTaskResult

func (*Client) GetTasks

func (c *Client) GetTasks() *GetTasksResult

func (*Client) JoinAgreement

func (c *Client) JoinAgreement(agreementName, memberName string) *JoinAgreementResult

func (*Client) LeaveAgreement

func (c *Client) LeaveAgreement(agreementName, memberName string) *LeaveAgreementResult

func (*Client) ListAgreements

func (c *Client) ListAgreements() *ListAgreementResult

func (*Client) ListMembers

func (c *Client) ListMembers() *ListMembersResult

func (*Client) LoadPlugin

func (c *Client) LoadPlugin(p []string) *LoadPluginResult

func (*Client) RemoveTask

func (c *Client) RemoveTask(id string) *RemoveTasksResult

func (*Client) SetPluginConfig

func (c *Client) SetPluginConfig(pluginType, name, version string, key string, value ctypes.ConfigValue) *SetPluginConfigResult

SetPluginConfig sets the plugin config given the type, name and version of a plugin. Like GetPluginConfig if the type, name and version are all empty strings the plugin config is set for all plugins. When config data is set it is merged with the existing data if present.

func (*Client) StartTask

func (c *Client) StartTask(id string) *StartTasksResult

func (*Client) StopTask

func (c *Client) StopTask(id string) *StopTasksResult

func (*Client) UnloadPlugin

func (c *Client) UnloadPlugin(pluginType, name string, version int) *UnloadPluginResult

func (*Client) WatchTask

func (c *Client) WatchTask(id string) *WatchTasksResult

type CreateTaskResult

type CreateTaskResult struct {
	*rbody.AddScheduledTask
	Err error
}

type DeleteAgreementResult

type DeleteAgreementResult struct {
	*rbody.TribeDeleteAgreement
	Err error
}

type DeletePluginConfigResult

type DeletePluginConfigResult struct {
	*rbody.DeletePluginConfigItem
	Err error
}

type EnableTaskResult

type EnableTaskResult struct {
	*rbody.ScheduledTaskEnabled
	Err error
}

type GetAgreementResult

type GetAgreementResult struct {
	*rbody.TribeGetAgreement
	Err error
}

type GetMemberResult

type GetMemberResult struct {
	*rbody.TribeMemberShow
	Err error
}

type GetMetricResult

type GetMetricResult struct {
	Metric *rbody.Metric
	Err    error
}

type GetMetricsResult

type GetMetricsResult struct {
	Catalog []*rbody.Metric
	Err     error
}

func (*GetMetricsResult) Len

func (g *GetMetricsResult) Len() int

type GetPluginConfigResult

type GetPluginConfigResult struct {
	*rbody.PluginConfigItem
	Err error
}

type GetPluginsResult

type GetPluginsResult struct {
	LoadedPlugins    []LoadedPlugin
	AvailablePlugins []AvailablePlugin
	Err              error
}

type GetTaskResult

type GetTaskResult struct {
	*rbody.ScheduledTaskReturned
	Err error
}

type GetTasksResult

type GetTasksResult struct {
	*rbody.ScheduledTaskListReturned
	Err error
}

type JoinAgreementResult

type JoinAgreementResult struct {
	*rbody.TribeJoinAgreement
	Err error
}

type LeaveAgreementResult

type LeaveAgreementResult struct {
	*rbody.TribeLeaveAgreement
	Err error
}

type ListAgreementResult

type ListAgreementResult struct {
	*rbody.TribeListAgreement
	Err error
}

type ListMembersResult

type ListMembersResult struct {
	*rbody.TribeMemberList
	Err error
}

type LoadPluginResult

type LoadPluginResult struct {
	LoadedPlugins []LoadedPlugin
	Err           perror.PulseError
}

type LoadedPlugin

type LoadedPlugin struct {
	*rbody.LoadedPlugin
}

We wrap this so we can provide some functionality (like LoadedTime)

func (*LoadedPlugin) LoadedTime

func (l *LoadedPlugin) LoadedTime() time.Time

type RemoveTasksResult

type RemoveTasksResult struct {
	*rbody.ScheduledTaskRemoved
	Err error
}

type Schedule

type Schedule struct {
	Type      string
	Interval  string
	StartTime *time.Time
	StopTime  *time.Time
}

type SetPluginConfigResult

type SetPluginConfigResult struct {
	*rbody.SetPluginConfigItem
	Err error
}

type StartTasksResult

type StartTasksResult struct {
	*rbody.ScheduledTaskStarted
	Err error
}

type StopTasksResult

type StopTasksResult struct {
	*rbody.ScheduledTaskStopped
	Err error
}

type UnloadPluginResult

type UnloadPluginResult struct {
	*rbody.PluginUnloaded
	Err error
}

UnloadPluginResponse is the response from pulse/client on an UnloadPlugin call.

type WatchTasksResult

type WatchTasksResult struct {
	Err       error
	EventChan chan *rbody.StreamedTaskEvent
	DoneChan  chan struct{}
	// contains filtered or unexported fields
}

func (*WatchTasksResult) Close

func (w *WatchTasksResult) Close()

Jump to

Keyboard shortcuts

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