models

package
v1.8.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ScheduleHourly : 'Hourly'
	ScheduleHourly = "Hourly"
	// ScheduleDaily : 'Daily'
	ScheduleDaily = "Daily"
	// ScheduleWeekly : 'Weekly'
	ScheduleWeekly = "Weekly"
	// ScheduleCustom : 'Custom'
	ScheduleCustom = "Custom"
	// ScheduleManual : 'Manual'
	ScheduleManual = "Manual"
	// ScheduleNone : 'None'
	ScheduleNone = "None"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminJobRep added in v1.8.0

type AdminJobRep struct {
	AdminJobSchedule
	ID           int64     `json:"id"`
	Name         string    `json:"job_name"`
	Kind         string    `json:"job_kind"`
	Status       string    `json:"job_status"`
	UUID         string    `json:"-"`
	Deleted      bool      `json:"deleted"`
	CreationTime time.Time `json:"creation_time"`
	UpdateTime   time.Time `json:"update_time"`
}

AdminJobRep holds the response of query admin job

type AdminJobReq added in v1.8.0

type AdminJobReq struct {
	AdminJobSchedule
	Name       string                 `json:"name"`
	Status     string                 `json:"status"`
	ID         int64                  `json:"id"`
	Parameters map[string]interface{} `json:"parameters"`
}

AdminJobReq holds request information for admin job

func (*AdminJobReq) CronString added in v1.8.0

func (ar *AdminJobReq) CronString() string

CronString ...

func (*AdminJobReq) IsPeriodic added in v1.8.0

func (ar *AdminJobReq) IsPeriodic() bool

IsPeriodic ...

func (*AdminJobReq) JobKind added in v1.8.0

func (ar *AdminJobReq) JobKind() string

JobKind ...

func (*AdminJobReq) ToJob added in v1.8.0

func (ar *AdminJobReq) ToJob() *models.JobData

ToJob converts request to a job recognized by job service.

func (*AdminJobReq) Valid added in v1.8.0

func (ar *AdminJobReq) Valid(v *validation.Validation)

Valid validates the schedule type of a admin job request. Only scheduleHourly, ScheduleDaily, ScheduleWeekly, ScheduleCustom, ScheduleManual, ScheduleNone are accepted.

type AdminJobSchedule added in v1.8.0

type AdminJobSchedule struct {
	Schedule *ScheduleParam `json:"schedule"`
}

AdminJobSchedule ...

type Execution added in v1.8.0

type Execution struct {
	ID          int64     `json:"id"`
	Status      string    `json:"status"`
	TriggerMode string    `json:"trigger_mode"`
	Duration    int       `json:"duration"`
	SuccessRate string    `json:"success_rate"`
	StartTime   time.Time `json:"start_time"`
}

Execution defines the data model used in API level

type RegistryUpdateRequest added in v1.8.0

type RegistryUpdateRequest struct {
	Name           *string `json:"name"`
	Description    *string `json:"description"`
	URL            *string `json:"url"`
	CredentialType *string `json:"credential_type"`
	AccessKey      *string `json:"access_key"`
	AccessSecret   *string `json:"access_secret"`
	Insecure       *bool   `json:"insecure"`
}

RegistryUpdateRequest is request used to update a registry.

type ScheduleParam

type ScheduleParam struct {
	// Daily, Weekly, Custom, Manual, None
	Type string `json:"type"`
	// The cron string of scheduled job
	Cron string `json:"cron"`
}

ScheduleParam defines the parameter of schedule trigger

func ConvertSchedule added in v1.8.0

func ConvertSchedule(cronStr string) (ScheduleParam, error)

ConvertSchedule converts different kinds of cron string into one standard for UI to show. in the latest design, it uses {"type":"Daily","cron":"0 0 0 * * *"} as the cron item. As for supporting migration from older version, it needs to convert {"parameter":{"daily_time":0},"type":"daily"} and {"type":"Daily","weekday":0,"offtime":57600} into one standard.

Jump to

Keyboard shortcuts

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