MCPcopy Index your code
hub / github.com/coder/coder / DeleteDevcontainer

Method DeleteDevcontainer

codersdk/workspacesdk/agentconn.go:780–792  ·  view source on GitHub ↗

DeleteDevcontainer deletes the provided devcontainer. This is a blocking call and will wait for the container to be deleted.

(ctx context.Context, devcontainerID string)

Source from the content-addressed store, hash-verified

778// DeleteDevcontainer deletes the provided devcontainer.
779// This is a blocking call and will wait for the container to be deleted.
780func (c *agentConn) DeleteDevcontainer(ctx context.Context, devcontainerID string) error {
781 ctx, span := tracing.StartSpan(ctx)
782 defer span.End()
783 res, err := c.apiRequest(ctx, http.MethodDelete, "/api/v0/containers/devcontainers/"+devcontainerID, nil)
784 if err != nil {
785 return xerrors.Errorf("do request: %w", err)
786 }
787 defer res.Body.Close()
788 if res.StatusCode != http.StatusNoContent {
789 return codersdk.ReadBodyAsError(res)
790 }
791 return nil
792}
793
794// RecreateDevcontainer recreates a devcontainer with the given container.
795// This is a blocking call and will wait for the container to be recreated.

Callers

nothing calls this directly

Calls 5

apiRequestMethod · 0.95
StartSpanFunction · 0.92
ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected