client

package
v0.0.0-...-ccbff5b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultHTTPTimeout does exactly what you think it does.
	DefaultHTTPTimeout = 10
	// SkipSSLVerify allows SSL certificate verification to be skipped. This is
	// frowned upon.
	SkipSSLVerify = false
)

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	Endpoint   string
	Username   string
	Password   string
	PrivateKey string
}

APIClient implements the Client interface and communicates with the Agent over HTTPS.

func (APIClient) CreateDeployment

CreateDeployment creates a new deployment from a blueprint.

func (APIClient) DeleteDeployment

func (c APIClient) DeleteDeployment(id string) error

DeleteDeployment deletes a specific deployment.

func (APIClient) DescribeDeployment

func (c APIClient) DescribeDeployment(id string) (agent.DeploymentResponseFull, error)

DescribeDeployment fetches details for a specific deployment.

func (APIClient) GetMetadata

func (c APIClient) GetMetadata() (agent.Metadata, error)

GetMetadata fetches metadata for the agent and adapter.

func (APIClient) ListDeployments

func (c APIClient) ListDeployments() ([]agent.DeploymentResponseLite, error)

ListDeployments fetches a list of deployments.

func (APIClient) RedeployDeployment

func (c APIClient) RedeployDeployment(id string) (agent.DeploymentResponseLite, error)

RedeployDeployment redeploys a specific deployment.

type Client

type Client interface {
	ListDeployments() ([]agent.DeploymentResponseLite, error)
	DescribeDeployment(id string) (agent.DeploymentResponseFull, error)
	CreateDeployment(b agent.DeploymentBlueprint) (agent.DeploymentResponseLite, error)
	RedeployDeployment(id string) (agent.DeploymentResponseLite, error)
	DeleteDeployment(id string) error
	GetMetadata() (agent.Metadata, error)
}

Client represents any struct that can communicate with the Agent.

type RequestError

type RequestError struct {
	StatusCode int
	Body       string
}

A RequestError is a special type of error that will be returned for unexpected HTTP responses.

func (RequestError) Error

func (e RequestError) Error() string

Jump to

Keyboard shortcuts

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