models

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type GCRep

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

GCRep holds the response of query gc

type GCReq

type GCReq struct {
	Schedule   *ScheduleParam         `json:"schedule"`
	Status     string                 `json:"status"`
	ID         int64                  `json:"id"`
	Parameters map[string]interface{} `json:"parameters"`
}

GCReq holds request information for admin job

func (*GCReq) CronString

func (gr *GCReq) CronString() string

CronString ...

func (*GCReq) IsPeriodic

func (gr *GCReq) IsPeriodic() bool

IsPeriodic ...

func (*GCReq) JobKind

func (gr *GCReq) JobKind() string

JobKind ...

func (*GCReq) ToJob

func (gr *GCReq) ToJob() (*models.JobData, error)

ToJob converts request to a job reconiged by job service.

func (*GCReq) Valid

func (gr *GCReq) Valid(v *validation.Validation)

Valid validates the gc request

type Replication

type Replication struct {
	PolicyID int64 `json:"policy_id"`
}

Replication defines the properties of model used in replication API

func (*Replication) Valid

func (r *Replication) Valid(v *validation.Validation)

Valid ...

type ReplicationPolicy

type ReplicationPolicy struct {
	ID                        int64                      `json:"id"`
	Name                      string                     `json:"name"`
	Description               string                     `json:"description"`
	Filters                   []rep_models.Filter        `json:"filters"`
	ReplicateDeletion         bool                       `json:"replicate_deletion"`
	Trigger                   *rep_models.Trigger        `json:"trigger"`
	Projects                  []*common_models.Project   `json:"projects"`
	Targets                   []*common_models.RepTarget `json:"targets"`
	CreationTime              time.Time                  `json:"creation_time"`
	UpdateTime                time.Time                  `json:"update_time"`
	ReplicateExistingImageNow bool                       `json:"replicate_existing_image_now"`
	ErrorJobCount             int64                      `json:"error_job_count"`
}

ReplicationPolicy defines the data model used in API level

func (*ReplicationPolicy) Valid

Valid ...

type ReplicationResponse

type ReplicationResponse struct {
	UUID string `json:"uuid"`
}

ReplicationResponse describes response of a replication request, it gives

type ScheduleParam

type ScheduleParam struct {
	// Daily, Weekly, Manual, None
	Type string `json:"type"`
	// Optional, only used when type is 'weekly'
	Weekday int8 `json:"weekday"`
	// The time offset with the UTC 00:00 in seconds
	Offtime int64 `json:"offtime"`
}

ScheduleParam defines the parameter of schedule trigger

type StopJobsReq

type StopJobsReq struct {
	PolicyID int64  `json:"policy_id"`
	Status   string `json:"status"`
}

StopJobsReq holds information needed to stop the jobs for a replication rule

func (*StopJobsReq) Valid

func (s *StopJobsReq) Valid(v *validation.Validation)

Valid ...

Jump to

Keyboard shortcuts

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