예제 #1
0
        public Dictionary <string, ContainerInfoEntry> BulkInfo(string[] handles)
        {
            var response = new Dictionary <string, ContainerInfoEntry>();

            foreach (var handle in handles)
            {
                ContainerInfoEntry infoEntry = new ContainerInfoEntry();
                try
                {
                    var info = containerInfoService.GetInfoByHandle(handle);
                    if (info == null)
                    {
                        throw new Exception("container " + handle + " does not exist");
                    }
                    infoEntry.Info = info;
                }
                catch (Exception e)
                {
                    infoEntry.Err = new Error()
                    {
                        Message = "cannot get info for container " + handle + ". Error: " + e.Message,
                    };
                }
                response[handle] = infoEntry;
            }
            return(response);
        }
예제 #2
0
        public IHttpActionResult GetInfo(string handle)
        {
            var info = containerInfoService.GetInfoByHandle(handle);

            if (info == null)
            {
                return(NotFound());
            }
            return(Json(info));
        }
예제 #3
0
        public Dictionary <string, BulkInfoResponse> BulkInfo(string[] handles)
        {
            var response = new Dictionary <string, BulkInfoResponse>();

            foreach (var handle in handles)
            {
                var info = containerInfoService.GetInfoByHandle(handle);
                if (info != null)
                {
                    response[handle] = new BulkInfoResponse
                    {
                        Info = info,
                    };
                }
            }
            return(response);
        }