scheduledtask

package
v0.3.10-0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ST_TYPE_TIMING = "timing" // 定时
	ST_TYPE_CYCLE  = "cycle"  // 周期

	ST_STATUS_READY         = "ready"
	ST_STATUS_CREATE_FAILED = "create_failed"

	ST_RESOURCE_SERVER       = "server"
	ST_RESOURCE_CLOUDACCOUNT = "cloudaccount"

	ST_RESOURCE_OPERATION_START   = "start"
	ST_RESOURCE_OPERATION_STOP    = "stop"
	ST_RESOURCE_OPERATION_RESTART = "restart"
	ST_RESOURCE_OPERATION_SYNC    = "sync"

	ST_LABEL_ID  = "id"
	ST_LABEL_TAG = "tag"

	ST_ACTIVITY_STATUS_EXEC         = "execution"    // 执行中
	ST_ACTIVITY_STATUS_SUCCEED      = "succeed"      // 成功
	ST_ACTIVITY_STATUS_PART_SUCCEED = "part_succeed" // 部分成功
	ST_ACTIVITY_STATUS_FAILED       = "failed"       // 失败
	ST_ACTIVITY_STATUS_REJECT       = "reject"       // 拒绝

	TIMER_TYPE_ONCE  = "once"
	TIMER_TYPE_DAY   = "day"
	TIMER_TYPE_WEEK  = "week"
	TIMER_TYPE_MONTH = "month"
)
View Source
const (
	SERVICE_TYPE = apis.SERVICE_TYPE_SCHEDULEDTASK
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CycleTimerCreateInput

type CycleTimerCreateInput struct {

	// description: 周期类型
	// enum: day,week,month
	CycleType string `json:"cycle_type"`

	// description: 分(0-59)
	// example: 13
	Minute int `json:"minute"`

	// description: 时(0-23)
	// example: 13
	Hour int `json:"hour"`

	// description: 每周的周几; 1-7, 1: Monday, 7: Sunday
	// example: [1,3,5,7]
	WeekDays []int `json:"week_days"`

	// description: 每月的哪几天; 1-31
	// example: [1,4,31]
	MonthDays []int `json:"month_days"`

	// description: 开始时间
	StartTime time.Time `json:"start_time"`

	// description: 截止时间
	EndTime time.Time `json:"end_time"`
}

type CycleTimerDetails

type CycleTimerDetails struct {
	// description: 周期类型:按天/周/月
	CycleType string `json:"cycle_type"`
	// description: 分钟
	Minute int `json:"minute"`
	// description: 小时
	Hour int `json:"hour"`
	// description: 每周的几天
	WeekDays []int `json:"week_days"`
	// description: 每月的几天
	MonthDays []int `json:"month_days"`
	// description: 此周期任务的开始时间
	StartTime time.Time `json:"start_time"`
	// description: 此周期任务的截止时间
	EndTime time.Time `json:"end_time"`
}

type LabelDetail

type LabelDetail struct {
	Label        string    `json:"label"`
	IsolatedTime time.Time `json:"isolated_time"`
}

type SScheduledTask

type SScheduledTask struct {
	apis.SVirtualResourceBase
	apis.SEnabledResourceBase
	ScheduledType string `json:"scheduled_type"`
	STimer
	ResourceType string `json:"resource_type"`
	Operation    string `json:"operation"`
	LabelType    string `json:"label_type"`
}

SScheduledTask is an autogenerated struct via yunion.io/x/onecloud/pkg/scheduledtask/models.SScheduledTask.

type SScheduledTaskActivity

type SScheduledTaskActivity struct {
	apis.SStatusStandaloneResourceBase
	ScheduledTaskId string    `json:"scheduled_task_id"`
	StartTime       time.Time `json:"start_time"`
	EndTime         time.Time `json:"end_time"`
	Reason          string    `json:"reason"`
}

SScheduledTaskActivity is an autogenerated struct via yunion.io/x/onecloud/pkg/scheduledtask/models.SScheduledTaskActivity.

type SScheduledTaskLabel

type SScheduledTaskLabel struct {
	apis.SResourceBase
	ScheduledTaskId string `json:"scheduled_task_id"`
	Label           string `json:"label"`
}

SScheduledTaskLabel is an autogenerated struct via yunion.io/x/onecloud/pkg/scheduledtask/models.SScheduledTaskLabel.

type STimer

type STimer struct {
	// Cycle type
	Type string `json:"type"`
	// 0-59
	Minute int `json:"minute"`
	// 0-23
	Hour int `json:"hour"`
	// 0-7 1 is Monday 0 is unlimited
	WeekDays byte `json:"week_days"`
	// 0-31 0 is unlimited
	MonthDays uint32 `json:"month_days"`
	IsExpired bool   `json:"is_expired"`
}

STimer is an autogenerated struct via yunion.io/x/onecloud/pkg/scheduledtask/models.STimer.

type ScheduledTaskActivityListInput

type ScheduledTaskActivityListInput struct {
	apis.StatusStandaloneResourceListInput
	// description: 定时任务 ID or Name
	// example: st-11212
	ScheduledTask string `json:"scheduled_task"`
}

type ScheduledTaskCreateInput

type ScheduledTaskCreateInput struct {
	apis.VirtualResourceCreateInput
	apis.EnabledBaseResourceCreateInput

	// description: scheduled type
	// enum: cycle,timing
	// example: timing
	ScheduledType string                `json:"scheduled_type"`
	Timer         TimerCreateInput      `json:"timer"`
	CycleTimer    CycleTimerCreateInput `json:"cycle_timer"`

	// description: resource type
	// enum: server
	// example: server
	ResourceType string `json:"resource_type"`
	// description: operation
	// enum: start,stop,restart
	// example: stop
	Operation string `json:"operation"`
	// description: label type
	// enum: tag,id
	// example: id
	LabelType string `json:"label_type"`
	// description: labels
	// example: {g-12345}
	Labels []string
}

type ScheduledTaskDetails

type ScheduledTaskDetails struct {
	apis.VirtualResourceDetails
	SScheduledTask

	// 描述
	TimerDesc string `json:"timer_desc"`
	// 定时方式触发
	Timer TimerDetails `json:"timer"`
	// 周期方式触发
	CycleTimer CycleTimerDetails `json:"cycle_timer"`
	// 绑定的所有标示
	Labels       []string      `json:"labels,allowempty"`
	LabelDetails []LabelDetail `json:"label_details,allowempty"`
}

type ScheduledTaskFilterListInput

type ScheduledTaskFilterListInput struct {
	// description: 定时任务 Id or Name
	// example: st-1234
	ScheduledTask string `json:"scheduled_task"`
}

type ScheduledTaskListInput

type ScheduledTaskListInput struct {
	apis.VirtualResourceListInput
	apis.EnabledResourceBaseListInput

	// description: resource type
	// example: server
	// enum: server
	ResourceType string `json:"resource_type"`

	// description: label type
	// example: tag
	LabelType string `json:"label_type"`

	// description: filter scheduledtask binded with label
	// example: g-12345
	Label string `json:"label"`

	// description: operation
	// example: stop
	// enum: start,stop,restart
	Operation string `json:"operation"`
}

type ScheduledTaskResourceInfo

type ScheduledTaskResourceInfo struct {
	// description: 定时任务名称
	// example: st-nihao
	ScheduledTask string `json:"scheduled_task"`

	// description: 定时任务ID
	// example: 1234
	ScheduledTaskId string `json:"scheduled_task_id"`
}

type ScheduledTaskSetLabelsInput

type ScheduledTaskSetLabelsInput struct {
	Labels []string `json:"labels"`
}

type ScheduledTaskTriggerInput

type ScheduledTaskTriggerInput struct {
}

type TimerCreateInput

type TimerCreateInput struct {

	// description: 执行时间
	ExecTime time.Time
}

type TimerDetails

type TimerDetails struct {
	// description: 执行时间
	ExecTime time.Time `json:"exec_time"`
}

Jump to

Keyboard shortcuts

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