Example #1
0
 /// <summary>
 /// 获取服务器磁盘情况
 /// </summary>
 /// <param name="DiskName">磁盘名称</param>
 /// <returns></returns>
 public BasicResponse <HardDiskInfo> GetDiskInfo(ConfigGetDiskInfoRequest request)
 {
     // return HardwareUtils.GetDiskInfo(diskName);
     return(new BasicResponse <HardDiskInfo>()
     {
         Data = HardwareUtils.GetDiskInfo(request.DiskName)
     });
 }
Example #2
0
        /// <summary>
        /// 获取数据库磁盘信息
        /// </summary>
        /// <returns></returns>
        public BasicResponse <HardDiskInfo> GetDatabaseDiskInfo()
        {
            BasicResponse <HardDiskInfo> response = new BasicResponse <HardDiskInfo>();
            string databaseDiskName = GetDatabaseDiskName();

            if (string.IsNullOrEmpty(databaseDiskName))
            {
                response.Code    = BasicResponseCodes.CommonFailure;
                response.Message = "未能正确解析数据库所在磁盘名称";
            }
            else
            {
                response.Data = HardwareUtils.GetDiskInfo(databaseDiskName);
            }
            return(response);
        }