agentclient

package
v0.0.0-...-9a89ba0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2014 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentRequest

func NewAgentRequest(endpoint string, httpClient bmhttpclient.HTTPClient, uuid string) agentRequest

func NewGetStateRetryable

func NewGetStateRetryable(agentClient AgentClient) bmretrystrategy.Retryable

func NewPingRetryable

func NewPingRetryable(agentClient AgentClient) bmretrystrategy.Retryable

Types

type AgentClient

type AgentClient interface {
	Ping() (string, error)
	Stop() error
	Apply(bmas.ApplySpec) error
	Start() error
	GetState() (State, error)
}

func NewAgentClient

func NewAgentClient(
	endpoint string,
	uuid string,
	getTaskDelay time.Duration,
	httpClient bmhttpclient.HTTPClient,
	logger boshlog.Logger,
) AgentClient

type AgentRequestMessage

type AgentRequestMessage struct {
	Method    string        `json:"method"`
	Arguments []interface{} `json:"arguments"`
	ReplyTo   string        `json:"reply_to"`
}

type Factory

type Factory interface {
	Create(string) AgentClient
}

func NewAgentClientFactory

func NewAgentClientFactory(
	deploymentUUID string,
	getTaskDelay time.Duration,
	logger boshlog.Logger,
) Factory

type Response

type Response interface {
	Unmarshal([]byte) error
	GetException() exceptionResponse
}

type SimpleTaskResponse

type SimpleTaskResponse struct {
	Value     string
	Exception exceptionResponse
}

func (*SimpleTaskResponse) GetException

func (r *SimpleTaskResponse) GetException() exceptionResponse

func (*SimpleTaskResponse) Unmarshal

func (r *SimpleTaskResponse) Unmarshal(message []byte) error

type State

type State struct {
	JobState string `json:"job_state"`
}

type StateResponse

type StateResponse struct {
	Value     State
	Exception exceptionResponse
}

func (*StateResponse) GetException

func (r *StateResponse) GetException() exceptionResponse

func (*StateResponse) Unmarshal

func (r *StateResponse) Unmarshal(message []byte) error

type TaskResponse

type TaskResponse struct {
	Value     interface{}
	Exception exceptionResponse
}

func (*TaskResponse) GetException

func (r *TaskResponse) GetException() exceptionResponse

func (*TaskResponse) TaskID

func (r *TaskResponse) TaskID() (string, error)

func (*TaskResponse) TaskState

func (r *TaskResponse) TaskState() (string, error)

TaskState returns the state of the task reported by agent.

Agent response to get_task can be in different format based on task state. If task state is running agent responds with value as { agent_task_id: "task-id", state: "running" } Otherwise the value is a string like "stopped".

func (*TaskResponse) Unmarshal

func (r *TaskResponse) Unmarshal(message []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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