job.go 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. package model
  2. // PaasJobResponse create job response in paas.
  3. type PaasJobResponse struct {
  4. ExcludeDataResponse
  5. Data interface{} `json:"data"`
  6. }
  7. //Job job json
  8. type Job struct {
  9. Name string `json:"name"`
  10. CPU int `json:"cpu"`
  11. Memory int `json:"memory"`
  12. Parallelism int `json:"parallelism"`
  13. FileName string `json:"file_name"`
  14. ResJtl string `json:"res_jtl"`
  15. ResLog string `json:"res_log"`
  16. JmeterLog string `json:"jmeter_log"`
  17. EnvInfo string `json:"env_info"`
  18. JarPath string `json:"jar_path"`
  19. Command string `json:"command"`
  20. }
  21. // CleanableDocker docker clearable container list
  22. type CleanableDocker struct {
  23. Name string `json:"name"`
  24. }
  25. //PaasQueryAndDelJob query and del machines request.
  26. type PaasQueryAndDelJob struct {
  27. BusinessUnit string `json:"business_unit"`
  28. Project string `json:"project"`
  29. App string `json:"app"`
  30. Env string `json:"env"`
  31. Name string `json:"name"`
  32. ClusterID int `json:"cluster_id"`
  33. TreeID int `json:"tree_id"`
  34. }
  35. // PaasJobDetail machine detail.
  36. type PaasJobDetail struct {
  37. BusinessUnit string `json:"business_unit"`
  38. Project string `json:"project"`
  39. App string `json:"app"`
  40. Env string `json:"env"`
  41. Name string `json:"name"`
  42. Image string `json:"image"`
  43. ImageVersion string `json:"image_version"`
  44. Volumes string `json:"volumes"`
  45. CPURequest int `json:"cpu_request"`
  46. CPULimit int `json:"cpu_limit"`
  47. MemoryRequest int `json:"memory_request"`
  48. Command string `json:"command"`
  49. ResourcePoolID string `json:"resource_pool_id"`
  50. Parallelism int `json:"parallelism"`
  51. Completions int `json:"completions"`
  52. RetriesLimit int `json:"retries_limit"`
  53. NetworkID int `json:"network_id"`
  54. ClusterID int `json:"cluster_id"`
  55. TreeID int `json:"tree_id"`
  56. HostInfo string `json:"host_info"`
  57. EnvInfo string `json:"env_info"`
  58. }
  59. // PaasJobQueryStatus machine detail.
  60. type PaasJobQueryStatus struct {
  61. ExcludeDataResponse
  62. Data PaasJobQueryData `json:"data"`
  63. }
  64. // PaasJobQueryData machine detail.
  65. type PaasJobQueryData struct {
  66. StartTime string `json:"start_time"`
  67. CompletionTime string `json:"completion_time"`
  68. ActiveNum int `json:"active_num"`
  69. SucceededNum int `json:"succeeded_num"`
  70. FailedNum int `json:"failed_num"`
  71. Conditions PaasJobQueryConditions `json:"conditions"`
  72. Pods []PodInfo `json:"pods"`
  73. }
  74. //PaasQueryJobCPUPostDetail query job cpu detail
  75. type PaasQueryJobCPUPostDetail struct {
  76. Action string `json:"Action"`
  77. PublicKey string `json:"PublicKey"`
  78. Signature int `json:"Signature"`
  79. DataSource string `json:"DataSource"`
  80. Query string `json:"Query"`
  81. }
  82. //PaasQueryJobCPUResult paas query cpu result
  83. type PaasQueryJobCPUResult struct {
  84. ReqID string `json:"ReqId"`
  85. Action string `json:"Action"`
  86. RetCode int `json:"RetCode"`
  87. Data []CPUResult `json:"Data"`
  88. }
  89. //CPUResult cpu result
  90. type CPUResult struct {
  91. JobMetric JobMetric `json:"metric"`
  92. Value []interface{} `json:"value"`
  93. }
  94. //JobMetric job metric
  95. type JobMetric struct {
  96. ContainerEnvAppID string `json:"container_env_app_id"`
  97. ContainerEnvDeployEnv string `json:"container_env_deploy_env"`
  98. ContainerEnvPodCon string `json:"container_env_pod_container"`
  99. ContainerEnvPodName string `json:"container_env_pod_name"`
  100. Job string `json:"job"`
  101. Pro string `json:"pro"`
  102. }
  103. // PodInfo pod info
  104. type PodInfo struct {
  105. AppID string `json:"app_id"`
  106. AppType string `json:"app_type"`
  107. ContainerID string `json:"container_id"`
  108. ContainerStatuses interface{} `json:"container_statuses"`
  109. CreateTime string `json:"create_time"`
  110. DeployEnv string `json:"deploy_env"`
  111. DiscoveryStatus interface{} `json:"discovery_status"`
  112. Health string `json:"health"`
  113. HostIP string `json:"host_ip"`
  114. Image string `json:"image"`
  115. IP string `json:"ip"`
  116. Lables interface{} `json:"lables"`
  117. Name string `json:"name"`
  118. Namespace string `json:"namespace"`
  119. Port interface{} `json:"port"`
  120. StartTime string `json:"start_time"`
  121. Status string `json:"status"`
  122. }
  123. // PaasJobQueryConditions machine detail.
  124. type PaasJobQueryConditions struct {
  125. Complete string `json:"complete"`
  126. }