Example #1
0
File: api.go Project: noqcks/docker
func procCreateSandbox(c libnetwork.NetworkController, vars map[string]string, body []byte) (interface{}, *responseStatus) {
	var create sandboxCreate

	err := json.Unmarshal(body, &create)
	if err != nil {
		return "", &responseStatus{Status: "Invalid body: " + err.Error(), StatusCode: http.StatusBadRequest}
	}

	sb, err := c.NewSandbox(create.ContainerID, create.parseOptions()...)
	if err != nil {
		return "", convertNetworkError(err)
	}

	return sb.ID(), &createdResponse
}