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

Method ContainerCreate

agent/app/api/v2/container.go:459–470  ·  view source on GitHub ↗

@Tags Container @Summary Create container @Accept json @Param request body dto.ContainerOperate true "request" @Success 200 @Security ApiKeyAuth @Security Timestamp @Router /containers [post] @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器 [name][image]

(c *gin.Context)

Source from the content-addressed store, hash-verified

457// @Router /containers [post]
458// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器 [name][image]","formatEN":"create container [name][image]"}
459func (b *BaseApi) ContainerCreate(c *gin.Context) {
460 var req dto.ContainerOperate
461 if err := helper.CheckBindAndValidate(&req, c); err != nil {
462 return
463 }
464
465 if err := containerService.ContainerCreate(req, true); err != nil {
466 helper.InternalServer(c, err)
467 return
468 }
469 helper.Success(c)
470}
471
472// @Tags Container
473// @Summary Upgrade container

Callers

nothing calls this directly

Calls 1

ContainerCreateMethod · 0.65

Tested by

no test coverage detected