Re: About restful APIs for job services


Herman Zhu <zhuhui...@...>
 

Post the json data to job server 
{"job":{"name":"IMAGE_TRANSFER","parameters":{"dst_registry_insecure":false,"dst_registry_password":"SGFyYm9yMTIzNDUK","dst_registry_url":"http://192.168.191.157","dst_registry_username":"admin","repository":"library/rust","src_registry_insecure":true,"src_registry_url":"http://192.168.191.156","tags":"aa5551d785"},"metadata":{"kind":"Generic","unique":false},"status_hook":"test"}}

job server response the data

{"job":{"id":"3613fa8b32655b179a1f2f7d","status":"Pending","name":"IMAGE_TRANSFER","kind":"Generic","unique":false,"ref_link":"/api/v1/jobs/3613fa8b32655b179a1f2f7d","enqueue_time":1538408243,"update_time":1538408243,"hook_status":"activated"}}

job server log is 

Oct  1 23:37:25 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:25Z [INFO] Job incoming: IMAGE_TRANSFER:3613fa8b32655b179a1f2f7d
Oct  1 23:37:25 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:25Z [ERROR] [service_logger.go:63]: Job 'IMAGE_TRANSFER:3613fa8b32655b179a1f2f7d' exit with error: Runtime error: interface conversion: interface {} is string, not []interface {}
Oct  1 23:37:25 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:25Z [WARNING] Failed to process 'report_status' request with error: Post test: unsupported protocol scheme ""
Oct  1 23:37:25 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:25Z [WARNING] Failed to process 'report_status' request with error: Post test: unsupported protocol scheme ""
Oct  1 23:37:27 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:27Z [WARNING] Failed to process 'mark_die_at' request with error: seems 3613fa8b32655b179a1f2f7d is not a dead job
Oct  1 23:37:29 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:29Z [WARNING] Failed to process 'report_status' request with error: Post test: unsupported protocol scheme ""
Oct  1 23:37:29 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:29Z [WARNING] Failed to process 'mark_die_at' request with error: seems 3613fa8b32655b179a1f2f7d is not a dead job
Oct  1 23:37:30 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:30Z [WARNING] Failed to process 'report_status' request with error: Post test: unsupported protocol scheme ""
Oct  1 23:37:39 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:39Z [ERROR] [service_logger.go:63]: Failed to process 'report_status' request with error: Post test: unsupported protocol scheme "" (3 times tried)
Oct  1 23:37:42 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:42Z [ERROR] [service_logger.go:63]: Failed to process 'report_status' request with error: Post test: unsupported protocol scheme "" (3 times tried)
Oct  1 23:37:42 172.18.0.1 jobservice[23019]: 2018-10-01T15:37:42Z [ERROR] [service_logger.go:63]: Failed to process 'mark_die_at' request with error: seems 3613fa8b32655b179a1f2f7d is not a dead job (3 times tried)


Join harbor-users@lists.cncf.io to automatically receive all group messages.