snapshots

package
v0.0.1-beta3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateReq

type CreateReq struct {
	ID      uint   `json:"-"`        // 实例ID
	Type    string `json:"type"`     // 备份类型(snap快照,backup备份)
	Name    string `json:"name"`     // 备注名
	StoreId int    `json:"store_id"` // 存储ID(创建备份可以指定)
}

func (*CreateReq) Body

func (r *CreateReq) Body() any

func (*CreateReq) Form

func (r *CreateReq) Form() (form url.Values)

func (*CreateReq) Header

func (r *CreateReq) Header() http.Header

func (*CreateReq) Method

func (r *CreateReq) Method() string

func (*CreateReq) Url

func (r *CreateReq) Url() string

func (*CreateReq) Values

func (r *CreateReq) Values() (values url.Values)

type CreateResp

type CreateResp struct {
	TaskID string `json:"taskid"`
}

func Create

func Create(ctx *cloudplatform.Context, req *CreateReq) (*CreateResp, error)

Create 创建备份/快照

type DeleteReq

type DeleteReq struct {
	ID uint // 备份/快照ID
}

func (*DeleteReq) Body

func (r *DeleteReq) Body() any

func (*DeleteReq) Form

func (r *DeleteReq) Form() (form url.Values)

func (*DeleteReq) Header

func (r *DeleteReq) Header() http.Header

func (*DeleteReq) Method

func (r *DeleteReq) Method() string

func (*DeleteReq) Url

func (r *DeleteReq) Url() string

func (*DeleteReq) Values

func (r *DeleteReq) Values() (values url.Values)

type DeleteResp

type DeleteResp struct {
	TaskID string `json:"taskid"`
}

func Delete

func Delete(ctx *cloudplatform.Context, req *DeleteReq) (*DeleteResp, error)

Delete 删除备份/快照

type ListReq

type ListReq struct {
	ID     uint   `url:"-"`                // 实例ID
	Search string `url:"search,omitempty"` // 搜索
	Type   string `url:"type,omitempty"`   // 按备份类型搜索(snap快照,backup备份)

	Page    string `url:"page,omitempty"`
	PerPage string `url:"per_page,omitempty"`
	Orderby string `url:"orderby,omitempty"` // 排序(id,size,name,type)
	Sort    string `url:"sort,omitempty"`
}

func (*ListReq) Body

func (r *ListReq) Body() any

func (*ListReq) Form

func (r *ListReq) Form() (form url.Values)

func (*ListReq) Header

func (r *ListReq) Header() http.Header

func (*ListReq) Method

func (r *ListReq) Method() string

func (*ListReq) Url

func (r *ListReq) Url() string

func (*ListReq) Values

func (r *ListReq) Values() (values url.Values)

type ListResp

type ListResp struct {
	Data []struct {
		Id          int    `json:"id"`           // 备份ID
		Size        int    `json:"size"`         // 大小(G)
		Name        string `json:"name"`         // 文件名
		Type        string `json:"type"`         // 备份类型(snap快照,backup备份)
		CreateTime  string `json:"create_time"`  // 创建时间
		Remarks     string `json:"remarks"`      // 备注名
		DiskName    string `json:"disk_name"`    // 关联磁盘文件
		DiskRemarks string `json:"disk_remarks"` // 关联磁盘备注
		RealFile    string `json:"real_file"`    // 当前备份完整路径(v2.4.3+)
		Status      int    `json:"status"`       // 状态(0=创建中,1=创建完成,v2.4.7+)
		Next        []struct {
			Id   int    `json:"id"`   // 下级快照ID
			Name string `json:"name"` // 下级快照文件名
		}
	} `json:"data"`
	Meta struct {
		Total     int `json:"total"`
		TotalPage int `json:"total_page"`
		Page      int `json:"page"`
		PerPage   int `json:"per_page"`
	} `json:"meta"`
}

func List

func List(ctx *cloudplatform.Context, req *ListReq) (*ListResp, error)

List 实例备份/快照列表

type RestoreReq

type RestoreReq struct {
	ID uint // 备份/快照ID
}

func (*RestoreReq) Body

func (r *RestoreReq) Body() any

func (*RestoreReq) Form

func (r *RestoreReq) Form() (form url.Values)

func (*RestoreReq) Header

func (r *RestoreReq) Header() http.Header

func (*RestoreReq) Method

func (r *RestoreReq) Method() string

func (*RestoreReq) Url

func (r *RestoreReq) Url() string

func (*RestoreReq) Values

func (r *RestoreReq) Values() (values url.Values)

type RestoreResp

type RestoreResp struct {
	TaskID string `json:"taskid"`
	Os     struct {
		Id       int    `json:"id"`       // 还原后镜像ID
		Name     string `json:"name"`     // 还原后镜像名称
		User     string `json:"user"`     // 还原后用户名
		Password string `json:"password"` // 还原后密码
		Port     int    `json:"port"`     // 还原后端口
	} `json:"os"`
}

func Restore

func Restore(ctx *cloudplatform.Context, req *RestoreReq) (*RestoreResp, error)

Restore 备份/快照还原

Jump to

Keyboard shortcuts

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