Documentation ¶
Index ¶
- Constants
- func CheckingJob(jobMsg *api.RunJobMessage, username *string, token *string) (*api.RunJobMessage, error)
- func DownloadFromURL(url string, filename string) error
- func DownloadSelfFromURL(username, token *string, apiPath string)
- func DownloadTmpFromURL(url string) (string, error)
- func GetClusterStatus(userName, token *string) api.SchedulerStatus
- func GetCredit(userName, token *string) (*request.CreditSchema, error)
- func GetJobs(userName, token *string) (*[]api.RunJobMessage, error)
- func GetPollInterval(jobMessage *api.RunJobMessage) int64
- func GetStatusCode(jobMsg *api.RunJobMessage, status string) (int, error)
- func GetTrans(userName, token *string) (*[]request.TransSchema, error)
- func GetUpdate(userName, token *string, os, arch, release string) (*[]request.SupportedOSArch, error)
- func GetVendors(userName, token *string) (*request.Vendors, error)
- func ListClusters(userName, token *string) *[]request.ListClustersResponse
- func ListUpdates(userName, token *string) (*[]request.SupportedOSArch, error)
- func NewJobByFile(filePath string) (*api.Job, error)
- func UnmarshalJobMsg(resp *resty.Response) (*api.RunJobMessage, error)
- func Upload(jobMsg *api.RunJobMessage) error
- func UploadDirToS3(localDir string, s3Pair api.PresignPair) error
- func UploadImage(jobMsg *api.RunJobMessage) error
- func UploadInputs(jobMsg *api.RunJobMessage) error
- type Instance
- type JobStatus
- type RunArgs
- type RunEngine
- type TableView
- type View
Constants ¶
View Source
const DefaultServerURL string = "https://cloudor.dev"
Variables ¶
This section is empty.
Functions ¶
func CheckingJob ¶
func CheckingJob(jobMsg *api.RunJobMessage, username *string, token *string) (*api.RunJobMessage, error)
func DownloadFromURL ¶
func DownloadSelfFromURL ¶
func DownloadTmpFromURL ¶
func GetClusterStatus ¶
func GetClusterStatus(userName, token *string) api.SchedulerStatus
ListClusters
func GetJobs ¶
func GetJobs(userName, token *string) (*[]api.RunJobMessage, error)
GetJobs returns recent jobs issued by a user
func GetPollInterval ¶
func GetPollInterval(jobMessage *api.RunJobMessage) int64
func GetStatusCode ¶
func GetStatusCode(jobMsg *api.RunJobMessage, status string) (int, error)
GetStatusTs returns the unix time in second for a status
func GetTrans ¶
func GetTrans(userName, token *string) (*[]request.TransSchema, error)
GetTrans returns recent jobs issued by a user
func GetUpdate ¶
func GetUpdate(userName, token *string, os, arch, release string) (*[]request.SupportedOSArch, error)
GetUpdate returns supported upda
func GetVendors ¶
GetVendors returns supported vendors by cloudor
func ListClusters ¶
func ListClusters(userName, token *string) *[]request.ListClustersResponse
ListClusters
func ListUpdates ¶
func ListUpdates(userName, token *string) (*[]request.SupportedOSArch, error)
ListUpdates returns supported updates
func UnmarshalJobMsg ¶
func UnmarshalJobMsg(resp *resty.Response) (*api.RunJobMessage, error)
func UploadDirToS3 ¶
func UploadDirToS3(localDir string, s3Pair api.PresignPair) error
func UploadImage ¶
func UploadImage(jobMsg *api.RunJobMessage) error
UploadImage uploads the local image file to a stage area (S3 presigned URL)
Types ¶
type Instance ¶
type Instance struct { Vendor string `json:"vendor,omitempty"` Region string `json:"region,omitempty"` InstanceType string `json:"instance_type,omitempty"` Instance request.Instance `json:"instance,omitempty"` }
Instance specifies instance features
type JobStatus ¶
type JobStatus struct { UserName string `json:"user_name,omitempty"` ID string `json:"id,omitempty"` Status string `json:"status,omitempty"` StatusCode int `json:"status_code,omitempty"` Vendor string `json:"vendor,omitempty"` Description string `json:"description,omitempty"` }
JobStatus is used for streaming job status to the client
type RunEngine ¶
func NewRunEngine ¶
type TableView ¶
type TableView struct {
Table *tablewriter.Table
}
TableView shows the API list nicely
func (TableView) View ¶
func (v TableView) View(jobs *[]api.RunJobMessage)
View implements the View interface
func (TableView) ViewTrans ¶
func (v TableView) ViewTrans(transactions *[]request.TransSchema)
View implements the View interface
func (TableView) ViewUpdates ¶
func (v TableView) ViewUpdates(releases *[]request.SupportedOSArch)
View implements the View interface
func (TableView) ViewVendors ¶
ViewVendors tabulates the vendor
Click to show internal directories.
Click to hide internal directories.