MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / BatchInstall

Method BatchInstall

agent/app/service/agents.go:310–332  ·  view source on GitHub ↗
(req dto.AgentBatchInstallReq)

Source from the content-addressed store, hash-verified

308}
309
310func (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
334func (a AgentService) BatchUpgrade(req dto.AgentBatchUpgradeReq) ([]dto.AgentBatchUpgradeResult, error) {
335 plans, results, err := buildBatchUpgradePlans(req)

Callers

nothing calls this directly

Tested by

no test coverage detected