Beispiel #1
0
        public void DeleteVolumes(IEnumerable <Volume> volumes)
        {
            var gets = volumes.Select(v => _compute.GetVolumeAsync(v.Id)).ToArray();

            Task.WaitAll(gets);

            var serverDeletes = gets.SelectMany(v => v.Result.Attachments.Select(a => a.ServerId))
                                .Select(serverId => _compute.WaitUntilServerIsDeletedAsync(serverId)).ToArray();

            Task.WaitAll(serverDeletes);

            var deletes = volumes.Select(x => x.DeleteAsync()).ToArray();

            Task.WaitAll(deletes);
        }