コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AttachServerVolumeRequest"/> class
        /// with the given device name and volume ID.
        /// </summary>
        /// <param name="device">
        /// The name of the device, such as <localUri>/dev/xvdb</localUri>. If the value
        /// is <see langword="null"/>, an automatically generated device name will be used.
        /// </param>
        /// <param name="volumeId">The volume ID. This is obtained from <see cref="Volume.Id"/>.</param>
        /// <exception cref="ArgumentNullException">If <paramref name="volumeId"/> is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentException">If <paramref name="volumeId"/> is empty.</exception>
        public AttachServerVolumeRequest(string device, string volumeId)
        {
            if (volumeId == null)
                throw new ArgumentNullException("volumeId");
            if (string.IsNullOrEmpty(volumeId))
                throw new ArgumentException("volumeId cannot be empty");

            ServerVolumeData = new AttachServerVolumeData(device, volumeId);
        }
コード例 #2
0
ファイル: ServerVolume.cs プロジェクト: krowin24/backuptool
        /// <summary>
        /// Initializes a new instance of the <see cref="AttachServerVolumeRequest"/> class
        /// with the given device name and volume ID.
        /// </summary>
        /// <param name="device">
        /// The name of the device, such as <localUri>/dev/xvdb</localUri>. If the value
        /// is <see langword="null"/>, an automatically generated device name will be used.
        /// </param>
        /// <param name="volumeId">The volume ID. This is obtained from <see cref="Volume.Id"/>.</param>
        /// <exception cref="ArgumentNullException">If <paramref name="volumeId"/> is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentException">If <paramref name="volumeId"/> is empty.</exception>
        public AttachServerVolumeRequest(string device, string volumeId)
        {
            if (volumeId == null)
            {
                throw new ArgumentNullException("volumeId");
            }
            if (string.IsNullOrEmpty(volumeId))
            {
                throw new ArgumentException("volumeId cannot be empty");
            }

            ServerVolumeData = new AttachServerVolumeData(device, volumeId);
        }