예제 #1
0
파일: Manage.cs 프로젝트: sd05031/SEproject
        public int update_container()
        {
            Containers = new List <Container>();
            JObject result;

            try
            {
                result = JObject.Parse(serverconnector.GET("containers"));
            }
            catch (Exception ex)
            {
                return(-1);
            }

            if (result["code"].ToString() == "0")
            {
                JArray jarray = JArray.Parse(result["msg"].ToString());

                for (int i = 0; i < jarray.Count; i++)
                {
                    Containers.Add(new Container(jarray[i].ToString()));
                }
                return(jarray.Count);
            }
            else
            {
                return(-1);
            }
        }
예제 #2
0
        public int remove()
        {
            JObject result = JObject.Parse(serverconnector.GET("image/rm/" + image.uuid));

            if (result["code"].ToString() == "0")
            {
                return(0);
            }
            return(-1);
        }
예제 #3
0
        public int remove()
        {
            string  r      = serverconnector.GET("container/rm/" + container.uuid);
            JObject result = JObject.Parse(r);

            if (result["code"].ToString() == "0")
            {
                return(0);
            }
            return(-1);
        }