diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/IVirtualizationServer2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/IVirtualizationServer2012.cs new file mode 100644 index 00000000..f234ef0d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/IVirtualizationServer2012.cs @@ -0,0 +1,115 @@ +// Copyright (c) 2015, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.Providers.Virtualization +{ + public interface IVirtualizationServer2012 + { + // Virtual Machines + VirtualMachine GetVirtualMachine(string vmId); + VirtualMachine GetVirtualMachineEx(string vmId); + List GetVirtualMachines(); + byte[] GetVirtualMachineThumbnailImage(string vmId, ThumbnailSize size); + VirtualMachine CreateVirtualMachine(VirtualMachine vm); + VirtualMachine UpdateVirtualMachine(VirtualMachine vm); + JobResult ChangeVirtualMachineState(string vmId, VirtualMachineRequestedState newState); + ReturnCode ShutDownVirtualMachine(string vmId, bool force, string reason); + List GetVirtualMachineJobs(string vmId); + JobResult RenameVirtualMachine(string vmId, string name); + JobResult ExportVirtualMachine(string vmId, string exportPath); + JobResult DeleteVirtualMachine(string vmId); + + // Snapshots + List GetVirtualMachineSnapshots(string vmId); + VirtualMachineSnapshot GetSnapshot(string snapshotId); + JobResult CreateSnapshot(string vmId); + JobResult RenameSnapshot(string vmId, string snapshotId, string name); + JobResult ApplySnapshot(string vmId, string snapshotId); + JobResult DeleteSnapshot(string snapshotId); + JobResult DeleteSnapshotSubtree(string snapshotId); + byte[] GetSnapshotThumbnailImage(string snapshotId, ThumbnailSize size); + + // Virtual Switches + List GetExternalSwitches(string computerName); + List GetSwitches(); + bool SwitchExists(string switchId); + VirtualSwitch CreateSwitch(string name); + ReturnCode DeleteSwitch(string switchId); + + // DVD operations + string GetInsertedDVD(string vmId); + JobResult InsertDVD(string vmId, string isoPath); + JobResult EjectDVD(string vmId); + + // KVP items + List GetKVPItems(string vmId); + List GetStandardKVPItems(string vmId); + JobResult AddKVPItems(string vmId, KvpExchangeDataItem[] items); + JobResult RemoveKVPItems(string vmId, string[] itemNames); + JobResult ModifyKVPItems(string vmId, KvpExchangeDataItem[] items); + + // Library + LibraryItem[] GetLibraryItems(string path); + + // Storage + VirtualHardDiskInfo GetVirtualHardDiskInfo(string vhdPath); + MountedDiskInfo MountVirtualHardDisk(string vhdPath); + ReturnCode UnmountVirtualHardDisk(string vhdPath); + JobResult ExpandVirtualHardDisk(string vhdPath, UInt64 sizeGB); + JobResult ConvertVirtualHardDisk(string sourcePath, string destinationPath, VirtualHardDiskType diskType); + void ExpandDiskVolume(string diskAddress, string volumeName); + void DeleteRemoteFile(string path); + string ReadRemoteFile(string path); + void WriteRemoteFile(string path, string content); + + // Jobs + ConcreteJob GetJob(string jobId); + List GetAllJobs(); + ChangeJobStateReturnCode ChangeJobState(string jobId, ConcreteJobRequestedState newState); + + // Configuration + int GetProcessorCoresNumber(); + + List GetCertificates(string remoteServer); + void SetReplicaServer(string remoteServer, string thumbprint, string storagePath); + void UnsetReplicaServer(string remoteServer); + void EnableVmReplication(string vmId, string replicaServer, VmReplication replication); + void SetVmReplication(string vmId, string replicaServer, VmReplication replication); + void TestReplicationServer(string vmId, string replicaServer, string localThumbprint); + void StartInitialReplication(string vmId); + VmReplication GetReplication(string vmId); + bool DisableVmReplication(string vmId, string replicaServer); + ReplicationDetailInfo GetReplicationInfo(string vmId); + void PauseReplication(string vmId); + void ResumeReplication(string vmId); + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/CertificateInfo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/CertificateInfo.cs new file mode 100644 index 00000000..5d35700c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/CertificateInfo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.Virtualization +{ + public class CertificateInfo + { + public string Thumbprint { get; set; } + public string Subject { get; set; } + public string Title { get; set; } + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicaFrequency.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicaFrequency.cs new file mode 100644 index 00000000..e9207c38 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicaFrequency.cs @@ -0,0 +1,9 @@ +namespace WebsitePanel.Providers.Virtualization +{ + public enum ReplicaFrequency + { + Seconds30 = 30, + Minutes5 = 300, + Minutes15 = 900, + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicaMode.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicaMode.cs new file mode 100644 index 00000000..77008773 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicaMode.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.Virtualization +{ + public enum ReplicaMode + { + None = 0, + ReplicationEnabled = 1, + IsReplicaServer = 2, + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationDetailInfo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationDetailInfo.cs new file mode 100644 index 00000000..77fe5aa6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationDetailInfo.cs @@ -0,0 +1,23 @@ +using System; + +namespace WebsitePanel.Providers.Virtualization +{ + public class ReplicationDetailInfo + { + public VmReplicationMode Mode { get; set; } + public ReplicationState State { get; set; } + public ReplicationHealth Health { get; set; } + public string HealthDetails { get; set; } + public string PrimaryServerName { get; set; } + public string ReplicaServerName { get; set; } + public DateTime FromTime { get; set; } + public DateTime ToTime { get; set; } + public string AverageSize { get; set; } + public string MaximumSize { get; set; } + public TimeSpan AverageLatency { get; set; } + public int Errors { get; set; } + public int SuccessfulReplications { get; set; } + public string PendingSize { get; set; } + public DateTime LastSynhronizedAt { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationHealth.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationHealth.cs new file mode 100644 index 00000000..ebac7337 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationHealth.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.Virtualization +{ + public enum ReplicationHealth + { + Critical, + Warning, + Normal, + NotApplicable, + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationState.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationState.cs new file mode 100644 index 00000000..394a7aa5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/ReplicationState.cs @@ -0,0 +1,25 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.Virtualization +{ + public enum ReplicationState + { + Disabled, + Error, + FailOverWaitingCompletion, + FailedOver, + NotApplicable, + ReadyForInitialReplication, + Replicating, + Resynchronizing, + ResynchronizeSuspended, + Suspended, + SyncedReplicationComplete, + WaitingForInitialReplication, + WaitingForStartResynchronize, + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/VmReplication.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/VmReplication.cs new file mode 100644 index 00000000..915c3a0e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/VmReplication.cs @@ -0,0 +1,21 @@ +namespace WebsitePanel.Providers.Virtualization +{ + [Persistent] + public class VmReplication + { + [Persistent] + public string Thumbprint { get; set; } + + [Persistent] + public string VhdToReplicate { get; set; } + + [Persistent] + public ReplicaFrequency ReplicaFrequency { get; set; } + + [Persistent] + public int AdditionalRecoveryPoints { get; set; } + + [Persistent] + public int VSSSnapshotFrequencyHour { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/VmReplicationMode.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/VmReplicationMode.cs new file mode 100644 index 00000000..6c520fe5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/Replication/VmReplicationMode.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.Virtualization +{ + public enum VmReplicationMode + { + None, + Primary, + Replica, + TestReplica, + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/VirtualMachine.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/VirtualMachine.cs index a4f1b809..5a8d6678 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/VirtualMachine.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Virtualization/VirtualMachine.cs @@ -134,8 +134,7 @@ namespace WebsitePanel.Providers.Virtualization [Persistent] public string Status { get; set; } - [Persistent] - public string ReplicationState { get; set; } + public ReplicationState ReplicationState { get; set; } [Persistent] public int Generation { get; set; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 013e31a3..6ac5b9f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -310,6 +310,7 @@ Code + Code @@ -326,6 +327,14 @@ + + + + + + + + Code diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs index acdcf69c..6e270640 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Constants.cs @@ -20,6 +20,7 @@ namespace WebsitePanel.Providers.Virtualization public const Int64 Size1G = 0x40000000; public const Int64 Size1M = 0x100000; + public const Int64 Size1K = 1024; public const string KVP_RAM_SUMMARY_KEY = "VM-RAM-Summary"; public const string KVP_HDD_SUMMARY_KEY = "VM-HDD-Summary"; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs index ba8df901..5bb57fb2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Extensions/PSObjectExtension.cs @@ -20,9 +20,17 @@ namespace WebsitePanel.Providers.Virtualization { return (T)obj.Members[name].Value; } - public static T GetEnum(this PSObject obj, string name) where T : struct + public static T GetEnum(this PSObject obj, string name, T? defaultValue = null) where T : struct { - return (T)Enum.Parse(typeof(T), GetProperty(obj, name).ToString()); + try + { + return (T) Enum.Parse(typeof (T), GetProperty(obj, name).ToString()); + } + catch + { + if (defaultValue.HasValue) return defaultValue.Value; + throw; + } } public static int GetInt(this PSObject obj, string name) { @@ -40,6 +48,25 @@ namespace WebsitePanel.Providers.Virtualization { return Convert.ToBoolean(obj.Members[name].Value); } + + public static string GetMb(this PSObject obj, string name) + { + var bytes = GetLong(obj, name); + + if (bytes == 0) + return "0"; + + if (bytes > Constants.Size1G) + return string.Format("{0:0.0} GB", bytes / Constants.Size1G); + + if (bytes > Constants.Size1M) + return string.Format("{0:0.0} MB", bytes / Constants.Size1M); + + if (bytes > Constants.Size1K) + return string.Format("{0:0.0} KB", bytes / Constants.Size1K); + + return string.Format("{0} b", bytes); + } #endregion diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/ReplicaHelper.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/ReplicaHelper.cs new file mode 100644 index 00000000..3eeda2a4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/ReplicaHelper.cs @@ -0,0 +1,49 @@ +using System.Management.Automation.Runspaces; + +namespace WebsitePanel.Providers.Virtualization +{ + public static class ReplicaHelper + { + public static void SetReplicaServer(PowerShellManager powerShell, bool enabled, string remoteServer, string thumbprint, string storagePath) + { + Command cmd = new Command("Set-VMReplicationServer"); + cmd.Parameters.Add("ReplicationEnabled", enabled); + + if (!string.IsNullOrEmpty(remoteServer)) + { + cmd.Parameters.Add("ComputerName", remoteServer); + } + + if (!string.IsNullOrEmpty(thumbprint)) + { + cmd.Parameters.Add("AllowedAuthenticationType", "Certificate"); + cmd.Parameters.Add("CertificateThumbprint", thumbprint); + } + + if (!string.IsNullOrEmpty(storagePath)) + { + cmd.Parameters.Add("ReplicationAllowedFromAnyServer", true); + cmd.Parameters.Add("DefaultStorageLocation", storagePath); + } + + powerShell.Execute(cmd, false); + } + + public static void SetFirewallRule(PowerShellManager powerShell, bool enabled) + { + Command cmd = new Command("Enable-Netfirewallrule"); + cmd.Parameters.Add("DisplayName", "Hyper-V Replica HTTPS Listener (TCP-In)"); + + powerShell.Execute(cmd, false); + } + + public static void RemoveVmReplication(PowerShellManager powerShell, string vmName, string server) + { + Command cmd = new Command("Remove-VMReplication"); + cmd.Parameters.Add("VmName", vmName); + if (!string.IsNullOrEmpty(server)) cmd.Parameters.Add("ComputerName", server); + + powerShell.Execute(cmd, false); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs index 68cd50ac..7cebe04b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/Helpers/VirtualMachineHelper.cs @@ -61,5 +61,24 @@ namespace WebsitePanel.Providers.Virtualization powerShell.Execute(cmd, true); } + + public static void Delete(PowerShellManager powerShell, string vmName, string server) + { + Command cmd = new Command("Remove-VM"); + cmd.Parameters.Add("Name", vmName); + if (!string.IsNullOrEmpty(server)) cmd.Parameters.Add("ComputerName", server); + cmd.Parameters.Add("Force"); + powerShell.Execute(cmd, false, true); + } + public static void Stop(PowerShellManager powerShell, string vmName, bool force, string server) + { + Command cmd = new Command("Stop-VM"); + + if (force) cmd.Parameters.Add("Force"); + if (!string.IsNullOrEmpty(server)) cmd.Parameters.Add("ComputerName", server); + //if (!string.IsNullOrEmpty(reason)) cmd.Parameters.Add("Reason", reason); + + powerShell.Execute(cmd, false); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs index 9cfaba40..c65b5c90 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs @@ -56,7 +56,7 @@ using System.Configuration; namespace WebsitePanel.Providers.Virtualization { - public class HyperV2012R2 : HostingServiceProviderBase, IVirtualizationServer + public class HyperV2012R2 : HostingServiceProviderBase, IVirtualizationServer2012 { #region Provider Settings protected string ServerNameSettings @@ -98,6 +98,20 @@ namespace WebsitePanel.Providers.Virtualization { get { return ProviderSettings.GetInt("CpuWeight"); } } + + + public ReplicaMode ReplicaMode + { + get { return (ReplicaMode) ProviderSettings.GetInt("ReplicaMode"); } + } + protected string ReplicaServerPath + { + get { return ProviderSettings["ReplicaServerPath"]; } + } + protected string ReplicaServerThumbprint + { + get { return ProviderSettings["ReplicaServerThumbprint"]; } + } #endregion #region Fields @@ -157,12 +171,12 @@ namespace WebsitePanel.Providers.Virtualization vm.RamSize = Convert.ToInt32(ConvertNullableToInt64(result[0].GetProperty("MemoryStartup")) / Constants.Size1M); vm.Uptime = Convert.ToInt64(result[0].GetProperty("UpTime").TotalMilliseconds); vm.Status = result[0].GetProperty("Status").ToString(); - vm.ReplicationState = result[0].GetProperty("ReplicationState").ToString(); vm.Generation = result[0].GetInt("Generation"); vm.ProcessorCount = result[0].GetInt("ProcessorCount"); vm.ParentSnapshotId = result[0].GetString("ParentSnapshotId"); vm.Heartbeat = VirtualMachineHelper.GetVMHeartBeatStatus(PowerShell, vm.Name); vm.CreatedDate = DateTime.Now; + vm.ReplicationState = result[0].GetEnum("ReplicationState"); if (extendedInfo) { @@ -222,9 +236,10 @@ namespace WebsitePanel.Providers.Virtualization VirtualMachine vm = new VirtualMachine { VirtualMachineId = current.GetProperty("Id").ToString(), - Name = current.GetProperty("Name").ToString(), - State = (VirtualMachineState)Enum.Parse(typeof(VirtualMachineState), current.GetProperty("State").ToString()), - Uptime = Convert.ToInt64(current.GetProperty("UpTime").TotalMilliseconds) + Name = current.GetString("Name"), + State = current.GetEnum("State"), + Uptime = Convert.ToInt64(current.GetProperty("UpTime").TotalMilliseconds), + ReplicationState = result[0].GetEnum("ReplicationState") }; vmachines.Add(vm); } @@ -443,30 +458,11 @@ namespace WebsitePanel.Providers.Virtualization public ReturnCode ShutDownVirtualMachine(string vmId, bool force, string reason) { - HostedSolutionLog.LogStart("ShutDownVirtualMachine"); - ReturnCode returnCode = ReturnCode.OK; - var vm = GetVirtualMachine(vmId); - try - { - Command cmd = new Command("Stop-VM"); + VirtualMachineHelper.Stop(PowerShell, vm.Name, force, ServerNameSettings); - cmd.Parameters.Add("Name", vm.Name); - if (force) cmd.Parameters.Add("Force"); - //if (!string.IsNullOrEmpty(reason)) cmd.Parameters.Add("Reason", reason); - - PowerShell.Execute(cmd, true); - } - catch (Exception ex) - { - HostedSolutionLog.LogError("ShutDownVirtualMachine", ex); - throw; - } - - HostedSolutionLog.LogEnd("ShutDownVirtualMachine"); - - return returnCode; + return ReturnCode.OK; } public List GetVirtualMachineJobs(string vmId) @@ -517,10 +513,7 @@ namespace WebsitePanel.Providers.Virtualization //DeleteSwitch(networkAdapter.SwitchName); } - Command cmdSet = new Command("Remove-VM"); - cmdSet.Parameters.Add("Name", vm.Name); - cmdSet.Parameters.Add("Force"); - PowerShell.Execute(cmdSet, true, true); + VirtualMachineHelper.Delete(PowerShell, vm.Name, ServerNameSettings); return JobHelper.CreateSuccessResult(ReturnCode.JobStarted); } @@ -1963,6 +1956,284 @@ namespace WebsitePanel.Providers.Virtualization return !String.IsNullOrEmpty(connString); } #endregion Hyper-V Cloud - + + #region Replication + + public List GetCertificates(string remoteServer) + { + // we cant get certificates from remote server + if (string.IsNullOrEmpty(remoteServer)) + return null; + + Command cmd = new Command("Get-ChildItem"); + cmd.Parameters.Add("Path", @"cert:\LocalMachine\My"); + + Collection result = PowerShell.Execute(cmd, true); + + return result + .Select( + cert => new CertificateInfo + { + Subject = cert.GetString("Subject"), + Thumbprint = cert.GetString("Thumbprint"), + Title = string.Format("{0} ({1})", cert.GetString("Thumbprint"), cert.GetString("Subject")), + }) + .ToList(); + } + + public void SetReplicaServer(string remoteServer, string thumbprint, string storagePath) + { + // we cant enable firewall rules on remote server + if (!string.IsNullOrEmpty(remoteServer)) + { + ReplicaHelper.SetFirewallRule(PowerShell, true); + } + + ReplicaHelper.SetReplicaServer(PowerShell, true, remoteServer, thumbprint, storagePath); + } + + public void UnsetReplicaServer(string remoteServer) + { + ReplicaHelper.SetReplicaServer(PowerShell, false, remoteServer, null, null); + } + + public void EnableVmReplication(string vmId, string replicaServer, VmReplication replication) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + var vm = GetVirtualMachineEx(vmId); + + Command cmd = new Command("Enable-VMReplication"); + cmd.Parameters.Add("VmName", vm.Name); + cmd.Parameters.Add("ReplicaServerName", replicaServer); + cmd.Parameters.Add("ReplicaServerPort", 443); + cmd.Parameters.Add("AuthenticationType", "Cert"); + cmd.Parameters.Add("CertificateThumbprint", replication.Thumbprint); + cmd.Parameters.Add("ReplicationFrequencySec", (int)replication.ReplicaFrequency); + + var excludes = vm.Disks + .Select(d => d.Path) + .Where(p => !p.Equals(replication.VhdToReplicate, StringComparison.OrdinalIgnoreCase)) + .ToArray(); + if (excludes.Any()) + cmd.Parameters.Add("ExcludedVhdPath", excludes); + + // recovery points + if (replication.AdditionalRecoveryPoints > 0) + { + if (replication.AdditionalRecoveryPoints > 24) + throw new Exception("AdditionalRecoveryPoints can not be greater than 24"); + + cmd.Parameters.Add("RecoveryHistory", replication.AdditionalRecoveryPoints); + + if (replication.VSSSnapshotFrequencyHour > 0) + { + if (replication.VSSSnapshotFrequencyHour > 12) + throw new Exception("VSSSnapshotFrequencyHour can not be greater than 12"); + + cmd.Parameters.Add("VSSSnapshotFrequencyHour", replication.VSSSnapshotFrequencyHour); + } + } + + PowerShell.Execute(cmd, true); + + // Initial Replication + StartInitialReplication(vmId); + } + + public void SetVmReplication(string vmId, string replicaServer, VmReplication replication) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + var vm = GetVirtualMachineEx(vmId); + + Command cmd = new Command("Set-VMReplication"); + cmd.Parameters.Add("VmName", vm.Name); + cmd.Parameters.Add("ReplicaServerName", replicaServer); + cmd.Parameters.Add("ReplicaServerPort", 443); + cmd.Parameters.Add("AuthenticationType", "Cert"); + cmd.Parameters.Add("CertificateThumbprint", replication.Thumbprint); + cmd.Parameters.Add("ReplicationFrequencySec", (int)replication.ReplicaFrequency); + + var excludes = vm.Disks + .Select(d => d.Path) + .Where(p => !p.Equals(replication.VhdToReplicate, StringComparison.OrdinalIgnoreCase)) + .ToArray(); + if (excludes.Any()) + cmd.Parameters.Add("ExcludedVhdPath", excludes); + + // recovery points + if (replication.AdditionalRecoveryPoints > 0) + { + if (replication.AdditionalRecoveryPoints > 24) + throw new Exception("AdditionalRecoveryPoints can not be greater than 24"); + + cmd.Parameters.Add("RecoveryHistory", replication.AdditionalRecoveryPoints); + + if (replication.VSSSnapshotFrequencyHour > 0) + { + if (replication.VSSSnapshotFrequencyHour > 12) + throw new Exception("VSSSnapshotFrequencyHour can not be greater than 12"); + + cmd.Parameters.Add("VSSSnapshotFrequencyHour", replication.VSSSnapshotFrequencyHour); + } + } + + PowerShell.Execute(cmd, true); + } + + public void TestReplicationServer(string vmId, string replicaServer, string localThumbprint) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + var vm = GetVirtualMachine(vmId); + + Command cmd = new Command("Test-VMReplicationConnection"); + cmd.Parameters.Add("VmName", vm.Name); + cmd.Parameters.Add("ReplicaServerName", replicaServer); + cmd.Parameters.Add("ReplicaServerPort", 443); + cmd.Parameters.Add("AuthenticationType", "Cert"); + cmd.Parameters.Add("CertificateThumbprint", localThumbprint); + + PowerShell.Execute(cmd, true); + } + + public void StartInitialReplication(string vmId) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + var vm = GetVirtualMachine(vmId); + + Command cmd = new Command("Start-VMInitialReplication"); + cmd.Parameters.Add("VmName", vm.Name); + + PowerShell.Execute(cmd, true); + } + + public VmReplication GetReplication(string vmId) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + VmReplication replica = null; + var vm = GetVirtualMachineEx(vmId); + + Command cmd = new Command("Get-VMReplication"); + cmd.Parameters.Add("VmName", vm.Name); + + Collection result = PowerShell.Execute(cmd, true); + + if (result != null && result.Count > 0) + { + replica = new VmReplication(); + replica.ReplicaFrequency = result[0].GetEnum("FrequencySec", ReplicaFrequency.Seconds30); + replica.Thumbprint = result[0].GetString("CertificateThumbprint"); + replica.AdditionalRecoveryPoints = result[0].GetInt("RecoveryHistory"); + replica.VSSSnapshotFrequencyHour = result[0].GetInt("VSSSnapshotFrequencyHour"); + + List excludes = new List(); + foreach (dynamic item in (IEnumerable) result[0].GetProperty("ExcludedDisks")) + excludes.Add(item.Path.ToString()); + replica.VhdToReplicate = vm.Disks + .Select(d => d.Path) + .FirstOrDefault(p => excludes.All(ep => !p.Equals(ep, StringComparison.OrdinalIgnoreCase))); + } + + return replica; + } + + public bool DisableVmReplication(string vmId, string replicaServer) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + var vm = GetVirtualMachine(vmId); + + ReplicaHelper.RemoveVmReplication(PowerShell, vm.Name, ServerNameSettings); + + // move it to EnterpriseServer? + // If we have access - delete garbage from replica server + try + { + ReplicaHelper.RemoveVmReplication(PowerShell, vm.Name, replicaServer); + // Delete replica vm + VirtualMachineHelper.Stop(PowerShell, vm.Name, true, replicaServer); + VirtualMachineHelper.Delete(PowerShell, vm.Name, replicaServer); + } + catch + { + return false; + } + + return true; + } + + + public ReplicationDetailInfo GetReplicationInfo(string vmId) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + ReplicationDetailInfo replica = null; + var vm = GetVirtualMachine(vmId); + + Command cmd = new Command("Measure-VMReplication"); + cmd.Parameters.Add("VmName", vm.Name); + + Collection result = PowerShell.Execute(cmd, true); + + if (result != null && result.Count > 0) + { + replica = new ReplicationDetailInfo(); + replica.AverageLatency = result[0].GetProperty("AverageReplicationLatency"); + replica.AverageSize = result[0].GetMb("AverageReplicationSize"); + replica.Errors = result[0].GetInt("ReplicationErrors"); + replica.FromTime = result[0].GetProperty("MonitoringStartTime"); + replica.Health = result[0].GetEnum("ReplicationHealth"); + replica.HealthDetails = result[0].GetString("ReplicationHealthDetails"); + replica.LastSynhronizedAt = result[0].GetProperty("LastReplicationTime"); + replica.MaximumSize = result[0].GetMb("MaximumReplicationSize"); + replica.Mode = result[0].GetEnum("ReplicationMode"); + replica.PendingSize = result[0].GetMb("PendingReplicationSize"); + replica.PrimaryServerName = result[0].GetString("PrimaryServerName"); + replica.ReplicaServerName = result[0].GetString("CurrentReplicaServerName"); + replica.State = result[0].GetEnum("ReplicationState"); + replica.SuccessfulReplications = result[0].GetInt("SuccessfulReplicationCount"); + replica.ToTime = result[0].GetProperty("MonitoringEndTime"); + } + + return replica; + } + + public void PauseReplication(string vmId) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + var vm = GetVirtualMachine(vmId); + + Command cmd = new Command("Suspend-VMReplication"); + cmd.Parameters.Add("VmName", vm.Name); + + PowerShell.Execute(cmd, true); + } + + public void ResumeReplication(string vmId) + { + if (ReplicaMode != ReplicaMode.ReplicationEnabled) + throw new Exception("Server does not allow replication by settings"); + + var vm = GetVirtualMachine(vmId); + + Command cmd = new Command("Resume-VMReplication"); + cmd.Parameters.Add("VmName", vm.Name); + + PowerShell.Execute(cmd, true); + } + #endregion } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj index 814d9693..52087d00 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj @@ -56,6 +56,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/VirtualizationServerProxy2012.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/VirtualizationServerProxy2012.cs new file mode 100644 index 00000000..132c2287 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/VirtualizationServerProxy2012.cs @@ -0,0 +1,3455 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.7905 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// + +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Providers.Virtualization2012 { + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="VirtualizationServerSoap", Namespace="http://smbsaas/websitepanel/server/")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] + public partial class VirtualizationServer : Microsoft.Web.Services3.WebServicesClientProtocol { + + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; + + private System.Threading.SendOrPostCallback GetVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineExOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachinesOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineThumbnailImageOperationCompleted; + + private System.Threading.SendOrPostCallback CreateVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback ChangeVirtualMachineStateOperationCompleted; + + private System.Threading.SendOrPostCallback ShutDownVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineJobsOperationCompleted; + + private System.Threading.SendOrPostCallback RenameVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback ExportVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineSnapshotsOperationCompleted; + + private System.Threading.SendOrPostCallback GetSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback CreateSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback RenameSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback ApplySnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteSnapshotSubtreeOperationCompleted; + + private System.Threading.SendOrPostCallback GetSnapshotThumbnailImageOperationCompleted; + + private System.Threading.SendOrPostCallback GetExternalSwitchesOperationCompleted; + + private System.Threading.SendOrPostCallback GetSwitchesOperationCompleted; + + private System.Threading.SendOrPostCallback SwitchExistsOperationCompleted; + + private System.Threading.SendOrPostCallback CreateSwitchOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteSwitchOperationCompleted; + + private System.Threading.SendOrPostCallback GetInsertedDVDOperationCompleted; + + private System.Threading.SendOrPostCallback InsertDVDOperationCompleted; + + private System.Threading.SendOrPostCallback EjectDVDOperationCompleted; + + private System.Threading.SendOrPostCallback GetLibraryItemsOperationCompleted; + + private System.Threading.SendOrPostCallback GetKVPItemsOperationCompleted; + + private System.Threading.SendOrPostCallback GetStandardKVPItemsOperationCompleted; + + private System.Threading.SendOrPostCallback AddKVPItemsOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveKVPItemsOperationCompleted; + + private System.Threading.SendOrPostCallback ModifyKVPItemsOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualHardDiskInfoOperationCompleted; + + private System.Threading.SendOrPostCallback MountVirtualHardDiskOperationCompleted; + + private System.Threading.SendOrPostCallback UnmountVirtualHardDiskOperationCompleted; + + private System.Threading.SendOrPostCallback ExpandVirtualHardDiskOperationCompleted; + + private System.Threading.SendOrPostCallback ConvertVirtualHardDiskOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteRemoteFileOperationCompleted; + + private System.Threading.SendOrPostCallback ExpandDiskVolumeOperationCompleted; + + private System.Threading.SendOrPostCallback ReadRemoteFileOperationCompleted; + + private System.Threading.SendOrPostCallback WriteRemoteFileOperationCompleted; + + private System.Threading.SendOrPostCallback GetJobOperationCompleted; + + private System.Threading.SendOrPostCallback GetAllJobsOperationCompleted; + + private System.Threading.SendOrPostCallback ChangeJobStateOperationCompleted; + + private System.Threading.SendOrPostCallback GetProcessorCoresNumberOperationCompleted; + + /// + public VirtualizationServer() { + this.Url = "http://172.31.0.5:9090/VirtualizationServer2012.asmx"; + } + + /// + public event GetVirtualMachineCompletedEventHandler GetVirtualMachineCompleted; + + /// + public event GetVirtualMachineExCompletedEventHandler GetVirtualMachineExCompleted; + + /// + public event GetVirtualMachinesCompletedEventHandler GetVirtualMachinesCompleted; + + /// + public event GetVirtualMachineThumbnailImageCompletedEventHandler GetVirtualMachineThumbnailImageCompleted; + + /// + public event CreateVirtualMachineCompletedEventHandler CreateVirtualMachineCompleted; + + /// + public event UpdateVirtualMachineCompletedEventHandler UpdateVirtualMachineCompleted; + + /// + public event ChangeVirtualMachineStateCompletedEventHandler ChangeVirtualMachineStateCompleted; + + /// + public event ShutDownVirtualMachineCompletedEventHandler ShutDownVirtualMachineCompleted; + + /// + public event GetVirtualMachineJobsCompletedEventHandler GetVirtualMachineJobsCompleted; + + /// + public event RenameVirtualMachineCompletedEventHandler RenameVirtualMachineCompleted; + + /// + public event DeleteVirtualMachineCompletedEventHandler DeleteVirtualMachineCompleted; + + /// + public event ExportVirtualMachineCompletedEventHandler ExportVirtualMachineCompleted; + + /// + public event GetVirtualMachineSnapshotsCompletedEventHandler GetVirtualMachineSnapshotsCompleted; + + /// + public event GetSnapshotCompletedEventHandler GetSnapshotCompleted; + + /// + public event CreateSnapshotCompletedEventHandler CreateSnapshotCompleted; + + /// + public event RenameSnapshotCompletedEventHandler RenameSnapshotCompleted; + + /// + public event ApplySnapshotCompletedEventHandler ApplySnapshotCompleted; + + /// + public event DeleteSnapshotCompletedEventHandler DeleteSnapshotCompleted; + + /// + public event DeleteSnapshotSubtreeCompletedEventHandler DeleteSnapshotSubtreeCompleted; + + /// + public event GetSnapshotThumbnailImageCompletedEventHandler GetSnapshotThumbnailImageCompleted; + + /// + public event GetExternalSwitchesCompletedEventHandler GetExternalSwitchesCompleted; + + /// + public event GetSwitchesCompletedEventHandler GetSwitchesCompleted; + + /// + public event SwitchExistsCompletedEventHandler SwitchExistsCompleted; + + /// + public event CreateSwitchCompletedEventHandler CreateSwitchCompleted; + + /// + public event DeleteSwitchCompletedEventHandler DeleteSwitchCompleted; + + /// + public event GetInsertedDVDCompletedEventHandler GetInsertedDVDCompleted; + + /// + public event InsertDVDCompletedEventHandler InsertDVDCompleted; + + /// + public event EjectDVDCompletedEventHandler EjectDVDCompleted; + + /// + public event GetLibraryItemsCompletedEventHandler GetLibraryItemsCompleted; + + /// + public event GetKVPItemsCompletedEventHandler GetKVPItemsCompleted; + + /// + public event GetStandardKVPItemsCompletedEventHandler GetStandardKVPItemsCompleted; + + /// + public event AddKVPItemsCompletedEventHandler AddKVPItemsCompleted; + + /// + public event RemoveKVPItemsCompletedEventHandler RemoveKVPItemsCompleted; + + /// + public event ModifyKVPItemsCompletedEventHandler ModifyKVPItemsCompleted; + + /// + public event GetVirtualHardDiskInfoCompletedEventHandler GetVirtualHardDiskInfoCompleted; + + /// + public event MountVirtualHardDiskCompletedEventHandler MountVirtualHardDiskCompleted; + + /// + public event UnmountVirtualHardDiskCompletedEventHandler UnmountVirtualHardDiskCompleted; + + /// + public event ExpandVirtualHardDiskCompletedEventHandler ExpandVirtualHardDiskCompleted; + + /// + public event ConvertVirtualHardDiskCompletedEventHandler ConvertVirtualHardDiskCompleted; + + /// + public event DeleteRemoteFileCompletedEventHandler DeleteRemoteFileCompleted; + + /// + public event ExpandDiskVolumeCompletedEventHandler ExpandDiskVolumeCompleted; + + /// + public event ReadRemoteFileCompletedEventHandler ReadRemoteFileCompleted; + + /// + public event WriteRemoteFileCompletedEventHandler WriteRemoteFileCompleted; + + /// + public event GetJobCompletedEventHandler GetJobCompleted; + + /// + public event GetAllJobsCompletedEventHandler GetAllJobsCompleted; + + /// + public event ChangeJobStateCompletedEventHandler ChangeJobStateCompleted; + + /// + public event GetProcessorCoresNumberCompletedEventHandler GetProcessorCoresNumberCompleted; + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine GetVirtualMachine(string vmId) { + object[] results = this.Invoke("GetVirtualMachine", new object[] { + vmId}); + return ((VirtualMachine)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachine(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachine", new object[] { + vmId}, callback, asyncState); + } + + /// + public VirtualMachine EndGetVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine)(results[0])); + } + + /// + public void GetVirtualMachineAsync(string vmId) { + this.GetVirtualMachineAsync(vmId, null); + } + + /// + public void GetVirtualMachineAsync(string vmId, object userState) { + if ((this.GetVirtualMachineOperationCompleted == null)) { + this.GetVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineOperationCompleted); + } + this.InvokeAsync("GetVirtualMachine", new object[] { + vmId}, this.GetVirtualMachineOperationCompleted, userState); + } + + private void OnGetVirtualMachineOperationCompleted(object arg) { + if ((this.GetVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineCompleted(this, new GetVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetVirtualMachineEx", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine GetVirtualMachineEx(string vmId) { + object[] results = this.Invoke("GetVirtualMachineEx", new object[] { + vmId}); + return ((VirtualMachine)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineEx(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineEx", new object[] { + vmId}, callback, asyncState); + } + + /// + public VirtualMachine EndGetVirtualMachineEx(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine)(results[0])); + } + + /// + public void GetVirtualMachineExAsync(string vmId) { + this.GetVirtualMachineExAsync(vmId, null); + } + + /// + public void GetVirtualMachineExAsync(string vmId, object userState) { + if ((this.GetVirtualMachineExOperationCompleted == null)) { + this.GetVirtualMachineExOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineExOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineEx", new object[] { + vmId}, this.GetVirtualMachineExOperationCompleted, userState); + } + + private void OnGetVirtualMachineExOperationCompleted(object arg) { + if ((this.GetVirtualMachineExCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineExCompleted(this, new GetVirtualMachineExCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetVirtualMachines", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine[] GetVirtualMachines() { + object[] results = this.Invoke("GetVirtualMachines", new object[0]); + return ((VirtualMachine[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachines(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachines", new object[0], callback, asyncState); + } + + /// + public VirtualMachine[] EndGetVirtualMachines(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine[])(results[0])); + } + + /// + public void GetVirtualMachinesAsync() { + this.GetVirtualMachinesAsync(null); + } + + /// + public void GetVirtualMachinesAsync(object userState) { + if ((this.GetVirtualMachinesOperationCompleted == null)) { + this.GetVirtualMachinesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachinesOperationCompleted); + } + this.InvokeAsync("GetVirtualMachines", new object[0], this.GetVirtualMachinesOperationCompleted, userState); + } + + private void OnGetVirtualMachinesOperationCompleted(object arg) { + if ((this.GetVirtualMachinesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachinesCompleted(this, new GetVirtualMachinesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetVirtualMachineThumbnailImage", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] GetVirtualMachineThumbnailImage(string vmId, ThumbnailSize size) { + object[] results = this.Invoke("GetVirtualMachineThumbnailImage", new object[] { + vmId, + size}); + return ((byte[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineThumbnailImage(string vmId, ThumbnailSize size, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineThumbnailImage", new object[] { + vmId, + size}, callback, asyncState); + } + + /// + public byte[] EndGetVirtualMachineThumbnailImage(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((byte[])(results[0])); + } + + /// + public void GetVirtualMachineThumbnailImageAsync(string vmId, ThumbnailSize size) { + this.GetVirtualMachineThumbnailImageAsync(vmId, size, null); + } + + /// + public void GetVirtualMachineThumbnailImageAsync(string vmId, ThumbnailSize size, object userState) { + if ((this.GetVirtualMachineThumbnailImageOperationCompleted == null)) { + this.GetVirtualMachineThumbnailImageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineThumbnailImageOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineThumbnailImage", new object[] { + vmId, + size}, this.GetVirtualMachineThumbnailImageOperationCompleted, userState); + } + + private void OnGetVirtualMachineThumbnailImageOperationCompleted(object arg) { + if ((this.GetVirtualMachineThumbnailImageCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineThumbnailImageCompleted(this, new GetVirtualMachineThumbnailImageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine CreateVirtualMachine(VirtualMachine vm) { + object[] results = this.Invoke("CreateVirtualMachine", new object[] { + vm}); + return ((VirtualMachine)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateVirtualMachine(VirtualMachine vm, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateVirtualMachine", new object[] { + vm}, callback, asyncState); + } + + /// + public VirtualMachine EndCreateVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine)(results[0])); + } + + /// + public void CreateVirtualMachineAsync(VirtualMachine vm) { + this.CreateVirtualMachineAsync(vm, null); + } + + /// + public void CreateVirtualMachineAsync(VirtualMachine vm, object userState) { + if ((this.CreateVirtualMachineOperationCompleted == null)) { + this.CreateVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateVirtualMachineOperationCompleted); + } + this.InvokeAsync("CreateVirtualMachine", new object[] { + vm}, this.CreateVirtualMachineOperationCompleted, userState); + } + + private void OnCreateVirtualMachineOperationCompleted(object arg) { + if ((this.CreateVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateVirtualMachineCompleted(this, new CreateVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine UpdateVirtualMachine(VirtualMachine vm) { + object[] results = this.Invoke("UpdateVirtualMachine", new object[] { + vm}); + return ((VirtualMachine)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateVirtualMachine(VirtualMachine vm, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UpdateVirtualMachine", new object[] { + vm}, callback, asyncState); + } + + /// + public VirtualMachine EndUpdateVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine)(results[0])); + } + + /// + public void UpdateVirtualMachineAsync(VirtualMachine vm) { + this.UpdateVirtualMachineAsync(vm, null); + } + + /// + public void UpdateVirtualMachineAsync(VirtualMachine vm, object userState) { + if ((this.UpdateVirtualMachineOperationCompleted == null)) { + this.UpdateVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateVirtualMachineOperationCompleted); + } + this.InvokeAsync("UpdateVirtualMachine", new object[] { + vm}, this.UpdateVirtualMachineOperationCompleted, userState); + } + + private void OnUpdateVirtualMachineOperationCompleted(object arg) { + if ((this.UpdateVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateVirtualMachineCompleted(this, new UpdateVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ChangeVirtualMachineState", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult ChangeVirtualMachineState(string vmId, VirtualMachineRequestedState newState) { + object[] results = this.Invoke("ChangeVirtualMachineState", new object[] { + vmId, + newState}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginChangeVirtualMachineState(string vmId, VirtualMachineRequestedState newState, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ChangeVirtualMachineState", new object[] { + vmId, + newState}, callback, asyncState); + } + + /// + public JobResult EndChangeVirtualMachineState(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void ChangeVirtualMachineStateAsync(string vmId, VirtualMachineRequestedState newState) { + this.ChangeVirtualMachineStateAsync(vmId, newState, null); + } + + /// + public void ChangeVirtualMachineStateAsync(string vmId, VirtualMachineRequestedState newState, object userState) { + if ((this.ChangeVirtualMachineStateOperationCompleted == null)) { + this.ChangeVirtualMachineStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeVirtualMachineStateOperationCompleted); + } + this.InvokeAsync("ChangeVirtualMachineState", new object[] { + vmId, + newState}, this.ChangeVirtualMachineStateOperationCompleted, userState); + } + + private void OnChangeVirtualMachineStateOperationCompleted(object arg) { + if ((this.ChangeVirtualMachineStateCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ChangeVirtualMachineStateCompleted(this, new ChangeVirtualMachineStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ShutDownVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ReturnCode ShutDownVirtualMachine(string vmId, bool force, string reason) { + object[] results = this.Invoke("ShutDownVirtualMachine", new object[] { + vmId, + force, + reason}); + return ((ReturnCode)(results[0])); + } + + /// + public System.IAsyncResult BeginShutDownVirtualMachine(string vmId, bool force, string reason, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ShutDownVirtualMachine", new object[] { + vmId, + force, + reason}, callback, asyncState); + } + + /// + public ReturnCode EndShutDownVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ReturnCode)(results[0])); + } + + /// + public void ShutDownVirtualMachineAsync(string vmId, bool force, string reason) { + this.ShutDownVirtualMachineAsync(vmId, force, reason, null); + } + + /// + public void ShutDownVirtualMachineAsync(string vmId, bool force, string reason, object userState) { + if ((this.ShutDownVirtualMachineOperationCompleted == null)) { + this.ShutDownVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShutDownVirtualMachineOperationCompleted); + } + this.InvokeAsync("ShutDownVirtualMachine", new object[] { + vmId, + force, + reason}, this.ShutDownVirtualMachineOperationCompleted, userState); + } + + private void OnShutDownVirtualMachineOperationCompleted(object arg) { + if ((this.ShutDownVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ShutDownVirtualMachineCompleted(this, new ShutDownVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetVirtualMachineJobs", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ConcreteJob[] GetVirtualMachineJobs(string vmId) { + object[] results = this.Invoke("GetVirtualMachineJobs", new object[] { + vmId}); + return ((ConcreteJob[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineJobs(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineJobs", new object[] { + vmId}, callback, asyncState); + } + + /// + public ConcreteJob[] EndGetVirtualMachineJobs(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ConcreteJob[])(results[0])); + } + + /// + public void GetVirtualMachineJobsAsync(string vmId) { + this.GetVirtualMachineJobsAsync(vmId, null); + } + + /// + public void GetVirtualMachineJobsAsync(string vmId, object userState) { + if ((this.GetVirtualMachineJobsOperationCompleted == null)) { + this.GetVirtualMachineJobsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineJobsOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineJobs", new object[] { + vmId}, this.GetVirtualMachineJobsOperationCompleted, userState); + } + + private void OnGetVirtualMachineJobsOperationCompleted(object arg) { + if ((this.GetVirtualMachineJobsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineJobsCompleted(this, new GetVirtualMachineJobsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RenameVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult RenameVirtualMachine(string vmId, string name) { + object[] results = this.Invoke("RenameVirtualMachine", new object[] { + vmId, + name}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginRenameVirtualMachine(string vmId, string name, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RenameVirtualMachine", new object[] { + vmId, + name}, callback, asyncState); + } + + /// + public JobResult EndRenameVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void RenameVirtualMachineAsync(string vmId, string name) { + this.RenameVirtualMachineAsync(vmId, name, null); + } + + /// + public void RenameVirtualMachineAsync(string vmId, string name, object userState) { + if ((this.RenameVirtualMachineOperationCompleted == null)) { + this.RenameVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRenameVirtualMachineOperationCompleted); + } + this.InvokeAsync("RenameVirtualMachine", new object[] { + vmId, + name}, this.RenameVirtualMachineOperationCompleted, userState); + } + + private void OnRenameVirtualMachineOperationCompleted(object arg) { + if ((this.RenameVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RenameVirtualMachineCompleted(this, new RenameVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult DeleteVirtualMachine(string vmId) { + object[] results = this.Invoke("DeleteVirtualMachine", new object[] { + vmId}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteVirtualMachine(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteVirtualMachine", new object[] { + vmId}, callback, asyncState); + } + + /// + public JobResult EndDeleteVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void DeleteVirtualMachineAsync(string vmId) { + this.DeleteVirtualMachineAsync(vmId, null); + } + + /// + public void DeleteVirtualMachineAsync(string vmId, object userState) { + if ((this.DeleteVirtualMachineOperationCompleted == null)) { + this.DeleteVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteVirtualMachineOperationCompleted); + } + this.InvokeAsync("DeleteVirtualMachine", new object[] { + vmId}, this.DeleteVirtualMachineOperationCompleted, userState); + } + + private void OnDeleteVirtualMachineOperationCompleted(object arg) { + if ((this.DeleteVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteVirtualMachineCompleted(this, new DeleteVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ExportVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult ExportVirtualMachine(string vmId, string exportPath) { + object[] results = this.Invoke("ExportVirtualMachine", new object[] { + vmId, + exportPath}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginExportVirtualMachine(string vmId, string exportPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ExportVirtualMachine", new object[] { + vmId, + exportPath}, callback, asyncState); + } + + /// + public JobResult EndExportVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void ExportVirtualMachineAsync(string vmId, string exportPath) { + this.ExportVirtualMachineAsync(vmId, exportPath, null); + } + + /// + public void ExportVirtualMachineAsync(string vmId, string exportPath, object userState) { + if ((this.ExportVirtualMachineOperationCompleted == null)) { + this.ExportVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExportVirtualMachineOperationCompleted); + } + this.InvokeAsync("ExportVirtualMachine", new object[] { + vmId, + exportPath}, this.ExportVirtualMachineOperationCompleted, userState); + } + + private void OnExportVirtualMachineOperationCompleted(object arg) { + if ((this.ExportVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ExportVirtualMachineCompleted(this, new ExportVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetVirtualMachineSnapshots", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachineSnapshot[] GetVirtualMachineSnapshots(string vmId) { + object[] results = this.Invoke("GetVirtualMachineSnapshots", new object[] { + vmId}); + return ((VirtualMachineSnapshot[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineSnapshots(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineSnapshots", new object[] { + vmId}, callback, asyncState); + } + + /// + public VirtualMachineSnapshot[] EndGetVirtualMachineSnapshots(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachineSnapshot[])(results[0])); + } + + /// + public void GetVirtualMachineSnapshotsAsync(string vmId) { + this.GetVirtualMachineSnapshotsAsync(vmId, null); + } + + /// + public void GetVirtualMachineSnapshotsAsync(string vmId, object userState) { + if ((this.GetVirtualMachineSnapshotsOperationCompleted == null)) { + this.GetVirtualMachineSnapshotsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineSnapshotsOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineSnapshots", new object[] { + vmId}, this.GetVirtualMachineSnapshotsOperationCompleted, userState); + } + + private void OnGetVirtualMachineSnapshotsOperationCompleted(object arg) { + if ((this.GetVirtualMachineSnapshotsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineSnapshotsCompleted(this, new GetVirtualMachineSnapshotsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetSnapshot", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachineSnapshot GetSnapshot(string snapshotId) { + object[] results = this.Invoke("GetSnapshot", new object[] { + snapshotId}); + return ((VirtualMachineSnapshot)(results[0])); + } + + /// + public System.IAsyncResult BeginGetSnapshot(string snapshotId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSnapshot", new object[] { + snapshotId}, callback, asyncState); + } + + /// + public VirtualMachineSnapshot EndGetSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachineSnapshot)(results[0])); + } + + /// + public void GetSnapshotAsync(string snapshotId) { + this.GetSnapshotAsync(snapshotId, null); + } + + /// + public void GetSnapshotAsync(string snapshotId, object userState) { + if ((this.GetSnapshotOperationCompleted == null)) { + this.GetSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSnapshotOperationCompleted); + } + this.InvokeAsync("GetSnapshot", new object[] { + snapshotId}, this.GetSnapshotOperationCompleted, userState); + } + + private void OnGetSnapshotOperationCompleted(object arg) { + if ((this.GetSnapshotCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSnapshotCompleted(this, new GetSnapshotCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateSnapshot", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult CreateSnapshot(string vmId) { + object[] results = this.Invoke("CreateSnapshot", new object[] { + vmId}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateSnapshot(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateSnapshot", new object[] { + vmId}, callback, asyncState); + } + + /// + public JobResult EndCreateSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void CreateSnapshotAsync(string vmId) { + this.CreateSnapshotAsync(vmId, null); + } + + /// + public void CreateSnapshotAsync(string vmId, object userState) { + if ((this.CreateSnapshotOperationCompleted == null)) { + this.CreateSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateSnapshotOperationCompleted); + } + this.InvokeAsync("CreateSnapshot", new object[] { + vmId}, this.CreateSnapshotOperationCompleted, userState); + } + + private void OnCreateSnapshotOperationCompleted(object arg) { + if ((this.CreateSnapshotCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateSnapshotCompleted(this, new CreateSnapshotCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RenameSnapshot", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult RenameSnapshot(string vmId, string snapshotId, string name) { + object[] results = this.Invoke("RenameSnapshot", new object[] { + vmId, + snapshotId, + name}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginRenameSnapshot(string vmId, string snapshotId, string name, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RenameSnapshot", new object[] { + vmId, + snapshotId, + name}, callback, asyncState); + } + + /// + public JobResult EndRenameSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void RenameSnapshotAsync(string vmId, string snapshotId, string name) { + this.RenameSnapshotAsync(vmId, snapshotId, name, null); + } + + /// + public void RenameSnapshotAsync(string vmId, string snapshotId, string name, object userState) { + if ((this.RenameSnapshotOperationCompleted == null)) { + this.RenameSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRenameSnapshotOperationCompleted); + } + this.InvokeAsync("RenameSnapshot", new object[] { + vmId, + snapshotId, + name}, this.RenameSnapshotOperationCompleted, userState); + } + + private void OnRenameSnapshotOperationCompleted(object arg) { + if ((this.RenameSnapshotCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RenameSnapshotCompleted(this, new RenameSnapshotCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ApplySnapshot", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult ApplySnapshot(string vmId, string snapshotId) { + object[] results = this.Invoke("ApplySnapshot", new object[] { + vmId, + snapshotId}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginApplySnapshot(string vmId, string snapshotId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ApplySnapshot", new object[] { + vmId, + snapshotId}, callback, asyncState); + } + + /// + public JobResult EndApplySnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void ApplySnapshotAsync(string vmId, string snapshotId) { + this.ApplySnapshotAsync(vmId, snapshotId, null); + } + + /// + public void ApplySnapshotAsync(string vmId, string snapshotId, object userState) { + if ((this.ApplySnapshotOperationCompleted == null)) { + this.ApplySnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnApplySnapshotOperationCompleted); + } + this.InvokeAsync("ApplySnapshot", new object[] { + vmId, + snapshotId}, this.ApplySnapshotOperationCompleted, userState); + } + + private void OnApplySnapshotOperationCompleted(object arg) { + if ((this.ApplySnapshotCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ApplySnapshotCompleted(this, new ApplySnapshotCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteSnapshot", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult DeleteSnapshot(string snapshotId) { + object[] results = this.Invoke("DeleteSnapshot", new object[] { + snapshotId}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteSnapshot(string snapshotId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteSnapshot", new object[] { + snapshotId}, callback, asyncState); + } + + /// + public JobResult EndDeleteSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void DeleteSnapshotAsync(string snapshotId) { + this.DeleteSnapshotAsync(snapshotId, null); + } + + /// + public void DeleteSnapshotAsync(string snapshotId, object userState) { + if ((this.DeleteSnapshotOperationCompleted == null)) { + this.DeleteSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSnapshotOperationCompleted); + } + this.InvokeAsync("DeleteSnapshot", new object[] { + snapshotId}, this.DeleteSnapshotOperationCompleted, userState); + } + + private void OnDeleteSnapshotOperationCompleted(object arg) { + if ((this.DeleteSnapshotCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteSnapshotCompleted(this, new DeleteSnapshotCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteSnapshotSubtree", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult DeleteSnapshotSubtree(string snapshotId) { + object[] results = this.Invoke("DeleteSnapshotSubtree", new object[] { + snapshotId}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteSnapshotSubtree(string snapshotId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteSnapshotSubtree", new object[] { + snapshotId}, callback, asyncState); + } + + /// + public JobResult EndDeleteSnapshotSubtree(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void DeleteSnapshotSubtreeAsync(string snapshotId) { + this.DeleteSnapshotSubtreeAsync(snapshotId, null); + } + + /// + public void DeleteSnapshotSubtreeAsync(string snapshotId, object userState) { + if ((this.DeleteSnapshotSubtreeOperationCompleted == null)) { + this.DeleteSnapshotSubtreeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSnapshotSubtreeOperationCompleted); + } + this.InvokeAsync("DeleteSnapshotSubtree", new object[] { + snapshotId}, this.DeleteSnapshotSubtreeOperationCompleted, userState); + } + + private void OnDeleteSnapshotSubtreeOperationCompleted(object arg) { + if ((this.DeleteSnapshotSubtreeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteSnapshotSubtreeCompleted(this, new DeleteSnapshotSubtreeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetSnapshotThumbnailImage", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] GetSnapshotThumbnailImage(string snapshotId, ThumbnailSize size) { + object[] results = this.Invoke("GetSnapshotThumbnailImage", new object[] { + snapshotId, + size}); + return ((byte[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetSnapshotThumbnailImage(string snapshotId, ThumbnailSize size, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSnapshotThumbnailImage", new object[] { + snapshotId, + size}, callback, asyncState); + } + + /// + public byte[] EndGetSnapshotThumbnailImage(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((byte[])(results[0])); + } + + /// + public void GetSnapshotThumbnailImageAsync(string snapshotId, ThumbnailSize size) { + this.GetSnapshotThumbnailImageAsync(snapshotId, size, null); + } + + /// + public void GetSnapshotThumbnailImageAsync(string snapshotId, ThumbnailSize size, object userState) { + if ((this.GetSnapshotThumbnailImageOperationCompleted == null)) { + this.GetSnapshotThumbnailImageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSnapshotThumbnailImageOperationCompleted); + } + this.InvokeAsync("GetSnapshotThumbnailImage", new object[] { + snapshotId, + size}, this.GetSnapshotThumbnailImageOperationCompleted, userState); + } + + private void OnGetSnapshotThumbnailImageOperationCompleted(object arg) { + if ((this.GetSnapshotThumbnailImageCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSnapshotThumbnailImageCompleted(this, new GetSnapshotThumbnailImageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetExternalSwitches", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualSwitch[] GetExternalSwitches(string computerName) { + object[] results = this.Invoke("GetExternalSwitches", new object[] { + computerName}); + return ((VirtualSwitch[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetExternalSwitches(string computerName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExternalSwitches", new object[] { + computerName}, callback, asyncState); + } + + /// + public VirtualSwitch[] EndGetExternalSwitches(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualSwitch[])(results[0])); + } + + /// + public void GetExternalSwitchesAsync(string computerName) { + this.GetExternalSwitchesAsync(computerName, null); + } + + /// + public void GetExternalSwitchesAsync(string computerName, object userState) { + if ((this.GetExternalSwitchesOperationCompleted == null)) { + this.GetExternalSwitchesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExternalSwitchesOperationCompleted); + } + this.InvokeAsync("GetExternalSwitches", new object[] { + computerName}, this.GetExternalSwitchesOperationCompleted, userState); + } + + private void OnGetExternalSwitchesOperationCompleted(object arg) { + if ((this.GetExternalSwitchesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExternalSwitchesCompleted(this, new GetExternalSwitchesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetSwitches", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualSwitch[] GetSwitches() { + object[] results = this.Invoke("GetSwitches", new object[0]); + return ((VirtualSwitch[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetSwitches(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSwitches", new object[0], callback, asyncState); + } + + /// + public VirtualSwitch[] EndGetSwitches(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualSwitch[])(results[0])); + } + + /// + public void GetSwitchesAsync() { + this.GetSwitchesAsync(null); + } + + /// + public void GetSwitchesAsync(object userState) { + if ((this.GetSwitchesOperationCompleted == null)) { + this.GetSwitchesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSwitchesOperationCompleted); + } + this.InvokeAsync("GetSwitches", new object[0], this.GetSwitchesOperationCompleted, userState); + } + + private void OnGetSwitchesOperationCompleted(object arg) { + if ((this.GetSwitchesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSwitchesCompleted(this, new GetSwitchesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SwitchExists", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool SwitchExists(string switchId) { + object[] results = this.Invoke("SwitchExists", new object[] { + switchId}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginSwitchExists(string switchId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SwitchExists", new object[] { + switchId}, callback, asyncState); + } + + /// + public bool EndSwitchExists(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void SwitchExistsAsync(string switchId) { + this.SwitchExistsAsync(switchId, null); + } + + /// + public void SwitchExistsAsync(string switchId, object userState) { + if ((this.SwitchExistsOperationCompleted == null)) { + this.SwitchExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSwitchExistsOperationCompleted); + } + this.InvokeAsync("SwitchExists", new object[] { + switchId}, this.SwitchExistsOperationCompleted, userState); + } + + private void OnSwitchExistsOperationCompleted(object arg) { + if ((this.SwitchExistsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SwitchExistsCompleted(this, new SwitchExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateSwitch", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualSwitch CreateSwitch(string name) { + object[] results = this.Invoke("CreateSwitch", new object[] { + name}); + return ((VirtualSwitch)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateSwitch(string name, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateSwitch", new object[] { + name}, callback, asyncState); + } + + /// + public VirtualSwitch EndCreateSwitch(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualSwitch)(results[0])); + } + + /// + public void CreateSwitchAsync(string name) { + this.CreateSwitchAsync(name, null); + } + + /// + public void CreateSwitchAsync(string name, object userState) { + if ((this.CreateSwitchOperationCompleted == null)) { + this.CreateSwitchOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateSwitchOperationCompleted); + } + this.InvokeAsync("CreateSwitch", new object[] { + name}, this.CreateSwitchOperationCompleted, userState); + } + + private void OnCreateSwitchOperationCompleted(object arg) { + if ((this.CreateSwitchCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateSwitchCompleted(this, new CreateSwitchCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteSwitch", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ReturnCode DeleteSwitch(string switchId) { + object[] results = this.Invoke("DeleteSwitch", new object[] { + switchId}); + return ((ReturnCode)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteSwitch(string switchId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteSwitch", new object[] { + switchId}, callback, asyncState); + } + + /// + public ReturnCode EndDeleteSwitch(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ReturnCode)(results[0])); + } + + /// + public void DeleteSwitchAsync(string switchId) { + this.DeleteSwitchAsync(switchId, null); + } + + /// + public void DeleteSwitchAsync(string switchId, object userState) { + if ((this.DeleteSwitchOperationCompleted == null)) { + this.DeleteSwitchOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSwitchOperationCompleted); + } + this.InvokeAsync("DeleteSwitch", new object[] { + switchId}, this.DeleteSwitchOperationCompleted, userState); + } + + private void OnDeleteSwitchOperationCompleted(object arg) { + if ((this.DeleteSwitchCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteSwitchCompleted(this, new DeleteSwitchCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetInsertedDVD", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetInsertedDVD(string vmId) { + object[] results = this.Invoke("GetInsertedDVD", new object[] { + vmId}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginGetInsertedDVD(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetInsertedDVD", new object[] { + vmId}, callback, asyncState); + } + + /// + public string EndGetInsertedDVD(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void GetInsertedDVDAsync(string vmId) { + this.GetInsertedDVDAsync(vmId, null); + } + + /// + public void GetInsertedDVDAsync(string vmId, object userState) { + if ((this.GetInsertedDVDOperationCompleted == null)) { + this.GetInsertedDVDOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetInsertedDVDOperationCompleted); + } + this.InvokeAsync("GetInsertedDVD", new object[] { + vmId}, this.GetInsertedDVDOperationCompleted, userState); + } + + private void OnGetInsertedDVDOperationCompleted(object arg) { + if ((this.GetInsertedDVDCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetInsertedDVDCompleted(this, new GetInsertedDVDCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/InsertDVD", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult InsertDVD(string vmId, string isoPath) { + object[] results = this.Invoke("InsertDVD", new object[] { + vmId, + isoPath}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginInsertDVD(string vmId, string isoPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("InsertDVD", new object[] { + vmId, + isoPath}, callback, asyncState); + } + + /// + public JobResult EndInsertDVD(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void InsertDVDAsync(string vmId, string isoPath) { + this.InsertDVDAsync(vmId, isoPath, null); + } + + /// + public void InsertDVDAsync(string vmId, string isoPath, object userState) { + if ((this.InsertDVDOperationCompleted == null)) { + this.InsertDVDOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInsertDVDOperationCompleted); + } + this.InvokeAsync("InsertDVD", new object[] { + vmId, + isoPath}, this.InsertDVDOperationCompleted, userState); + } + + private void OnInsertDVDOperationCompleted(object arg) { + if ((this.InsertDVDCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.InsertDVDCompleted(this, new InsertDVDCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/EjectDVD", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult EjectDVD(string vmId) { + object[] results = this.Invoke("EjectDVD", new object[] { + vmId}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginEjectDVD(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("EjectDVD", new object[] { + vmId}, callback, asyncState); + } + + /// + public JobResult EndEjectDVD(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void EjectDVDAsync(string vmId) { + this.EjectDVDAsync(vmId, null); + } + + /// + public void EjectDVDAsync(string vmId, object userState) { + if ((this.EjectDVDOperationCompleted == null)) { + this.EjectDVDOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEjectDVDOperationCompleted); + } + this.InvokeAsync("EjectDVD", new object[] { + vmId}, this.EjectDVDOperationCompleted, userState); + } + + private void OnEjectDVDOperationCompleted(object arg) { + if ((this.EjectDVDCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EjectDVDCompleted(this, new EjectDVDCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetLibraryItems", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LibraryItem[] GetLibraryItems(string path) { + object[] results = this.Invoke("GetLibraryItems", new object[] { + path}); + return ((LibraryItem[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetLibraryItems(string path, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLibraryItems", new object[] { + path}, callback, asyncState); + } + + /// + public LibraryItem[] EndGetLibraryItems(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LibraryItem[])(results[0])); + } + + /// + public void GetLibraryItemsAsync(string path) { + this.GetLibraryItemsAsync(path, null); + } + + /// + public void GetLibraryItemsAsync(string path, object userState) { + if ((this.GetLibraryItemsOperationCompleted == null)) { + this.GetLibraryItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLibraryItemsOperationCompleted); + } + this.InvokeAsync("GetLibraryItems", new object[] { + path}, this.GetLibraryItemsOperationCompleted, userState); + } + + private void OnGetLibraryItemsOperationCompleted(object arg) { + if ((this.GetLibraryItemsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLibraryItemsCompleted(this, new GetLibraryItemsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetKVPItems", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public KvpExchangeDataItem[] GetKVPItems(string vmId) { + object[] results = this.Invoke("GetKVPItems", new object[] { + vmId}); + return ((KvpExchangeDataItem[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetKVPItems(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetKVPItems", new object[] { + vmId}, callback, asyncState); + } + + /// + public KvpExchangeDataItem[] EndGetKVPItems(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((KvpExchangeDataItem[])(results[0])); + } + + /// + public void GetKVPItemsAsync(string vmId) { + this.GetKVPItemsAsync(vmId, null); + } + + /// + public void GetKVPItemsAsync(string vmId, object userState) { + if ((this.GetKVPItemsOperationCompleted == null)) { + this.GetKVPItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetKVPItemsOperationCompleted); + } + this.InvokeAsync("GetKVPItems", new object[] { + vmId}, this.GetKVPItemsOperationCompleted, userState); + } + + private void OnGetKVPItemsOperationCompleted(object arg) { + if ((this.GetKVPItemsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetKVPItemsCompleted(this, new GetKVPItemsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetStandardKVPItems", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public KvpExchangeDataItem[] GetStandardKVPItems(string vmId) { + object[] results = this.Invoke("GetStandardKVPItems", new object[] { + vmId}); + return ((KvpExchangeDataItem[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetStandardKVPItems(string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetStandardKVPItems", new object[] { + vmId}, callback, asyncState); + } + + /// + public KvpExchangeDataItem[] EndGetStandardKVPItems(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((KvpExchangeDataItem[])(results[0])); + } + + /// + public void GetStandardKVPItemsAsync(string vmId) { + this.GetStandardKVPItemsAsync(vmId, null); + } + + /// + public void GetStandardKVPItemsAsync(string vmId, object userState) { + if ((this.GetStandardKVPItemsOperationCompleted == null)) { + this.GetStandardKVPItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetStandardKVPItemsOperationCompleted); + } + this.InvokeAsync("GetStandardKVPItems", new object[] { + vmId}, this.GetStandardKVPItemsOperationCompleted, userState); + } + + private void OnGetStandardKVPItemsOperationCompleted(object arg) { + if ((this.GetStandardKVPItemsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetStandardKVPItemsCompleted(this, new GetStandardKVPItemsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddKVPItems", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult AddKVPItems(string vmId, KvpExchangeDataItem[] items) { + object[] results = this.Invoke("AddKVPItems", new object[] { + vmId, + items}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginAddKVPItems(string vmId, KvpExchangeDataItem[] items, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddKVPItems", new object[] { + vmId, + items}, callback, asyncState); + } + + /// + public JobResult EndAddKVPItems(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void AddKVPItemsAsync(string vmId, KvpExchangeDataItem[] items) { + this.AddKVPItemsAsync(vmId, items, null); + } + + /// + public void AddKVPItemsAsync(string vmId, KvpExchangeDataItem[] items, object userState) { + if ((this.AddKVPItemsOperationCompleted == null)) { + this.AddKVPItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddKVPItemsOperationCompleted); + } + this.InvokeAsync("AddKVPItems", new object[] { + vmId, + items}, this.AddKVPItemsOperationCompleted, userState); + } + + private void OnAddKVPItemsOperationCompleted(object arg) { + if ((this.AddKVPItemsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddKVPItemsCompleted(this, new AddKVPItemsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveKVPItems", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult RemoveKVPItems(string vmId, string[] itemNames) { + object[] results = this.Invoke("RemoveKVPItems", new object[] { + vmId, + itemNames}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveKVPItems(string vmId, string[] itemNames, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RemoveKVPItems", new object[] { + vmId, + itemNames}, callback, asyncState); + } + + /// + public JobResult EndRemoveKVPItems(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void RemoveKVPItemsAsync(string vmId, string[] itemNames) { + this.RemoveKVPItemsAsync(vmId, itemNames, null); + } + + /// + public void RemoveKVPItemsAsync(string vmId, string[] itemNames, object userState) { + if ((this.RemoveKVPItemsOperationCompleted == null)) { + this.RemoveKVPItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveKVPItemsOperationCompleted); + } + this.InvokeAsync("RemoveKVPItems", new object[] { + vmId, + itemNames}, this.RemoveKVPItemsOperationCompleted, userState); + } + + private void OnRemoveKVPItemsOperationCompleted(object arg) { + if ((this.RemoveKVPItemsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveKVPItemsCompleted(this, new RemoveKVPItemsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ModifyKVPItems", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult ModifyKVPItems(string vmId, KvpExchangeDataItem[] items) { + object[] results = this.Invoke("ModifyKVPItems", new object[] { + vmId, + items}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginModifyKVPItems(string vmId, KvpExchangeDataItem[] items, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ModifyKVPItems", new object[] { + vmId, + items}, callback, asyncState); + } + + /// + public JobResult EndModifyKVPItems(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void ModifyKVPItemsAsync(string vmId, KvpExchangeDataItem[] items) { + this.ModifyKVPItemsAsync(vmId, items, null); + } + + /// + public void ModifyKVPItemsAsync(string vmId, KvpExchangeDataItem[] items, object userState) { + if ((this.ModifyKVPItemsOperationCompleted == null)) { + this.ModifyKVPItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnModifyKVPItemsOperationCompleted); + } + this.InvokeAsync("ModifyKVPItems", new object[] { + vmId, + items}, this.ModifyKVPItemsOperationCompleted, userState); + } + + private void OnModifyKVPItemsOperationCompleted(object arg) { + if ((this.ModifyKVPItemsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ModifyKVPItemsCompleted(this, new ModifyKVPItemsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetVirtualHardDiskInfo", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualHardDiskInfo GetVirtualHardDiskInfo(string vhdPath) { + object[] results = this.Invoke("GetVirtualHardDiskInfo", new object[] { + vhdPath}); + return ((VirtualHardDiskInfo)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualHardDiskInfo(string vhdPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualHardDiskInfo", new object[] { + vhdPath}, callback, asyncState); + } + + /// + public VirtualHardDiskInfo EndGetVirtualHardDiskInfo(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualHardDiskInfo)(results[0])); + } + + /// + public void GetVirtualHardDiskInfoAsync(string vhdPath) { + this.GetVirtualHardDiskInfoAsync(vhdPath, null); + } + + /// + public void GetVirtualHardDiskInfoAsync(string vhdPath, object userState) { + if ((this.GetVirtualHardDiskInfoOperationCompleted == null)) { + this.GetVirtualHardDiskInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualHardDiskInfoOperationCompleted); + } + this.InvokeAsync("GetVirtualHardDiskInfo", new object[] { + vhdPath}, this.GetVirtualHardDiskInfoOperationCompleted, userState); + } + + private void OnGetVirtualHardDiskInfoOperationCompleted(object arg) { + if ((this.GetVirtualHardDiskInfoCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualHardDiskInfoCompleted(this, new GetVirtualHardDiskInfoCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MountVirtualHardDisk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public MountedDiskInfo MountVirtualHardDisk(string vhdPath) { + object[] results = this.Invoke("MountVirtualHardDisk", new object[] { + vhdPath}); + return ((MountedDiskInfo)(results[0])); + } + + /// + public System.IAsyncResult BeginMountVirtualHardDisk(string vhdPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("MountVirtualHardDisk", new object[] { + vhdPath}, callback, asyncState); + } + + /// + public MountedDiskInfo EndMountVirtualHardDisk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((MountedDiskInfo)(results[0])); + } + + /// + public void MountVirtualHardDiskAsync(string vhdPath) { + this.MountVirtualHardDiskAsync(vhdPath, null); + } + + /// + public void MountVirtualHardDiskAsync(string vhdPath, object userState) { + if ((this.MountVirtualHardDiskOperationCompleted == null)) { + this.MountVirtualHardDiskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMountVirtualHardDiskOperationCompleted); + } + this.InvokeAsync("MountVirtualHardDisk", new object[] { + vhdPath}, this.MountVirtualHardDiskOperationCompleted, userState); + } + + private void OnMountVirtualHardDiskOperationCompleted(object arg) { + if ((this.MountVirtualHardDiskCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.MountVirtualHardDiskCompleted(this, new MountVirtualHardDiskCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UnmountVirtualHardDisk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ReturnCode UnmountVirtualHardDisk(string vhdPath) { + object[] results = this.Invoke("UnmountVirtualHardDisk", new object[] { + vhdPath}); + return ((ReturnCode)(results[0])); + } + + /// + public System.IAsyncResult BeginUnmountVirtualHardDisk(string vhdPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UnmountVirtualHardDisk", new object[] { + vhdPath}, callback, asyncState); + } + + /// + public ReturnCode EndUnmountVirtualHardDisk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ReturnCode)(results[0])); + } + + /// + public void UnmountVirtualHardDiskAsync(string vhdPath) { + this.UnmountVirtualHardDiskAsync(vhdPath, null); + } + + /// + public void UnmountVirtualHardDiskAsync(string vhdPath, object userState) { + if ((this.UnmountVirtualHardDiskOperationCompleted == null)) { + this.UnmountVirtualHardDiskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUnmountVirtualHardDiskOperationCompleted); + } + this.InvokeAsync("UnmountVirtualHardDisk", new object[] { + vhdPath}, this.UnmountVirtualHardDiskOperationCompleted, userState); + } + + private void OnUnmountVirtualHardDiskOperationCompleted(object arg) { + if ((this.UnmountVirtualHardDiskCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UnmountVirtualHardDiskCompleted(this, new UnmountVirtualHardDiskCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ExpandVirtualHardDisk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult ExpandVirtualHardDisk(string vhdPath, ulong sizeGB) { + object[] results = this.Invoke("ExpandVirtualHardDisk", new object[] { + vhdPath, + sizeGB}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginExpandVirtualHardDisk(string vhdPath, ulong sizeGB, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ExpandVirtualHardDisk", new object[] { + vhdPath, + sizeGB}, callback, asyncState); + } + + /// + public JobResult EndExpandVirtualHardDisk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void ExpandVirtualHardDiskAsync(string vhdPath, ulong sizeGB) { + this.ExpandVirtualHardDiskAsync(vhdPath, sizeGB, null); + } + + /// + public void ExpandVirtualHardDiskAsync(string vhdPath, ulong sizeGB, object userState) { + if ((this.ExpandVirtualHardDiskOperationCompleted == null)) { + this.ExpandVirtualHardDiskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExpandVirtualHardDiskOperationCompleted); + } + this.InvokeAsync("ExpandVirtualHardDisk", new object[] { + vhdPath, + sizeGB}, this.ExpandVirtualHardDiskOperationCompleted, userState); + } + + private void OnExpandVirtualHardDiskOperationCompleted(object arg) { + if ((this.ExpandVirtualHardDiskCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ExpandVirtualHardDiskCompleted(this, new ExpandVirtualHardDiskCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ConvertVirtualHardDisk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public JobResult ConvertVirtualHardDisk(string sourcePath, string destinationPath, VirtualHardDiskType diskType) { + object[] results = this.Invoke("ConvertVirtualHardDisk", new object[] { + sourcePath, + destinationPath, + diskType}); + return ((JobResult)(results[0])); + } + + /// + public System.IAsyncResult BeginConvertVirtualHardDisk(string sourcePath, string destinationPath, VirtualHardDiskType diskType, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ConvertVirtualHardDisk", new object[] { + sourcePath, + destinationPath, + diskType}, callback, asyncState); + } + + /// + public JobResult EndConvertVirtualHardDisk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((JobResult)(results[0])); + } + + /// + public void ConvertVirtualHardDiskAsync(string sourcePath, string destinationPath, VirtualHardDiskType diskType) { + this.ConvertVirtualHardDiskAsync(sourcePath, destinationPath, diskType, null); + } + + /// + public void ConvertVirtualHardDiskAsync(string sourcePath, string destinationPath, VirtualHardDiskType diskType, object userState) { + if ((this.ConvertVirtualHardDiskOperationCompleted == null)) { + this.ConvertVirtualHardDiskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnConvertVirtualHardDiskOperationCompleted); + } + this.InvokeAsync("ConvertVirtualHardDisk", new object[] { + sourcePath, + destinationPath, + diskType}, this.ConvertVirtualHardDiskOperationCompleted, userState); + } + + private void OnConvertVirtualHardDiskOperationCompleted(object arg) { + if ((this.ConvertVirtualHardDiskCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ConvertVirtualHardDiskCompleted(this, new ConvertVirtualHardDiskCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteRemoteFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteRemoteFile(string path) { + this.Invoke("DeleteRemoteFile", new object[] { + path}); + } + + /// + public System.IAsyncResult BeginDeleteRemoteFile(string path, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteRemoteFile", new object[] { + path}, callback, asyncState); + } + + /// + public void EndDeleteRemoteFile(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void DeleteRemoteFileAsync(string path) { + this.DeleteRemoteFileAsync(path, null); + } + + /// + public void DeleteRemoteFileAsync(string path, object userState) { + if ((this.DeleteRemoteFileOperationCompleted == null)) { + this.DeleteRemoteFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteRemoteFileOperationCompleted); + } + this.InvokeAsync("DeleteRemoteFile", new object[] { + path}, this.DeleteRemoteFileOperationCompleted, userState); + } + + private void OnDeleteRemoteFileOperationCompleted(object arg) { + if ((this.DeleteRemoteFileCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteRemoteFileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ExpandDiskVolume", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ExpandDiskVolume(string diskAddress, string volumeName) { + this.Invoke("ExpandDiskVolume", new object[] { + diskAddress, + volumeName}); + } + + /// + public System.IAsyncResult BeginExpandDiskVolume(string diskAddress, string volumeName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ExpandDiskVolume", new object[] { + diskAddress, + volumeName}, callback, asyncState); + } + + /// + public void EndExpandDiskVolume(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void ExpandDiskVolumeAsync(string diskAddress, string volumeName) { + this.ExpandDiskVolumeAsync(diskAddress, volumeName, null); + } + + /// + public void ExpandDiskVolumeAsync(string diskAddress, string volumeName, object userState) { + if ((this.ExpandDiskVolumeOperationCompleted == null)) { + this.ExpandDiskVolumeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExpandDiskVolumeOperationCompleted); + } + this.InvokeAsync("ExpandDiskVolume", new object[] { + diskAddress, + volumeName}, this.ExpandDiskVolumeOperationCompleted, userState); + } + + private void OnExpandDiskVolumeOperationCompleted(object arg) { + if ((this.ExpandDiskVolumeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ExpandDiskVolumeCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ReadRemoteFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ReadRemoteFile(string path) { + object[] results = this.Invoke("ReadRemoteFile", new object[] { + path}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginReadRemoteFile(string path, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ReadRemoteFile", new object[] { + path}, callback, asyncState); + } + + /// + public string EndReadRemoteFile(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void ReadRemoteFileAsync(string path) { + this.ReadRemoteFileAsync(path, null); + } + + /// + public void ReadRemoteFileAsync(string path, object userState) { + if ((this.ReadRemoteFileOperationCompleted == null)) { + this.ReadRemoteFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReadRemoteFileOperationCompleted); + } + this.InvokeAsync("ReadRemoteFile", new object[] { + path}, this.ReadRemoteFileOperationCompleted, userState); + } + + private void OnReadRemoteFileOperationCompleted(object arg) { + if ((this.ReadRemoteFileCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReadRemoteFileCompleted(this, new ReadRemoteFileCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/WriteRemoteFile", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void WriteRemoteFile(string path, string content) { + this.Invoke("WriteRemoteFile", new object[] { + path, + content}); + } + + /// + public System.IAsyncResult BeginWriteRemoteFile(string path, string content, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("WriteRemoteFile", new object[] { + path, + content}, callback, asyncState); + } + + /// + public void EndWriteRemoteFile(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void WriteRemoteFileAsync(string path, string content) { + this.WriteRemoteFileAsync(path, content, null); + } + + /// + public void WriteRemoteFileAsync(string path, string content, object userState) { + if ((this.WriteRemoteFileOperationCompleted == null)) { + this.WriteRemoteFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteRemoteFileOperationCompleted); + } + this.InvokeAsync("WriteRemoteFile", new object[] { + path, + content}, this.WriteRemoteFileOperationCompleted, userState); + } + + private void OnWriteRemoteFileOperationCompleted(object arg) { + if ((this.WriteRemoteFileCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WriteRemoteFileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetJob", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ConcreteJob GetJob(string jobId) { + object[] results = this.Invoke("GetJob", new object[] { + jobId}); + return ((ConcreteJob)(results[0])); + } + + /// + public System.IAsyncResult BeginGetJob(string jobId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetJob", new object[] { + jobId}, callback, asyncState); + } + + /// + public ConcreteJob EndGetJob(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ConcreteJob)(results[0])); + } + + /// + public void GetJobAsync(string jobId) { + this.GetJobAsync(jobId, null); + } + + /// + public void GetJobAsync(string jobId, object userState) { + if ((this.GetJobOperationCompleted == null)) { + this.GetJobOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetJobOperationCompleted); + } + this.InvokeAsync("GetJob", new object[] { + jobId}, this.GetJobOperationCompleted, userState); + } + + private void OnGetJobOperationCompleted(object arg) { + if ((this.GetJobCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetJobCompleted(this, new GetJobCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetAllJobs", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ConcreteJob[] GetAllJobs() { + object[] results = this.Invoke("GetAllJobs", new object[0]); + return ((ConcreteJob[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetAllJobs(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetAllJobs", new object[0], callback, asyncState); + } + + /// + public ConcreteJob[] EndGetAllJobs(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ConcreteJob[])(results[0])); + } + + /// + public void GetAllJobsAsync() { + this.GetAllJobsAsync(null); + } + + /// + public void GetAllJobsAsync(object userState) { + if ((this.GetAllJobsOperationCompleted == null)) { + this.GetAllJobsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAllJobsOperationCompleted); + } + this.InvokeAsync("GetAllJobs", new object[0], this.GetAllJobsOperationCompleted, userState); + } + + private void OnGetAllJobsOperationCompleted(object arg) { + if ((this.GetAllJobsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetAllJobsCompleted(this, new GetAllJobsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ChangeJobState", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ChangeJobStateReturnCode ChangeJobState(string jobId, ConcreteJobRequestedState newState) { + object[] results = this.Invoke("ChangeJobState", new object[] { + jobId, + newState}); + return ((ChangeJobStateReturnCode)(results[0])); + } + + /// + public System.IAsyncResult BeginChangeJobState(string jobId, ConcreteJobRequestedState newState, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ChangeJobState", new object[] { + jobId, + newState}, callback, asyncState); + } + + /// + public ChangeJobStateReturnCode EndChangeJobState(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ChangeJobStateReturnCode)(results[0])); + } + + /// + public void ChangeJobStateAsync(string jobId, ConcreteJobRequestedState newState) { + this.ChangeJobStateAsync(jobId, newState, null); + } + + /// + public void ChangeJobStateAsync(string jobId, ConcreteJobRequestedState newState, object userState) { + if ((this.ChangeJobStateOperationCompleted == null)) { + this.ChangeJobStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeJobStateOperationCompleted); + } + this.InvokeAsync("ChangeJobState", new object[] { + jobId, + newState}, this.ChangeJobStateOperationCompleted, userState); + } + + private void OnChangeJobStateOperationCompleted(object arg) { + if ((this.ChangeJobStateCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ChangeJobStateCompleted(this, new ChangeJobStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetProcessorCoresNumber", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetProcessorCoresNumber() { + object[] results = this.Invoke("GetProcessorCoresNumber", new object[0]); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginGetProcessorCoresNumber(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetProcessorCoresNumber", new object[0], callback, asyncState); + } + + /// + public int EndGetProcessorCoresNumber(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void GetProcessorCoresNumberAsync() { + this.GetProcessorCoresNumberAsync(null); + } + + /// + public void GetProcessorCoresNumberAsync(object userState) { + if ((this.GetProcessorCoresNumberOperationCompleted == null)) { + this.GetProcessorCoresNumberOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetProcessorCoresNumberOperationCompleted); + } + this.InvokeAsync("GetProcessorCoresNumber", new object[0], this.GetProcessorCoresNumberOperationCompleted, userState); + } + + private void OnGetProcessorCoresNumberOperationCompleted(object arg) { + if ((this.GetProcessorCoresNumberCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetProcessorCoresNumberCompleted(this, new GetProcessorCoresNumberCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineCompletedEventHandler(object sender, GetVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachine Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachine)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineExCompletedEventHandler(object sender, GetVirtualMachineExCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineExCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineExCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachine Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachine)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachinesCompletedEventHandler(object sender, GetVirtualMachinesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachinesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachinesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachine[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachine[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineThumbnailImageCompletedEventHandler(object sender, GetVirtualMachineThumbnailImageCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineThumbnailImageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineThumbnailImageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public byte[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((byte[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateVirtualMachineCompletedEventHandler(object sender, CreateVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachine Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachine)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void UpdateVirtualMachineCompletedEventHandler(object sender, UpdateVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachine Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachine)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ChangeVirtualMachineStateCompletedEventHandler(object sender, ChangeVirtualMachineStateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ChangeVirtualMachineStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ChangeVirtualMachineStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ShutDownVirtualMachineCompletedEventHandler(object sender, ShutDownVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ShutDownVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ShutDownVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ReturnCode Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ReturnCode)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineJobsCompletedEventHandler(object sender, GetVirtualMachineJobsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineJobsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineJobsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ConcreteJob[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ConcreteJob[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RenameVirtualMachineCompletedEventHandler(object sender, RenameVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RenameVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal RenameVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteVirtualMachineCompletedEventHandler(object sender, DeleteVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ExportVirtualMachineCompletedEventHandler(object sender, ExportVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ExportVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ExportVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineSnapshotsCompletedEventHandler(object sender, GetVirtualMachineSnapshotsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineSnapshotsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineSnapshotsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachineSnapshot[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachineSnapshot[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSnapshotCompletedEventHandler(object sender, GetSnapshotCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSnapshotCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSnapshotCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachineSnapshot Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachineSnapshot)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateSnapshotCompletedEventHandler(object sender, CreateSnapshotCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateSnapshotCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateSnapshotCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RenameSnapshotCompletedEventHandler(object sender, RenameSnapshotCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RenameSnapshotCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal RenameSnapshotCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ApplySnapshotCompletedEventHandler(object sender, ApplySnapshotCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ApplySnapshotCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ApplySnapshotCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteSnapshotCompletedEventHandler(object sender, DeleteSnapshotCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteSnapshotCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteSnapshotCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteSnapshotSubtreeCompletedEventHandler(object sender, DeleteSnapshotSubtreeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteSnapshotSubtreeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteSnapshotSubtreeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSnapshotThumbnailImageCompletedEventHandler(object sender, GetSnapshotThumbnailImageCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSnapshotThumbnailImageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSnapshotThumbnailImageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public byte[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((byte[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetExternalSwitchesCompletedEventHandler(object sender, GetExternalSwitchesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExternalSwitchesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExternalSwitchesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualSwitch[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualSwitch[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSwitchesCompletedEventHandler(object sender, GetSwitchesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSwitchesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSwitchesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualSwitch[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualSwitch[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SwitchExistsCompletedEventHandler(object sender, SwitchExistsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SwitchExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SwitchExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public bool Result { + get { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateSwitchCompletedEventHandler(object sender, CreateSwitchCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateSwitchCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateSwitchCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualSwitch Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualSwitch)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteSwitchCompletedEventHandler(object sender, DeleteSwitchCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteSwitchCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteSwitchCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ReturnCode Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ReturnCode)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetInsertedDVDCompletedEventHandler(object sender, GetInsertedDVDCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetInsertedDVDCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetInsertedDVDCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void InsertDVDCompletedEventHandler(object sender, InsertDVDCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class InsertDVDCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal InsertDVDCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void EjectDVDCompletedEventHandler(object sender, EjectDVDCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EjectDVDCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EjectDVDCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLibraryItemsCompletedEventHandler(object sender, GetLibraryItemsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLibraryItemsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLibraryItemsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LibraryItem[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LibraryItem[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetKVPItemsCompletedEventHandler(object sender, GetKVPItemsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetKVPItemsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetKVPItemsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public KvpExchangeDataItem[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((KvpExchangeDataItem[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetStandardKVPItemsCompletedEventHandler(object sender, GetStandardKVPItemsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetStandardKVPItemsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetStandardKVPItemsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public KvpExchangeDataItem[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((KvpExchangeDataItem[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddKVPItemsCompletedEventHandler(object sender, AddKVPItemsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddKVPItemsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddKVPItemsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveKVPItemsCompletedEventHandler(object sender, RemoveKVPItemsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveKVPItemsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal RemoveKVPItemsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ModifyKVPItemsCompletedEventHandler(object sender, ModifyKVPItemsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ModifyKVPItemsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ModifyKVPItemsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualHardDiskInfoCompletedEventHandler(object sender, GetVirtualHardDiskInfoCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualHardDiskInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualHardDiskInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualHardDiskInfo Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualHardDiskInfo)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void MountVirtualHardDiskCompletedEventHandler(object sender, MountVirtualHardDiskCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class MountVirtualHardDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal MountVirtualHardDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public MountedDiskInfo Result { + get { + this.RaiseExceptionIfNecessary(); + return ((MountedDiskInfo)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void UnmountVirtualHardDiskCompletedEventHandler(object sender, UnmountVirtualHardDiskCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UnmountVirtualHardDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UnmountVirtualHardDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ReturnCode Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ReturnCode)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ExpandVirtualHardDiskCompletedEventHandler(object sender, ExpandVirtualHardDiskCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ExpandVirtualHardDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ExpandVirtualHardDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ConvertVirtualHardDiskCompletedEventHandler(object sender, ConvertVirtualHardDiskCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ConvertVirtualHardDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ConvertVirtualHardDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public JobResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((JobResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteRemoteFileCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ExpandDiskVolumeCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ReadRemoteFileCompletedEventHandler(object sender, ReadRemoteFileCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ReadRemoteFileCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ReadRemoteFileCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void WriteRemoteFileCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetJobCompletedEventHandler(object sender, GetJobCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetJobCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetJobCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ConcreteJob Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ConcreteJob)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetAllJobsCompletedEventHandler(object sender, GetAllJobsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetAllJobsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetAllJobsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ConcreteJob[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ConcreteJob[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ChangeJobStateCompletedEventHandler(object sender, ChangeJobStateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ChangeJobStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ChangeJobStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ChangeJobStateReturnCode Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ChangeJobStateReturnCode)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetProcessorCoresNumberCompletedEventHandler(object sender, GetProcessorCoresNumberCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetProcessorCoresNumberCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetProcessorCoresNumberCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj index c68a63eb..496916bb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj @@ -99,6 +99,7 @@ code + diff --git a/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx b/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx new file mode 100644 index 00000000..ed75812a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="VirtualizationServer2012.asmx.cs" Class="WebsitePanel.Server.VirtualizationServer" %> diff --git a/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx.cs new file mode 100644 index 00000000..4fa2f4a1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/VirtualizationServer2012.asmx.cs @@ -0,0 +1,1064 @@ +// Copyright (c) 2015, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Data; +using System.Web; +using System.Collections; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.ComponentModel; +using Microsoft.Web.Services3; + +using WebsitePanel.Providers; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Server.Utils; +using System.Collections.Generic; + +namespace WebsitePanel.Server +{ + /// + /// Summary description for VirtualizationServer + /// + [WebService(Namespace = "http://smbsaas/websitepanel/server/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [Policy("ServerPolicy")] + [ToolboxItem(false)] + public class VirtualizationServer2012 : HostingServiceProviderWebService, IVirtualizationServer2012 + { + private IVirtualizationServer2012 VirtualizationProvider + { + get { return (IVirtualizationServer2012)Provider; } + } + + #region Virtual Machines + + [WebMethod, SoapHeader("settings")] + public VirtualMachine GetVirtualMachine(string vmId) + { + try + { + Log.WriteStart("'{0}' GetVirtualMachine", ProviderSettings.ProviderName); + VirtualMachine result = VirtualizationProvider.GetVirtualMachine(vmId); + Log.WriteEnd("'{0}' GetVirtualMachine", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetVirtualMachine", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public VirtualMachine GetVirtualMachineEx(string vmId) + { + try + { + Log.WriteStart("'{0}' GetVirtualMachineEx", ProviderSettings.ProviderName); + VirtualMachine result = VirtualizationProvider.GetVirtualMachineEx(vmId); + Log.WriteEnd("'{0}' GetVirtualMachineEx", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetVirtualMachineEx", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public List GetVirtualMachines() + { + try + { + Log.WriteStart("'{0}' GetVirtualMachines", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetVirtualMachines(); + Log.WriteEnd("'{0}' GetVirtualMachines", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetVirtualMachines", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public byte[] GetVirtualMachineThumbnailImage(string vmId, ThumbnailSize size) + { + try + { + Log.WriteStart("'{0}' GetVirtualMachineThumbnailImage", ProviderSettings.ProviderName); + byte[] result = VirtualizationProvider.GetVirtualMachineThumbnailImage(vmId, size); + Log.WriteEnd("'{0}' GetVirtualMachineThumbnailImage", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetVirtualMachineThumbnailImage", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public VirtualMachine CreateVirtualMachine(VirtualMachine vm) + { + try + { + Log.WriteStart("'{0}' CreateVirtualMachine", ProviderSettings.ProviderName); + VirtualMachine result = VirtualizationProvider.CreateVirtualMachine(vm); + Log.WriteEnd("'{0}' CreateVirtualMachine", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' CreateVirtualMachine", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public VirtualMachine UpdateVirtualMachine(VirtualMachine vm) + { + try + { + Log.WriteStart("'{0}' UpdateVirtualMachine", ProviderSettings.ProviderName); + VirtualMachine result = VirtualizationProvider.UpdateVirtualMachine(vm); + Log.WriteEnd("'{0}' UpdateVirtualMachine", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' UpdateVirtualMachine", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult ChangeVirtualMachineState(string vmId, VirtualMachineRequestedState newState) + { + try + { + Log.WriteStart("'{0}' ChangeVirtualMachineState", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.ChangeVirtualMachineState(vmId, newState); + Log.WriteEnd("'{0}' ChangeVirtualMachineState", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ChangeVirtualMachineState", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ReturnCode ShutDownVirtualMachine(string vmId, bool force, string reason) + { + try + { + Log.WriteStart("'{0}' ShutDownVirtualMachine", ProviderSettings.ProviderName); + ReturnCode result = VirtualizationProvider.ShutDownVirtualMachine(vmId, force, reason); + Log.WriteEnd("'{0}' ShutDownVirtualMachine", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ShutDownVirtualMachine", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public List GetVirtualMachineJobs(string vmId) + { + try + { + Log.WriteStart("'{0}' GetVirtualMachineJobs", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetVirtualMachineJobs(vmId); + Log.WriteEnd("'{0}' GetVirtualMachineJobs", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetVirtualMachineJobs", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult RenameVirtualMachine(string vmId, string name) + { + try + { + Log.WriteStart("'{0}' RenameVirtualMachine", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.RenameVirtualMachine(vmId, name); + Log.WriteEnd("'{0}' RenameVirtualMachine", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' RenameVirtualMachine", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult DeleteVirtualMachine(string vmId) + { + try + { + Log.WriteStart("'{0}' DeleteVirtualMachine", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.DeleteVirtualMachine(vmId); + Log.WriteEnd("'{0}' DeleteVirtualMachine", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' DeleteVirtualMachine", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult ExportVirtualMachine(string vmId, string exportPath) + { + try + { + Log.WriteStart("'{0}' ExportVirtualMachine", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.ExportVirtualMachine(vmId, exportPath); + Log.WriteEnd("'{0}' ExportVirtualMachine", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ExportVirtualMachine", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Snapshots + [WebMethod, SoapHeader("settings")] + public List GetVirtualMachineSnapshots(string vmId) + { + try + { + Log.WriteStart("'{0}' GetVirtualMachineSnapshots", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetVirtualMachineSnapshots(vmId); + Log.WriteEnd("'{0}' GetVirtualMachineSnapshots", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetVirtualMachineSnapshots", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public VirtualMachineSnapshot GetSnapshot(string snapshotId) + { + try + { + Log.WriteStart("'{0}' GetSnapshot", ProviderSettings.ProviderName); + VirtualMachineSnapshot result = VirtualizationProvider.GetSnapshot(snapshotId); + Log.WriteEnd("'{0}' GetSnapshot", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetSnapshot", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult CreateSnapshot(string vmId) + { + try + { + Log.WriteStart("'{0}' CreateSnapshot", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.CreateSnapshot(vmId); + Log.WriteEnd("'{0}' CreateSnapshot", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' CreateSnapshot", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult RenameSnapshot(string vmId, string snapshotId, string name) + { + try + { + Log.WriteStart("'{0}' RenameSnapshot", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.RenameSnapshot(vmId, snapshotId, name); + Log.WriteEnd("'{0}' RenameSnapshot", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' RenameSnapshot", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult ApplySnapshot(string vmId, string snapshotId) + { + try + { + Log.WriteStart("'{0}' ApplySnapshot", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.ApplySnapshot(vmId, snapshotId); + Log.WriteEnd("'{0}' ApplySnapshot", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ApplySnapshot", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult DeleteSnapshot(string snapshotId) + { + try + { + Log.WriteStart("'{0}' DeleteSnapshot", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.DeleteSnapshot(snapshotId); + Log.WriteEnd("'{0}' DeleteSnapshot", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' DeleteSnapshot", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult DeleteSnapshotSubtree(string snapshotId) + { + try + { + Log.WriteStart("'{0}' DeleteSnapshotSubtree", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.DeleteSnapshotSubtree(snapshotId); + Log.WriteEnd("'{0}' DeleteSnapshotSubtree", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' DeleteSnapshotSubtree", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public byte[] GetSnapshotThumbnailImage(string snapshotId, ThumbnailSize size) + { + try + { + Log.WriteStart("'{0}' GetSnapshotThumbnailImage", ProviderSettings.ProviderName); + byte[] result = VirtualizationProvider.GetSnapshotThumbnailImage(snapshotId, size); + Log.WriteEnd("'{0}' GetSnapshotThumbnailImage", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetSnapshotThumbnailImage", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Virtual Switches + [WebMethod, SoapHeader("settings")] + public List GetExternalSwitches(string computerName) + { + try + { + Log.WriteStart("'{0}' GetExternalSwitches", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetExternalSwitches(computerName); + Log.WriteEnd("'{0}' GetExternalSwitches", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetExternalSwitches", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public List GetSwitches() + { + try + { + Log.WriteStart("'{0}' GetSwitches", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetSwitches(); + Log.WriteEnd("'{0}' GetSwitches", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetSwitches", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool SwitchExists(string switchId) + { + try + { + Log.WriteStart("'{0}' SwitchExists", ProviderSettings.ProviderName); + bool result = VirtualizationProvider.SwitchExists(switchId); + Log.WriteEnd("'{0}' SwitchExists", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' SwitchExists", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public VirtualSwitch CreateSwitch(string name) + { + try + { + Log.WriteStart("'{0}' CreateSwitch", ProviderSettings.ProviderName); + VirtualSwitch result = VirtualizationProvider.CreateSwitch(name); + Log.WriteEnd("'{0}' CreateSwitch", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' CreateSwitch", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ReturnCode DeleteSwitch(string switchId) + { + try + { + Log.WriteStart("'{0}' DeleteSwitch", ProviderSettings.ProviderName); + ReturnCode result = VirtualizationProvider.DeleteSwitch(switchId); + Log.WriteEnd("'{0}' DeleteSwitch", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' DeleteSwitch", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region DVD operations + [WebMethod, SoapHeader("settings")] + public string GetInsertedDVD(string vmId) + { + try + { + Log.WriteStart("'{0}' GetInsertedDVD", ProviderSettings.ProviderName); + string result = VirtualizationProvider.GetInsertedDVD(vmId); + Log.WriteEnd("'{0}' GetInsertedDVD", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetInsertedDVD", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult InsertDVD(string vmId, string isoPath) + { + try + { + Log.WriteStart("'{0}' InsertDVD", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.InsertDVD(vmId, isoPath); + Log.WriteEnd("'{0}' InsertDVD", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' InsertDVD", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult EjectDVD(string vmId) + { + try + { + Log.WriteStart("'{0}' EjectDVD", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.EjectDVD(vmId); + Log.WriteEnd("'{0}' EjectDVD", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' EjectDVD", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Library + [WebMethod, SoapHeader("settings")] + public LibraryItem[] GetLibraryItems(string path) + { + try + { + Log.WriteStart("'{0}' GetLibraryItems", ProviderSettings.ProviderName); + LibraryItem[] result = VirtualizationProvider.GetLibraryItems(path); + Log.WriteEnd("'{0}' GetLibraryItems", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetLibraryItems", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region KVP items + [WebMethod, SoapHeader("settings")] + public List GetKVPItems(string vmId) + { + try + { + Log.WriteStart("'{0}' GetKVPItems", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetKVPItems(vmId); + Log.WriteEnd("'{0}' GetKVPItems", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetKVPItems", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public List GetStandardKVPItems(string vmId) + { + try + { + Log.WriteStart("'{0}' GetStandardKVPItems", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetStandardKVPItems(vmId); + Log.WriteEnd("'{0}' GetStandardKVPItems", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetStandardKVPItems", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult AddKVPItems(string vmId, KvpExchangeDataItem[] items) + { + try + { + Log.WriteStart("'{0}' AddKVPItems", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.AddKVPItems(vmId, items); + Log.WriteEnd("'{0}' AddKVPItems", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' AddKVPItems", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult RemoveKVPItems(string vmId, string[] itemNames) + { + try + { + Log.WriteStart("'{0}' RemoveKVPItems", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.RemoveKVPItems(vmId, itemNames); + Log.WriteEnd("'{0}' RemoveKVPItems", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' RemoveKVPItems", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult ModifyKVPItems(string vmId, KvpExchangeDataItem[] items) + { + try + { + Log.WriteStart("'{0}' ModifyKVPItems", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.ModifyKVPItems(vmId, items); + Log.WriteEnd("'{0}' ModifyKVPItems", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ModifyKVPItems", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Storage + [WebMethod, SoapHeader("settings")] + public VirtualHardDiskInfo GetVirtualHardDiskInfo(string vhdPath) + { + try + { + Log.WriteStart("'{0}' GetVirtualHardDiskInfo", ProviderSettings.ProviderName); + VirtualHardDiskInfo result = VirtualizationProvider.GetVirtualHardDiskInfo(vhdPath); + Log.WriteEnd("'{0}' GetVirtualHardDiskInfo", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetVirtualHardDiskInfo", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public MountedDiskInfo MountVirtualHardDisk(string vhdPath) + { + try + { + Log.WriteStart("'{0}' MountVirtualHardDisk", ProviderSettings.ProviderName); + MountedDiskInfo result = VirtualizationProvider.MountVirtualHardDisk(vhdPath); + Log.WriteEnd("'{0}' MountVirtualHardDisk", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' MountVirtualHardDisk", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ReturnCode UnmountVirtualHardDisk(string vhdPath) + { + try + { + Log.WriteStart("'{0}' UnmountVirtualHardDisk", ProviderSettings.ProviderName); + ReturnCode result = VirtualizationProvider.UnmountVirtualHardDisk(vhdPath); + Log.WriteEnd("'{0}' UnmountVirtualHardDisk", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' UnmountVirtualHardDisk", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult ExpandVirtualHardDisk(string vhdPath, UInt64 sizeGB) + { + try + { + Log.WriteStart("'{0}' ExpandVirtualHardDisk", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.ExpandVirtualHardDisk(vhdPath, sizeGB); + Log.WriteEnd("'{0}' ExpandVirtualHardDisk", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ExpandVirtualHardDisk", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public JobResult ConvertVirtualHardDisk(string sourcePath, string destinationPath, VirtualHardDiskType diskType) + { + try + { + Log.WriteStart("'{0}' ConvertVirtualHardDisk", ProviderSettings.ProviderName); + JobResult result = VirtualizationProvider.ConvertVirtualHardDisk(sourcePath, destinationPath, diskType); + Log.WriteEnd("'{0}' ConvertVirtualHardDisk", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ConvertVirtualHardDisk", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void DeleteRemoteFile(string path) + { + try + { + Log.WriteStart("'{0}' DeleteRemoteFile", ProviderSettings.ProviderName); + VirtualizationProvider.DeleteRemoteFile(path); + Log.WriteEnd("'{0}' DeleteRemoteFile", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' DeleteRemoteFile", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void ExpandDiskVolume(string diskAddress, string volumeName) + { + try + { + Log.WriteStart("'{0}' ExpandDiskVolume", ProviderSettings.ProviderName); + VirtualizationProvider.ExpandDiskVolume(diskAddress, volumeName); + Log.WriteEnd("'{0}' ExpandDiskVolume", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ExpandDiskVolume", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public string ReadRemoteFile(string path) + { + try + { + Log.WriteStart("'{0}' ReadRemoteFile", ProviderSettings.ProviderName); + string result = VirtualizationProvider.ReadRemoteFile(path); + Log.WriteEnd("'{0}' ReadRemoteFile", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ReadRemoteFile", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void WriteRemoteFile(string path, string content) + { + try + { + Log.WriteStart("'{0}' WriteRemoteFile", ProviderSettings.ProviderName); + VirtualizationProvider.WriteRemoteFile(path, content); + Log.WriteEnd("'{0}' WriteRemoteFile", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' WriteRemoteFile", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Jobs + [WebMethod, SoapHeader("settings")] + public ConcreteJob GetJob(string jobId) + { + try + { + Log.WriteStart("'{0}' GetJob", ProviderSettings.ProviderName); + ConcreteJob result = VirtualizationProvider.GetJob(jobId); + Log.WriteEnd("'{0}' GetJob", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetJob", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public List GetAllJobs() + { + try + { + Log.WriteStart("'{0}' GetAllJobs", ProviderSettings.ProviderName); + List result = VirtualizationProvider.GetAllJobs(); + Log.WriteEnd("'{0}' GetAllJobs", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetAllJobs", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ChangeJobStateReturnCode ChangeJobState(string jobId, ConcreteJobRequestedState newState) + { + try + { + Log.WriteStart("'{0}' ChangeJobState", ProviderSettings.ProviderName); + ChangeJobStateReturnCode result = VirtualizationProvider.ChangeJobState(jobId, newState); + Log.WriteEnd("'{0}' ChangeJobState", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ChangeJobState", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Configuration + [WebMethod, SoapHeader("settings")] + public int GetProcessorCoresNumber() + { + try + { + Log.WriteStart("'{0}' GetProcessorCoresNumber", ProviderSettings.ProviderName); + int result = VirtualizationProvider.GetProcessorCoresNumber(); + Log.WriteEnd("'{0}' GetProcessorCoresNumber", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetProcessorCoresNumber", ProviderSettings.ProviderName), ex); + throw; + } + } + + #endregion + + + #region Replication + + public List GetCertificates(string remoteServer) + { + try + { + Log.WriteStart("'{0}' GetCertificates", ProviderSettings.ProviderName); + var result = VirtualizationProvider.GetCertificates(remoteServer); + Log.WriteEnd("'{0}' GetCertificates", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetCertificates", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void SetReplicaServer(string remoteServer, string thumbprint, string storagePath) + { + try + { + Log.WriteStart("'{0}' SetReplicaServer", ProviderSettings.ProviderName); + VirtualizationProvider.SetReplicaServer(remoteServer, thumbprint, storagePath); + Log.WriteEnd("'{0}' SetReplicaServer", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' SetReplicaServer", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void UnsetReplicaServer(string remoteServer) + { + try + { + Log.WriteStart("'{0}' UnsetReplicaServer", ProviderSettings.ProviderName); + VirtualizationProvider.UnsetReplicaServer(remoteServer); + Log.WriteEnd("'{0}' UnsetReplicaServer", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' UnsetReplicaServer", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void EnableVmReplication(string vmId, string replicaServer, VmReplication replication) + { + try + { + Log.WriteStart("'{0}' EnableVmReplication", ProviderSettings.ProviderName); + VirtualizationProvider.EnableVmReplication(vmId, replicaServer, replication); + Log.WriteEnd("'{0}' EnableVmReplication", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' EnableVmReplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void SetVmReplication(string vmId, string replicaServer, VmReplication replication) + { + try + { + Log.WriteStart("'{0}' SetVmReplication", ProviderSettings.ProviderName); + VirtualizationProvider.SetVmReplication(vmId, replicaServer, replication); + Log.WriteEnd("'{0}' SetVmReplication", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' SetVmReplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void TestReplicationServer(string vmId, string replicaServer, string localThumbprint) + { + try + { + Log.WriteStart("'{0}' TestReplicationServer", ProviderSettings.ProviderName); + VirtualizationProvider.TestReplicationServer(vmId, replicaServer, localThumbprint); + Log.WriteEnd("'{0}' TestReplicationServer", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' TestReplicationServer", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void StartInitialReplication(string vmId) + { + try + { + Log.WriteStart("'{0}' StartInitialReplication", ProviderSettings.ProviderName); + VirtualizationProvider.StartInitialReplication(vmId); + Log.WriteEnd("'{0}' StartInitialReplication", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' StartInitialReplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + public VmReplication GetReplication(string vmId) + { + try + { + Log.WriteStart("'{0}' GetReplication", ProviderSettings.ProviderName); + var result = VirtualizationProvider.GetReplication(vmId); + Log.WriteEnd("'{0}' GetReplication", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetReplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + public bool DisableVmReplication(string vmId, string replicaServer) + { + try + { + Log.WriteStart("'{0}' DisableVmReplication", ProviderSettings.ProviderName); + var result = VirtualizationProvider.DisableVmReplication(vmId, replicaServer); + Log.WriteEnd("'{0}' DisableVmReplication", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' DisableVmReplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + public ReplicationDetailInfo GetReplicationInfo(string vmId) + { + try + { + Log.WriteStart("'{0}' GetReplicationInfo", ProviderSettings.ProviderName); + var result = VirtualizationProvider.GetReplicationInfo(vmId); + Log.WriteEnd("'{0}' GetReplicationInfo", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetReplicationInfo", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void PauseReplication(string vmId) + { + try + { + Log.WriteStart("'{0}' PauseReplication", ProviderSettings.ProviderName); + VirtualizationProvider.PauseReplication(vmId); + Log.WriteEnd("'{0}' PauseReplication", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' PauseReplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + public void ResumeReplication(string vmId) + { + try + { + Log.WriteStart("'{0}' ResumeReplication", ProviderSettings.ProviderName); + VirtualizationProvider.ResumeReplication(vmId); + Log.WriteEnd("'{0}' ResumeReplication", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ResumeReplication", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index 029e25a2..0af042ca 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -292,6 +292,7 @@ + @@ -406,6 +407,10 @@ StatisticsServer.asmx Component + + VirtualizationServer2012.asmx + Component + VirtualizationServer.asmx Component diff --git a/WebsitePanel/Sources/generate_server_proxies.bat b/WebsitePanel/Sources/generate_server_proxies.bat index cd4f2b8a..fdce3f8f 100644 --- a/WebsitePanel/Sources/generate_server_proxies.bat +++ b/WebsitePanel/Sources/generate_server_proxies.bat @@ -26,8 +26,8 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerHostedEditionProxy.cs REM %WSDL% %SERVER_URL%/HostedSharePointServer.asmx /out:.\WebsitePanel.Server.Client\HostedSharePointServerProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\HostedSharePointServerProxy.cs -%WSDL% %SERVER_URL%/HostedSharePointServerEnt.asmx /out:.\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs +REM %WSDL% %SERVER_URL%/HostedSharePointServerEnt.asmx /out:.\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields +REM %WSE_CLEAN% .\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs REM %WSDL% %SERVER_URL%/OCSEdgeServer.asmx /out:.\WebsitePanel.Server.Client\OCSEdgeServerProxy.cs /namespace:WebsitePanel.Providers.OCS /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OCSEdgeServerProxy.cs @@ -50,6 +50,9 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\SharePointServerProxy.cs REM %WSDL% %SERVER_URL%/VirtualizationServer.asmx /out:.\WebsitePanel.Server.Client\VirtualizationServerProxy.cs /namespace:WebsitePanel.Providers.Virtualization /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerProxy.cs +%WSDL% %SERVER_URL%/VirtualizationServer2012.asmx /out:.\WebsitePanel.Server.Client\VirtualizationServerProxy2012.cs /namespace:WebsitePanel.Providers.Virtualization2012 /type:webClient /fields +%WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerProxy2012.cs + REM %WSDL% %SERVER_URL%/VirtualizationServerForPrivateCloud.asmx /out:.\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs /namespace:WebsitePanel.Providers.VirtualizationForPC /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs