clouds

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 CancelReq

type CancelReq struct{ TaskID uint }

func (*CancelReq) Body

func (r *CancelReq) Body() any

func (*CancelReq) Form

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

func (*CancelReq) Header

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

func (*CancelReq) Method

func (r *CancelReq) Method() string

func (*CancelReq) Url

func (r *CancelReq) Url() string

func (*CancelReq) Values

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

type CancelResp

type CancelResp struct{}

func Cancel

func Cancel(ctx *cloudplatform.Context, req *CancelReq) (*CancelResp, error)

Cancel 取消任务

type DetailReq

type DetailReq struct{ TaskID uint }

func (*DetailReq) Body

func (r *DetailReq) Body() any

func (*DetailReq) Form

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

func (*DetailReq) Header

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

func (*DetailReq) Method

func (r *DetailReq) Method() string

func (*DetailReq) Url

func (r *DetailReq) Url() string

func (*DetailReq) Values

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

type DetailResp

type DetailResp struct {
	Id         int           `json:"id"`
	Data       []interface{} `json:"data"`
	Type       string        `json:"type"`
	Hostid     int           `json:"hostid"`
	Status     int           `json:"status"`
	CreateTime string        `json:"create_time"`
	StartTime  string        `json:"start_time"`
	EndTime    string        `json:"end_time"`
	Progress   int           `json:"progress"`
	Msg        string        `json:"msg"`
	UserType   int           `json:"user_type"`
	Uid        int           `json:"uid"`
	Ip         string        `json:"ip"`
	TypeDesc   string        `json:"type_desc"`
}

func Detail

func Detail(ctx *cloudplatform.Context, req *DetailReq) (*DetailResp, error)

Detail 任务详情

type ListReq

type ListReq struct {
	Status  string `url:"status,omitempty"`   // 状态(0未开始,1正在执行,2执行成功,3执行失败,4强制结束,5已取消)
	Cloud   string `url:"cloud,omitempty"`    // 实例ID(传入ID获取某个实例的任务列表)
	RelType string `url:"rel_type,omitempty"` // 任务关联类型(cloud=实例,load_balance=负载均衡)

	Page    string `url:"page,omitempty"`
	PerPage string `url:"per_page,omitempty"`
	Orderby string `url:"orderby,omitempty"` // 排序(id,status,start_time,end_time,progress)
	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"`
		Type       string `json:"type"`
		Status     int    `json:"status"`
		CreateTime string `json:"create_time"`
		StartTime  string `json:"start_time"`
		EndTime    string `json:"end_time"`
		Progress   int    `json:"progress"`
		Msg        string `json:"msg"`
		RelType    string `json:"rel_type"`
		Hostid     int    `json:"hostid"`
		Hostname   string `json:"hostname"`
	} `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 任务列表

Jump to

Keyboard shortcuts

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