Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ImageScanJob is name of scan job it will be used as key to register to job service. ImageScanJob = "IMAGE_SCAN" // ImageScanAllJob is the name of "scanall" job in job service ImageScanAllJob = "IMAGE_SCAN_ALL" // ImageTransfer : the name of image transfer job in job service ImageTransfer = "IMAGE_TRANSFER" // ImageDelete : the name of image delete job in job service ImageDelete = "IMAGE_DELETE" // ImageReplicate : the name of image replicate job in job service ImageReplicate = "IMAGE_REPLICATE" // ImageGC the name of image garbage collection job in job service ImageGC = "IMAGE_GC" // JobKindGeneric : Kind of generic job JobKindGeneric = "Generic" // JobKindScheduled : Kind of scheduled job JobKindScheduled = "Scheduled" // JobKindPeriodic : Kind of periodic job JobKindPeriodic = "Periodic" // JobServiceStatusPending : job status pending JobServiceStatusPending = "Pending" // JobServiceStatusRunning : job status running JobServiceStatusRunning = "Running" // JobServiceStatusStopped : job status stopped JobServiceStatusStopped = "Stopped" // JobServiceStatusCancelled : job status cancelled JobServiceStatusCancelled = "Cancelled" // JobServiceStatusError : job status error JobServiceStatusError = "Error" // JobServiceStatusSuccess : job status success JobServiceStatusSuccess = "Success" // JobServiceStatusScheduled : job status scheduled JobServiceStatusScheduled = "Scheduled" // JobActionStop : the action to stop the job JobActionStop = "stop" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { SubmitJob(*models.JobData) (string, error) GetJobLog(uuid string) ([]byte, error) PostAction(uuid, action string) error }
Client wraps interface to access jobservice.
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
DefaultClient is the default implementation of Client interface
func NewDefaultClient ¶
func NewDefaultClient(endpoint, secret string) *DefaultClient
NewDefaultClient creates a default client based on endpoint and secret.
func (*DefaultClient) GetJobLog ¶
func (d *DefaultClient) GetJobLog(uuid string) ([]byte, error)
GetJobLog call jobserivce API to get the log of a job. It only accepts the UUID of the job
func (*DefaultClient) PostAction ¶
func (d *DefaultClient) PostAction(uuid, action string) error
PostAction call jobservice's API to operate action for job specified by uuid
Click to show internal directories.
Click to hide internal directories.