/// <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);
        }
Esempio n. 2
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 <c>null</c>, 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 <c>null</c>.</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);
        }