コード例 #1
0
        public virtual StorApiStatus GetDrivePool(Drive drive, ref SpacesPool pool)
        {
            StorApiStatus  storApiStatus  = StorApiStatusEnum.STOR_NO_ERROR;
            SpacesApiError spacesApiError = SpacesApiError.Success;

            if (drive == null)
            {
                return(StorApiStatusEnum.STOR_INVALID_PARAM);
            }
            StoragePool storagePool = null;

            spacesApiError = SpacesApi.SpacesApi.GetPhysicalDiskPool(drive.Id, ref storagePool);
            if (spacesApiError == SpacesApiError.Success && storagePool != null)
            {
                foreach (SpacesPool spacesPool in this.pools)
                {
                    if (string.Equals(spacesPool.Id, storagePool.ObjectId, StringComparison.OrdinalIgnoreCase))
                    {
                        pool = spacesPool;
                        break;
                    }
                }
            }
            return(SpacesUtil.ToStorApiStatus(spacesApiError));
        }
コード例 #2
0
        public StorApiStatus AddPool(SpacesPool pool)
        {
            StorApiStatus result = StorApiStatusEnum.STOR_NO_ERROR;

            if (this.pools == null)
            {
                this.pools = new List <SpacesPool>();
            }
            int i;

            for (i = 0; i < this.pools.Count; i++)
            {
                SpacesPool spacesPool = this.pools[i];
                if (string.Equals(spacesPool.Id, pool.Id, StringComparison.OrdinalIgnoreCase))
                {
                    this.pools[i] = spacesPool;
                    break;
                }
            }
            if (i == this.pools.Count)
            {
                this.pools.Add(pool);
            }
            return(result);
        }
コード例 #3
0
        public virtual StorApiStatus GetPool(string id, ref SpacesPool pool)
        {
            StorApiStatus result = StorApiStatusEnum.STOR_NO_ERROR;

            if (this.pools == null)
            {
                return(result);
            }
            for (int i = 0; i < this.pools.Count; i++)
            {
                SpacesPool spacesPool = this.pools[i];
                if (string.Equals(spacesPool.Id, id, StringComparison.OrdinalIgnoreCase))
                {
                    pool = spacesPool;
                    break;
                }
            }
            return(result);
        }