fixed errors when providing docker container name in the parameter

This commit is contained in:
2021-06-11 01:52:31 +04:00
parent af46493aa9
commit c9b35ac790
3 changed files with 14 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ var client = http.Client{}
// StartContainer Start container using REST api Implementation
// From the selected server IP address
// TODO: Test cases for this function
//Calls URL ex: http://0.0.0.0:8088/startcontainer?ports=0&GPU=false&ContainerName=docker-ubuntu-sshd
func StartContainer(IP string, NumPorts int, GPU bool, ContainerName string) (*docker.DockerVM ,error) {
// Passes URL with number of TCP ports to allocated and to give GPU access to the docker container
URL := "http://" + IP + ":" + serverPort + "/startcontainer?ports=" + fmt.Sprint(NumPorts) + "&GPU=" + strconv.FormatBool(GPU) + "&ContainerName=" + ContainerName