config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, req CreateRequest) (string, error)

Create Generate new cluster configuration. If no links given, default to local IP address as link0.

func (*Client) Index

func (c *Client) Index(ctx context.Context) ([]map[string]interface{}, error)

Index Directory index.

func (*Client) Join

func (c *Client) Join(ctx context.Context, req JoinRequest) (string, error)

Join Joins this node into an existing cluster. If no links are given, default to IP resolved by node's hostname on single link (fallback fails for clusters with multiple links).

func (*Client) JoinApiVersionApiversion

func (c *Client) JoinApiVersionApiversion(ctx context.Context) (int, error)

JoinApiVersionApiversion Return the version of the cluster join API available on this node.

func (*Client) JoinInfo added in v0.0.15

func (c *Client) JoinInfo(ctx context.Context, req JoinInfoRequest) (JoinInfoResponse, error)

JoinInfo Get information needed to join this cluster over the connected node.

func (*Client) StatusQdevice

func (c *Client) StatusQdevice(ctx context.Context) (map[string]interface{}, error)

StatusQdevice Get QDevice status

func (*Client) Totem

func (c *Client) Totem(ctx context.Context) (map[string]interface{}, error)

Totem Get corosync totem protocol settings.

type CreateRequest

type CreateRequest struct {
	Clustername string `url:"clustername" json:"clustername"` // The name of the cluster.

	// The following parameters are optional
	Links  *Links `url:"link[n],omitempty" json:"link[n],omitempty"` // Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)
	Nodeid *int   `url:"nodeid,omitempty" json:"nodeid,omitempty"`   // Node id for this node.
	Votes  *int   `url:"votes,omitempty" json:"votes,omitempty"`     // Number of votes for this node.
}

func (*CreateRequest) UnmarshalJSON added in v0.0.19

func (t *CreateRequest) UnmarshalJSON(d []byte) error

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type JoinInfoRequest added in v0.0.15

type JoinInfoRequest struct {

	// The following parameters are optional
	Node *string `url:"node,omitempty" json:"node,omitempty"` // The node for which the joinee gets the nodeinfo.
}

type JoinInfoResponse added in v0.0.15

type JoinInfoResponse struct {
	ConfigDigest  string                 `url:"config_digest" json:"config_digest"`
	Nodelist      []Nodelist             `url:"nodelist" json:"nodelist"`
	PreferredNode string                 `url:"preferred_node" json:"preferred_node"` // The cluster node name.
	Totem         map[string]interface{} `url:"totem" json:"totem"`
}

type JoinRequest

type JoinRequest struct {
	Fingerprint string `url:"fingerprint" json:"fingerprint"` // Certificate SHA 256 fingerprint.
	Hostname    string `url:"hostname" json:"hostname"`       // Hostname (or IP) of an existing cluster member.
	Password    string `url:"password" json:"password"`       // Superuser (root) password of peer node.

	// The following parameters are optional
	Force  *util.PVEBool `url:"force,omitempty" json:"force,omitempty"`     // Do not throw error if node already exists.
	Links  *Links        `url:"link[n],omitempty" json:"link[n],omitempty"` // Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)
	Nodeid *int          `url:"nodeid,omitempty" json:"nodeid,omitempty"`   // Node id for this node.
	Votes  *int          `url:"votes,omitempty" json:"votes,omitempty"`     // Number of votes for this node
}

func (*JoinRequest) UnmarshalJSON added in v0.0.19

func (t *JoinRequest) UnmarshalJSON(d []byte) error
type Link struct {
	Address string `url:"address" json:"address"` // Hostname (or IP) of this corosync link address.

	// The following parameters are optional
	Priority *int `url:"priority,omitempty" json:"priority,omitempty"` // The priority for the link when knet is used in 'passive' mode (default). Lower value means higher priority. Only valid for cluster create, ignored on node add.
}

Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)

func (Link) EncodeValues added in v0.0.15

func (t Link) EncodeValues(key string, v *url.Values) error

func (*Link) UnmarshalJSON added in v0.0.19

func (t *Link) UnmarshalJSON(d []byte) error
type Links []*Link

Array of Link

func (Links) EncodeValues added in v0.0.15

func (t Links) EncodeValues(key string, v *url.Values) error

type Nodelist added in v0.0.10

type Nodelist struct {
	Name        string `url:"name" json:"name"` // The cluster node name.
	PveAddr     string `url:"pve_addr" json:"pve_addr"`
	PveFp       string `url:"pve_fp" json:"pve_fp"` // Certificate SHA 256 fingerprint.
	QuorumVotes int    `url:"quorum_votes" json:"quorum_votes"`

	// The following parameters are optional
	Nodeid    *int       `url:"nodeid,omitempty" json:"nodeid,omitempty"`         // Node id for this node.
	Ring0Addr *Ring0Addr `url:"ring0_addr,omitempty" json:"ring0_addr,omitempty"` // Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)
}

type Ring0Addr added in v0.0.10

type Ring0Addr struct {
	Address string `url:"address" json:"address"` // Hostname (or IP) of this corosync link address.

	// The following parameters are optional
	Priority *int `url:"priority,omitempty" json:"priority,omitempty"` // The priority for the link when knet is used in 'passive' mode (default). Lower value means higher priority. Only valid for cluster create, ignored on node add.
}

Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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