smartos

package
v0.0.0-...-8f65f1b Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() *schema.Provider

func ReconcileMaps

func ReconcileMaps(oldMap map[string]interface{}, newMap map[string]interface{}, addItem AddItemFunc, updateItem UpdateItemFunc, removeItem RemoveItemFunc, itemsAreEqual ItemEqualFunc) bool

ReconcileMaps compares two maps; one with old data and one with new data and calls the various argument functions reflecting what operations are necessary to transform the old map into the new.

func ReconcileSlices

func ReconcileSlices(oldSlice []string, newSlice []string, addItem AddSliceItemFunc, removeItem RemoveSliceItemFunc) bool

ReconcileSlices compares two slices; one with old data and one with new data and calls the various argument functions reflecting what operations are necessary to transform the old slice into the new.

Types

type AddItemFunc

type AddItemFunc func(string, interface{})

type AddSliceItemFunc

type AddSliceItemFunc func(string)

type Disk

type Disk struct {
	Boot        bool       `json:"boot,omitempty"`
	Compression string     `json:"compression,omitempty"`
	ImageUUID   *uuid.UUID `json:"image_uuid,omitempty"`
	ImageSize   uint32     `json:"image_size,omitempty"`
	Model       string     `json:"model,omitempty"`
	Size        *uint32    `json:"size,omitempty"`
}

type Image

type Image struct {
	NodeName string
	ID       *uuid.UUID `json:"uuid,omitempty"`
	Name     string     `json:"name,omitempty"`
	Version  string     `json:"version,omitempty"`
}

type ItemEqualFunc

type ItemEqualFunc func(interface{}, interface{}) bool

type Machine

type Machine struct {
	NodeName string
	ID       *uuid.UUID `json:"uuid,omitempty"`
	Alias    string     `json:"alias,omitempty"`
	Autoboot *bool      `json:"autoboot,omitempty"`
	Brand    string     `json:"brand,omitempty"`
	CPUCap   *uint32    `json:"cpu_cap,omitempty"`
	/*
		CPUShares                  uint32             `json:"cpu_shares,omitempty"`
	*/
	CustomerMetadata       map[string]string `json:"customer_metadata,omitempty"`
	SetCustomerMetadata    map[string]string `json:"set_customer_metadata,omitempty"`    // for updates
	RemoveCustomerMetadata []string          `json:"remove_customer_metadata,omitempty"` // for updates

	Disks []Disk `json:"disks,omitempty"`

	/*
		DelegateDataset            bool               `json:"delegate_dataset,omitempty"`
		DNSDomain                  string             `json:"dns_domain,omitempty"`
		FirewallEnabled            bool               `json:"firewall_enabled,omitempty"`
		Hostname                   string             `json:"hostname,omitempty"`
	*/
	ImageUUID *uuid.UUID `json:"image_uuid,omitempty"`
	/*
		InternalMetadata           map[string]string  `json:"internal_metadat,omitempty"`
		InternalMetadataNamespaces map[string]string  `json:"internal_metadata_namespaces,omitempty"`
		IndestructableDelegated    bool               `json:"indestructible_delegated,omitempty"`
		IndestructableZoneRoot     bool               `json:"indestructible_zoneroot,omitempty"`
	*/
	KernelVersion     string  `json:"kernel_version,omitempty"`
	MaintainResolvers *bool   `json:"maintain_resolvers,omitempty"`
	MaxPhysicalMemory *uint32 `json:"max_physical_memory,omitempty"`
	/*
		MaxSwap           uint32             `json:"max_swap,omitempty"`
	*/
	NetworkInterfaces []NetworkInterface `json:"nics,omitempty"`
	Quota             *uint32            `json:"quota,omitempty"`
	RAM               *uint32            `json:"ram,omitempty"`
	Resolvers         []string           `json:"resolvers,omitempty"`
	VirtualCPUCount   *uint32            `json:"vcpus,omitempty"`
	State             string             `json:"state,omitempty"`
	PrimaryIP         string             `json:"-"`

	Metadata map[string]string `json:"-"`
}

func (*Machine) LoadFromSchema

func (m *Machine) LoadFromSchema(d *schema.ResourceData) error

func (*Machine) SaveToSchema

func (m *Machine) SaveToSchema(d *schema.ResourceData) error

func (*Machine) UpdateMetadata

func (m *Machine) UpdateMetadata()

func (*Machine) UpdatePrimaryIP

func (m *Machine) UpdatePrimaryIP()

type NetworkInterface

type NetworkInterface struct {
	/*
		AllowDHCPSpoofing     bool     `json:"allow_dhcp_spoofing,omitempty"`
	*/
	AllowIPSpoofing        bool `json:"allow_ip_spoofing"`
	AllowMACSpoofing       bool `json:"allow_mac_spoofing"`
	AllowRestrictedTraffic bool `json:"allow_restricted_traffic"`
	/*
		BlockedOutgoingPorts  []uint16 `json:"blocked_outgoing_ports,omitempty"`
	*/
	Gateways    []string `json:"gateways,omitempty"`
	Interface   string   `json:"interface,omitempty"`
	IPAddresses []string `json:"ips,omitempty"`
	IPAddress   string   `json:"ip,omitempty"`
	/*
		HardwareAddress       string   `json:"mac,omitempty"`
	*/
	Model        string `json:"model,omitempty"`
	Tag          string `json:"nic_tag,omitempty"`
	IsPrimary    *bool  `json:"primary,omitempty"`
	VirtualLANID uint16 `json:"vlan_id,omitempty"`

	/*
		VRRP Support
	*/
	VRRPVRID      *uint32 `json:"vrrp_vrid,omitempty"`
	VRRPPrimaryIP string  `json:"vrrp_primary_ip,omitempty"`
}

type RemoveItemFunc

type RemoveItemFunc func(string)

type RemoveSliceItemFunc

type RemoveSliceItemFunc func(string)

type SmartOSClient

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

func (*SmartOSClient) Close

func (c *SmartOSClient) Close(nodeName string)

func (*SmartOSClient) Connect

func (c *SmartOSClient) Connect(nodeName string) error

func (*SmartOSClient) CreateMachine

func (c *SmartOSClient) CreateMachine(nodeName string, machine *Machine) (*uuid.UUID, error)

func (*SmartOSClient) DeleteMachine

func (c *SmartOSClient) DeleteMachine(nodeName string, id uuid.UUID) error

func (*SmartOSClient) FindRemoteImage

func (c *SmartOSClient) FindRemoteImage(nodeName string, name string, version string) (*Image, error)

func (*SmartOSClient) GetImage

func (c *SmartOSClient) GetImage(nodeName string, name string, version string) (*Image, error)

func (*SmartOSClient) GetLocalImage

func (c *SmartOSClient) GetLocalImage(nodeName string, name string, version string) (*Image, error)

func (*SmartOSClient) GetMachine

func (c *SmartOSClient) GetMachine(nodeName string, id uuid.UUID) (*Machine, error)

func (*SmartOSClient) ImportRemoteImage

func (c *SmartOSClient) ImportRemoteImage(nodeName string, uuid uuid.UUID) error

func (*SmartOSClient) UpdateMachine

func (c *SmartOSClient) UpdateMachine(nodeName string, machine *Machine) error

type UpdateItemFunc

type UpdateItemFunc func(string, interface{})

Jump to

Keyboard shortcuts

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