func setup() { client = jobscheduler.NewClient(os.Getenv("JS_URL")) test_job_dir = "test" test_job_name = "test_job" test_job = test_job_dir + "/" + test_job_name test_job_name_1 = "test_job_1" test_job_name_2 = "test_job_2" test_job_1 = test_job_dir + "/" + test_job_name_1 test_job_2 = test_job_dir + "/" + test_job_name_2 test_job_chain = "test_job_chain" }
func main() { var joc_url string flag.StringVar(&joc_url, "u", "http://*****:*****@@@@@@@@@@@@Modify Hot Folder@@@@@@@@@@@@@@@@") script := &jobscheduler.Script{Language: "shell", Script: "echo test"} job := &jobscheduler.JobConf{Name: "hogehoge", Script: script} params := &jobscheduler.ModifyHotFolderInput{Folder: "support_test", Job: job} answer := client.ModifyHotFolder(params) if answer.Ok != nil { fmt.Println("OK!!!") } if answer.Error != nil { fmt.Println("ERROR!!!") } fmt.Println(answer.Ok) */ /* fmt.Println("@@@@@@@@@@@@Update Job@@@@@@@@@@@@@@@@") job := client.ShowJob("/support_test/hogehoge") script := &jobscheduler.Script{Language: "shell", Script: "echo hoge hoge hoge test"} job.Script = script answer := client.UpdateJob(job, "support_test") //params := &jobscheduler.ModifyHotFolderInput{Folder: "support_test", Job: job} //answer := client.ModifyHotFolder(params) fmt.Println(answer) */ fmt.Println("@@@@@@@@@@@@Show Order History@@@@@@@@@@@@@@@@") params := &jobscheduler.ShowOrderHistoryInput{JobChain: "test/test_job_chain"} answer := client.ShowOrderHistory(params) for _, order := range answer.JobChain.OrderHistory.Order { fmt.Println(order.StartTime) fmt.Println(order.EndTime) fmt.Println(order.Id) } }
func initClient() *jobscheduler.Client { return jobscheduler.NewClient(joc_url) }