registry

package
v0.0.0-...-2ac3827 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEphemeralDisk = "/dev/xvdc"

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentOptions

type AgentOptions struct {
	// Mbus URI
	Mbus string

	// List of NTP servers
	Ntp []string

	// Blobstore options
	Blobstore BlobstoreOptions

	//The SHA-512 encrypted vcap password
	VcapPassword string
}

AgentOptions are the agent options passed to the the BOSH Agent (http://bosh.io/docs/bosh-components.html#agent).

func (AgentOptions) Validate

func (o AgentOptions) Validate() error

Validate validates the Agent options.

type AgentSettings

type AgentSettings struct {
	// Agent ID
	AgentID string `json:"agent_id"`

	// Blobstore settings
	Blobstore BlobstoreSettings `json:"blobstore"`

	// Disks settings
	Disks DisksSettings `json:"disks"`

	// Environment settings
	Env EnvSettings `json:"env"`

	// Mbus URI
	Mbus string `json:"mbus"`

	// Networks settings
	Networks NetworksSettings `json:"networks"`

	// List of NTP servers
	Ntp []string `json:"ntp"`

	// VM settings
	VM VMSettings `json:"vm"`
}

AgentSettings are the Agent settings for a particular VM.

func NewAgentSettings

func NewAgentSettings(agentID string, vmCID string, networksSettings NetworksSettings, env EnvSettings, agentOptions AgentOptions) AgentSettings

NewAgentSettings creates new agent settings for a VM.

func (AgentSettings) AttachEphemeralDisk

func (as AgentSettings) AttachEphemeralDisk(path string) AgentSettings

AttachPersistentDisk updates the agent settings in order to add an attached persistent disk.

func (AgentSettings) AttachPersistentDisk

func (as AgentSettings) AttachPersistentDisk(diskID string, updateSetting []byte) (AgentSettings, error)

AttachPersistentDisk updates the agent settings in order to add an attached persistent disk.

func (AgentSettings) ConfigureNetworks

func (as AgentSettings) ConfigureNetworks(networksSettings NetworksSettings) AgentSettings

ConfigureNetworks updates the agent settings with the networks settings.

func (AgentSettings) DetachPersistentDisk

func (as AgentSettings) DetachPersistentDisk(diskID string) AgentSettings

DetachPersistentDisk updates the agent settings in order to delete an attached persistent disk.

type BlobstoreOptions

type BlobstoreOptions struct {
	// Blobstore provider
	Provider string

	// Blobstore options
	Options map[string]interface{}
}

BlobstoreOptions are the blobstore options passed to the BOSH Agent (http://bosh.io/docs/bosh-components.html#agent).

func (BlobstoreOptions) Validate

func (o BlobstoreOptions) Validate() error

Validate validates the Blobstore options.

type BlobstoreSettings

type BlobstoreSettings struct {
	// Blobstore provider
	Provider string `json:"provider"`

	// Blobstore options
	Options map[string]interface{} `json:"options"`
}

BlobstoreSettings are the Blobstore settings for a particular VM.

type Client

type Client interface {
	Delete(instanceID string) error
	Fetch(instanceID string) (AgentSettings, error)
	Update(instanceID string, agentSettings AgentSettings) error
	IsExist(instanceID string) (bool, error)
}

Client represents a BOSH Registry Client.

type ClientOptions

type ClientOptions struct {
	// BOSH Registry protocol
	Protocol string `json:"protocol,omitempty"`

	// BOSH Registry hostname
	Address string `json:"address,omitempty"`

	// BOSH Registry port
	Port int `json:"port,omitempty"`

	// BOSH Registry username
	Username string `json:"user,omitempty"`

	// BOSH Registry password
	Password string `json:"password,omitempty"`

	// BOSH Registry TLS options (only when using protocol https)
	TLS ClientTLSOptions `json:"tls,omitempty"`

	Endpoint string `json:"endpoint,omitempty"`

	HTTPOptions HttpRegistryOptions `json:"http,omitempty"`
}

ClientOptions are the options used to create a BOSH Registry client.

func (ClientOptions) EndpointWithCredentials

func (o ClientOptions) EndpointWithCredentials() string

EndpointWithCredentials returns the BOSH Registry endpoint including credentials.

func (ClientOptions) Validate

func (o ClientOptions) Validate() error

Validate validates the Client options.

type ClientTLSOptions

type ClientTLSOptions struct {
	// Certificate file (PEM format)
	CertFile string `json:"certfile,omitempty"`

	// Private key file (PEM format)
	KeyFile string `json:"keyfile,omitempty"`

	// Roor CA certificate file (PEM format)
	CACertFile string `json:"cacertfile,omitempty"`
}

ClientTLSOptions are the TLS options used to create a BOSH Registry client.

func (ClientTLSOptions) Validate

func (o ClientTLSOptions) Validate() error

Validate validates the TLS options.

type DisksSettings

type DisksSettings struct {
	// System disk
	System string `json:"system"`

	// Ephemeral disk
	Ephemeral string `json:"ephemeral"`

	// Persistent disk
	Persistent map[string]PersistentSettings `json:"persistent"`
}

DisksSettings are the Disks settings for a particular VM.

type EnvSettings

type EnvSettings map[string]interface{}

EnvSettings are the Environment settings for a particular VM.

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient represents a BOSH Registry Client.

func NewHTTPClient

func NewHTTPClient(
	options ClientOptions,
	logger logger.Logger,
) HTTPClient

NewHTTPClient creates a new BOSH Registry Client.

func (HTTPClient) Delete

func (c HTTPClient) Delete(instanceID string) error

Delete deletes the instance settings for a given instance ID.

func (HTTPClient) Fetch

func (c HTTPClient) Fetch(instanceID string) (AgentSettings, error)

Fetch gets the agent settings for a given instance ID.

func (HTTPClient) IsExist

func (c HTTPClient) IsExist(instanceID string) (bool, error)

IsExist indicates whether the agent settings for a given instance ID exists w/i empty. Workaround for Bosh::Registry::InstanceNotFound error return 500 simply

func (HTTPClient) Update

func (c HTTPClient) Update(instanceID string, agentSettings AgentSettings) error

Update updates the agent settings for a given instance ID. If there are not already agent settings for the instance, it will create ones.

type HttpRegistryOptions

type HttpRegistryOptions struct {
	Port     int    `json:"port,omitempty"`
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

type ISCSISettings

type ISCSISettings struct {
	InitiatorName string `json:"initiator_name"`
	Target        string `json:"target"`
	Username      string `json:"username"`
	Password      string `json:"password"`
}

type NetworkSettings

type NetworkSettings struct {
	// Network type
	Type string `json:"type"`

	// Network IP address
	IP string `json:"ip"`

	// Network gateway
	Gateway string `json:"gateway"`

	// Network MAC address
	Mac string `json:"mac"`

	// Network netmask
	Netmask string `json:"netmask"`

	// List of DNS servers
	DNS []string `json:"dns"`

	// Does network have DHCP
	DHCP bool `json:"use_dhcp"`

	// List of defaults
	Default []string `json:"default"`

	Alias string `json:"alias,omitempty"`

	Routes Routes `json:"routes,omitempty"`

	// Network cloud properties
	CloudProperties map[string]interface{} `json:"cloud_properties"`
}

NetworkSettings are the Network settings for a particular VM.

type NetworksSettings

type NetworksSettings map[string]NetworkSettings

NetworksSettings are the Networks settings for a particular VM.

type PersistentSettings

type PersistentSettings struct {
	// Persistent disk ID
	ID string `json:"id"`

	// For iscsi setup info
	ISCSISettings ISCSISettings `json:"iscsi_settings"`
}

PersistentSettings are the Persistent Disk settings for a particular VM.

type Route

type Route struct {
	Destination string
	Gateway     string
	NetMask     string
}

type Routes

type Routes []Route

type SoftlayerUserData

type SoftlayerUserData struct {
	Server   SoftlayerUserDataServerName       `json:"server"`
	Registry SoftlayerUserDataRegistryEndpoint `json:"registry"`
	DNS      SoftlayerUserDataDNSItems         `json:"dns,omitempty"`
}

type SoftlayerUserDataDNSItems

type SoftlayerUserDataDNSItems struct {
	NameServer []string `json:"nameserver,omitempty"`
}

type SoftlayerUserDataRegistryEndpoint

type SoftlayerUserDataRegistryEndpoint struct {
	Endpoint string `json:"endpoint"`
}

type SoftlayerUserDataServerName

type SoftlayerUserDataServerName struct {
	Name string `json:"name"`
}

type VMSettings

type VMSettings struct {
	// VM name
	Name string `json:"name"`
}

VMSettings are the VM settings for a particular VM.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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