Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateReq ¶
type CreateResp ¶
type CreateResp struct {
TaskID string `json:"taskid"`
}
func Create ¶
func Create(ctx *cloudplatform.Context, req *CreateReq) (*CreateResp, error)
Create 创建备份/快照
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"`
}
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"`
}
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 备份/快照还原
Click to show internal directories.
Click to hide internal directories.