Exemplo n.º 1
0
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"
}
Exemplo n.º 2
0
func main() {
	var joc_url string
	flag.StringVar(&joc_url, "u", "http://localhost:4444/", "Please input JOC URL")
	flag.StringVar(&joc_url, "url", "http://localhost:4444/", "Please input JOC URL")
	flag.Parse()

	fmt.Println(joc_url)

	client := jobscheduler.NewClient(joc_url)
	/*
		fmt.Println("@@@@@@@@@@@@Modify Hot [email protected]@@@@@@@@@@@@@@@")
		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 [email protected]@@@@@@@@@@@@@@@")
		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 [email protected]@@@@@@@@@@@@@@@")
	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)
	}

}
Exemplo n.º 3
0
func initClient() *jobscheduler.Client {
	return jobscheduler.NewClient(joc_url)
}