director

package
v0.0.0-...-089390d Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package director contains: actions.go - agent.go - director.go - slave.go

Actions provides the functions to resolve the action to do

Package director contains: actions.go - agent.go - director.go - slave.go

Agent executes the orders received from director

Package director contains: actions.go - agent.go - director.go - slave.go

Director sends an order to the agent Make orders from synchronisation between nodes

Package director contains: agent.go - consul.go - director.go - server.go - slave.go

Slave receives a snapshot from agent

Index

Constants

View Source
const (
	DatasetTrue    = iota + 1 // Dataset not empty
	DatasetFalse              // Dataset does not exist or empty
	DatasetDisable            // Dataset disabled
	DatasetDocker             // Dataset docker
	DatasetNotConf            // Dataset not configured
)

Status for DestDataset

View Source
const (
	WasRenamed  = iota + 1 // The snapshot sent was renamed on destination
	WasWritten             // The snapshot sent was written on destination
	NothingToDo            // The snapshot sent already existed on destination
	Zerror                 // Any error string
	NotEmpty               // Need an incremental stream
	Incremental            // Ready to send an incremental stream
	MostActual             // The last snapshot on destination is the most actual
)

Status for response

Variables

This section is empty.

Functions

func Delete

func Delete(dataset string, DeleteList []string, prefix string, retention []string) (bool, []string)

Delete returns true if the snapshot should be deleted

func Director

func Director()

Director reads the server config file and all KV pairs Then it creates the orders

func HandleRequestAgent

func HandleRequestAgent(ConnAgent net.Conn)

HandleRequestAgent incoming requests from director

func HandleRequestSlave

func HandleRequestSlave(ConnSlave net.Conn)

HandleRequestSlave incoming requests from agent

func NewSnapshot

func NewSnapshot(TakeList []string, cron string, prefix string) (bool, string)

NewSnapshot returns true if a new snapshot should be created and its name

func Send

func Send(dataset string, SentList []string, SyncPolicy string, prefix string) (bool, string)

Send returns true if the snapshot should be sent

Types

type ZFSDirectorsOrder

type ZFSDirectorsOrder struct {
	OrderUUID        string   `json:"OrderUUID"`        // Mandatory
	Action           string   `json:"Action"`           // take_snapshot, send_snapshot, destroy_snapshot
	Destination      string   `json:"Destination"`      // Hostname or IP for send
	SnapshotUUID     []string `json:"SnapshotUUID"`     // List of snapshots
	SnapshotName     string   `json:"SnapshotName"`     // Name of snapshot for take_snapshot order
	DestDataset      string   `json:"DestDataset"`      // Dataset for receive
	RollbackIfNeeded bool     `json:"RollbackIfNeeded"` // Should I rollback if written is true on destination
	SkipIfRenamed    bool     `json:"SkipIfRenamed"`    // Should I do the stuff if a snapshot has been renamed
	SkipIfNotWritten bool     `json:"SkipIfNotWritten"` // Should I take a snapshot if nothing is written
	SkipIfCloned     bool     `json:"SkipIfCloned"`     // Should I delete a snapshot if it was cloned
}

ZFSDirectorsOrder is the struct for the director's orders

type ZFSListUUIDsFromSlave

type ZFSListUUIDsFromSlave struct {
	MapUUID []string // map of uuids
}

ZFSListUUIDsFromSlave is the struct to receive the list of uuids in DestDataset

type ZFSListUUIDsToAgent

type ZFSListUUIDsToAgent struct {
	MapUUID []string `json:"MapUUID"`
}

ZFSListUUIDsToAgent is the struct to send the list of uuids in dataset

type ZFSOrderFromAgent

type ZFSOrderFromAgent struct {
	Source       string // hostname of agent
	OrderUUID    string // mandatory
	SnapshotUUID string // uuid of snapshot received
	SnapshotName string // name of snapshot received
	DestDataset  string // dataset for receive
}

ZFSOrderFromAgent is the struct for ZFS orders from agent

type ZFSOrderToSlave

type ZFSOrderToSlave struct {
	Hostname     string `json:"Source"`
	OrderUUID    string `json:"OrderUUID"`
	SnapshotUUID string `json:"SnapshotUUID"`
	SnapshotName string `json:"SnapshotName"`
	DestDataset  string `json:"DestDataset"`
}

ZFSOrderToSlave is the struct for ZFS orders to slave

type ZFSResponseFromSlave

type ZFSResponseFromSlave struct {
	OrderUUID string // reference to a valid order
	IsSuccess bool   // true or false
	Status    int64  //
	Error     string // error string if needed
}

ZFSResponseFromSlave is the struct for ZFS response from slave

type ZFSResponseToAgent

type ZFSResponseToAgent struct {
	OrderUUID string `json:"OrderUUID"`
	IsSuccess bool   `json:"IsSuccess"`
	Status    int64  `json:"Status"`
	Error     string `json:"Error"`
}

ZFSResponseToAgent is the struct for ZFS response to agent

Jump to

Keyboard shortcuts

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