You are viewing limited content. For full access, please sign in.

Question

Question

SDK Volume export with LongOperation

asked on February 15, 2018 Show version history

I set up the following function to export a volume using repository access:

        public bool export(string volumeName, string volumePath)
        {
            try
            {
                VolumeInfo vi = Volume.GetInfo(volumeName, _lfSess);
                VolumeExportSettings veSettings = new VolumeExportSettings();
                veSettings.Path = volumePath;
                
                LongOperation longOp = vi.Export(veSettings);
                while (longOp.IsCompleted != true)
                {
                    System.Threading.Thread.Sleep(5000);
                    Console.Write(".");
                }
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }

The volume exports just fine but "longOp" never receives any values other than "isOpen" which is set to true.  Without the "IsCompleted" notification, the loop just keeps running long after the volume is exported.  Am I missing something about how this is supposed to work?

0 0

Answer

SELECTED ANSWER
replied on February 15, 2018

All updates in RA are driven by the client.  That is, you need to call Refresh() on the LongOperation object to get an update on its status.

0 0

Replies

replied on February 15, 2018

Worked great... thanks Brian!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.