示例#1
0
        public void VolumeGet()
        {
            Configure();

            var newVolume = volumeApi.FindById(datacenter.Id, volume.Id);

            Assert.IsNotNull(newVolume);
        }
        protected override void BeginProcessing()
        {
            try
            {
                var volumeApi = new VolumeApi(Utilities.Configuration);

                if (string.IsNullOrEmpty(VolumeId))
                {
                    var volumes = volumeApi.FindAll(DataCenterId, depth: 5);
                    WriteObject(volumes.Items);
                    return;
                }
                else
                {
                    var volume = volumeApi.FindById(DataCenterId, VolumeId, depth: 5);
                    WriteObject(volume);
                    return;
                }
            }
            catch (Exception ex)
            {
                WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
            }
        }