api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	// GetName returns the name of the cluster
	GetName() string
	// Start starts the cluster
	Start() error
	// Stop stops the cluster
	Stop() error
	// GetState returns the current state of the cluster
	GetState() (ClusterState.Enum, error)
	// GetNetworkID returns the ID of the network used by the cluster
	GetNetworkID() string
	// AddNode adds a node
	AddNode(bool, *pb.HostDefinition) (string, error)
	// AddNodes adds several nodes
	AddNodes(int, bool, *pb.HostDefinition) ([]string, error)
	// DeleteLastNode deletes a node
	DeleteLastNode(bool) error
	// DeleteSpecificNode deletes a node identified by its ID
	DeleteSpecificNode(string) error
	// ListMasterIDs lists the IDs of masters (if there is such masters in the flavor...)
	ListMasterIDs() []string
	// ListMasterIPs lists the IPs of masters (if there is such masters in the flavor...)
	ListMasterIPs() []string
	// FindAvailableMaster returns ID of the first master available to execute order
	FindAvailableMaster() (string, error)
	// ListNodeIDs lists IDs of the nodes in the cluster
	ListNodeIDs(bool) []string
	// ListNodeIPs lists the IPs of the nodes in the cluster
	ListNodeIPs(bool) []string
	// FindAvailableNode returns ID of the first node available to execute order
	FindAvailableNode(bool) (string, error)
	// SearchNode tells if the ID of the host passed as parameter is a node
	SearchNode(string, bool) bool
	// GetNode returns a node based on its ID
	GetNode(string) (*pb.Host, error)
	// CountNodes counts the nodes of the cluster
	CountNodes(bool) uint
	// Delete allows to destroy infrastructure of cluster
	Delete() error
	// GetConfig ...
	GetConfig() ClusterCore
	// GetExtension returns additional info about parameter
	GetExtension(Extension.Enum) interface{}
	// SetExtension sets the content of additional info
	SetExtension(Extension.Enum, interface{})
}

Cluster is an interface of methods associated to Cluster-like structs

type ClusterCore

type ClusterCore struct {
	// Name is the name of the cluster
	Name string `json:"name"`
	// CIDR is the network CIDR wanted for the Network
	CIDR string `json:"cidr"`
	// Flavor tells what kind of cluster it is
	Flavor Flavor.Enum `json:"flavor"`
	// Mode is the mode of cluster; can be Simple, HighAvailability, HighVolume
	Complexity Complexity.Enum `json:"complexity"`
	// Keypair contains the key-pair used inside the Cluster
	Keypair *model.KeyPair `json:"keypair,omitempty"`
	// State of the cluster
	State ClusterState.Enum `json:"state,omitempty"`
	// Tenant is the name of the tenant
	Tenant string `json:"tenant"`
	// NetworkID is the ID of the network to use
	NetworkID string `json:"network_id"`
	// GatewayIP is the IP of the gateway of the network
	GatewayIP string `json:"gateway_ip,omitempty"`
	// PublicNodedIDs is a slice of host IDs of the public cluster nodes
	PublicNodeIDs []string `json:"public_node_ids,omitempty"`
	// PrivateNodedIDs is a slice of host IDs of the private cluster nodes
	PrivateNodeIDs []string `json:"private_node_ids,omitempty"`
	// AdminPassword contains the password of cladm account. This password
	// is used to connect via Guacamole, but can't be used with SSH
	AdminPassword string `json:"admin_password"`
	// PublicIP is the IP address to reach the cluster (ie the public IP address of the network gateway)
	PublicIP string `json:"public_ip"`
	// NodesDef keeps the default node definition
	NodesDef pb.HostDefinition `json:"nodes_def"`
	// DisabledFeatures keeps track of features normally automatically added with cluster creation,
	// but explicitely disabled; if a disabled feature is added, must be removed from this property
	DisabledFeatures map[string]struct{} `json:"disabled_features"`
	// Extensions contains additional info about the cluster
	Extensions ExtensionMap `json:"infos,omitempty"`
}

ClusterCore contains the bare minimum information about a cluster

func (*ClusterCore) CountNodes

func (c *ClusterCore) CountNodes(public bool) uint

CountNodes returns the number of public or private nodes in the cluster

func (*ClusterCore) Deserialize

func (c *ClusterCore) Deserialize(buf []byte) error

Deserialize ...

func (*ClusterCore) GetExtension

func (c *ClusterCore) GetExtension(ctx Extension.Enum) interface{}

GetExtension returns the additional info requested

func (*ClusterCore) GetGatewayIP

func (c *ClusterCore) GetGatewayIP() string

GetGatewayIP returns the IP of the gateway of the network used by the cluster

func (*ClusterCore) GetName

func (c *ClusterCore) GetName() string

GetName returns the name of the cluster

func (*ClusterCore) GetNetworkID

func (c *ClusterCore) GetNetworkID() string

GetNetworkID returns the ID of the Network used by the cluster

func (*ClusterCore) Serialize

func (c *ClusterCore) Serialize() ([]byte, error)

Serialize ...

func (*ClusterCore) SetExtension

func (c *ClusterCore) SetExtension(ctx Extension.Enum, info interface{})

SetExtension ...

type ExtensionAPI

type ExtensionAPI interface {
	Value() interface{}
}

ExtensionAPI defines the interface to handle additional info

type ExtensionMap

type ExtensionMap map[Extension.Enum]interface{}

ExtensionMap ...

type Request

type Request struct {
	// Name is the name of the cluster wanted
	Name string
	// CIDR defines the network to create
	CIDR string
	// Complexity is the implementation wanted, can be Small, Normal or Large
	Complexity Complexity.Enum
	// Flavor tells what kind of cluster to create
	Flavor Flavor.Enum
	// NetworkID is the ID of the network to use
	NetworkID string
	// Tenant contains the name of the tenant
	Tenant string
	// KeepOnFailure is set to True to keep resources on cluster creation failure
	KeepOnFailure bool
	// NodesDef count
	NodesDef *pb.HostDefinition
	// DisabledDefaultFeatures contains the list of features that should be installed by default but we don't want actually
	DisabledDefaultFeatures map[string]struct{}
}

Request defines what kind of Cluster is wanted

Jump to

Keyboard shortcuts

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