bosh

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Username string
	Password string
	Token    string
}

type CPU

type CPU struct {
	Sys  string `json:"sys"`
	User string `json:"user"`
	Wait string `json:"wait"`
}

CPU struct

type Client

type Client struct {
	UAAClient *uaa.Client
	// contains filtered or unexported fields
}

Client used to communicate with BOSH

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient returns a new client

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(manifest string, auth Auth) (task Task, err error)

CreateDeployment from given BOSH

func (*Client) DoAuthRequest

func (c *Client) DoAuthRequest(r *request, auth Auth) ([]byte, error)

DoAuthRequest runs a request with our client

func (*Client) DoAuthRequestRaw

func (c *Client) DoAuthRequestRaw(r *request, auth Auth) (*http.Response, error)

DoAuthRequestRaw runs a request with our client

func (*Client) DoRequest

func (c *Client) DoRequest(r *request) (*http.Response, error)

func (*Client) GetDeployment

func (c *Client) GetDeployment(name string, auth Auth) (manifest Manifest, err error)

GetDeployment from given BOSH

func (*Client) GetDeploymentVMs

func (c *Client) GetDeploymentVMs(name string, auth Auth) (vms []VM, err error)

GetDeploymentVMs from given BOSH

func (*Client) GetDeployments

func (c *Client) GetDeployments(auth Auth) (deployments []Deployment, err error)

GetDeployments from given BOSH

func (*Client) GetInfo

func (c *Client) GetInfo() (info Info, err error)

GetInfo returns BOSH Info

func (*Client) GetPasswordToken added in v0.2.3

func (c *Client) GetPasswordToken(username, password string) (tokenResp uaa.TokenResp, err error)

GetPasswordToken from UAA

func (*Client) GetReleases

func (c *Client) GetReleases(auth Auth) (releases []Release, err error)

GetReleases from given BOSH

func (*Client) GetRunningTasks

func (c *Client) GetRunningTasks(auth Auth) (tasks []Task, err error)

GetRunningTasks from given BOSH

func (*Client) GetStemcells

func (c *Client) GetStemcells(auth Auth) (stemcells []Stemcell, err error)

GetStemcells from given BOSH

func (*Client) GetTask

func (c *Client) GetTask(id int, auth Auth) (task Task, err error)

GetTask from given BOSH

func (*Client) GetTaskResult

func (c *Client) GetTaskResult(id int, auth Auth) (output []string)

GetTaskResult from given BOSH

func (*Client) GetTasks

func (c *Client) GetTasks(auth Auth) (tasks []Task, err error)

GetTasks from given BOSH

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string) *request

NewRequest is used to create a new request

func (*Client) SSH

func (c *Client) SSH(sshRequest SSHRequest, auth Auth) (sshResponses []SSHResponse, err error)

SSH from given BOSH

func (*Client) WaitForTaskResult

func (c *Client) WaitForTaskResult(id int, auth Auth) (output []string)

WaitForTaskResult from given BOSH

type Config

type Config struct {
	BOSHAddress string
	UAA         struct {
		ClientID     string
		ClientSecret string
	}
	HttpClient        *http.Client
	SkipSslValidation bool
}

Config is used to configure the creation of a client

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig configuration for client

type Deployment

type Deployment struct {
	Name        string     `json:"name"`
	CloudConfig string     `json:"cloud_config"`
	Releases    []Resource `json:"releases"`
	Stemcells   []Resource `json:"stemcells"`
}

Deployment struct

type Disk

type Disk struct {
	Ephemeral DiskStats `json:"ephemeral"`
	System    DiskStats `json:"system"`
}

Disk struct

type DiskStats

type DiskStats struct {
	Percent      string `json:"percent"`
	InodePercent string `json:"inode_percent"`
}

DiskStats struct

type Info

type Info struct {
	Name              string            `json:"name"`
	UUID              string            `json:"uuid"`
	Version           string            `json:"version"`
	User              string            `json:"user"`
	CPI               string            `json:"cpi"`
	UserAuthenication UserAuthenication `json:"user_authentication"`
}

Info struct

type Manifest

type Manifest struct {
	Manifest string `json:"manifest"`
}

Manifest struct

type Memory

type Memory struct {
	Percent string `json:"percent"`
	KB      string `json:"KB"`
}

Memory struct

type Params

type Params struct {
	User      string `json:"user"`
	Password  string `json:"password"`
	PublicKey string `json:"public_key"`
}

Params struct

type Release

type Release struct {
	Name            string           `json:"name"`
	ReleaseVersions []ReleaseVersion `json:"release_versions"`
}

Release struct

type ReleaseVersion

type ReleaseVersion struct {
	Version            string   `json:"version"`
	CommitHash         string   `json:"commit_hash"`
	UncommittedChanges bool     `json:"uncommitted_changes"`
	CurrentlyDeployed  bool     `json:"currently_deployed"`
	JobNames           []string `json:"job_names"`
}

ReleaseVersion struct

type Resource

type Resource struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

Resource struct

type SSHRequest

type SSHRequest struct {
	Command        string            `json:"command"`
	DeploymentName string            `json:"deployment_name"`
	Target         Target            `json:"target"`
	Params         map[string]string `json:"params"`
}

SSHRequest struct

type SSHResponse

type SSHResponse struct {
	Status string

	Job   string
	Index *int
	ID    string

	IP            string
	HostPublicKey string `json:"host_public_key"`

	GatewayUser string `json:"gateway_user"`
	GatewayHost string `json:"gateway_host"`
}

SSHResponse struct

type Stemcell

type Stemcell struct {
	Name            string `json:"name"`
	OperatingSystem string `json:"operating_system"`
	Version         string `json:"version"`
	CID             string `json:"cid"`
	Deployments     []struct {
		Name string `json:"name"`
	} `json:"deployments"`
}

Stemcell struct

type Target

type Target struct {
	Job     string   `json:"job"`
	Indexes []string `json:"indexes"`
	Ids     []string `json:"ids"`
}

Target struct

type Task

type Task struct {
	ID          int    `json:"id"`
	State       string `json:"state"`
	Description string `json:"description"`
	Timestamp   int    `json:"timestamp"`
	Result      string `json:"result"`
	User        string `json:"user"`
}

Task struct

type UserAuthenication

type UserAuthenication struct {
	Type    string `json:"type"`
	Options struct {
		URL string `json:"url"`
	} `json:"options"`
}

UserAuthenication struct

type VM

type VM struct {
	AgentID           string   `json:"agent_id"`
	VMCID             string   `json:"vm_cid"`
	CID               string   `json:"cid"`
	JobName           string   `json:"job_name"`
	JobState          string   `json:"job_state"`
	Index             int      `json:"index"`
	IPs               []string `json:"ips"`
	DNS               []string `json:"dns"`
	ResurectionPaused bool     `json:"resurrection_paused"`
	Vitals            Vitals   `json:"vitals"`
	ID                string   `json:"id"`
}

VM struct

type Vitals

type Vitals struct {
	Disk Disk     `json:"disk"`
	Load []string `json:"load"`
	Mem  Memory   `json:"mem"`
	Swap Memory   `json:"swap"`
	CPU  CPU      `json:"cpu"`
}

Vitals struct

Jump to

Keyboard shortcuts

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