registry

package
v46.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* Copyright (C) 2017-2019 Alibaba Group Holding Limited *

* Copyright (C) 2017-2019 Alibaba Group Holding Limited

* Copyright (C) 2017-2019 Alibaba Group Holding Limited

* Copyright (C) 2017-2019 Alibaba Group Holding Limited

* Copyright (C) 2017-2019 Alibaba Group Holding Limited *

Index

Constants

This section is empty.

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
}

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 Env `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 Env, agentOptions AgentOptions) AgentSettings

NewAgentSettings creates new agent settings for a VM.

func (AgentSettings) AttachPersistentDisk

func (as AgentSettings) AttachPersistentDisk(diskID string, volumeID string, path string) AgentSettings

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 BoshEnv

type BoshEnv struct {
	Password              string                 `json:"password"`
	KeepRootPassword      bool                   `json:"keep_root_password"`
	RemoveDevTools        bool                   `json:"remove_dev_tools"`
	RemoveStaticLibraries bool                   `json:"remove_static_libraries"`
	AuthorizedKeys        []string               `json:"authorized_keys"`
	SwapSizeInMB          *uint64                `json:"swap_size"`
	Mbus                  MBus                   `json:"mbus"`
	IPv6                  IPv6                   `json:"ipv6"`
	Blobstores            []BlobstoreSettings    `json:"blobstores"`
	NTP                   []string               `json:"ntp"`
	Tags                  map[string]interface{} `json:"tags"`
	Group                 string                 `json:"group"`
}

type CertKeyPair

type CertKeyPair struct {
	CA          string `json:"ca"`
	PrivateKey  string `json:"private_key"`
	Certificate string `json:"certificate"`
}

type Client

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

Client represents a BOSH Registry Client.

type ClientOptions

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

	// BOSH Registry hostname
	Host string `json:"host,omitempty"`

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

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

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

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

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

func (ClientOptions) Endpoint

func (o ClientOptions) Endpoint() string

Endpoint returns the BOSH Registry endpoint.

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 {
	// If the Client must skip the verification of the server certificates
	InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`

	// 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]interface{} `json:"persistent"`
}

DisksSettings are the Disks settings for a particular VM.

type Env

type Env struct {
	Bosh             BoshEnv `json:"bosh"`
	PersistentDiskFS string  `json:"persistent_disk_fs"`
}

func UnmarshalEnvSettings

func UnmarshalEnvSettings(env apiv1.VMEnv) (Env, error)

type HTTPClient

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

HTTPClient represents a BOSH Registry Client.

func NewHTTPClient

func NewHTTPClient(
	options ClientOptions,
	logger boshlog.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) GetOptions

func (c HTTPClient) GetOptions() ClientOptions

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 IPv6

type IPv6 struct {
	Enable bool `json:"enable"`
}

type MBus

type MBus struct {
	Cert CertKeyPair `json:"cert"`
	URLs []string    `json:"urls"`
}

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"`

	// 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"`

	// Persistent disk volume ID
	VolumeID string `json:"volume_id"`

	// Persistent disk path
	Path string `json:"path"`
}

PersistentSettings are the Persistent Disk settings for a particular VM.

type VMSettings

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

VMSettings are the VM settings for a particular VM.

Jump to

Keyboard shortcuts

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