| 581 | } |
| 582 | |
| 583 | func batchOperateSkipMessage(operate constant.AppOperate, status string) string { |
| 584 | switch status { |
| 585 | case constant.StatusInstalling, constant.StatusUpgrading, constant.StatusUninstalling, constant.StatusRebuilding: |
| 586 | return fmt.Sprintf("agent status is %s", status) |
| 587 | } |
| 588 | switch operate { |
| 589 | case constant.Start: |
| 590 | if status == constant.StatusRunning || status == constant.StatusStarting || status == constant.StatusRestarting { |
| 591 | return fmt.Sprintf("agent status is %s", status) |
| 592 | } |
| 593 | case constant.Stop: |
| 594 | if status != constant.StatusRunning { |
| 595 | return fmt.Sprintf("agent status is %s", status) |
| 596 | } |
| 597 | case constant.Restart: |
| 598 | if status == constant.StatusStarting { |
| 599 | return fmt.Sprintf("agent status is %s", status) |
| 600 | } |
| 601 | } |
| 602 | return "" |
| 603 | } |
| 604 | |
| 605 | func buildCreateReqFromBatchInstallReq(req dto.AgentBatchInstallReq) dto.AgentCreateReq { |
| 606 | return dto.AgentCreateReq{ |