Documentation
¶
Index ¶
- func NewAgentRequest(endpoint string, httpClient bmhttpclient.HTTPClient, uuid string) agentRequest
- func NewGetStateRetryable(agentClient AgentClient) bmretrystrategy.Retryable
- func NewPingRetryable(agentClient AgentClient) bmretrystrategy.Retryable
- type AgentClient
- type AgentRequestMessage
- type Factory
- type Response
- type SimpleTaskResponse
- type State
- type StateResponse
- type TaskResponse
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 Factory ¶
type Factory interface {
Create(string) AgentClient
}
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 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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.