package containers

import (
	"floares/config"
	"io"
	"log"
	"net/http"
)

func Start(id string) error {
	///libpod/containers/01fa88c29752b2f6fa6ed0df14868966e13b9ce460c4b71e070a44a59fd37218/start
	req, err := http.NewRequest(http.MethodPost, config.Entrypoint+"/v2.2.2/libpod/containers/"+id+"/start", nil)
	if err != nil {
		log.Println("request for containers list error:", err)
		return err
	}
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Println("request for containers list error:", err)
		return err
	}
	defer res.Body.Close()
	str, err := io.ReadAll(res.Body)
	log.Println(string(str))
	return nil
}
