Example #1
0
        /// <summary>
        /// Restore backup
        /// </summary>
        /// <param name="type"></param>
        /// <param name="vmId"></param>
        /// <param name="archive"></param>
        /// <returns></returns>
        public Result RestoreBackup(VMTypeEnum type, int vmId, string archive)
        {
            switch (type)
            {
            case VMTypeEnum.Qemu: return(Client.Nodes[Id].Qemu.CreateRest(vmid: vmId, archive: archive));

            case VMTypeEnum.Lxc: return(Client.Nodes[Id].Lxc.CreateRest(vmid: vmId, ostemplate: archive));

            default: return(null);
            }
        }
Example #2
0
 /// <summary>
 /// Restore backup
 /// </summary>
 /// <param name="type"></param>
 /// <param name="vmId"></param>
 /// <param name="archive"></param>
 /// <returns></returns>
 public Result RestoreBackup(VMTypeEnum type, int vmId, string archive)
 => type switch
 {
Example #3
0
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="VMTypeEnum" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => VMTypeEnum.CreateFrom(sourceValue);