(req dto.AgentBatchInstallReq)
| 308 | } |
| 309 | |
| 310 | func (a AgentService) BatchInstall(req dto.AgentBatchInstallReq) (*dto.AgentItem, error) { |
| 311 | accountID, err := a.ensureBatchInstallAccount(req) |
| 312 | if err != nil { |
| 313 | return nil, err |
| 314 | } |
| 315 | createReq := buildCreateReqFromBatchInstallReq(req) |
| 316 | createReq.AccountID = accountID |
| 317 | if strings.TrimSpace(createReq.Name) == "" { |
| 318 | name, err := buildBatchInstallAgentName(createReq.AgentType) |
| 319 | if err != nil { |
| 320 | return nil, err |
| 321 | } |
| 322 | createReq.Name = name |
| 323 | } |
| 324 | if createReq.AgentType == constant.AppOpenclaw && len(createReq.AllowedOrigins) == 0 { |
| 325 | allowedOrigin, err := buildBatchInstallOpenclawAllowedOrigin(req) |
| 326 | if err != nil { |
| 327 | return nil, err |
| 328 | } |
| 329 | createReq.AllowedOrigins = []string{allowedOrigin} |
| 330 | } |
| 331 | return a.Create(createReq) |
| 332 | } |
| 333 | |
| 334 | func (a AgentService) BatchUpgrade(req dto.AgentBatchUpgradeReq) ([]dto.AgentBatchUpgradeResult, error) { |
| 335 | plans, results, err := buildBatchUpgradePlans(req) |
nothing calls this directly
no test coverage detected