snapshotclone

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACTION_GET_CLONE_TASKS = "GetCloneTasks"
	ACTION_CLONE           = "Clone"
	ACTION_FLATTEN         = "Flatten"

	CLONE_STATUS_DONE           = "done"
	CLONE_STATUS_CLONING        = "cloning"
	CLONE_STATUS_RECOVERING     = "recovering"
	CLONE_STATUS_CLEANING       = "cleaning"
	CLONE_STATUS_ERROR_CLEANING = "errorCleaning"
	CLONE_STATUS_ERROR          = "error"
	CLONE_STATUS_RETRYING       = "retrying"
	CLONE_STATUS_METAINSTALLED  = "metaInstalled"
)
View Source
const (
	SERVICE_ROUTER         = "/SnapshotCloneService"
	SNAPSHOT_CLONE_VERSION = "0.0.6"

	ERROR_CODE_SUCCESS = "0"
)
View Source
const (
	ACTION_CREATE_SANPSHOT   = "CreateSnapshot"
	ACTION_CANCEL_SNAPSHOT   = "CancelSnapshot"
	ACTION_GET_SNAPSHOT_LIST = "GetFileSnapshotList"
	ACTION_DELETE_SNAPSHOT   = "DeleteSnapshot"

	// snapshot status
	STATUS_DONE           = "done"
	STATUS_IN_PROCESS     = "inProcess"
	STATUS_DELETING       = "deleting"
	STATUS_ERROR_DELETING = "errorDeleting"
	STATUS_CANCELING      = "canceling"
	STATUS_ERROR          = "error"
	STATUS_NOT_SUPPORT    = "notSupport"

	LIST_SNAPSHOT_LIMIT = 100
)
View Source
const (
	CURVEBS_SNAPSHOT_CLONE_PROXY_ADDRESS = "snapshot.clone.proxy.address"
)

Variables

View Source
var (
	GSnapshotCloneClient *snapshotCloneClient
)

Functions

func CancelSnapshot

func CancelSnapshot(uuid, user, volumeName string) error

func CreateClone

func CreateClone(src, dest, user string, lazy bool) error

func CreateSnapshot

func CreateSnapshot(volumeName, user, snapshotName string) error

func DeleteSnapshot

func DeleteSnapshot(uuid, volumeName, user string) error

func Flatten

func Flatten(user, uuid string) error

func GetCloneTaskNeedFlatten

func GetCloneTaskNeedFlatten(r *pigeon.Request, volumeName, user string) ([]string, error)

func Init

func Init(cfg map[string]string)

Types

type CreateSnapshotCloneResponse

type CreateSnapshotCloneResponse struct {
	Code      string `json:"Code" binding:"required"`
	Message   string `json:"Message" binding:"required"`
	RequestId string `json:"RequestId" binding:"required"`
	UUID      string `json:"UUID"`
}

type GetCloneTasksResponse

type GetCloneTasksResponse struct {
	Code       string     `json:"Code" binding:"required"`
	Message    string     `json:"Message" binding:"required"`
	RequestId  string     `json:"RequestId" binding:"required"`
	TaskInfos  []TaskInfo `json:"TaskInfos"`
	TotalCount uint64     `json:"TotalCount"`
}

type GetSnapShotResponse

type GetSnapShotResponse struct {
	Code       string     `json:"Code" binding:"required"`
	Message    string     `json:"Message" binding:"required"`
	RequestId  string     `json:"RequestId" binding:"required"`
	Snapshots  []snapshot `json:"Snapshots"`
	TotalCount uint64     `json:"TotalCount"`
}

struct received from snapshot clone server

type ListSnapshotInfo

type ListSnapshotInfo struct {
	Total int            `json:"total" binding:"required"`
	Info  []SnapshotInfo `json:"info" binding:"required"`
}

struct return to uplayer

func GetSnapshot

func GetSnapshot(size, page uint32, uuid, user, fileName, status string) (ListSnapshotInfo, error)

type SnapshotCloneResponse

type SnapshotCloneResponse struct {
	Code      string `json:"Code" binding:"required"`
	Message   string `json:"Message" binding:"required"`
	RequestId string `json:"RequestId" binding:"required"`
}

type SnapshotInfo

type SnapshotInfo struct {
	UUID       string `json:"uuid" binding:"required"`
	User       string `json:"user" binding:"required"`
	File       string `json:"file" binding:"required"`
	Name       string `json:"name" binding:"required"`
	SeqNum     uint64 `json:"seqNum" binding:"required"`
	Ctime      string `json:"time" binding:"required"`
	FileLength uint64 `json:"length" binding:"required"`
	Status     string `json:"status" binding:"required"`
	Progress   string `json:"Progress" binding:"required"`
}

func GetAllSnapshot

func GetAllSnapshot(user, fileName, status string) ([]SnapshotInfo, error)

type TaskInfo

type TaskInfo struct {
	File       string `json:"File"`
	FileType   int    `json:"FileType"`
	IsLazy     bool   `json:"IsLazy"`
	NextStep   int    `json:"NextStep"`
	Progress   int    `json:"Progress"`
	Src        string `json:"Src"`
	TaskStatus int    `json:"TaskStatus"`
	TaskType   int    `json:"TaskType"`
	Time       uint64 `json:"Time"`
	UUID       string `json:"UUID"`
	User       string `json:"User"`
}

Jump to

Keyboard shortcuts

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