diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 228701b7..972a6006 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -8218,6 +8218,21 @@ AS INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 558 -- RAM of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 559 -- HDD of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 562 -- External IP addresses of VPS + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID @@ -8861,16 +8876,168 @@ RETURN GO -- Hyper-V 2012 R2 Provider +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'VPS2012') +BEGIN +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (33, N'VPS2012', 19, NULL, 1) + +INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (41, 33, N'VirtualMachine', N'WebsitePanel.Providers.Virtualization.VirtualMachine, WebsitePanel.Providers.Base', 1, 0, 0, 1, 1, 1, 0, 0) + +INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (42, 33, N'VirtualSwitch', N'WebsitePanel.Providers.Virtualization.VirtualSwitch, WebsitePanel.Providers.Base', 2, 0, 0, 1, 1, 1, 0, 0) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (553, 33, 1, N'VPS2012.ServersNumber', N'Number of VPS', 2, 0, 41, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (554, 33, 2, N'VPS2012.ManagingAllowed', N'Allow user to create VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (555, 33, 3, N'VPS2012.CpuNumber', N'Number of CPU cores', 3, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (556, 33, 7, N'VPS2012.BootCdAllowed', N'Boot from CD allowed', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (557, 33, 8, N'VPS2012.BootCdEnabled', N'Boot from CD', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (558, 33, 4, N'VPS2012.Ram', N'RAM size, MB', 2, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (559, 33, 5, N'VPS2012.Hdd', N'Hard Drive size, GB', 2, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (560, 33, 6, N'VPS2012.DvdEnabled', N'DVD drive', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (561, 33, 10, N'VPS2012.ExternalNetworkEnabled', N'External Network', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (562, 33, 11, N'VPS2012.ExternalIPAddressesNumber', N'Number of External IP addresses', 2, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (563, 33, 13, N'VPS2012.PrivateNetworkEnabled', N'Private Network', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (564, 33, 14, N'VPS2012.PrivateIPAddressesNumber', N'Number of Private IP addresses per VPS', 3, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (565, 33, 9, N'VPS2012.SnapshotsNumber', N'Number of Snaphots', 3, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (566, 33, 15, N'VPS2012.StartShutdownAllowed', N'Allow user to Start, Turn off and Shutdown VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (567, 33, 16, N'VPS2012.PauseResumeAllowed', N'Allow user to Pause, Resume VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (568, 33, 17, N'VPS2012.RebootAllowed', N'Allow user to Reboot VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (569, 33, 18, N'VPS2012.ResetAlowed', N'Allow user to Reset VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (570, 33, 19, N'VPS2012.ReinstallAllowed', N'Allow user to Re-install VPS', 1, 0, NULL, NULL) + +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (571, 33, 12, N'VPS2012.Bandwidth', N'Monthly bandwidth, GB', 2, 0, NULL, NULL) + +END +GO + IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2') BEGIN -INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 30, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1) +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 33, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1) END ELSE BEGIN -UPDATE [dbo].[Providers] SET [EditorControl] = N'HyperV2012R2' WHERE [ProviderName] = 'HyperV2012R2' +UPDATE [dbo].[Providers] SET [EditorControl] = N'HyperV2012R2', [GroupID] = 33 WHERE [ProviderName] = 'HyperV2012R2' END GO +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetVirtualMachinesPaged2012') +DROP PROCEDURE GetVirtualMachinesPaged2012 +GO +CREATE PROCEDURE [dbo].[GetVirtualMachinesPaged2012] +( + @ActorID int, + @PackageID int, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int, + @Recursive bit +) +AS +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +SI.ItemTypeID = 41 -- VPS2012 +AND ((@Recursive = 0 AND P.PackageID = @PackageID) +OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, P.PackageID) = 1)) +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'SI.ItemName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT COUNT(SI.ItemID) FROM Packages AS P +INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID +INNER JOIN Users AS U ON P.UserID = U.UserID +LEFT OUTER JOIN ( + SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses +) AS EIP ON SI.ItemID = EIP.ItemID +LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1 +WHERE ' + @condition + ' + +DECLARE @Items AS TABLE +( + ItemID int +); + +WITH TempItems AS ( + SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row, + SI.ItemID + FROM Packages AS P + INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID + INNER JOIN Users AS U ON P.UserID = U.UserID + LEFT OUTER JOIN ( + SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses + ) AS EIP ON SI.ItemID = EIP.ItemID + LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1 + WHERE ' + @condition + ' +) + +INSERT INTO @Items +SELECT ItemID FROM TempItems +WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows + +SELECT + SI.ItemID, + SI.ItemName, + SI.PackageID, + P.PackageName, + P.UserID, + U.Username, + + EIP.ExternalIP, + PIP.IPAddress +FROM @Items AS TSI +INNER JOIN ServiceItems AS SI ON TSI.ItemID = SI.ItemID +INNER JOIN Packages AS P ON SI.PackageID = P.PackageID +INNER JOIN Users AS U ON P.UserID = U.UserID +LEFT OUTER JOIN ( + SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses +) AS EIP ON SI.ItemID = EIP.ItemID +LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1 +' + +--print @sql + +exec sp_executesql @sql, N'@PackageID int, @StartRow int, @MaximumRows int, @Recursive bit', +@PackageID, @StartRow, @MaximumRows, @Recursive + +RETURN +GO + + --ES OWA Editing IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'EnterpriseFoldersOwaPermissions') CREATE TABLE EnterpriseFoldersOwaPermissions @@ -9461,4 +9628,119 @@ END GO -UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps' \ No newline at end of file +UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps' +Go + +ALTER PROCEDURE [dbo].[AddServiceItem] +( + @ActorID int, + @PackageID int, + @ServiceID int, + @ItemName nvarchar(500), + @ItemTypeName nvarchar(200), + @ItemID int OUTPUT, + @XmlProperties ntext, + @CreatedDate datetime +) +AS +BEGIN TRAN + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- get GroupID +DECLARE @GroupID int +SELECT + @GroupID = PROV.GroupID +FROM Services AS S +INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID +WHERE S.ServiceID = @ServiceID + +DECLARE @ItemTypeID int +SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes +WHERE TypeName = @ItemTypeName +AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND GroupID = @GroupID)) + +-- Fix to allow plans assigned to serveradmin +IF (@ItemTypeName = 'WebsitePanel.Providers.HostedSolution.Organization, WebsitePanel.Providers.Base') +BEGIN + IF NOT EXISTS (SELECT * FROM ServiceItems WHERE PackageID = 1) + BEGIN + INSERT INTO ServiceItems (PackageID, ItemTypeID,ServiceID,ItemName,CreatedDate) + VALUES(1, @ItemTypeID, @ServiceID, 'System', @CreatedDate) + + DECLARE @TempItemID int + + SET @TempItemID = SCOPE_IDENTITY() + INSERT INTO ExchangeOrganizations (ItemID, OrganizationID) + VALUES(@TempItemID, 'System') + END +END + + +-- add item +INSERT INTO ServiceItems +( + PackageID, + ServiceID, + ItemName, + ItemTypeID, + CreatedDate +) +VALUES +( + @PackageID, + @ServiceID, + @ItemName, + @ItemTypeID, + @CreatedDate +) + +SET @ItemID = SCOPE_IDENTITY() + +DECLARE @idoc int +--Create an internal representation of the XML document. +EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties + +-- Execute a SELECT statement that uses the OPENXML rowset provider. +DELETE FROM ServiceItemProperties +WHERE ItemID = @ItemID + +CREATE TABLE #TempTable( + ItemID int, + PropertyName nvarchar(50), + PropertyValue nvarchar(3000)) + +INSERT INTO #TempTable (ItemID, PropertyName, PropertyValue) +SELECT + @ItemID, + PropertyName, + PropertyValue +FROM OPENXML(@idoc, '/properties/property',1) WITH +( + PropertyName nvarchar(50) '@name', + PropertyValue nvarchar(3000) '@value' +) as PV + +-- Move data from temp table to real table +INSERT INTO ServiceItemProperties +( + ItemID, + PropertyName, + PropertyValue +) +SELECT + ItemID, + PropertyName, + PropertyValue +FROM #TempTable + +DROP TABLE #TempTable + +-- remove document +exec sp_xml_removedocument @idoc + +COMMIT TRAN +RETURN +GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs index 9481c0c9..96501589 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs @@ -44,6 +44,7 @@ namespace WebsitePanel.EnterpriseServer public const string EXCHANGE_SERVER = "ExchangeServer"; public const string HOSTED_SOLLUTION = "HostedSollution"; public const string VIRTUAL_PRIVATE_SERVERS = "VirtualPrivateServers"; + public const string VIRTUAL_PRIVATE_SERVERS_2012 = "VirtualPrivateServers2012"; public const string VIRTUAL_PRIVATE_SERVERS_FOR_PRIVATE_CLOUD = "VirtualPrivateServersForPrivateCloud"; public int PackageId; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 47155cb1..bd209203 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -201,6 +201,26 @@ order by rg.groupOrder public const string VPS_REINSTALL_ALLOWED = "VPS.ReinstallAllowed"; // Allow user to Re-install VPS public const string VPS_BANDWIDTH = "VPS.Bandwidth"; // Monthly bandwidth, GB + public const string VPS2012_SERVERS_NUMBER = "VPS2012.ServersNumber"; // Number of VPS + public const string VPS2012_MANAGING_ALLOWED = "VPS2012.ManagingAllowed"; // Allow user to create VPS + public const string VPS2012_CPU_NUMBER = "VPS2012.CpuNumber"; // Number of CPU cores + public const string VPS2012_BOOT_CD_ALLOWED = "VPS2012.BootCdAllowed"; // Boot from CD allowed + public const string VPS2012_BOOT_CD_ENABLED = "VPS2012.BootCdEnabled"; // Boot from CD + public const string VPS2012_RAM = "VPS2012.Ram"; // RAM size, MB + public const string VPS2012_HDD = "VPS2012.Hdd"; // Hard Drive size, GB + public const string VPS2012_DVD_ENABLED = "VPS2012.DvdEnabled"; // DVD drive + public const string VPS2012_EXTERNAL_NETWORK_ENABLED = "VPS2012.ExternalNetworkEnabled"; // External Network + public const string VPS2012_EXTERNAL_IP_ADDRESSES_NUMBER = "VPS2012.ExternalIPAddressesNumber"; // Number of External IP addresses + public const string VPS2012_PRIVATE_NETWORK_ENABLED = "VPS2012.PrivateNetworkEnabled"; // Private Network + public const string VPS2012_PRIVATE_IP_ADDRESSES_NUMBER = "VPS2012.PrivateIPAddressesNumber"; // Number of Private IP addresses per VPS + public const string VPS2012_SNAPSHOTS_NUMBER = "VPS2012.SnapshotsNumber"; // Number of Snaphots + public const string VPS2012_START_SHUTDOWN_ALLOWED = "VPS2012.StartShutdownAllowed"; // Allow user to Start, Turn off and Shutdown VPS + public const string VPS2012_PAUSE_RESUME_ALLOWED = "VPS2012.PauseResumeAllowed"; // Allow user to Pause, Resume VPS + public const string VPS2012_REBOOT_ALLOWED = "VPS2012.RebootAllowed"; // Allow user to Reboot VPS + public const string VPS2012_RESET_ALOWED = "VPS2012.ResetAlowed"; // Allow user to Reset VPS + public const string VPS2012_REINSTALL_ALLOWED = "VPS2012.ReinstallAllowed"; // Allow user to Re-install VPS + public const string VPS2012_BANDWIDTH = "VPS2012.Bandwidth"; // Monthly bandwidth, GB + public const string VPSForPC_SERVERS_NUMBER = "VPSForPC.ServersNumber"; // Number of VPS public const string VPSForPC_MANAGING_ALLOWED = "VPSForPC.ManagingAllowed"; // Allow user to create VPS public const string VPSForPC_CPU_NUMBER = "VPSForPC.CpuNumber"; // Number of CPU cores diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs index 0e412bfb..3c80d70e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs @@ -51,6 +51,7 @@ namespace WebsitePanel.EnterpriseServer public const string HostedCRM = "Hosted CRM"; // CRM 4/2011 public const string HostedCRM2013 = "Hosted CRM2013"; // CRM 2013/2015 public const string VPS = "VPS"; + public const string VPS2012 = "VPS2012"; public const string BlackBerry = "BlackBerry"; public const string OCS = "OCS"; public const string VPSForPC = "VPSForPC"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy.cs index 26699aa8..bd5a855b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy.cs @@ -3120,1435 +3120,1435 @@ namespace WebsitePanel.EnterpriseServer { } } - /// - [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 VirtualMachineMetaItemsPaged Result { - get { - this.RaiseExceptionIfNecessary(); - return ((VirtualMachineMetaItemsPaged)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetVirtualMachinesByServiceIdCompletedEventHandler(object sender, GetVirtualMachinesByServiceIdCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachinesByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachinesByServiceIdCompletedEventArgs(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 GetVirtualMachineItemCompletedEventHandler(object sender, GetVirtualMachineItemCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachineItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachineItemCompletedEventArgs(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 EvaluateVirtualMachineTemplateCompletedEventHandler(object sender, EvaluateVirtualMachineTemplateCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class EvaluateVirtualMachineTemplateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal EvaluateVirtualMachineTemplateCompletedEventArgs(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 GetExternalNetworkDetailsCompletedEventHandler(object sender, GetExternalNetworkDetailsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetExternalNetworkDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetExternalNetworkDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public NetworkAdapterDetails Result { - get { - this.RaiseExceptionIfNecessary(); - return ((NetworkAdapterDetails)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetPackagePrivateIPAddressesPagedCompletedEventHandler(object sender, GetPackagePrivateIPAddressesPagedCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPackagePrivateIPAddressesPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPackagePrivateIPAddressesPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public PrivateIPAddressesPaged Result { - get { - this.RaiseExceptionIfNecessary(); - return ((PrivateIPAddressesPaged)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetPackagePrivateIPAddressesCompletedEventHandler(object sender, GetPackagePrivateIPAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPackagePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPackagePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public PrivateIPAddress[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((PrivateIPAddress[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetPrivateNetworkDetailsCompletedEventHandler(object sender, GetPrivateNetworkDetailsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPrivateNetworkDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPrivateNetworkDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public NetworkAdapterDetails Result { - get { - this.RaiseExceptionIfNecessary(); - return ((NetworkAdapterDetails)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetSpaceUserPermissionsCompletedEventHandler(object sender, GetSpaceUserPermissionsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetSpaceUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetSpaceUserPermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public VirtualMachinePermission[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((VirtualMachinePermission[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void UpdateSpaceUserPermissionsCompletedEventHandler(object sender, UpdateSpaceUserPermissionsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UpdateSpaceUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal UpdateSpaceUserPermissionsCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetSpaceAuditLogCompletedEventHandler(object sender, GetSpaceAuditLogCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetSpaceAuditLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetSpaceAuditLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public LogRecord[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((LogRecord[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetVirtualMachineAuditLogCompletedEventHandler(object sender, GetVirtualMachineAuditLogCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachineAuditLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachineAuditLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public LogRecord[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((LogRecord[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetOperatingSystemTemplatesCompletedEventHandler(object sender, GetOperatingSystemTemplatesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOperatingSystemTemplatesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetOperatingSystemTemplatesCompletedEventArgs(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 GetOperatingSystemTemplatesByServiceIdCompletedEventHandler(object sender, GetOperatingSystemTemplatesByServiceIdCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOperatingSystemTemplatesByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetOperatingSystemTemplatesByServiceIdCompletedEventArgs(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 GetMaximumCpuCoresNumberCompletedEventHandler(object sender, GetMaximumCpuCoresNumberCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetMaximumCpuCoresNumberCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetMaximumCpuCoresNumberCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetDefaultExportPathCompletedEventHandler(object sender, GetDefaultExportPathCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetDefaultExportPathCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetDefaultExportPathCompletedEventArgs(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 CreateDefaultVirtualMachineCompletedEventHandler(object sender, CreateDefaultVirtualMachineCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateDefaultVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal CreateDefaultVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public IntResult Result { - get { - this.RaiseExceptionIfNecessary(); - return ((IntResult)(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 IntResult Result { - get { - this.RaiseExceptionIfNecessary(); - return ((IntResult)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void ImportVirtualMachineCompletedEventHandler(object sender, ImportVirtualMachineCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class ImportVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal ImportVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public IntResult Result { - get { - this.RaiseExceptionIfNecessary(); - return ((IntResult)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetVirtualMachineThumbnailCompletedEventHandler(object sender, GetVirtualMachineThumbnailCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachineThumbnailCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachineThumbnailCompletedEventArgs(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 GetVirtualMachineGeneralDetailsCompletedEventHandler(object sender, GetVirtualMachineGeneralDetailsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachineGeneralDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachineGeneralDetailsCompletedEventArgs(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 GetVirtualMachineExtendedInfoCompletedEventHandler(object sender, GetVirtualMachineExtendedInfoCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachineExtendedInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachineExtendedInfoCompletedEventArgs(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 CancelVirtualMachineJobCompletedEventHandler(object sender, CancelVirtualMachineJobCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CancelVirtualMachineJobCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal CancelVirtualMachineJobCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void UpdateVirtualMachineHostNameCompletedEventHandler(object sender, UpdateVirtualMachineHostNameCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UpdateVirtualMachineHostNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal UpdateVirtualMachineHostNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 ChangeAdministratorPasswordCompletedEventHandler(object sender, ChangeAdministratorPasswordCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class ChangeAdministratorPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal ChangeAdministratorPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void UpdateVirtualMachineConfigurationCompletedEventHandler(object sender, UpdateVirtualMachineConfigurationCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UpdateVirtualMachineConfigurationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal UpdateVirtualMachineConfigurationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetInsertedDvdDiskCompletedEventHandler(object sender, GetInsertedDvdDiskCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetInsertedDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetInsertedDvdDiskCompletedEventArgs(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 GetLibraryDisksCompletedEventHandler(object sender, GetLibraryDisksCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetLibraryDisksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetLibraryDisksCompletedEventArgs(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 InsertDvdDiskCompletedEventHandler(object sender, InsertDvdDiskCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class InsertDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal InsertDvdDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void EjectDvdDiskCompletedEventHandler(object sender, EjectDvdDiskCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class EjectDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal EjectDvdDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetSnapshotThumbnailCompletedEventHandler(object sender, GetSnapshotThumbnailCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetSnapshotThumbnailCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetSnapshotThumbnailCompletedEventArgs(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 GetExternalNetworkAdapterDetailsCompletedEventHandler(object sender, GetExternalNetworkAdapterDetailsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetExternalNetworkAdapterDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetExternalNetworkAdapterDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public NetworkAdapterDetails Result { - get { - this.RaiseExceptionIfNecessary(); - return ((NetworkAdapterDetails)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void AddVirtualMachineExternalIPAddressesCompletedEventHandler(object sender, AddVirtualMachineExternalIPAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddVirtualMachineExternalIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal AddVirtualMachineExternalIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SetVirtualMachinePrimaryExternalIPAddressCompletedEventHandler(object sender, SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void DeleteVirtualMachineExternalIPAddressesCompletedEventHandler(object sender, DeleteVirtualMachineExternalIPAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteVirtualMachineExternalIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal DeleteVirtualMachineExternalIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetPrivateNetworkAdapterDetailsCompletedEventHandler(object sender, GetPrivateNetworkAdapterDetailsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPrivateNetworkAdapterDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPrivateNetworkAdapterDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public NetworkAdapterDetails Result { - get { - this.RaiseExceptionIfNecessary(); - return ((NetworkAdapterDetails)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void AddVirtualMachinePrivateIPAddressesCompletedEventHandler(object sender, AddVirtualMachinePrivateIPAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddVirtualMachinePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal AddVirtualMachinePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SetVirtualMachinePrimaryPrivateIPAddressCompletedEventHandler(object sender, SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void DeleteVirtualMachinePrivateIPAddressesCompletedEventHandler(object sender, DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetVirtualMachinePermissionsCompletedEventHandler(object sender, GetVirtualMachinePermissionsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachinePermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachinePermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public VirtualMachinePermission[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((VirtualMachinePermission[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void UpdateVirtualMachineUserPermissionsCompletedEventHandler(object sender, UpdateVirtualMachineUserPermissionsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UpdateVirtualMachineUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal UpdateVirtualMachineUserPermissionsCompletedEventArgs(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])); - } - } - } - - /// - [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 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 ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void ReinstallVirtualMachineCompletedEventHandler(object sender, ReinstallVirtualMachineCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class ReinstallVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal ReinstallVirtualMachineCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetVirtualMachineSummaryTextCompletedEventHandler(object sender, GetVirtualMachineSummaryTextCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetVirtualMachineSummaryTextCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetVirtualMachineSummaryTextCompletedEventArgs(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 SendVirtualMachineSummaryLetterCompletedEventHandler(object sender, SendVirtualMachineSummaryLetterCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SendVirtualMachineSummaryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SendVirtualMachineSummaryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ResultObject Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ResultObject)(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 VirtualMachineMetaItemsPaged Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((VirtualMachineMetaItemsPaged)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetVirtualMachinesByServiceIdCompletedEventHandler(object sender, GetVirtualMachinesByServiceIdCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachinesByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachinesByServiceIdCompletedEventArgs(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 GetVirtualMachineItemCompletedEventHandler(object sender, GetVirtualMachineItemCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachineItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachineItemCompletedEventArgs(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 EvaluateVirtualMachineTemplateCompletedEventHandler(object sender, EvaluateVirtualMachineTemplateCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class EvaluateVirtualMachineTemplateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal EvaluateVirtualMachineTemplateCompletedEventArgs(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 GetExternalNetworkDetailsCompletedEventHandler(object sender, GetExternalNetworkDetailsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetExternalNetworkDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetExternalNetworkDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public NetworkAdapterDetails Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((NetworkAdapterDetails)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetPackagePrivateIPAddressesPagedCompletedEventHandler(object sender, GetPackagePrivateIPAddressesPagedCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetPackagePrivateIPAddressesPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetPackagePrivateIPAddressesPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public PrivateIPAddressesPaged Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((PrivateIPAddressesPaged)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetPackagePrivateIPAddressesCompletedEventHandler(object sender, GetPackagePrivateIPAddressesCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetPackagePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetPackagePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public PrivateIPAddress[] Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((PrivateIPAddress[])(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetPrivateNetworkDetailsCompletedEventHandler(object sender, GetPrivateNetworkDetailsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetPrivateNetworkDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetPrivateNetworkDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public NetworkAdapterDetails Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((NetworkAdapterDetails)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetSpaceUserPermissionsCompletedEventHandler(object sender, GetSpaceUserPermissionsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetSpaceUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetSpaceUserPermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public VirtualMachinePermission[] Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((VirtualMachinePermission[])(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void UpdateSpaceUserPermissionsCompletedEventHandler(object sender, UpdateSpaceUserPermissionsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class UpdateSpaceUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal UpdateSpaceUserPermissionsCompletedEventArgs(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])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetSpaceAuditLogCompletedEventHandler(object sender, GetSpaceAuditLogCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetSpaceAuditLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetSpaceAuditLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public LogRecord[] Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((LogRecord[])(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetVirtualMachineAuditLogCompletedEventHandler(object sender, GetVirtualMachineAuditLogCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachineAuditLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachineAuditLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public LogRecord[] Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((LogRecord[])(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetOperatingSystemTemplatesCompletedEventHandler(object sender, GetOperatingSystemTemplatesCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetOperatingSystemTemplatesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetOperatingSystemTemplatesCompletedEventArgs(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 GetOperatingSystemTemplatesByServiceIdCompletedEventHandler(object sender, GetOperatingSystemTemplatesByServiceIdCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetOperatingSystemTemplatesByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetOperatingSystemTemplatesByServiceIdCompletedEventArgs(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 GetMaximumCpuCoresNumberCompletedEventHandler(object sender, GetMaximumCpuCoresNumberCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetMaximumCpuCoresNumberCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetMaximumCpuCoresNumberCompletedEventArgs(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])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetDefaultExportPathCompletedEventHandler(object sender, GetDefaultExportPathCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetDefaultExportPathCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetDefaultExportPathCompletedEventArgs(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 CreateDefaultVirtualMachineCompletedEventHandler(object sender, CreateDefaultVirtualMachineCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class CreateDefaultVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal CreateDefaultVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public IntResult Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((IntResult)(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 IntResult Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((IntResult)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void ImportVirtualMachineCompletedEventHandler(object sender, ImportVirtualMachineCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class ImportVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal ImportVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public IntResult Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((IntResult)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetVirtualMachineThumbnailCompletedEventHandler(object sender, GetVirtualMachineThumbnailCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachineThumbnailCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachineThumbnailCompletedEventArgs(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 GetVirtualMachineGeneralDetailsCompletedEventHandler(object sender, GetVirtualMachineGeneralDetailsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachineGeneralDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachineGeneralDetailsCompletedEventArgs(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 GetVirtualMachineExtendedInfoCompletedEventHandler(object sender, GetVirtualMachineExtendedInfoCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachineExtendedInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachineExtendedInfoCompletedEventArgs(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 CancelVirtualMachineJobCompletedEventHandler(object sender, CancelVirtualMachineJobCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class CancelVirtualMachineJobCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal CancelVirtualMachineJobCompletedEventArgs(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])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void UpdateVirtualMachineHostNameCompletedEventHandler(object sender, UpdateVirtualMachineHostNameCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class UpdateVirtualMachineHostNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal UpdateVirtualMachineHostNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(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 ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(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 ChangeAdministratorPasswordCompletedEventHandler(object sender, ChangeAdministratorPasswordCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class ChangeAdministratorPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal ChangeAdministratorPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void UpdateVirtualMachineConfigurationCompletedEventHandler(object sender, UpdateVirtualMachineConfigurationCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class UpdateVirtualMachineConfigurationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal UpdateVirtualMachineConfigurationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetInsertedDvdDiskCompletedEventHandler(object sender, GetInsertedDvdDiskCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetInsertedDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetInsertedDvdDiskCompletedEventArgs(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 GetLibraryDisksCompletedEventHandler(object sender, GetLibraryDisksCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetLibraryDisksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetLibraryDisksCompletedEventArgs(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 InsertDvdDiskCompletedEventHandler(object sender, InsertDvdDiskCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class InsertDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal InsertDvdDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void EjectDvdDiskCompletedEventHandler(object sender, EjectDvdDiskCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class EjectDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal EjectDvdDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(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 ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(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 ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(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 ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(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 ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(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 ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetSnapshotThumbnailCompletedEventHandler(object sender, GetSnapshotThumbnailCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetSnapshotThumbnailCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetSnapshotThumbnailCompletedEventArgs(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 GetExternalNetworkAdapterDetailsCompletedEventHandler(object sender, GetExternalNetworkAdapterDetailsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetExternalNetworkAdapterDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetExternalNetworkAdapterDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public NetworkAdapterDetails Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((NetworkAdapterDetails)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void AddVirtualMachineExternalIPAddressesCompletedEventHandler(object sender, AddVirtualMachineExternalIPAddressesCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class AddVirtualMachineExternalIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal AddVirtualMachineExternalIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void SetVirtualMachinePrimaryExternalIPAddressCompletedEventHandler(object sender, SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void DeleteVirtualMachineExternalIPAddressesCompletedEventHandler(object sender, DeleteVirtualMachineExternalIPAddressesCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class DeleteVirtualMachineExternalIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal DeleteVirtualMachineExternalIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetPrivateNetworkAdapterDetailsCompletedEventHandler(object sender, GetPrivateNetworkAdapterDetailsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetPrivateNetworkAdapterDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetPrivateNetworkAdapterDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public NetworkAdapterDetails Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((NetworkAdapterDetails)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void AddVirtualMachinePrivateIPAddressesCompletedEventHandler(object sender, AddVirtualMachinePrivateIPAddressesCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class AddVirtualMachinePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal AddVirtualMachinePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void SetVirtualMachinePrimaryPrivateIPAddressCompletedEventHandler(object sender, SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void DeleteVirtualMachinePrivateIPAddressesCompletedEventHandler(object sender, DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetVirtualMachinePermissionsCompletedEventHandler(object sender, GetVirtualMachinePermissionsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachinePermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachinePermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public VirtualMachinePermission[] Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((VirtualMachinePermission[])(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void UpdateVirtualMachineUserPermissionsCompletedEventHandler(object sender, UpdateVirtualMachineUserPermissionsCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class UpdateVirtualMachineUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal UpdateVirtualMachineUserPermissionsCompletedEventArgs(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])); + // } + // } + //} + + ///// + //[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 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 ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void ReinstallVirtualMachineCompletedEventHandler(object sender, ReinstallVirtualMachineCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class ReinstallVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal ReinstallVirtualMachineCompletedEventArgs(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])); + // } + // } + //} + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //public delegate void GetVirtualMachineSummaryTextCompletedEventHandler(object sender, GetVirtualMachineSummaryTextCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class GetVirtualMachineSummaryTextCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal GetVirtualMachineSummaryTextCompletedEventArgs(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 SendVirtualMachineSummaryLetterCompletedEventHandler(object sender, SendVirtualMachineSummaryLetterCompletedEventArgs e); + + ///// + //[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + //[System.Diagnostics.DebuggerStepThroughAttribute()] + //[System.ComponentModel.DesignerCategoryAttribute("code")] + //public partial class SendVirtualMachineSummaryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + // private object[] results; + + // internal SendVirtualMachineSummaryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + // base(exception, cancelled, userState) { + // this.results = results; + // } + + // /// + // public ResultObject Result { + // get { + // this.RaiseExceptionIfNecessary(); + // return ((ResultObject)(this.results[0])); + // } + // } + //} //Hyper-V Cloud /// diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy2012.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy2012.cs new file mode 100644 index 00000000..45cfcd16 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/VirtualizationServerProxy2012.cs @@ -0,0 +1,4523 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.8000 +// +// 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. +// +namespace WebsitePanel.EnterpriseServer { + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + using WebsitePanel.Providers; + using WebsitePanel.Providers.Common; + using WebsitePanel.Providers.Virtualization; + using WebsitePanel.Providers.ResultObjects; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="esVirtualizationServer2012Soap", Namespace="http://smbsaas/websitepanel/enterpriseserver")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] + public partial class esVirtualizationServer2012 : Microsoft.Web.Services3.WebServicesClientProtocol { + + private System.Threading.SendOrPostCallback GetVirtualMachinesOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachinesByServiceIdOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineItemOperationCompleted; + + private System.Threading.SendOrPostCallback EvaluateVirtualMachineTemplateOperationCompleted; + + private System.Threading.SendOrPostCallback GetExternalNetworkDetailsOperationCompleted; + + private System.Threading.SendOrPostCallback GetPackagePrivateIPAddressesPagedOperationCompleted; + + private System.Threading.SendOrPostCallback GetPackagePrivateIPAddressesOperationCompleted; + + private System.Threading.SendOrPostCallback GetPrivateNetworkDetailsOperationCompleted; + + private System.Threading.SendOrPostCallback GetSpaceUserPermissionsOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateSpaceUserPermissionsOperationCompleted; + + private System.Threading.SendOrPostCallback GetSpaceAuditLogOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineAuditLogOperationCompleted; + + private System.Threading.SendOrPostCallback GetOperatingSystemTemplatesOperationCompleted; + + private System.Threading.SendOrPostCallback GetOperatingSystemTemplatesByServiceIdOperationCompleted; + + private System.Threading.SendOrPostCallback GetMaximumCpuCoresNumberOperationCompleted; + + private System.Threading.SendOrPostCallback GetDefaultExportPathOperationCompleted; + + private System.Threading.SendOrPostCallback CreateDefaultVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback CreateVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback ImportVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineThumbnailOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineGeneralDetailsOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineExtendedInfoOperationCompleted; + + private System.Threading.SendOrPostCallback CancelVirtualMachineJobOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateVirtualMachineHostNameOperationCompleted; + + private System.Threading.SendOrPostCallback ChangeVirtualMachineStateOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineJobsOperationCompleted; + + private System.Threading.SendOrPostCallback ChangeAdministratorPasswordOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateVirtualMachineConfigurationOperationCompleted; + + private System.Threading.SendOrPostCallback GetInsertedDvdDiskOperationCompleted; + + private System.Threading.SendOrPostCallback GetLibraryDisksOperationCompleted; + + private System.Threading.SendOrPostCallback InsertDvdDiskOperationCompleted; + + private System.Threading.SendOrPostCallback EjectDvdDiskOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineSnapshotsOperationCompleted; + + private System.Threading.SendOrPostCallback GetSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback CreateSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback ApplySnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback RenameSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteSnapshotOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteSnapshotSubtreeOperationCompleted; + + private System.Threading.SendOrPostCallback GetSnapshotThumbnailOperationCompleted; + + private System.Threading.SendOrPostCallback GetExternalNetworkAdapterDetailsOperationCompleted; + + private System.Threading.SendOrPostCallback AddVirtualMachineExternalIPAddressesOperationCompleted; + + private System.Threading.SendOrPostCallback SetVirtualMachinePrimaryExternalIPAddressOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteVirtualMachineExternalIPAddressesOperationCompleted; + + private System.Threading.SendOrPostCallback GetPrivateNetworkAdapterDetailsOperationCompleted; + + private System.Threading.SendOrPostCallback AddVirtualMachinePrivateIPAddressesOperationCompleted; + + private System.Threading.SendOrPostCallback SetVirtualMachinePrimaryPrivateIPAddressOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteVirtualMachinePrivateIPAddressesOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachinePermissionsOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateVirtualMachineUserPermissionsOperationCompleted; + + private System.Threading.SendOrPostCallback GetExternalSwitchesOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback ReinstallVirtualMachineOperationCompleted; + + private System.Threading.SendOrPostCallback GetVirtualMachineSummaryTextOperationCompleted; + + private System.Threading.SendOrPostCallback SendVirtualMachineSummaryLetterOperationCompleted; + + /// + public esVirtualizationServer2012() { + this.Url = "http://127.0.0.1:9012/esVirtualizationServer2012.asmx"; + } + + /// + public event GetVirtualMachinesCompletedEventHandler GetVirtualMachinesCompleted; + + /// + public event GetVirtualMachinesByServiceIdCompletedEventHandler GetVirtualMachinesByServiceIdCompleted; + + /// + public event GetVirtualMachineItemCompletedEventHandler GetVirtualMachineItemCompleted; + + /// + public event EvaluateVirtualMachineTemplateCompletedEventHandler EvaluateVirtualMachineTemplateCompleted; + + /// + public event GetExternalNetworkDetailsCompletedEventHandler GetExternalNetworkDetailsCompleted; + + /// + public event GetPackagePrivateIPAddressesPagedCompletedEventHandler GetPackagePrivateIPAddressesPagedCompleted; + + /// + public event GetPackagePrivateIPAddressesCompletedEventHandler GetPackagePrivateIPAddressesCompleted; + + /// + public event GetPrivateNetworkDetailsCompletedEventHandler GetPrivateNetworkDetailsCompleted; + + /// + public event GetSpaceUserPermissionsCompletedEventHandler GetSpaceUserPermissionsCompleted; + + /// + public event UpdateSpaceUserPermissionsCompletedEventHandler UpdateSpaceUserPermissionsCompleted; + + /// + public event GetSpaceAuditLogCompletedEventHandler GetSpaceAuditLogCompleted; + + /// + public event GetVirtualMachineAuditLogCompletedEventHandler GetVirtualMachineAuditLogCompleted; + + /// + public event GetOperatingSystemTemplatesCompletedEventHandler GetOperatingSystemTemplatesCompleted; + + /// + public event GetOperatingSystemTemplatesByServiceIdCompletedEventHandler GetOperatingSystemTemplatesByServiceIdCompleted; + + /// + public event GetMaximumCpuCoresNumberCompletedEventHandler GetMaximumCpuCoresNumberCompleted; + + /// + public event GetDefaultExportPathCompletedEventHandler GetDefaultExportPathCompleted; + + /// + public event CreateDefaultVirtualMachineCompletedEventHandler CreateDefaultVirtualMachineCompleted; + + /// + public event CreateVirtualMachineCompletedEventHandler CreateVirtualMachineCompleted; + + /// + public event ImportVirtualMachineCompletedEventHandler ImportVirtualMachineCompleted; + + /// + public event GetVirtualMachineThumbnailCompletedEventHandler GetVirtualMachineThumbnailCompleted; + + /// + public event GetVirtualMachineGeneralDetailsCompletedEventHandler GetVirtualMachineGeneralDetailsCompleted; + + /// + public event GetVirtualMachineExtendedInfoCompletedEventHandler GetVirtualMachineExtendedInfoCompleted; + + /// + public event CancelVirtualMachineJobCompletedEventHandler CancelVirtualMachineJobCompleted; + + /// + public event UpdateVirtualMachineHostNameCompletedEventHandler UpdateVirtualMachineHostNameCompleted; + + /// + public event ChangeVirtualMachineStateCompletedEventHandler ChangeVirtualMachineStateCompleted; + + /// + public event GetVirtualMachineJobsCompletedEventHandler GetVirtualMachineJobsCompleted; + + /// + public event ChangeAdministratorPasswordCompletedEventHandler ChangeAdministratorPasswordCompleted; + + /// + public event UpdateVirtualMachineConfigurationCompletedEventHandler UpdateVirtualMachineConfigurationCompleted; + + /// + public event GetInsertedDvdDiskCompletedEventHandler GetInsertedDvdDiskCompleted; + + /// + public event GetLibraryDisksCompletedEventHandler GetLibraryDisksCompleted; + + /// + public event InsertDvdDiskCompletedEventHandler InsertDvdDiskCompleted; + + /// + public event EjectDvdDiskCompletedEventHandler EjectDvdDiskCompleted; + + /// + public event GetVirtualMachineSnapshotsCompletedEventHandler GetVirtualMachineSnapshotsCompleted; + + /// + public event GetSnapshotCompletedEventHandler GetSnapshotCompleted; + + /// + public event CreateSnapshotCompletedEventHandler CreateSnapshotCompleted; + + /// + public event ApplySnapshotCompletedEventHandler ApplySnapshotCompleted; + + /// + public event RenameSnapshotCompletedEventHandler RenameSnapshotCompleted; + + /// + public event DeleteSnapshotCompletedEventHandler DeleteSnapshotCompleted; + + /// + public event DeleteSnapshotSubtreeCompletedEventHandler DeleteSnapshotSubtreeCompleted; + + /// + public event GetSnapshotThumbnailCompletedEventHandler GetSnapshotThumbnailCompleted; + + /// + public event GetExternalNetworkAdapterDetailsCompletedEventHandler GetExternalNetworkAdapterDetailsCompleted; + + /// + public event AddVirtualMachineExternalIPAddressesCompletedEventHandler AddVirtualMachineExternalIPAddressesCompleted; + + /// + public event SetVirtualMachinePrimaryExternalIPAddressCompletedEventHandler SetVirtualMachinePrimaryExternalIPAddressCompleted; + + /// + public event DeleteVirtualMachineExternalIPAddressesCompletedEventHandler DeleteVirtualMachineExternalIPAddressesCompleted; + + /// + public event GetPrivateNetworkAdapterDetailsCompletedEventHandler GetPrivateNetworkAdapterDetailsCompleted; + + /// + public event AddVirtualMachinePrivateIPAddressesCompletedEventHandler AddVirtualMachinePrivateIPAddressesCompleted; + + /// + public event SetVirtualMachinePrimaryPrivateIPAddressCompletedEventHandler SetVirtualMachinePrimaryPrivateIPAddressCompleted; + + /// + public event DeleteVirtualMachinePrivateIPAddressesCompletedEventHandler DeleteVirtualMachinePrivateIPAddressesCompleted; + + /// + public event GetVirtualMachinePermissionsCompletedEventHandler GetVirtualMachinePermissionsCompleted; + + /// + public event UpdateVirtualMachineUserPermissionsCompletedEventHandler UpdateVirtualMachineUserPermissionsCompleted; + + /// + public event GetExternalSwitchesCompletedEventHandler GetExternalSwitchesCompleted; + + /// + public event DeleteVirtualMachineCompletedEventHandler DeleteVirtualMachineCompleted; + + /// + public event ReinstallVirtualMachineCompletedEventHandler ReinstallVirtualMachineCompleted; + + /// + public event GetVirtualMachineSummaryTextCompletedEventHandler GetVirtualMachineSummaryTextCompleted; + + /// + public event SendVirtualMachineSummaryLetterCompletedEventHandler SendVirtualMachineSummaryLetterCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachines", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachineMetaItemsPaged GetVirtualMachines(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive) { + object[] results = this.Invoke("GetVirtualMachines", new object[] { + packageId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows, + recursive}); + return ((VirtualMachineMetaItemsPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachines(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachines", new object[] { + packageId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows, + recursive}, callback, asyncState); + } + + /// + public VirtualMachineMetaItemsPaged EndGetVirtualMachines(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachineMetaItemsPaged)(results[0])); + } + + /// + public void GetVirtualMachinesAsync(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive) { + this.GetVirtualMachinesAsync(packageId, filterColumn, filterValue, sortColumn, startRow, maximumRows, recursive, null); + } + + /// + public void GetVirtualMachinesAsync(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive, object userState) { + if ((this.GetVirtualMachinesOperationCompleted == null)) { + this.GetVirtualMachinesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachinesOperationCompleted); + } + this.InvokeAsync("GetVirtualMachines", new object[] { + packageId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows, + recursive}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachinesByServiceId", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine[] GetVirtualMachinesByServiceId(int serviceId) { + object[] results = this.Invoke("GetVirtualMachinesByServiceId", new object[] { + serviceId}); + return ((VirtualMachine[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachinesByServiceId(int serviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachinesByServiceId", new object[] { + serviceId}, callback, asyncState); + } + + /// + public VirtualMachine[] EndGetVirtualMachinesByServiceId(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine[])(results[0])); + } + + /// + public void GetVirtualMachinesByServiceIdAsync(int serviceId) { + this.GetVirtualMachinesByServiceIdAsync(serviceId, null); + } + + /// + public void GetVirtualMachinesByServiceIdAsync(int serviceId, object userState) { + if ((this.GetVirtualMachinesByServiceIdOperationCompleted == null)) { + this.GetVirtualMachinesByServiceIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachinesByServiceIdOperationCompleted); + } + this.InvokeAsync("GetVirtualMachinesByServiceId", new object[] { + serviceId}, this.GetVirtualMachinesByServiceIdOperationCompleted, userState); + } + + private void OnGetVirtualMachinesByServiceIdOperationCompleted(object arg) { + if ((this.GetVirtualMachinesByServiceIdCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachinesByServiceIdCompleted(this, new GetVirtualMachinesByServiceIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineItem", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine GetVirtualMachineItem(int itemId) { + object[] results = this.Invoke("GetVirtualMachineItem", new object[] { + itemId}); + return ((VirtualMachine)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineItem(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineItem", new object[] { + itemId}, callback, asyncState); + } + + /// + public VirtualMachine EndGetVirtualMachineItem(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine)(results[0])); + } + + /// + public void GetVirtualMachineItemAsync(int itemId) { + this.GetVirtualMachineItemAsync(itemId, null); + } + + /// + public void GetVirtualMachineItemAsync(int itemId, object userState) { + if ((this.GetVirtualMachineItemOperationCompleted == null)) { + this.GetVirtualMachineItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineItemOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineItem", new object[] { + itemId}, this.GetVirtualMachineItemOperationCompleted, userState); + } + + private void OnGetVirtualMachineItemOperationCompleted(object arg) { + if ((this.GetVirtualMachineItemCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineItemCompleted(this, new GetVirtualMachineItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/EvaluateVirtualMachineTemplate", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string EvaluateVirtualMachineTemplate(int itemId, string template) { + object[] results = this.Invoke("EvaluateVirtualMachineTemplate", new object[] { + itemId, + template}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginEvaluateVirtualMachineTemplate(int itemId, string template, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("EvaluateVirtualMachineTemplate", new object[] { + itemId, + template}, callback, asyncState); + } + + /// + public string EndEvaluateVirtualMachineTemplate(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void EvaluateVirtualMachineTemplateAsync(int itemId, string template) { + this.EvaluateVirtualMachineTemplateAsync(itemId, template, null); + } + + /// + public void EvaluateVirtualMachineTemplateAsync(int itemId, string template, object userState) { + if ((this.EvaluateVirtualMachineTemplateOperationCompleted == null)) { + this.EvaluateVirtualMachineTemplateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEvaluateVirtualMachineTemplateOperationCompleted); + } + this.InvokeAsync("EvaluateVirtualMachineTemplate", new object[] { + itemId, + template}, this.EvaluateVirtualMachineTemplateOperationCompleted, userState); + } + + private void OnEvaluateVirtualMachineTemplateOperationCompleted(object arg) { + if ((this.EvaluateVirtualMachineTemplateCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EvaluateVirtualMachineTemplateCompleted(this, new EvaluateVirtualMachineTemplateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExternalNetworkDetails", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public NetworkAdapterDetails GetExternalNetworkDetails(int packageId) { + object[] results = this.Invoke("GetExternalNetworkDetails", new object[] { + packageId}); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public System.IAsyncResult BeginGetExternalNetworkDetails(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExternalNetworkDetails", new object[] { + packageId}, callback, asyncState); + } + + /// + public NetworkAdapterDetails EndGetExternalNetworkDetails(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public void GetExternalNetworkDetailsAsync(int packageId) { + this.GetExternalNetworkDetailsAsync(packageId, null); + } + + /// + public void GetExternalNetworkDetailsAsync(int packageId, object userState) { + if ((this.GetExternalNetworkDetailsOperationCompleted == null)) { + this.GetExternalNetworkDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExternalNetworkDetailsOperationCompleted); + } + this.InvokeAsync("GetExternalNetworkDetails", new object[] { + packageId}, this.GetExternalNetworkDetailsOperationCompleted, userState); + } + + private void OnGetExternalNetworkDetailsOperationCompleted(object arg) { + if ((this.GetExternalNetworkDetailsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExternalNetworkDetailsCompleted(this, new GetExternalNetworkDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPackagePrivateIPAddressesPaged", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public PrivateIPAddressesPaged GetPackagePrivateIPAddressesPaged(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + object[] results = this.Invoke("GetPackagePrivateIPAddressesPaged", new object[] { + packageId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((PrivateIPAddressesPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetPackagePrivateIPAddressesPaged(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPackagePrivateIPAddressesPaged", new object[] { + packageId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public PrivateIPAddressesPaged EndGetPackagePrivateIPAddressesPaged(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((PrivateIPAddressesPaged)(results[0])); + } + + /// + public void GetPackagePrivateIPAddressesPagedAsync(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + this.GetPackagePrivateIPAddressesPagedAsync(packageId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetPackagePrivateIPAddressesPagedAsync(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { + if ((this.GetPackagePrivateIPAddressesPagedOperationCompleted == null)) { + this.GetPackagePrivateIPAddressesPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPackagePrivateIPAddressesPagedOperationCompleted); + } + this.InvokeAsync("GetPackagePrivateIPAddressesPaged", new object[] { + packageId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetPackagePrivateIPAddressesPagedOperationCompleted, userState); + } + + private void OnGetPackagePrivateIPAddressesPagedOperationCompleted(object arg) { + if ((this.GetPackagePrivateIPAddressesPagedCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPackagePrivateIPAddressesPagedCompleted(this, new GetPackagePrivateIPAddressesPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPackagePrivateIPAddresses", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public PrivateIPAddress[] GetPackagePrivateIPAddresses(int packageId) { + object[] results = this.Invoke("GetPackagePrivateIPAddresses", new object[] { + packageId}); + return ((PrivateIPAddress[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetPackagePrivateIPAddresses(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPackagePrivateIPAddresses", new object[] { + packageId}, callback, asyncState); + } + + /// + public PrivateIPAddress[] EndGetPackagePrivateIPAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((PrivateIPAddress[])(results[0])); + } + + /// + public void GetPackagePrivateIPAddressesAsync(int packageId) { + this.GetPackagePrivateIPAddressesAsync(packageId, null); + } + + /// + public void GetPackagePrivateIPAddressesAsync(int packageId, object userState) { + if ((this.GetPackagePrivateIPAddressesOperationCompleted == null)) { + this.GetPackagePrivateIPAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPackagePrivateIPAddressesOperationCompleted); + } + this.InvokeAsync("GetPackagePrivateIPAddresses", new object[] { + packageId}, this.GetPackagePrivateIPAddressesOperationCompleted, userState); + } + + private void OnGetPackagePrivateIPAddressesOperationCompleted(object arg) { + if ((this.GetPackagePrivateIPAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPackagePrivateIPAddressesCompleted(this, new GetPackagePrivateIPAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPrivateNetworkDetails", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public NetworkAdapterDetails GetPrivateNetworkDetails(int packageId) { + object[] results = this.Invoke("GetPrivateNetworkDetails", new object[] { + packageId}); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public System.IAsyncResult BeginGetPrivateNetworkDetails(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPrivateNetworkDetails", new object[] { + packageId}, callback, asyncState); + } + + /// + public NetworkAdapterDetails EndGetPrivateNetworkDetails(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public void GetPrivateNetworkDetailsAsync(int packageId) { + this.GetPrivateNetworkDetailsAsync(packageId, null); + } + + /// + public void GetPrivateNetworkDetailsAsync(int packageId, object userState) { + if ((this.GetPrivateNetworkDetailsOperationCompleted == null)) { + this.GetPrivateNetworkDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPrivateNetworkDetailsOperationCompleted); + } + this.InvokeAsync("GetPrivateNetworkDetails", new object[] { + packageId}, this.GetPrivateNetworkDetailsOperationCompleted, userState); + } + + private void OnGetPrivateNetworkDetailsOperationCompleted(object arg) { + if ((this.GetPrivateNetworkDetailsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPrivateNetworkDetailsCompleted(this, new GetPrivateNetworkDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSpaceUserPermissions", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachinePermission[] GetSpaceUserPermissions(int packageId) { + object[] results = this.Invoke("GetSpaceUserPermissions", new object[] { + packageId}); + return ((VirtualMachinePermission[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetSpaceUserPermissions(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSpaceUserPermissions", new object[] { + packageId}, callback, asyncState); + } + + /// + public VirtualMachinePermission[] EndGetSpaceUserPermissions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachinePermission[])(results[0])); + } + + /// + public void GetSpaceUserPermissionsAsync(int packageId) { + this.GetSpaceUserPermissionsAsync(packageId, null); + } + + /// + public void GetSpaceUserPermissionsAsync(int packageId, object userState) { + if ((this.GetSpaceUserPermissionsOperationCompleted == null)) { + this.GetSpaceUserPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSpaceUserPermissionsOperationCompleted); + } + this.InvokeAsync("GetSpaceUserPermissions", new object[] { + packageId}, this.GetSpaceUserPermissionsOperationCompleted, userState); + } + + private void OnGetSpaceUserPermissionsOperationCompleted(object arg) { + if ((this.GetSpaceUserPermissionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSpaceUserPermissionsCompleted(this, new GetSpaceUserPermissionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateSpaceUserPermissions", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int UpdateSpaceUserPermissions(int packageId, VirtualMachinePermission[] permissions) { + object[] results = this.Invoke("UpdateSpaceUserPermissions", new object[] { + packageId, + permissions}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateSpaceUserPermissions(int packageId, VirtualMachinePermission[] permissions, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UpdateSpaceUserPermissions", new object[] { + packageId, + permissions}, callback, asyncState); + } + + /// + public int EndUpdateSpaceUserPermissions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void UpdateSpaceUserPermissionsAsync(int packageId, VirtualMachinePermission[] permissions) { + this.UpdateSpaceUserPermissionsAsync(packageId, permissions, null); + } + + /// + public void UpdateSpaceUserPermissionsAsync(int packageId, VirtualMachinePermission[] permissions, object userState) { + if ((this.UpdateSpaceUserPermissionsOperationCompleted == null)) { + this.UpdateSpaceUserPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSpaceUserPermissionsOperationCompleted); + } + this.InvokeAsync("UpdateSpaceUserPermissions", new object[] { + packageId, + permissions}, this.UpdateSpaceUserPermissionsOperationCompleted, userState); + } + + private void OnUpdateSpaceUserPermissionsOperationCompleted(object arg) { + if ((this.UpdateSpaceUserPermissionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateSpaceUserPermissionsCompleted(this, new UpdateSpaceUserPermissionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSpaceAuditLog", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LogRecord[] GetSpaceAuditLog(int packageId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows) { + object[] results = this.Invoke("GetSpaceAuditLog", new object[] { + packageId, + startPeriod, + endPeriod, + severity, + sortColumn, + startRow, + maximumRows}); + return ((LogRecord[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetSpaceAuditLog(int packageId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSpaceAuditLog", new object[] { + packageId, + startPeriod, + endPeriod, + severity, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public LogRecord[] EndGetSpaceAuditLog(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LogRecord[])(results[0])); + } + + /// + public void GetSpaceAuditLogAsync(int packageId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows) { + this.GetSpaceAuditLogAsync(packageId, startPeriod, endPeriod, severity, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetSpaceAuditLogAsync(int packageId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows, object userState) { + if ((this.GetSpaceAuditLogOperationCompleted == null)) { + this.GetSpaceAuditLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSpaceAuditLogOperationCompleted); + } + this.InvokeAsync("GetSpaceAuditLog", new object[] { + packageId, + startPeriod, + endPeriod, + severity, + sortColumn, + startRow, + maximumRows}, this.GetSpaceAuditLogOperationCompleted, userState); + } + + private void OnGetSpaceAuditLogOperationCompleted(object arg) { + if ((this.GetSpaceAuditLogCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSpaceAuditLogCompleted(this, new GetSpaceAuditLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineAuditLog", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LogRecord[] GetVirtualMachineAuditLog(int itemId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows) { + object[] results = this.Invoke("GetVirtualMachineAuditLog", new object[] { + itemId, + startPeriod, + endPeriod, + severity, + sortColumn, + startRow, + maximumRows}); + return ((LogRecord[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineAuditLog(int itemId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineAuditLog", new object[] { + itemId, + startPeriod, + endPeriod, + severity, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public LogRecord[] EndGetVirtualMachineAuditLog(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LogRecord[])(results[0])); + } + + /// + public void GetVirtualMachineAuditLogAsync(int itemId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows) { + this.GetVirtualMachineAuditLogAsync(itemId, startPeriod, endPeriod, severity, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetVirtualMachineAuditLogAsync(int itemId, System.DateTime startPeriod, System.DateTime endPeriod, int severity, string sortColumn, int startRow, int maximumRows, object userState) { + if ((this.GetVirtualMachineAuditLogOperationCompleted == null)) { + this.GetVirtualMachineAuditLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineAuditLogOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineAuditLog", new object[] { + itemId, + startPeriod, + endPeriod, + severity, + sortColumn, + startRow, + maximumRows}, this.GetVirtualMachineAuditLogOperationCompleted, userState); + } + + private void OnGetVirtualMachineAuditLogOperationCompleted(object arg) { + if ((this.GetVirtualMachineAuditLogCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineAuditLogCompleted(this, new GetVirtualMachineAuditLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOperatingSystemTemplates", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LibraryItem[] GetOperatingSystemTemplates(int packageId) { + object[] results = this.Invoke("GetOperatingSystemTemplates", new object[] { + packageId}); + return ((LibraryItem[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetOperatingSystemTemplates(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetOperatingSystemTemplates", new object[] { + packageId}, callback, asyncState); + } + + /// + public LibraryItem[] EndGetOperatingSystemTemplates(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LibraryItem[])(results[0])); + } + + /// + public void GetOperatingSystemTemplatesAsync(int packageId) { + this.GetOperatingSystemTemplatesAsync(packageId, null); + } + + /// + public void GetOperatingSystemTemplatesAsync(int packageId, object userState) { + if ((this.GetOperatingSystemTemplatesOperationCompleted == null)) { + this.GetOperatingSystemTemplatesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOperatingSystemTemplatesOperationCompleted); + } + this.InvokeAsync("GetOperatingSystemTemplates", new object[] { + packageId}, this.GetOperatingSystemTemplatesOperationCompleted, userState); + } + + private void OnGetOperatingSystemTemplatesOperationCompleted(object arg) { + if ((this.GetOperatingSystemTemplatesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOperatingSystemTemplatesCompleted(this, new GetOperatingSystemTemplatesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOperatingSystemTemplatesByService" + + "Id", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LibraryItem[] GetOperatingSystemTemplatesByServiceId(int serviceId) { + object[] results = this.Invoke("GetOperatingSystemTemplatesByServiceId", new object[] { + serviceId}); + return ((LibraryItem[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetOperatingSystemTemplatesByServiceId(int serviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetOperatingSystemTemplatesByServiceId", new object[] { + serviceId}, callback, asyncState); + } + + /// + public LibraryItem[] EndGetOperatingSystemTemplatesByServiceId(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LibraryItem[])(results[0])); + } + + /// + public void GetOperatingSystemTemplatesByServiceIdAsync(int serviceId) { + this.GetOperatingSystemTemplatesByServiceIdAsync(serviceId, null); + } + + /// + public void GetOperatingSystemTemplatesByServiceIdAsync(int serviceId, object userState) { + if ((this.GetOperatingSystemTemplatesByServiceIdOperationCompleted == null)) { + this.GetOperatingSystemTemplatesByServiceIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOperatingSystemTemplatesByServiceIdOperationCompleted); + } + this.InvokeAsync("GetOperatingSystemTemplatesByServiceId", new object[] { + serviceId}, this.GetOperatingSystemTemplatesByServiceIdOperationCompleted, userState); + } + + private void OnGetOperatingSystemTemplatesByServiceIdOperationCompleted(object arg) { + if ((this.GetOperatingSystemTemplatesByServiceIdCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOperatingSystemTemplatesByServiceIdCompleted(this, new GetOperatingSystemTemplatesByServiceIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMaximumCpuCoresNumber", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetMaximumCpuCoresNumber(int packageId) { + object[] results = this.Invoke("GetMaximumCpuCoresNumber", new object[] { + packageId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginGetMaximumCpuCoresNumber(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetMaximumCpuCoresNumber", new object[] { + packageId}, callback, asyncState); + } + + /// + public int EndGetMaximumCpuCoresNumber(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void GetMaximumCpuCoresNumberAsync(int packageId) { + this.GetMaximumCpuCoresNumberAsync(packageId, null); + } + + /// + public void GetMaximumCpuCoresNumberAsync(int packageId, object userState) { + if ((this.GetMaximumCpuCoresNumberOperationCompleted == null)) { + this.GetMaximumCpuCoresNumberOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMaximumCpuCoresNumberOperationCompleted); + } + this.InvokeAsync("GetMaximumCpuCoresNumber", new object[] { + packageId}, this.GetMaximumCpuCoresNumberOperationCompleted, userState); + } + + private void OnGetMaximumCpuCoresNumberOperationCompleted(object arg) { + if ((this.GetMaximumCpuCoresNumberCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetMaximumCpuCoresNumberCompleted(this, new GetMaximumCpuCoresNumberCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetDefaultExportPath", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetDefaultExportPath(int itemId) { + object[] results = this.Invoke("GetDefaultExportPath", new object[] { + itemId}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginGetDefaultExportPath(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetDefaultExportPath", new object[] { + itemId}, callback, asyncState); + } + + /// + public string EndGetDefaultExportPath(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void GetDefaultExportPathAsync(int itemId) { + this.GetDefaultExportPathAsync(itemId, null); + } + + /// + public void GetDefaultExportPathAsync(int itemId, object userState) { + if ((this.GetDefaultExportPathOperationCompleted == null)) { + this.GetDefaultExportPathOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDefaultExportPathOperationCompleted); + } + this.InvokeAsync("GetDefaultExportPath", new object[] { + itemId}, this.GetDefaultExportPathOperationCompleted, userState); + } + + private void OnGetDefaultExportPathOperationCompleted(object arg) { + if ((this.GetDefaultExportPathCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDefaultExportPathCompleted(this, new GetDefaultExportPathCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateDefaultVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public IntResult CreateDefaultVirtualMachine(int packageId, string hostname, string osTemplate, string password, string summaryLetterEmail) { + object[] results = this.Invoke("CreateDefaultVirtualMachine", new object[] { + packageId, + hostname, + osTemplate, + password, + summaryLetterEmail}); + return ((IntResult)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateDefaultVirtualMachine(int packageId, string hostname, string osTemplate, string password, string summaryLetterEmail, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateDefaultVirtualMachine", new object[] { + packageId, + hostname, + osTemplate, + password, + summaryLetterEmail}, callback, asyncState); + } + + /// + public IntResult EndCreateDefaultVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((IntResult)(results[0])); + } + + /// + public void CreateDefaultVirtualMachineAsync(int packageId, string hostname, string osTemplate, string password, string summaryLetterEmail) { + this.CreateDefaultVirtualMachineAsync(packageId, hostname, osTemplate, password, summaryLetterEmail, null); + } + + /// + public void CreateDefaultVirtualMachineAsync(int packageId, string hostname, string osTemplate, string password, string summaryLetterEmail, object userState) { + if ((this.CreateDefaultVirtualMachineOperationCompleted == null)) { + this.CreateDefaultVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateDefaultVirtualMachineOperationCompleted); + } + this.InvokeAsync("CreateDefaultVirtualMachine", new object[] { + packageId, + hostname, + osTemplate, + password, + summaryLetterEmail}, this.CreateDefaultVirtualMachineOperationCompleted, userState); + } + + private void OnCreateDefaultVirtualMachineOperationCompleted(object arg) { + if ((this.CreateDefaultVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateDefaultVirtualMachineCompleted(this, new CreateDefaultVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public IntResult CreateVirtualMachine( + int packageId, + string hostname, + string osTemplateFile, + string password, + string summaryLetterEmail, + int generation, + int cpuCores, + int ramMB, + int hddGB, + int snapshots, + bool dvdInstalled, + bool bootFromCD, + bool numLock, + bool startShutdownAllowed, + bool pauseResumeAllowed, + bool rebootAllowed, + bool resetAllowed, + bool reinstallAllowed, + bool externalNetworkEnabled, + int externalAddressesNumber, + bool randomExternalAddresses, + int[] externalAddresses, + bool privateNetworkEnabled, + int privateAddressesNumber, + bool randomPrivateAddresses, + string[] privateAddresses) { + object[] results = this.Invoke("CreateVirtualMachine", new object[] { + packageId, + hostname, + osTemplateFile, + password, + summaryLetterEmail, + generation, + cpuCores, + ramMB, + hddGB, + snapshots, + dvdInstalled, + bootFromCD, + numLock, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNetworkEnabled, + externalAddressesNumber, + randomExternalAddresses, + externalAddresses, + privateNetworkEnabled, + privateAddressesNumber, + randomPrivateAddresses, + privateAddresses}); + return ((IntResult)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateVirtualMachine( + int packageId, + string hostname, + string osTemplateFile, + string password, + string summaryLetterEmail, + int generation, + int cpuCores, + int ramMB, + int hddGB, + int snapshots, + bool dvdInstalled, + bool bootFromCD, + bool numLock, + bool startShutdownAllowed, + bool pauseResumeAllowed, + bool rebootAllowed, + bool resetAllowed, + bool reinstallAllowed, + bool externalNetworkEnabled, + int externalAddressesNumber, + bool randomExternalAddresses, + int[] externalAddresses, + bool privateNetworkEnabled, + int privateAddressesNumber, + bool randomPrivateAddresses, + string[] privateAddresses, + System.AsyncCallback callback, + object asyncState) { + return this.BeginInvoke("CreateVirtualMachine", new object[] { + packageId, + hostname, + osTemplateFile, + password, + summaryLetterEmail, + generation, + cpuCores, + ramMB, + hddGB, + snapshots, + dvdInstalled, + bootFromCD, + numLock, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNetworkEnabled, + externalAddressesNumber, + randomExternalAddresses, + externalAddresses, + privateNetworkEnabled, + privateAddressesNumber, + randomPrivateAddresses, + privateAddresses}, callback, asyncState); + } + + /// + public IntResult EndCreateVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((IntResult)(results[0])); + } + + /// + public void CreateVirtualMachineAsync( + int packageId, + string hostname, + string osTemplateFile, + string password, + string summaryLetterEmail, + int generation, + int cpuCores, + int ramMB, + int hddGB, + int snapshots, + bool dvdInstalled, + bool bootFromCD, + bool numLock, + bool startShutdownAllowed, + bool pauseResumeAllowed, + bool rebootAllowed, + bool resetAllowed, + bool reinstallAllowed, + bool externalNetworkEnabled, + int externalAddressesNumber, + bool randomExternalAddresses, + int[] externalAddresses, + bool privateNetworkEnabled, + int privateAddressesNumber, + bool randomPrivateAddresses, + string[] privateAddresses) { + this.CreateVirtualMachineAsync(packageId, hostname, osTemplateFile, password, summaryLetterEmail, generation, cpuCores, ramMB, hddGB, snapshots, dvdInstalled, bootFromCD, numLock, startShutdownAllowed, pauseResumeAllowed, rebootAllowed, resetAllowed, reinstallAllowed, externalNetworkEnabled, externalAddressesNumber, randomExternalAddresses, externalAddresses, privateNetworkEnabled, privateAddressesNumber, randomPrivateAddresses, privateAddresses, null); + } + + /// + public void CreateVirtualMachineAsync( + int packageId, + string hostname, + string osTemplateFile, + string password, + string summaryLetterEmail, + int generation, + int cpuCores, + int ramMB, + int hddGB, + int snapshots, + bool dvdInstalled, + bool bootFromCD, + bool numLock, + bool startShutdownAllowed, + bool pauseResumeAllowed, + bool rebootAllowed, + bool resetAllowed, + bool reinstallAllowed, + bool externalNetworkEnabled, + int externalAddressesNumber, + bool randomExternalAddresses, + int[] externalAddresses, + bool privateNetworkEnabled, + int privateAddressesNumber, + bool randomPrivateAddresses, + string[] privateAddresses, + object userState) { + if ((this.CreateVirtualMachineOperationCompleted == null)) { + this.CreateVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateVirtualMachineOperationCompleted); + } + this.InvokeAsync("CreateVirtualMachine", new object[] { + packageId, + hostname, + osTemplateFile, + password, + summaryLetterEmail, + generation, + cpuCores, + ramMB, + hddGB, + snapshots, + dvdInstalled, + bootFromCD, + numLock, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNetworkEnabled, + externalAddressesNumber, + randomExternalAddresses, + externalAddresses, + privateNetworkEnabled, + privateAddressesNumber, + randomPrivateAddresses, + privateAddresses}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ImportVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public IntResult ImportVirtualMachine(int packageId, int serviceId, string vmId, string osTemplateFile, string adminPassword, bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, string externalNicMacAddress, int[] externalAddresses, string managementNicMacAddress, int managementAddress) { + object[] results = this.Invoke("ImportVirtualMachine", new object[] { + packageId, + serviceId, + vmId, + osTemplateFile, + adminPassword, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNicMacAddress, + externalAddresses, + managementNicMacAddress, + managementAddress}); + return ((IntResult)(results[0])); + } + + /// + public System.IAsyncResult BeginImportVirtualMachine( + int packageId, + int serviceId, + string vmId, + string osTemplateFile, + string adminPassword, + bool startShutdownAllowed, + bool pauseResumeAllowed, + bool rebootAllowed, + bool resetAllowed, + bool reinstallAllowed, + string externalNicMacAddress, + int[] externalAddresses, + string managementNicMacAddress, + int managementAddress, + System.AsyncCallback callback, + object asyncState) { + return this.BeginInvoke("ImportVirtualMachine", new object[] { + packageId, + serviceId, + vmId, + osTemplateFile, + adminPassword, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNicMacAddress, + externalAddresses, + managementNicMacAddress, + managementAddress}, callback, asyncState); + } + + /// + public IntResult EndImportVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((IntResult)(results[0])); + } + + /// + public void ImportVirtualMachineAsync(int packageId, int serviceId, string vmId, string osTemplateFile, string adminPassword, bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, string externalNicMacAddress, int[] externalAddresses, string managementNicMacAddress, int managementAddress) { + this.ImportVirtualMachineAsync(packageId, serviceId, vmId, osTemplateFile, adminPassword, startShutdownAllowed, pauseResumeAllowed, rebootAllowed, resetAllowed, reinstallAllowed, externalNicMacAddress, externalAddresses, managementNicMacAddress, managementAddress, null); + } + + /// + public void ImportVirtualMachineAsync(int packageId, int serviceId, string vmId, string osTemplateFile, string adminPassword, bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, string externalNicMacAddress, int[] externalAddresses, string managementNicMacAddress, int managementAddress, object userState) { + if ((this.ImportVirtualMachineOperationCompleted == null)) { + this.ImportVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnImportVirtualMachineOperationCompleted); + } + this.InvokeAsync("ImportVirtualMachine", new object[] { + packageId, + serviceId, + vmId, + osTemplateFile, + adminPassword, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNicMacAddress, + externalAddresses, + managementNicMacAddress, + managementAddress}, this.ImportVirtualMachineOperationCompleted, userState); + } + + private void OnImportVirtualMachineOperationCompleted(object arg) { + if ((this.ImportVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ImportVirtualMachineCompleted(this, new ImportVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineThumbnail", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] GetVirtualMachineThumbnail(int itemId, ThumbnailSize size) { + object[] results = this.Invoke("GetVirtualMachineThumbnail", new object[] { + itemId, + size}); + return ((byte[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineThumbnail(int itemId, ThumbnailSize size, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineThumbnail", new object[] { + itemId, + size}, callback, asyncState); + } + + /// + public byte[] EndGetVirtualMachineThumbnail(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((byte[])(results[0])); + } + + /// + public void GetVirtualMachineThumbnailAsync(int itemId, ThumbnailSize size) { + this.GetVirtualMachineThumbnailAsync(itemId, size, null); + } + + /// + public void GetVirtualMachineThumbnailAsync(int itemId, ThumbnailSize size, object userState) { + if ((this.GetVirtualMachineThumbnailOperationCompleted == null)) { + this.GetVirtualMachineThumbnailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineThumbnailOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineThumbnail", new object[] { + itemId, + size}, this.GetVirtualMachineThumbnailOperationCompleted, userState); + } + + private void OnGetVirtualMachineThumbnailOperationCompleted(object arg) { + if ((this.GetVirtualMachineThumbnailCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineThumbnailCompleted(this, new GetVirtualMachineThumbnailCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineGeneralDetails", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine GetVirtualMachineGeneralDetails(int itemId) { + object[] results = this.Invoke("GetVirtualMachineGeneralDetails", new object[] { + itemId}); + return ((VirtualMachine)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineGeneralDetails(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineGeneralDetails", new object[] { + itemId}, callback, asyncState); + } + + /// + public VirtualMachine EndGetVirtualMachineGeneralDetails(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine)(results[0])); + } + + /// + public void GetVirtualMachineGeneralDetailsAsync(int itemId) { + this.GetVirtualMachineGeneralDetailsAsync(itemId, null); + } + + /// + public void GetVirtualMachineGeneralDetailsAsync(int itemId, object userState) { + if ((this.GetVirtualMachineGeneralDetailsOperationCompleted == null)) { + this.GetVirtualMachineGeneralDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineGeneralDetailsOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineGeneralDetails", new object[] { + itemId}, this.GetVirtualMachineGeneralDetailsOperationCompleted, userState); + } + + private void OnGetVirtualMachineGeneralDetailsOperationCompleted(object arg) { + if ((this.GetVirtualMachineGeneralDetailsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineGeneralDetailsCompleted(this, new GetVirtualMachineGeneralDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineExtendedInfo", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachine GetVirtualMachineExtendedInfo(int serviceId, string vmId) { + object[] results = this.Invoke("GetVirtualMachineExtendedInfo", new object[] { + serviceId, + vmId}); + return ((VirtualMachine)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineExtendedInfo(int serviceId, string vmId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineExtendedInfo", new object[] { + serviceId, + vmId}, callback, asyncState); + } + + /// + public VirtualMachine EndGetVirtualMachineExtendedInfo(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachine)(results[0])); + } + + /// + public void GetVirtualMachineExtendedInfoAsync(int serviceId, string vmId) { + this.GetVirtualMachineExtendedInfoAsync(serviceId, vmId, null); + } + + /// + public void GetVirtualMachineExtendedInfoAsync(int serviceId, string vmId, object userState) { + if ((this.GetVirtualMachineExtendedInfoOperationCompleted == null)) { + this.GetVirtualMachineExtendedInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineExtendedInfoOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineExtendedInfo", new object[] { + serviceId, + vmId}, this.GetVirtualMachineExtendedInfoOperationCompleted, userState); + } + + private void OnGetVirtualMachineExtendedInfoOperationCompleted(object arg) { + if ((this.GetVirtualMachineExtendedInfoCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineExtendedInfoCompleted(this, new GetVirtualMachineExtendedInfoCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CancelVirtualMachineJob", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CancelVirtualMachineJob(string jobId) { + object[] results = this.Invoke("CancelVirtualMachineJob", new object[] { + jobId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginCancelVirtualMachineJob(string jobId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CancelVirtualMachineJob", new object[] { + jobId}, callback, asyncState); + } + + /// + public int EndCancelVirtualMachineJob(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void CancelVirtualMachineJobAsync(string jobId) { + this.CancelVirtualMachineJobAsync(jobId, null); + } + + /// + public void CancelVirtualMachineJobAsync(string jobId, object userState) { + if ((this.CancelVirtualMachineJobOperationCompleted == null)) { + this.CancelVirtualMachineJobOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelVirtualMachineJobOperationCompleted); + } + this.InvokeAsync("CancelVirtualMachineJob", new object[] { + jobId}, this.CancelVirtualMachineJobOperationCompleted, userState); + } + + private void OnCancelVirtualMachineJobOperationCompleted(object arg) { + if ((this.CancelVirtualMachineJobCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CancelVirtualMachineJobCompleted(this, new CancelVirtualMachineJobCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateVirtualMachineHostName", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject UpdateVirtualMachineHostName(int itemId, string hostname, bool updateNetBIOS) { + object[] results = this.Invoke("UpdateVirtualMachineHostName", new object[] { + itemId, + hostname, + updateNetBIOS}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateVirtualMachineHostName(int itemId, string hostname, bool updateNetBIOS, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UpdateVirtualMachineHostName", new object[] { + itemId, + hostname, + updateNetBIOS}, callback, asyncState); + } + + /// + public ResultObject EndUpdateVirtualMachineHostName(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void UpdateVirtualMachineHostNameAsync(int itemId, string hostname, bool updateNetBIOS) { + this.UpdateVirtualMachineHostNameAsync(itemId, hostname, updateNetBIOS, null); + } + + /// + public void UpdateVirtualMachineHostNameAsync(int itemId, string hostname, bool updateNetBIOS, object userState) { + if ((this.UpdateVirtualMachineHostNameOperationCompleted == null)) { + this.UpdateVirtualMachineHostNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateVirtualMachineHostNameOperationCompleted); + } + this.InvokeAsync("UpdateVirtualMachineHostName", new object[] { + itemId, + hostname, + updateNetBIOS}, this.UpdateVirtualMachineHostNameOperationCompleted, userState); + } + + private void OnUpdateVirtualMachineHostNameOperationCompleted(object arg) { + if ((this.UpdateVirtualMachineHostNameCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateVirtualMachineHostNameCompleted(this, new UpdateVirtualMachineHostNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ChangeVirtualMachineState", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject ChangeVirtualMachineState(int itemId, VirtualMachineRequestedState state) { + object[] results = this.Invoke("ChangeVirtualMachineState", new object[] { + itemId, + state}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginChangeVirtualMachineState(int itemId, VirtualMachineRequestedState state, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ChangeVirtualMachineState", new object[] { + itemId, + state}, callback, asyncState); + } + + /// + public ResultObject EndChangeVirtualMachineState(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void ChangeVirtualMachineStateAsync(int itemId, VirtualMachineRequestedState state) { + this.ChangeVirtualMachineStateAsync(itemId, state, null); + } + + /// + public void ChangeVirtualMachineStateAsync(int itemId, VirtualMachineRequestedState state, object userState) { + if ((this.ChangeVirtualMachineStateOperationCompleted == null)) { + this.ChangeVirtualMachineStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeVirtualMachineStateOperationCompleted); + } + this.InvokeAsync("ChangeVirtualMachineState", new object[] { + itemId, + state}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineJobs", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ConcreteJob[] GetVirtualMachineJobs(int itemId) { + object[] results = this.Invoke("GetVirtualMachineJobs", new object[] { + itemId}); + return ((ConcreteJob[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineJobs(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineJobs", new object[] { + itemId}, callback, asyncState); + } + + /// + public ConcreteJob[] EndGetVirtualMachineJobs(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ConcreteJob[])(results[0])); + } + + /// + public void GetVirtualMachineJobsAsync(int itemId) { + this.GetVirtualMachineJobsAsync(itemId, null); + } + + /// + public void GetVirtualMachineJobsAsync(int itemId, object userState) { + if ((this.GetVirtualMachineJobsOperationCompleted == null)) { + this.GetVirtualMachineJobsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineJobsOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineJobs", new object[] { + itemId}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ChangeAdministratorPassword", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject ChangeAdministratorPassword(int itemId, string password) { + object[] results = this.Invoke("ChangeAdministratorPassword", new object[] { + itemId, + password}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginChangeAdministratorPassword(int itemId, string password, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ChangeAdministratorPassword", new object[] { + itemId, + password}, callback, asyncState); + } + + /// + public ResultObject EndChangeAdministratorPassword(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void ChangeAdministratorPasswordAsync(int itemId, string password) { + this.ChangeAdministratorPasswordAsync(itemId, password, null); + } + + /// + public void ChangeAdministratorPasswordAsync(int itemId, string password, object userState) { + if ((this.ChangeAdministratorPasswordOperationCompleted == null)) { + this.ChangeAdministratorPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeAdministratorPasswordOperationCompleted); + } + this.InvokeAsync("ChangeAdministratorPassword", new object[] { + itemId, + password}, this.ChangeAdministratorPasswordOperationCompleted, userState); + } + + private void OnChangeAdministratorPasswordOperationCompleted(object arg) { + if ((this.ChangeAdministratorPasswordCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ChangeAdministratorPasswordCompleted(this, new ChangeAdministratorPasswordCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateVirtualMachineConfiguration", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject UpdateVirtualMachineConfiguration(int itemId, int cpuCores, int ramMB, int hddGB, int snapshots, bool dvdInstalled, bool bootFromCD, bool numLock, bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, bool externalNetworkEnabled, bool privateNetworkEnabled) { + object[] results = this.Invoke("UpdateVirtualMachineConfiguration", new object[] { + itemId, + cpuCores, + ramMB, + hddGB, + snapshots, + dvdInstalled, + bootFromCD, + numLock, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNetworkEnabled, + privateNetworkEnabled}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateVirtualMachineConfiguration( + int itemId, + int cpuCores, + int ramMB, + int hddGB, + int snapshots, + bool dvdInstalled, + bool bootFromCD, + bool numLock, + bool startShutdownAllowed, + bool pauseResumeAllowed, + bool rebootAllowed, + bool resetAllowed, + bool reinstallAllowed, + bool externalNetworkEnabled, + bool privateNetworkEnabled, + System.AsyncCallback callback, + object asyncState) { + return this.BeginInvoke("UpdateVirtualMachineConfiguration", new object[] { + itemId, + cpuCores, + ramMB, + hddGB, + snapshots, + dvdInstalled, + bootFromCD, + numLock, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNetworkEnabled, + privateNetworkEnabled}, callback, asyncState); + } + + /// + public ResultObject EndUpdateVirtualMachineConfiguration(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void UpdateVirtualMachineConfigurationAsync(int itemId, int cpuCores, int ramMB, int hddGB, int snapshots, bool dvdInstalled, bool bootFromCD, bool numLock, bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, bool externalNetworkEnabled, bool privateNetworkEnabled) { + this.UpdateVirtualMachineConfigurationAsync(itemId, cpuCores, ramMB, hddGB, snapshots, dvdInstalled, bootFromCD, numLock, startShutdownAllowed, pauseResumeAllowed, rebootAllowed, resetAllowed, reinstallAllowed, externalNetworkEnabled, privateNetworkEnabled, null); + } + + /// + public void UpdateVirtualMachineConfigurationAsync( + int itemId, + int cpuCores, + int ramMB, + int hddGB, + int snapshots, + bool dvdInstalled, + bool bootFromCD, + bool numLock, + bool startShutdownAllowed, + bool pauseResumeAllowed, + bool rebootAllowed, + bool resetAllowed, + bool reinstallAllowed, + bool externalNetworkEnabled, + bool privateNetworkEnabled, + object userState) { + if ((this.UpdateVirtualMachineConfigurationOperationCompleted == null)) { + this.UpdateVirtualMachineConfigurationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateVirtualMachineConfigurationOperationCompleted); + } + this.InvokeAsync("UpdateVirtualMachineConfiguration", new object[] { + itemId, + cpuCores, + ramMB, + hddGB, + snapshots, + dvdInstalled, + bootFromCD, + numLock, + startShutdownAllowed, + pauseResumeAllowed, + rebootAllowed, + resetAllowed, + reinstallAllowed, + externalNetworkEnabled, + privateNetworkEnabled}, this.UpdateVirtualMachineConfigurationOperationCompleted, userState); + } + + private void OnUpdateVirtualMachineConfigurationOperationCompleted(object arg) { + if ((this.UpdateVirtualMachineConfigurationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateVirtualMachineConfigurationCompleted(this, new UpdateVirtualMachineConfigurationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetInsertedDvdDisk", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LibraryItem GetInsertedDvdDisk(int itemId) { + object[] results = this.Invoke("GetInsertedDvdDisk", new object[] { + itemId}); + return ((LibraryItem)(results[0])); + } + + /// + public System.IAsyncResult BeginGetInsertedDvdDisk(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetInsertedDvdDisk", new object[] { + itemId}, callback, asyncState); + } + + /// + public LibraryItem EndGetInsertedDvdDisk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LibraryItem)(results[0])); + } + + /// + public void GetInsertedDvdDiskAsync(int itemId) { + this.GetInsertedDvdDiskAsync(itemId, null); + } + + /// + public void GetInsertedDvdDiskAsync(int itemId, object userState) { + if ((this.GetInsertedDvdDiskOperationCompleted == null)) { + this.GetInsertedDvdDiskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetInsertedDvdDiskOperationCompleted); + } + this.InvokeAsync("GetInsertedDvdDisk", new object[] { + itemId}, this.GetInsertedDvdDiskOperationCompleted, userState); + } + + private void OnGetInsertedDvdDiskOperationCompleted(object arg) { + if ((this.GetInsertedDvdDiskCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetInsertedDvdDiskCompleted(this, new GetInsertedDvdDiskCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetLibraryDisks", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LibraryItem[] GetLibraryDisks(int itemId) { + object[] results = this.Invoke("GetLibraryDisks", new object[] { + itemId}); + return ((LibraryItem[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetLibraryDisks(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLibraryDisks", new object[] { + itemId}, callback, asyncState); + } + + /// + public LibraryItem[] EndGetLibraryDisks(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LibraryItem[])(results[0])); + } + + /// + public void GetLibraryDisksAsync(int itemId) { + this.GetLibraryDisksAsync(itemId, null); + } + + /// + public void GetLibraryDisksAsync(int itemId, object userState) { + if ((this.GetLibraryDisksOperationCompleted == null)) { + this.GetLibraryDisksOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLibraryDisksOperationCompleted); + } + this.InvokeAsync("GetLibraryDisks", new object[] { + itemId}, this.GetLibraryDisksOperationCompleted, userState); + } + + private void OnGetLibraryDisksOperationCompleted(object arg) { + if ((this.GetLibraryDisksCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLibraryDisksCompleted(this, new GetLibraryDisksCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/InsertDvdDisk", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject InsertDvdDisk(int itemId, string isoPath) { + object[] results = this.Invoke("InsertDvdDisk", new object[] { + itemId, + isoPath}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginInsertDvdDisk(int itemId, string isoPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("InsertDvdDisk", new object[] { + itemId, + isoPath}, callback, asyncState); + } + + /// + public ResultObject EndInsertDvdDisk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void InsertDvdDiskAsync(int itemId, string isoPath) { + this.InsertDvdDiskAsync(itemId, isoPath, null); + } + + /// + public void InsertDvdDiskAsync(int itemId, string isoPath, object userState) { + if ((this.InsertDvdDiskOperationCompleted == null)) { + this.InsertDvdDiskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInsertDvdDiskOperationCompleted); + } + this.InvokeAsync("InsertDvdDisk", new object[] { + itemId, + isoPath}, this.InsertDvdDiskOperationCompleted, userState); + } + + private void OnInsertDvdDiskOperationCompleted(object arg) { + if ((this.InsertDvdDiskCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.InsertDvdDiskCompleted(this, new InsertDvdDiskCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/EjectDvdDisk", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject EjectDvdDisk(int itemId) { + object[] results = this.Invoke("EjectDvdDisk", new object[] { + itemId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginEjectDvdDisk(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("EjectDvdDisk", new object[] { + itemId}, callback, asyncState); + } + + /// + public ResultObject EndEjectDvdDisk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void EjectDvdDiskAsync(int itemId) { + this.EjectDvdDiskAsync(itemId, null); + } + + /// + public void EjectDvdDiskAsync(int itemId, object userState) { + if ((this.EjectDvdDiskOperationCompleted == null)) { + this.EjectDvdDiskOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEjectDvdDiskOperationCompleted); + } + this.InvokeAsync("EjectDvdDisk", new object[] { + itemId}, this.EjectDvdDiskOperationCompleted, userState); + } + + private void OnEjectDvdDiskOperationCompleted(object arg) { + if ((this.EjectDvdDiskCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EjectDvdDiskCompleted(this, new EjectDvdDiskCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineSnapshots", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachineSnapshot[] GetVirtualMachineSnapshots(int itemId) { + object[] results = this.Invoke("GetVirtualMachineSnapshots", new object[] { + itemId}); + return ((VirtualMachineSnapshot[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineSnapshots(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineSnapshots", new object[] { + itemId}, callback, asyncState); + } + + /// + public VirtualMachineSnapshot[] EndGetVirtualMachineSnapshots(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachineSnapshot[])(results[0])); + } + + /// + public void GetVirtualMachineSnapshotsAsync(int itemId) { + this.GetVirtualMachineSnapshotsAsync(itemId, null); + } + + /// + public void GetVirtualMachineSnapshotsAsync(int itemId, object userState) { + if ((this.GetVirtualMachineSnapshotsOperationCompleted == null)) { + this.GetVirtualMachineSnapshotsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineSnapshotsOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineSnapshots", new object[] { + itemId}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSnapshot", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachineSnapshot GetSnapshot(int itemId, string snaphostId) { + object[] results = this.Invoke("GetSnapshot", new object[] { + itemId, + snaphostId}); + return ((VirtualMachineSnapshot)(results[0])); + } + + /// + public System.IAsyncResult BeginGetSnapshot(int itemId, string snaphostId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSnapshot", new object[] { + itemId, + snaphostId}, callback, asyncState); + } + + /// + public VirtualMachineSnapshot EndGetSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachineSnapshot)(results[0])); + } + + /// + public void GetSnapshotAsync(int itemId, string snaphostId) { + this.GetSnapshotAsync(itemId, snaphostId, null); + } + + /// + public void GetSnapshotAsync(int itemId, string snaphostId, object userState) { + if ((this.GetSnapshotOperationCompleted == null)) { + this.GetSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSnapshotOperationCompleted); + } + this.InvokeAsync("GetSnapshot", new object[] { + itemId, + snaphostId}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateSnapshot", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject CreateSnapshot(int itemId) { + object[] results = this.Invoke("CreateSnapshot", new object[] { + itemId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateSnapshot(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateSnapshot", new object[] { + itemId}, callback, asyncState); + } + + /// + public ResultObject EndCreateSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void CreateSnapshotAsync(int itemId) { + this.CreateSnapshotAsync(itemId, null); + } + + /// + public void CreateSnapshotAsync(int itemId, object userState) { + if ((this.CreateSnapshotOperationCompleted == null)) { + this.CreateSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateSnapshotOperationCompleted); + } + this.InvokeAsync("CreateSnapshot", new object[] { + itemId}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ApplySnapshot", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject ApplySnapshot(int itemId, string snapshotId) { + object[] results = this.Invoke("ApplySnapshot", new object[] { + itemId, + snapshotId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginApplySnapshot(int itemId, string snapshotId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ApplySnapshot", new object[] { + itemId, + snapshotId}, callback, asyncState); + } + + /// + public ResultObject EndApplySnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void ApplySnapshotAsync(int itemId, string snapshotId) { + this.ApplySnapshotAsync(itemId, snapshotId, null); + } + + /// + public void ApplySnapshotAsync(int itemId, string snapshotId, object userState) { + if ((this.ApplySnapshotOperationCompleted == null)) { + this.ApplySnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnApplySnapshotOperationCompleted); + } + this.InvokeAsync("ApplySnapshot", new object[] { + itemId, + 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RenameSnapshot", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject RenameSnapshot(int itemId, string snapshotId, string newName) { + object[] results = this.Invoke("RenameSnapshot", new object[] { + itemId, + snapshotId, + newName}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginRenameSnapshot(int itemId, string snapshotId, string newName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RenameSnapshot", new object[] { + itemId, + snapshotId, + newName}, callback, asyncState); + } + + /// + public ResultObject EndRenameSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void RenameSnapshotAsync(int itemId, string snapshotId, string newName) { + this.RenameSnapshotAsync(itemId, snapshotId, newName, null); + } + + /// + public void RenameSnapshotAsync(int itemId, string snapshotId, string newName, object userState) { + if ((this.RenameSnapshotOperationCompleted == null)) { + this.RenameSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRenameSnapshotOperationCompleted); + } + this.InvokeAsync("RenameSnapshot", new object[] { + itemId, + snapshotId, + newName}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteSnapshot", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteSnapshot(int itemId, string snapshotId) { + object[] results = this.Invoke("DeleteSnapshot", new object[] { + itemId, + snapshotId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteSnapshot(int itemId, string snapshotId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteSnapshot", new object[] { + itemId, + snapshotId}, callback, asyncState); + } + + /// + public ResultObject EndDeleteSnapshot(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteSnapshotAsync(int itemId, string snapshotId) { + this.DeleteSnapshotAsync(itemId, snapshotId, null); + } + + /// + public void DeleteSnapshotAsync(int itemId, string snapshotId, object userState) { + if ((this.DeleteSnapshotOperationCompleted == null)) { + this.DeleteSnapshotOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSnapshotOperationCompleted); + } + this.InvokeAsync("DeleteSnapshot", new object[] { + itemId, + 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteSnapshotSubtree", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteSnapshotSubtree(int itemId, string snapshotId) { + object[] results = this.Invoke("DeleteSnapshotSubtree", new object[] { + itemId, + snapshotId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteSnapshotSubtree(int itemId, string snapshotId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteSnapshotSubtree", new object[] { + itemId, + snapshotId}, callback, asyncState); + } + + /// + public ResultObject EndDeleteSnapshotSubtree(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteSnapshotSubtreeAsync(int itemId, string snapshotId) { + this.DeleteSnapshotSubtreeAsync(itemId, snapshotId, null); + } + + /// + public void DeleteSnapshotSubtreeAsync(int itemId, string snapshotId, object userState) { + if ((this.DeleteSnapshotSubtreeOperationCompleted == null)) { + this.DeleteSnapshotSubtreeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSnapshotSubtreeOperationCompleted); + } + this.InvokeAsync("DeleteSnapshotSubtree", new object[] { + itemId, + 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSnapshotThumbnail", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] GetSnapshotThumbnail(int itemId, string snapshotId, ThumbnailSize size) { + object[] results = this.Invoke("GetSnapshotThumbnail", new object[] { + itemId, + snapshotId, + size}); + return ((byte[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetSnapshotThumbnail(int itemId, string snapshotId, ThumbnailSize size, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSnapshotThumbnail", new object[] { + itemId, + snapshotId, + size}, callback, asyncState); + } + + /// + public byte[] EndGetSnapshotThumbnail(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((byte[])(results[0])); + } + + /// + public void GetSnapshotThumbnailAsync(int itemId, string snapshotId, ThumbnailSize size) { + this.GetSnapshotThumbnailAsync(itemId, snapshotId, size, null); + } + + /// + public void GetSnapshotThumbnailAsync(int itemId, string snapshotId, ThumbnailSize size, object userState) { + if ((this.GetSnapshotThumbnailOperationCompleted == null)) { + this.GetSnapshotThumbnailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSnapshotThumbnailOperationCompleted); + } + this.InvokeAsync("GetSnapshotThumbnail", new object[] { + itemId, + snapshotId, + size}, this.GetSnapshotThumbnailOperationCompleted, userState); + } + + private void OnGetSnapshotThumbnailOperationCompleted(object arg) { + if ((this.GetSnapshotThumbnailCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSnapshotThumbnailCompleted(this, new GetSnapshotThumbnailCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExternalNetworkAdapterDetails", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public NetworkAdapterDetails GetExternalNetworkAdapterDetails(int itemId) { + object[] results = this.Invoke("GetExternalNetworkAdapterDetails", new object[] { + itemId}); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public System.IAsyncResult BeginGetExternalNetworkAdapterDetails(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExternalNetworkAdapterDetails", new object[] { + itemId}, callback, asyncState); + } + + /// + public NetworkAdapterDetails EndGetExternalNetworkAdapterDetails(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public void GetExternalNetworkAdapterDetailsAsync(int itemId) { + this.GetExternalNetworkAdapterDetailsAsync(itemId, null); + } + + /// + public void GetExternalNetworkAdapterDetailsAsync(int itemId, object userState) { + if ((this.GetExternalNetworkAdapterDetailsOperationCompleted == null)) { + this.GetExternalNetworkAdapterDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExternalNetworkAdapterDetailsOperationCompleted); + } + this.InvokeAsync("GetExternalNetworkAdapterDetails", new object[] { + itemId}, this.GetExternalNetworkAdapterDetailsOperationCompleted, userState); + } + + private void OnGetExternalNetworkAdapterDetailsOperationCompleted(object arg) { + if ((this.GetExternalNetworkAdapterDetailsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExternalNetworkAdapterDetailsCompleted(this, new GetExternalNetworkAdapterDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddVirtualMachineExternalIPAddresses" + + "", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject AddVirtualMachineExternalIPAddresses(int itemId, bool selectRandom, int addressesNumber, int[] addressId) { + object[] results = this.Invoke("AddVirtualMachineExternalIPAddresses", new object[] { + itemId, + selectRandom, + addressesNumber, + addressId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginAddVirtualMachineExternalIPAddresses(int itemId, bool selectRandom, int addressesNumber, int[] addressId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddVirtualMachineExternalIPAddresses", new object[] { + itemId, + selectRandom, + addressesNumber, + addressId}, callback, asyncState); + } + + /// + public ResultObject EndAddVirtualMachineExternalIPAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void AddVirtualMachineExternalIPAddressesAsync(int itemId, bool selectRandom, int addressesNumber, int[] addressId) { + this.AddVirtualMachineExternalIPAddressesAsync(itemId, selectRandom, addressesNumber, addressId, null); + } + + /// + public void AddVirtualMachineExternalIPAddressesAsync(int itemId, bool selectRandom, int addressesNumber, int[] addressId, object userState) { + if ((this.AddVirtualMachineExternalIPAddressesOperationCompleted == null)) { + this.AddVirtualMachineExternalIPAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddVirtualMachineExternalIPAddressesOperationCompleted); + } + this.InvokeAsync("AddVirtualMachineExternalIPAddresses", new object[] { + itemId, + selectRandom, + addressesNumber, + addressId}, this.AddVirtualMachineExternalIPAddressesOperationCompleted, userState); + } + + private void OnAddVirtualMachineExternalIPAddressesOperationCompleted(object arg) { + if ((this.AddVirtualMachineExternalIPAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddVirtualMachineExternalIPAddressesCompleted(this, new AddVirtualMachineExternalIPAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetVirtualMachinePrimaryExternalIPAd" + + "dress", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject SetVirtualMachinePrimaryExternalIPAddress(int itemId, int addressId) { + object[] results = this.Invoke("SetVirtualMachinePrimaryExternalIPAddress", new object[] { + itemId, + addressId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginSetVirtualMachinePrimaryExternalIPAddress(int itemId, int addressId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetVirtualMachinePrimaryExternalIPAddress", new object[] { + itemId, + addressId}, callback, asyncState); + } + + /// + public ResultObject EndSetVirtualMachinePrimaryExternalIPAddress(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void SetVirtualMachinePrimaryExternalIPAddressAsync(int itemId, int addressId) { + this.SetVirtualMachinePrimaryExternalIPAddressAsync(itemId, addressId, null); + } + + /// + public void SetVirtualMachinePrimaryExternalIPAddressAsync(int itemId, int addressId, object userState) { + if ((this.SetVirtualMachinePrimaryExternalIPAddressOperationCompleted == null)) { + this.SetVirtualMachinePrimaryExternalIPAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetVirtualMachinePrimaryExternalIPAddressOperationCompleted); + } + this.InvokeAsync("SetVirtualMachinePrimaryExternalIPAddress", new object[] { + itemId, + addressId}, this.SetVirtualMachinePrimaryExternalIPAddressOperationCompleted, userState); + } + + private void OnSetVirtualMachinePrimaryExternalIPAddressOperationCompleted(object arg) { + if ((this.SetVirtualMachinePrimaryExternalIPAddressCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetVirtualMachinePrimaryExternalIPAddressCompleted(this, new SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteVirtualMachineExternalIPAddres" + + "ses", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteVirtualMachineExternalIPAddresses(int itemId, int[] addressId) { + object[] results = this.Invoke("DeleteVirtualMachineExternalIPAddresses", new object[] { + itemId, + addressId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteVirtualMachineExternalIPAddresses(int itemId, int[] addressId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteVirtualMachineExternalIPAddresses", new object[] { + itemId, + addressId}, callback, asyncState); + } + + /// + public ResultObject EndDeleteVirtualMachineExternalIPAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteVirtualMachineExternalIPAddressesAsync(int itemId, int[] addressId) { + this.DeleteVirtualMachineExternalIPAddressesAsync(itemId, addressId, null); + } + + /// + public void DeleteVirtualMachineExternalIPAddressesAsync(int itemId, int[] addressId, object userState) { + if ((this.DeleteVirtualMachineExternalIPAddressesOperationCompleted == null)) { + this.DeleteVirtualMachineExternalIPAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteVirtualMachineExternalIPAddressesOperationCompleted); + } + this.InvokeAsync("DeleteVirtualMachineExternalIPAddresses", new object[] { + itemId, + addressId}, this.DeleteVirtualMachineExternalIPAddressesOperationCompleted, userState); + } + + private void OnDeleteVirtualMachineExternalIPAddressesOperationCompleted(object arg) { + if ((this.DeleteVirtualMachineExternalIPAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteVirtualMachineExternalIPAddressesCompleted(this, new DeleteVirtualMachineExternalIPAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPrivateNetworkAdapterDetails", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public NetworkAdapterDetails GetPrivateNetworkAdapterDetails(int itemId) { + object[] results = this.Invoke("GetPrivateNetworkAdapterDetails", new object[] { + itemId}); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public System.IAsyncResult BeginGetPrivateNetworkAdapterDetails(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPrivateNetworkAdapterDetails", new object[] { + itemId}, callback, asyncState); + } + + /// + public NetworkAdapterDetails EndGetPrivateNetworkAdapterDetails(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((NetworkAdapterDetails)(results[0])); + } + + /// + public void GetPrivateNetworkAdapterDetailsAsync(int itemId) { + this.GetPrivateNetworkAdapterDetailsAsync(itemId, null); + } + + /// + public void GetPrivateNetworkAdapterDetailsAsync(int itemId, object userState) { + if ((this.GetPrivateNetworkAdapterDetailsOperationCompleted == null)) { + this.GetPrivateNetworkAdapterDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPrivateNetworkAdapterDetailsOperationCompleted); + } + this.InvokeAsync("GetPrivateNetworkAdapterDetails", new object[] { + itemId}, this.GetPrivateNetworkAdapterDetailsOperationCompleted, userState); + } + + private void OnGetPrivateNetworkAdapterDetailsOperationCompleted(object arg) { + if ((this.GetPrivateNetworkAdapterDetailsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPrivateNetworkAdapterDetailsCompleted(this, new GetPrivateNetworkAdapterDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddVirtualMachinePrivateIPAddresses", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject AddVirtualMachinePrivateIPAddresses(int itemId, bool selectRandom, int addressesNumber, string[] addresses) { + object[] results = this.Invoke("AddVirtualMachinePrivateIPAddresses", new object[] { + itemId, + selectRandom, + addressesNumber, + addresses}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginAddVirtualMachinePrivateIPAddresses(int itemId, bool selectRandom, int addressesNumber, string[] addresses, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddVirtualMachinePrivateIPAddresses", new object[] { + itemId, + selectRandom, + addressesNumber, + addresses}, callback, asyncState); + } + + /// + public ResultObject EndAddVirtualMachinePrivateIPAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void AddVirtualMachinePrivateIPAddressesAsync(int itemId, bool selectRandom, int addressesNumber, string[] addresses) { + this.AddVirtualMachinePrivateIPAddressesAsync(itemId, selectRandom, addressesNumber, addresses, null); + } + + /// + public void AddVirtualMachinePrivateIPAddressesAsync(int itemId, bool selectRandom, int addressesNumber, string[] addresses, object userState) { + if ((this.AddVirtualMachinePrivateIPAddressesOperationCompleted == null)) { + this.AddVirtualMachinePrivateIPAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddVirtualMachinePrivateIPAddressesOperationCompleted); + } + this.InvokeAsync("AddVirtualMachinePrivateIPAddresses", new object[] { + itemId, + selectRandom, + addressesNumber, + addresses}, this.AddVirtualMachinePrivateIPAddressesOperationCompleted, userState); + } + + private void OnAddVirtualMachinePrivateIPAddressesOperationCompleted(object arg) { + if ((this.AddVirtualMachinePrivateIPAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddVirtualMachinePrivateIPAddressesCompleted(this, new AddVirtualMachinePrivateIPAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetVirtualMachinePrimaryPrivateIPAdd" + + "ress", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject SetVirtualMachinePrimaryPrivateIPAddress(int itemId, int addressId) { + object[] results = this.Invoke("SetVirtualMachinePrimaryPrivateIPAddress", new object[] { + itemId, + addressId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginSetVirtualMachinePrimaryPrivateIPAddress(int itemId, int addressId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetVirtualMachinePrimaryPrivateIPAddress", new object[] { + itemId, + addressId}, callback, asyncState); + } + + /// + public ResultObject EndSetVirtualMachinePrimaryPrivateIPAddress(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void SetVirtualMachinePrimaryPrivateIPAddressAsync(int itemId, int addressId) { + this.SetVirtualMachinePrimaryPrivateIPAddressAsync(itemId, addressId, null); + } + + /// + public void SetVirtualMachinePrimaryPrivateIPAddressAsync(int itemId, int addressId, object userState) { + if ((this.SetVirtualMachinePrimaryPrivateIPAddressOperationCompleted == null)) { + this.SetVirtualMachinePrimaryPrivateIPAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetVirtualMachinePrimaryPrivateIPAddressOperationCompleted); + } + this.InvokeAsync("SetVirtualMachinePrimaryPrivateIPAddress", new object[] { + itemId, + addressId}, this.SetVirtualMachinePrimaryPrivateIPAddressOperationCompleted, userState); + } + + private void OnSetVirtualMachinePrimaryPrivateIPAddressOperationCompleted(object arg) { + if ((this.SetVirtualMachinePrimaryPrivateIPAddressCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetVirtualMachinePrimaryPrivateIPAddressCompleted(this, new SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteVirtualMachinePrivateIPAddress" + + "es", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteVirtualMachinePrivateIPAddresses(int itemId, int[] addressId) { + object[] results = this.Invoke("DeleteVirtualMachinePrivateIPAddresses", new object[] { + itemId, + addressId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteVirtualMachinePrivateIPAddresses(int itemId, int[] addressId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteVirtualMachinePrivateIPAddresses", new object[] { + itemId, + addressId}, callback, asyncState); + } + + /// + public ResultObject EndDeleteVirtualMachinePrivateIPAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteVirtualMachinePrivateIPAddressesAsync(int itemId, int[] addressId) { + this.DeleteVirtualMachinePrivateIPAddressesAsync(itemId, addressId, null); + } + + /// + public void DeleteVirtualMachinePrivateIPAddressesAsync(int itemId, int[] addressId, object userState) { + if ((this.DeleteVirtualMachinePrivateIPAddressesOperationCompleted == null)) { + this.DeleteVirtualMachinePrivateIPAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteVirtualMachinePrivateIPAddressesOperationCompleted); + } + this.InvokeAsync("DeleteVirtualMachinePrivateIPAddresses", new object[] { + itemId, + addressId}, this.DeleteVirtualMachinePrivateIPAddressesOperationCompleted, userState); + } + + private void OnDeleteVirtualMachinePrivateIPAddressesOperationCompleted(object arg) { + if ((this.DeleteVirtualMachinePrivateIPAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteVirtualMachinePrivateIPAddressesCompleted(this, new DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachinePermissions", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualMachinePermission[] GetVirtualMachinePermissions(int itemId) { + object[] results = this.Invoke("GetVirtualMachinePermissions", new object[] { + itemId}); + return ((VirtualMachinePermission[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachinePermissions(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachinePermissions", new object[] { + itemId}, callback, asyncState); + } + + /// + public VirtualMachinePermission[] EndGetVirtualMachinePermissions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualMachinePermission[])(results[0])); + } + + /// + public void GetVirtualMachinePermissionsAsync(int itemId) { + this.GetVirtualMachinePermissionsAsync(itemId, null); + } + + /// + public void GetVirtualMachinePermissionsAsync(int itemId, object userState) { + if ((this.GetVirtualMachinePermissionsOperationCompleted == null)) { + this.GetVirtualMachinePermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachinePermissionsOperationCompleted); + } + this.InvokeAsync("GetVirtualMachinePermissions", new object[] { + itemId}, this.GetVirtualMachinePermissionsOperationCompleted, userState); + } + + private void OnGetVirtualMachinePermissionsOperationCompleted(object arg) { + if ((this.GetVirtualMachinePermissionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachinePermissionsCompleted(this, new GetVirtualMachinePermissionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateVirtualMachineUserPermissions", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int UpdateVirtualMachineUserPermissions(int itemId, VirtualMachinePermission[] permissions) { + object[] results = this.Invoke("UpdateVirtualMachineUserPermissions", new object[] { + itemId, + permissions}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateVirtualMachineUserPermissions(int itemId, VirtualMachinePermission[] permissions, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UpdateVirtualMachineUserPermissions", new object[] { + itemId, + permissions}, callback, asyncState); + } + + /// + public int EndUpdateVirtualMachineUserPermissions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void UpdateVirtualMachineUserPermissionsAsync(int itemId, VirtualMachinePermission[] permissions) { + this.UpdateVirtualMachineUserPermissionsAsync(itemId, permissions, null); + } + + /// + public void UpdateVirtualMachineUserPermissionsAsync(int itemId, VirtualMachinePermission[] permissions, object userState) { + if ((this.UpdateVirtualMachineUserPermissionsOperationCompleted == null)) { + this.UpdateVirtualMachineUserPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateVirtualMachineUserPermissionsOperationCompleted); + } + this.InvokeAsync("UpdateVirtualMachineUserPermissions", new object[] { + itemId, + permissions}, this.UpdateVirtualMachineUserPermissionsOperationCompleted, userState); + } + + private void OnUpdateVirtualMachineUserPermissionsOperationCompleted(object arg) { + if ((this.UpdateVirtualMachineUserPermissionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateVirtualMachineUserPermissionsCompleted(this, new UpdateVirtualMachineUserPermissionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExternalSwitches", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public VirtualSwitch[] GetExternalSwitches(int serviceId, string computerName) { + object[] results = this.Invoke("GetExternalSwitches", new object[] { + serviceId, + computerName}); + return ((VirtualSwitch[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetExternalSwitches(int serviceId, string computerName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExternalSwitches", new object[] { + serviceId, + computerName}, callback, asyncState); + } + + /// + public VirtualSwitch[] EndGetExternalSwitches(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((VirtualSwitch[])(results[0])); + } + + /// + public void GetExternalSwitchesAsync(int serviceId, string computerName) { + this.GetExternalSwitchesAsync(serviceId, computerName, null); + } + + /// + public void GetExternalSwitchesAsync(int serviceId, string computerName, object userState) { + if ((this.GetExternalSwitchesOperationCompleted == null)) { + this.GetExternalSwitchesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExternalSwitchesOperationCompleted); + } + this.InvokeAsync("GetExternalSwitches", new object[] { + serviceId, + 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteVirtualMachine(int itemId, bool saveFiles, bool exportVps, string exportPath) { + object[] results = this.Invoke("DeleteVirtualMachine", new object[] { + itemId, + saveFiles, + exportVps, + exportPath}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteVirtualMachine(int itemId, bool saveFiles, bool exportVps, string exportPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteVirtualMachine", new object[] { + itemId, + saveFiles, + exportVps, + exportPath}, callback, asyncState); + } + + /// + public ResultObject EndDeleteVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteVirtualMachineAsync(int itemId, bool saveFiles, bool exportVps, string exportPath) { + this.DeleteVirtualMachineAsync(itemId, saveFiles, exportVps, exportPath, null); + } + + /// + public void DeleteVirtualMachineAsync(int itemId, bool saveFiles, bool exportVps, string exportPath, object userState) { + if ((this.DeleteVirtualMachineOperationCompleted == null)) { + this.DeleteVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteVirtualMachineOperationCompleted); + } + this.InvokeAsync("DeleteVirtualMachine", new object[] { + itemId, + saveFiles, + exportVps, + exportPath}, 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.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ReinstallVirtualMachine", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int ReinstallVirtualMachine(int itemId, string adminPassword, bool preserveVirtualDiskFiles, bool saveVirtualDisk, bool exportVps, string exportPath) { + object[] results = this.Invoke("ReinstallVirtualMachine", new object[] { + itemId, + adminPassword, + preserveVirtualDiskFiles, + saveVirtualDisk, + exportVps, + exportPath}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginReinstallVirtualMachine(int itemId, string adminPassword, bool preserveVirtualDiskFiles, bool saveVirtualDisk, bool exportVps, string exportPath, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ReinstallVirtualMachine", new object[] { + itemId, + adminPassword, + preserveVirtualDiskFiles, + saveVirtualDisk, + exportVps, + exportPath}, callback, asyncState); + } + + /// + public int EndReinstallVirtualMachine(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void ReinstallVirtualMachineAsync(int itemId, string adminPassword, bool preserveVirtualDiskFiles, bool saveVirtualDisk, bool exportVps, string exportPath) { + this.ReinstallVirtualMachineAsync(itemId, adminPassword, preserveVirtualDiskFiles, saveVirtualDisk, exportVps, exportPath, null); + } + + /// + public void ReinstallVirtualMachineAsync(int itemId, string adminPassword, bool preserveVirtualDiskFiles, bool saveVirtualDisk, bool exportVps, string exportPath, object userState) { + if ((this.ReinstallVirtualMachineOperationCompleted == null)) { + this.ReinstallVirtualMachineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReinstallVirtualMachineOperationCompleted); + } + this.InvokeAsync("ReinstallVirtualMachine", new object[] { + itemId, + adminPassword, + preserveVirtualDiskFiles, + saveVirtualDisk, + exportVps, + exportPath}, this.ReinstallVirtualMachineOperationCompleted, userState); + } + + private void OnReinstallVirtualMachineOperationCompleted(object arg) { + if ((this.ReinstallVirtualMachineCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReinstallVirtualMachineCompleted(this, new ReinstallVirtualMachineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetVirtualMachineSummaryText", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetVirtualMachineSummaryText(int itemId) { + object[] results = this.Invoke("GetVirtualMachineSummaryText", new object[] { + itemId}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginGetVirtualMachineSummaryText(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetVirtualMachineSummaryText", new object[] { + itemId}, callback, asyncState); + } + + /// + public string EndGetVirtualMachineSummaryText(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void GetVirtualMachineSummaryTextAsync(int itemId) { + this.GetVirtualMachineSummaryTextAsync(itemId, null); + } + + /// + public void GetVirtualMachineSummaryTextAsync(int itemId, object userState) { + if ((this.GetVirtualMachineSummaryTextOperationCompleted == null)) { + this.GetVirtualMachineSummaryTextOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVirtualMachineSummaryTextOperationCompleted); + } + this.InvokeAsync("GetVirtualMachineSummaryText", new object[] { + itemId}, this.GetVirtualMachineSummaryTextOperationCompleted, userState); + } + + private void OnGetVirtualMachineSummaryTextOperationCompleted(object arg) { + if ((this.GetVirtualMachineSummaryTextCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVirtualMachineSummaryTextCompleted(this, new GetVirtualMachineSummaryTextCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SendVirtualMachineSummaryLetter", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject SendVirtualMachineSummaryLetter(int itemId, string to, string bcc) { + object[] results = this.Invoke("SendVirtualMachineSummaryLetter", new object[] { + itemId, + to, + bcc}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginSendVirtualMachineSummaryLetter(int itemId, string to, string bcc, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SendVirtualMachineSummaryLetter", new object[] { + itemId, + to, + bcc}, callback, asyncState); + } + + /// + public ResultObject EndSendVirtualMachineSummaryLetter(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void SendVirtualMachineSummaryLetterAsync(int itemId, string to, string bcc) { + this.SendVirtualMachineSummaryLetterAsync(itemId, to, bcc, null); + } + + /// + public void SendVirtualMachineSummaryLetterAsync(int itemId, string to, string bcc, object userState) { + if ((this.SendVirtualMachineSummaryLetterOperationCompleted == null)) { + this.SendVirtualMachineSummaryLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendVirtualMachineSummaryLetterOperationCompleted); + } + this.InvokeAsync("SendVirtualMachineSummaryLetter", new object[] { + itemId, + to, + bcc}, this.SendVirtualMachineSummaryLetterOperationCompleted, userState); + } + + private void OnSendVirtualMachineSummaryLetterOperationCompleted(object arg) { + if ((this.SendVirtualMachineSummaryLetterCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SendVirtualMachineSummaryLetterCompleted(this, new SendVirtualMachineSummaryLetterCompletedEventArgs(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 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 VirtualMachineMetaItemsPaged Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachineMetaItemsPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachinesByServiceIdCompletedEventHandler(object sender, GetVirtualMachinesByServiceIdCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachinesByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachinesByServiceIdCompletedEventArgs(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 GetVirtualMachineItemCompletedEventHandler(object sender, GetVirtualMachineItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineItemCompletedEventArgs(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 EvaluateVirtualMachineTemplateCompletedEventHandler(object sender, EvaluateVirtualMachineTemplateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EvaluateVirtualMachineTemplateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EvaluateVirtualMachineTemplateCompletedEventArgs(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 GetExternalNetworkDetailsCompletedEventHandler(object sender, GetExternalNetworkDetailsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExternalNetworkDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExternalNetworkDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public NetworkAdapterDetails Result { + get { + this.RaiseExceptionIfNecessary(); + return ((NetworkAdapterDetails)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetPackagePrivateIPAddressesPagedCompletedEventHandler(object sender, GetPackagePrivateIPAddressesPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPackagePrivateIPAddressesPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPackagePrivateIPAddressesPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public PrivateIPAddressesPaged Result { + get { + this.RaiseExceptionIfNecessary(); + return ((PrivateIPAddressesPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetPackagePrivateIPAddressesCompletedEventHandler(object sender, GetPackagePrivateIPAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPackagePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPackagePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public PrivateIPAddress[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((PrivateIPAddress[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetPrivateNetworkDetailsCompletedEventHandler(object sender, GetPrivateNetworkDetailsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPrivateNetworkDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPrivateNetworkDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public NetworkAdapterDetails Result { + get { + this.RaiseExceptionIfNecessary(); + return ((NetworkAdapterDetails)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSpaceUserPermissionsCompletedEventHandler(object sender, GetSpaceUserPermissionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSpaceUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSpaceUserPermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachinePermission[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachinePermission[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void UpdateSpaceUserPermissionsCompletedEventHandler(object sender, UpdateSpaceUserPermissionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateSpaceUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateSpaceUserPermissionsCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSpaceAuditLogCompletedEventHandler(object sender, GetSpaceAuditLogCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSpaceAuditLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSpaceAuditLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LogRecord[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LogRecord[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineAuditLogCompletedEventHandler(object sender, GetVirtualMachineAuditLogCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineAuditLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineAuditLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LogRecord[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LogRecord[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetOperatingSystemTemplatesCompletedEventHandler(object sender, GetOperatingSystemTemplatesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOperatingSystemTemplatesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetOperatingSystemTemplatesCompletedEventArgs(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 GetOperatingSystemTemplatesByServiceIdCompletedEventHandler(object sender, GetOperatingSystemTemplatesByServiceIdCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOperatingSystemTemplatesByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetOperatingSystemTemplatesByServiceIdCompletedEventArgs(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 GetMaximumCpuCoresNumberCompletedEventHandler(object sender, GetMaximumCpuCoresNumberCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetMaximumCpuCoresNumberCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetMaximumCpuCoresNumberCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetDefaultExportPathCompletedEventHandler(object sender, GetDefaultExportPathCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDefaultExportPathCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetDefaultExportPathCompletedEventArgs(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 CreateDefaultVirtualMachineCompletedEventHandler(object sender, CreateDefaultVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateDefaultVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateDefaultVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public IntResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((IntResult)(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 IntResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((IntResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ImportVirtualMachineCompletedEventHandler(object sender, ImportVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ImportVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ImportVirtualMachineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public IntResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((IntResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineThumbnailCompletedEventHandler(object sender, GetVirtualMachineThumbnailCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineThumbnailCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineThumbnailCompletedEventArgs(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 GetVirtualMachineGeneralDetailsCompletedEventHandler(object sender, GetVirtualMachineGeneralDetailsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineGeneralDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineGeneralDetailsCompletedEventArgs(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 GetVirtualMachineExtendedInfoCompletedEventHandler(object sender, GetVirtualMachineExtendedInfoCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineExtendedInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineExtendedInfoCompletedEventArgs(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 CancelVirtualMachineJobCompletedEventHandler(object sender, CancelVirtualMachineJobCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CancelVirtualMachineJobCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CancelVirtualMachineJobCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void UpdateVirtualMachineHostNameCompletedEventHandler(object sender, UpdateVirtualMachineHostNameCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateVirtualMachineHostNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateVirtualMachineHostNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(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 ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(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 ChangeAdministratorPasswordCompletedEventHandler(object sender, ChangeAdministratorPasswordCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ChangeAdministratorPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ChangeAdministratorPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void UpdateVirtualMachineConfigurationCompletedEventHandler(object sender, UpdateVirtualMachineConfigurationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateVirtualMachineConfigurationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateVirtualMachineConfigurationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetInsertedDvdDiskCompletedEventHandler(object sender, GetInsertedDvdDiskCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetInsertedDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetInsertedDvdDiskCompletedEventArgs(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 GetLibraryDisksCompletedEventHandler(object sender, GetLibraryDisksCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLibraryDisksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLibraryDisksCompletedEventArgs(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 InsertDvdDiskCompletedEventHandler(object sender, InsertDvdDiskCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class InsertDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal InsertDvdDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void EjectDvdDiskCompletedEventHandler(object sender, EjectDvdDiskCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EjectDvdDiskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EjectDvdDiskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(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 ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(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 ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(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 ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(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 ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(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 ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSnapshotThumbnailCompletedEventHandler(object sender, GetSnapshotThumbnailCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSnapshotThumbnailCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSnapshotThumbnailCompletedEventArgs(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 GetExternalNetworkAdapterDetailsCompletedEventHandler(object sender, GetExternalNetworkAdapterDetailsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExternalNetworkAdapterDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExternalNetworkAdapterDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public NetworkAdapterDetails Result { + get { + this.RaiseExceptionIfNecessary(); + return ((NetworkAdapterDetails)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddVirtualMachineExternalIPAddressesCompletedEventHandler(object sender, AddVirtualMachineExternalIPAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddVirtualMachineExternalIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddVirtualMachineExternalIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetVirtualMachinePrimaryExternalIPAddressCompletedEventHandler(object sender, SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetVirtualMachinePrimaryExternalIPAddressCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteVirtualMachineExternalIPAddressesCompletedEventHandler(object sender, DeleteVirtualMachineExternalIPAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteVirtualMachineExternalIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteVirtualMachineExternalIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetPrivateNetworkAdapterDetailsCompletedEventHandler(object sender, GetPrivateNetworkAdapterDetailsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPrivateNetworkAdapterDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPrivateNetworkAdapterDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public NetworkAdapterDetails Result { + get { + this.RaiseExceptionIfNecessary(); + return ((NetworkAdapterDetails)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddVirtualMachinePrivateIPAddressesCompletedEventHandler(object sender, AddVirtualMachinePrivateIPAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddVirtualMachinePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddVirtualMachinePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetVirtualMachinePrimaryPrivateIPAddressCompletedEventHandler(object sender, SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetVirtualMachinePrimaryPrivateIPAddressCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteVirtualMachinePrivateIPAddressesCompletedEventHandler(object sender, DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteVirtualMachinePrivateIPAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachinePermissionsCompletedEventHandler(object sender, GetVirtualMachinePermissionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachinePermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachinePermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VirtualMachinePermission[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VirtualMachinePermission[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void UpdateVirtualMachineUserPermissionsCompletedEventHandler(object sender, UpdateVirtualMachineUserPermissionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateVirtualMachineUserPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateVirtualMachineUserPermissionsCompletedEventArgs(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])); + } + } + } + + /// + [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 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 ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ReinstallVirtualMachineCompletedEventHandler(object sender, ReinstallVirtualMachineCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ReinstallVirtualMachineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ReinstallVirtualMachineCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetVirtualMachineSummaryTextCompletedEventHandler(object sender, GetVirtualMachineSummaryTextCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVirtualMachineSummaryTextCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVirtualMachineSummaryTextCompletedEventArgs(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 SendVirtualMachineSummaryLetterCompletedEventHandler(object sender, SendVirtualMachineSummaryLetterCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SendVirtualMachineSummaryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SendVirtualMachineSummaryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj index 481ef66f..dcd48338 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj @@ -91,6 +91,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 1ed10655..d60b57fa 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -3456,6 +3456,21 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@Recursive", recursive)); return reader; } + public static IDataReader GetVirtualMachinesPaged2012(int actorId, int packageId, string filterColumn, string filterValue, + string sortColumn, int startRow, int maximumRows, bool recursive) + { + IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, + "GetVirtualMachinesPaged2012", + new SqlParameter("@ActorID", actorId), + new SqlParameter("@PackageID", packageId), + new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)), + new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)), + new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)), + new SqlParameter("@StartRow", startRow), + new SqlParameter("@MaximumRows", maximumRows), + new SqlParameter("@Recursive", recursive)); + return reader; + } #endregion public static IDataReader GetVirtualMachinesForPCPaged(int actorId, int packageId, string filterColumn, string filterValue, diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs index 292abb2a..b47b2088 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs @@ -488,6 +488,7 @@ namespace WebsitePanel.EnterpriseServer ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MySql5, domain, ""); ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Statistics, domain, ""); ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPS, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPS2012, domain, ""); ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, ""); } } @@ -711,6 +712,11 @@ namespace WebsitePanel.EnterpriseServer if (Utils.ParseBool(vpsSettings["AutoAssignExternalIP"], true)) ServerController.AllocateMaximumPackageIPAddresses(packageId, ResourceGroups.VPS, IPAddressPool.VpsExternalNetwork); + // allocate "VPS" IP addresses + int vps2012ServiceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.VPS2012); + StringDictionary vps2012Settings = ServerController.GetServiceSettings(vps2012ServiceId); + if (Utils.ParseBool(vps2012Settings["AutoAssignExternalIP"], true)) + ServerController.AllocateMaximumPackageIPAddresses(packageId, ResourceGroups.VPS2012, IPAddressPool.VpsExternalNetwork); // allocate "VPSForPC" IP addresses int vpsfcpServiceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.VPSForPC); @@ -1681,6 +1687,18 @@ namespace WebsitePanel.EnterpriseServer } } + // VPS2012 + else if (String.Compare(PackageSettings.VIRTUAL_PRIVATE_SERVERS_2012, settingsName, true) == 0) + { + // load Exchange service settings + int vpsServiceId = GetPackageServiceId(packageId, ResourceGroups.VPS2012); + if (vpsServiceId > 0) + { + StringDictionary vpsSettings = ServerController.GetServiceSettings(vpsServiceId); + settings["HostnamePattern"] = vpsSettings["HostnamePattern"]; + } + } + //vpforCP else if (String.Compare(PackageSettings.VIRTUAL_PRIVATE_SERVERS_FOR_PRIVATE_CLOUD, settingsName, true) == 0) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs index c9aec104..9f87f606 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs @@ -1481,6 +1481,10 @@ namespace WebsitePanel.EnterpriseServer { return Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER; } + else if (String.Compare(groupName, ResourceGroups.VPS2012, true) == 0) + { + return Quotas.VPS2012_EXTERNAL_IP_ADDRESSES_NUMBER; + } else if (String.Compare(groupName, ResourceGroups.VPSForPC, true) == 0) { return Quotas.VPSForPC_EXTERNAL_IP_ADDRESSES_NUMBER; @@ -1840,6 +1844,7 @@ namespace WebsitePanel.EnterpriseServer ServerController.AddServiceDNSRecords(packageId, ResourceGroups.MySql5, domain, ""); ServerController.AddServiceDNSRecords(packageId, ResourceGroups.Statistics, domain, ""); ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPS, domain, ""); + ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPS2012, domain, ""); ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, ""); } @@ -2403,6 +2408,7 @@ namespace WebsitePanel.EnterpriseServer ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.MySql5, domain, ""); ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Statistics, domain, ""); ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.VPS, domain, ""); + ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.VPS2012, domain, ""); ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.VPSForPC, domain, ""); ServerController.AddServiceDNSRecords(domain.PackageId, ResourceGroups.Dns, domain, ""); break; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/CreateServerAsyncWorker2012.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/CreateServerAsyncWorker2012.cs new file mode 100644 index 00000000..5bc09f46 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/CreateServerAsyncWorker2012.cs @@ -0,0 +1,85 @@ +// 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.Web; +using System.Threading; + +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.EnterpriseServer +{ + public class CreateServerAsyncWorker2012 + { + #region Properties + public int ThreadUserId { get; set; } + public string TaskId { get; set; } + + public VirtualMachine Item { get; set; } + public LibraryItem OsTemplate { get; set; } + + public int ExternalAddressesNumber { get; set; } + public bool RandomExternalAddresses { get; set; } + public int[] ExternalAddresses { get; set; } + + public int PrivateAddressesNumber { get; set; } + public bool RandomPrivateAddresses { get; set; } + public string[] PrivateAddresses { get; set; } + + public string SummaryLetterEmail { get; set; } + #endregion + + public CreateServerAsyncWorker2012() + { + ThreadUserId = -1; // admin + } + + #region Create + public void CreateAsync() + { + // start asynchronously + Thread t = new Thread(new ThreadStart(Create)); + t.Start(); + } + + private void Create() + { + // impersonate thread + if (ThreadUserId != -1) + SecurityContext.SetThreadPrincipal(ThreadUserId); + + // perform backup + VirtualizationServerController2012.CreateVirtualMachineInternal(TaskId, Item, OsTemplate, + ExternalAddressesNumber, RandomExternalAddresses, ExternalAddresses, + PrivateAddressesNumber, RandomPrivateAddresses, PrivateAddresses, + SummaryLetterEmail); + } + #endregion + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs new file mode 100644 index 00000000..40a599ab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs @@ -0,0 +1,3687 @@ +// 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.Xml; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Virtualization; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; +using WebsitePanel.Providers; +using System.Text; +using System.Collections; +using System.Net.Mail; +using System.Diagnostics; +using System.Linq; +using System.Net; + +namespace WebsitePanel.EnterpriseServer +{ + public class VirtualizationServerController2012 + { + private const string SHUTDOWN_REASON = "WebsitePanel - Initiated by user"; + private const string SHUTDOWN_REASON_CHANGE_CONFIG = "WebsitePanel - changing VPS configuration"; + private const Int64 Size1G = 0x40000000; + private const string MS_MAC_PREFIX = "00155D"; // IEEE prefix of MS MAC addresses + + // default server creation (if "Unlimited" was specified in the hosting plan) + private const int DEFAULT_PASSWORD_LENGTH = 12; + private const int DEFAULT_RAM_SIZE = 512; // megabytes + private const int DEFAULT_HDD_SIZE = 20; // gigabytes + private const int DEFAULT_PRIVATE_IPS_NUMBER = 1; + private const int DEFAULT_SNAPSHOTS_NUMBER = 5; + + #region Virtual Machines + public static VirtualMachineMetaItemsPaged GetVirtualMachines(int packageId, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive) + { + VirtualMachineMetaItemsPaged result = new VirtualMachineMetaItemsPaged(); + + // get reader + IDataReader reader = DataProvider.GetVirtualMachinesPaged2012( + SecurityContext.User.UserId, + packageId, filterColumn, filterValue, sortColumn, startRow, maximumRows, recursive); + + // number of items = first data reader + reader.Read(); + result.Count = (int)reader[0]; + + // items = second data reader + reader.NextResult(); + result.Items = ObjectUtils.CreateListFromDataReader(reader).ToArray(); + + return result; + } + + public static VirtualMachine[] GetVirtualMachinesByServiceId(int serviceId) + { + // get proxy + VirtualizationServer vps = GetVirtualizationProxy(serviceId); + + // load details + return vps.GetVirtualMachines(); + } + #endregion + + #region Private Network + public static PrivateIPAddressesPaged GetPackagePrivateIPAddressesPaged(int packageId, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + PrivateIPAddressesPaged result = new PrivateIPAddressesPaged(); + + // get reader + IDataReader reader = DataProvider.GetPackagePrivateIPAddressesPaged(packageId, filterColumn, filterValue, + sortColumn, startRow, maximumRows); + + // number of items = first data reader + reader.Read(); + result.Count = (int)reader[0]; + + // items = second data reader + reader.NextResult(); + result.Items = ObjectUtils.CreateListFromDataReader(reader).ToArray(); + + return result; + } + + public static List GetPackagePrivateIPAddresses(int packageId) + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetPackagePrivateIPAddresses(packageId)); + } + #endregion + + #region User Permissions + public static List GetSpaceUserPermissions(int packageId) + { + List result = new List(); + return result; + } + + public static int UpdateSpaceUserPermissions(int packageId, VirtualMachinePermission[] permissions) + { + // VDC - UPDATE_PERMISSIONS + return 0; + } + #endregion + + #region Audit Log + public static List GetSpaceAuditLog(int packageId, DateTime startPeriod, DateTime endPeriod, + int severity, string sortColumn, int startRow, int maximumRows) + { + List result = new List(); + return result; + } + + public static List GetVirtualMachineAuditLog(int itemId, DateTime startPeriod, DateTime endPeriod, + int severity, string sortColumn, int startRow, int maximumRows) + { + List result = new List(); + return result; + } + #endregion + + #region VPS Create – Name & OS + public static LibraryItem[] GetOperatingSystemTemplates(int packageId) + { + // load service settings + int serviceId = GetServiceId(packageId); + + // return templates + return GetOperatingSystemTemplatesByServiceId(serviceId); + } + + public static LibraryItem[] GetOperatingSystemTemplatesByServiceId(int serviceId) + { + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + string path = settings["OsTemplatesPath"]; + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(serviceId); + + return vs.GetLibraryItems(path); + } + #endregion + + #region VPS Create - Configuration + public static int GetMaximumCpuCoresNumber(int packageId) + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxyByPackageId(packageId); + + return vs.GetProcessorCoresNumber(); + } + + public static string GetDefaultExportPath(int itemId) + { + // load meta item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + + if (vm == null) + return null; + + // load settings + StringDictionary settings = ServerController.GetServiceSettings(vm.ServiceId); + return settings["ExportedVpsPath"]; + } + #endregion + + #region VPS Create + public static IntResult CreateDefaultVirtualMachine(int packageId, + string hostname, string osTemplate, string password, string summaryLetterEmail) + { + if (String.IsNullOrEmpty(osTemplate)) + throw new ArgumentNullException("osTemplate"); + + IntResult res = new IntResult(); + + // load package info + PackageInfo package = PackageController.GetPackage(packageId); + if (package == null) + { + res.ErrorCodes.Add("VPS_CREATE_PACKAGE_NOT_FOUND"); + return res; + } + + // generate host name if not specified + if (String.IsNullOrEmpty(hostname)) + { + // load hostname pattern + PackageSettings spaceSettings = PackageController.GetPackageSettings(packageId, PackageSettings.VIRTUAL_PRIVATE_SERVERS_2012); + string hostnamePattern = spaceSettings["HostnamePattern"]; + if (String.IsNullOrEmpty(hostnamePattern)) + { + res.ErrorCodes.Add("VPS_CREATE_EMPTY_HOSTNAME_PATTERN"); + return res; + } + + hostname = EvaluateSpaceVariables(hostnamePattern, packageId); + } + + // generate password if not specified + if (String.IsNullOrEmpty(password)) + { + int passwordLength = DEFAULT_PASSWORD_LENGTH; // default length + + // load password policy + UserSettings userSettings = UserController.GetUserSettings(package.UserId, UserSettings.VPS_POLICY); + string passwordPolicy = userSettings["AdministratorPasswordPolicy"]; + + if (!String.IsNullOrEmpty(passwordPolicy)) + { + // get second parameter - max length + passwordLength = Utils.ParseInt(passwordPolicy.Split(';')[1].Trim(), passwordLength); + } + + // generate password + password = Utils.GetRandomString(passwordLength); + } + + // load quotas + PackageContext cntx = PackageController.GetPackageContext(packageId); + if (cntx.Groups.ContainsKey(ResourceGroups.VPS2012)) + { + res.ErrorCodes.Add("VPS_CREATE_VPS_GROUP_DISABLED"); + return res; + } + + int generation = 1; + + // CPU cores + int cpuCores = cntx.Quotas[Quotas.VPS2012_CPU_NUMBER].QuotaAllocatedValue; + if (cpuCores == -1) // unlimited is not possible + cpuCores = GetMaximumCpuCoresNumber(packageId); + + // RAM + int ramMB = cntx.Quotas[Quotas.VPS2012_RAM].QuotaAllocatedValue; + if (ramMB == -1) // unlimited is not possible + ramMB = DEFAULT_RAM_SIZE; + + // HDD + int hddGB = cntx.Quotas[Quotas.VPS2012_HDD].QuotaAllocatedValue; + if (hddGB == -1) // unlimited is not possible + hddGB = DEFAULT_HDD_SIZE; + + // snapshots + int snapshots = cntx.Quotas[Quotas.VPS2012_SNAPSHOTS_NUMBER].QuotaAllocatedValue; + if (snapshots == -1) // unlimited is not possible + snapshots = DEFAULT_SNAPSHOTS_NUMBER; + + bool dvdInstalled = !cntx.Quotas[Quotas.VPS2012_DVD_ENABLED].QuotaExhausted; + bool bootFromCD = !cntx.Quotas[Quotas.VPS2012_BOOT_CD_ENABLED].QuotaExhausted; + bool numLock = true; + + bool startShutdownAllowed = !cntx.Quotas[Quotas.VPS2012_START_SHUTDOWN_ALLOWED].QuotaExhausted; + bool pauseResumeAllowed = !cntx.Quotas[Quotas.VPS2012_PAUSE_RESUME_ALLOWED].QuotaExhausted; + bool rebootAllowed = !cntx.Quotas[Quotas.VPS2012_REBOOT_ALLOWED].QuotaExhausted; + bool resetAllowed = !cntx.Quotas[Quotas.VPS2012_RESET_ALOWED].QuotaExhausted; + bool reinstallAllowed = !cntx.Quotas[Quotas.VPS2012_REINSTALL_ALLOWED].QuotaExhausted; + + bool externalNetworkEnabled = !cntx.Quotas[Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED].QuotaExhausted; + int externalAddressesNumber = cntx.Quotas[Quotas.VPS2012_EXTERNAL_IP_ADDRESSES_NUMBER].QuotaAllocatedValue; + bool randomExternalAddresses = true; + int[] externalAddresses = new int[0]; // empty array + if (externalNetworkEnabled) + { + int maxExternalAddresses = ServerController.GetPackageUnassignedIPAddresses(packageId, IPAddressPool.VpsExternalNetwork).Count; + if (externalAddressesNumber == -1 + || externalAddressesNumber > maxExternalAddresses) + externalAddressesNumber = maxExternalAddresses; + } + + bool privateNetworkEnabled = !cntx.Quotas[Quotas.VPS2012_PRIVATE_NETWORK_ENABLED].QuotaExhausted; + int privateAddressesNumber = cntx.Quotas[Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER].QuotaAllocatedValue; + bool randomPrivateAddresses = true; + string[] privateAddresses = new string[0]; // empty array + if (privateAddressesNumber == -1) // unlimited is not possible + { + privateAddressesNumber = DEFAULT_PRIVATE_IPS_NUMBER; + } + + // create server and return result + return CreateVirtualMachine(packageId, hostname, osTemplate, password, summaryLetterEmail, + generation, cpuCores, ramMB, hddGB, snapshots, + dvdInstalled, bootFromCD, numLock, + startShutdownAllowed, pauseResumeAllowed, rebootAllowed, resetAllowed, reinstallAllowed, + externalNetworkEnabled, externalAddressesNumber, randomExternalAddresses, externalAddresses, + privateNetworkEnabled, privateAddressesNumber, randomPrivateAddresses, privateAddresses); + } + + public static IntResult CreateVirtualMachine(int packageId, + string hostname, string osTemplateFile, string password, string summaryLetterEmail, + int generation, int cpuCores, int ramMB, int hddGB, int snapshots, + bool dvdInstalled, bool bootFromCD, bool numLock, + bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, + bool externalNetworkEnabled, int externalAddressesNumber, bool randomExternalAddresses, int[] externalAddresses, + bool privateNetworkEnabled, int privateAddressesNumber, bool randomPrivateAddresses, string[] privateAddresses) + { + // result object + IntResult res = new IntResult(); + + // meta item + VirtualMachine vm = null; + + try + { + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, packageId, DemandPackage.IsActive)) + return res; + + #endregion + + #region Check if host name is already used + + try + { + ServiceProviderItem item = PackageController.GetPackageItemByName(packageId, hostname, + typeof (VirtualMachine)); + if (item != null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.HOST_NAMER_IS_ALREADY_USED); + return res; + } + } + catch(Exception ex) + { + res.AddError(VirtualizationErrorCodes.CANNOT_CHECK_HOST_EXISTS, ex); + return res; + } + + #endregion + + #region Check Quotas + // check quotas + List quotaResults = new List(); + PackageContext cntx = PackageController.GetPackageContext(packageId); + + CheckListsQuota(cntx, quotaResults, Quotas.VPS2012_SERVERS_NUMBER, VirtualizationErrorCodes.QUOTA_EXCEEDED_SERVERS_NUMBER); + + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_CPU_NUMBER, cpuCores, VirtualizationErrorCodes.QUOTA_EXCEEDED_CPU); + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_RAM, ramMB, VirtualizationErrorCodes.QUOTA_EXCEEDED_RAM); + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_HDD, hddGB, VirtualizationErrorCodes.QUOTA_EXCEEDED_HDD); + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_SNAPSHOTS_NUMBER, snapshots, VirtualizationErrorCodes.QUOTA_EXCEEDED_SNAPSHOTS); + + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_DVD_ENABLED, dvdInstalled, VirtualizationErrorCodes.QUOTA_EXCEEDED_DVD_ENABLED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_BOOT_CD_ALLOWED, bootFromCD, VirtualizationErrorCodes.QUOTA_EXCEEDED_CD_ALLOWED); + + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_START_SHUTDOWN_ALLOWED, startShutdownAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_START_SHUTDOWN_ALLOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_PAUSE_RESUME_ALLOWED, pauseResumeAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_PAUSE_RESUME_ALLOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_REBOOT_ALLOWED, rebootAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_REBOOT_ALLOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_RESET_ALOWED, resetAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_RESET_ALOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_REINSTALL_ALLOWED, reinstallAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_REINSTALL_ALLOWED); + + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED, externalNetworkEnabled, VirtualizationErrorCodes.QUOTA_EXCEEDED_EXTERNAL_NETWORK_ENABLED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED, privateNetworkEnabled, VirtualizationErrorCodes.QUOTA_EXCEEDED_PRIVATE_NETWORK_ENABLED); + + // check external addresses number + if (!randomExternalAddresses && externalAddresses != null) + externalAddressesNumber = externalAddresses.Length; + + int maxAddresses = ServerController.GetPackageUnassignedIPAddresses(packageId, IPAddressPool.VpsExternalNetwork).Count; + if (externalNetworkEnabled && externalAddressesNumber > maxAddresses) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_EXCEEDED_EXTERNAL_ADDRESSES_NUMBER + ":" + maxAddresses.ToString()); + + // check private addresses number + if (!randomPrivateAddresses && privateAddresses != null) + privateAddressesNumber = privateAddresses.Length; + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER, privateAddressesNumber, VirtualizationErrorCodes.QUOTA_EXCEEDED_PRIVATE_ADDRESSES_NUMBER); + + // check management network parameters + NetworkAdapterDetails manageNic = GetManagementNetworkDetails(packageId); + if (!String.IsNullOrEmpty(manageNic.NetworkId)) + { + // network enabled - check management IPs pool + int manageIpsNumber = ServerController.GetUnallottedIPAddresses( + packageId, ResourceGroups.VPS2012, IPAddressPool.VpsManagementNetwork).Count; + + if (manageIpsNumber == 0) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_EXCEEDED_MANAGEMENT_NETWORK); + } + + // check acceptable values + if (ramMB <= 0) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_WRONG_RAM); + if (hddGB <= 0) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_WRONG_HDD); + if (snapshots < 0) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_WRONG_SNAPSHOTS); + + if (quotaResults.Count > 0) + { + res.ErrorCodes.AddRange(quotaResults); + return res; + } + #endregion + + #region Check input parameters + // check private network IP addresses if they are specified + List checkResults = CheckPrivateIPAddresses(packageId, privateAddresses); + if (checkResults.Count > 0) + { + res.ErrorCodes.AddRange(checkResults); + return res; + } + #endregion + + #region Context variables + // service ID + int serviceId = GetServiceId(packageId); + + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + #endregion + + #region Create meta item + // create meta item + vm = new VirtualMachine(); + + vm.Name = hostname; + vm.AdministratorPassword = CryptoUtils.Encrypt(password); + vm.PackageId = packageId; + vm.VirtualMachineId = null; // from service + vm.ServiceId = serviceId; + + vm.CurrentTaskId = Guid.NewGuid().ToString("N"); // generate creation task id + vm.ProvisioningStatus = VirtualMachineProvisioningStatus.InProgress; + + vm.Generation = generation; + vm.CpuCores = cpuCores; + vm.RamSize = ramMB; + vm.HddSize = hddGB; + vm.SnapshotsNumber = snapshots; + vm.DvdDriveInstalled = dvdInstalled; + vm.BootFromCD = bootFromCD; + vm.NumLockEnabled = numLock; + vm.StartTurnOffAllowed = startShutdownAllowed; + vm.PauseResumeAllowed = pauseResumeAllowed; + vm.RebootAllowed = rebootAllowed; + vm.ResetAllowed = resetAllowed; + vm.ReinstallAllowed = reinstallAllowed; + + // networking + vm.ExternalNetworkEnabled = externalNetworkEnabled; + vm.PrivateNetworkEnabled = privateNetworkEnabled; + vm.ManagementNetworkEnabled = !String.IsNullOrEmpty(manageNic.NetworkId); + + // load OS templates + LibraryItem osTemplate = null; + + try + { + LibraryItem[] osTemplates = GetOperatingSystemTemplates(vm.PackageId); + foreach (LibraryItem item in osTemplates) + { + if (String.Compare(item.Path, osTemplateFile, true) == 0) + { + osTemplate = item; + + // check minimal disk size + if (osTemplate.DiskSize > 0 && vm.HddSize < osTemplate.DiskSize) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.QUOTA_TEMPLATE_DISK_MINIMAL_SIZE + ":" + osTemplate.DiskSize); + return res; + } + + vm.OperatingSystemTemplate = osTemplate.Name; + vm.LegacyNetworkAdapter = osTemplate.LegacyNetworkAdapter; + vm.RemoteDesktopEnabled = osTemplate.RemoteDesktop; + break; + } + } + } + catch (Exception ex) + { + res.AddError(VirtualizationErrorCodes.GET_OS_TEMPLATES_ERROR, ex); + return res; + } + + // setup VM paths + string templatesPath = settings["OsTemplatesPath"]; + string rootFolderPattern = settings["RootFolder"]; + if(rootFolderPattern.IndexOf("[") == -1) + { + // no pattern has been specified + if(!rootFolderPattern.EndsWith("\\")) + rootFolderPattern += "\\"; + rootFolderPattern += "[username]\\[vps_hostname]"; + } + + vm.RootFolderPath = EvaluateItemVariables(rootFolderPattern, vm); + var correctVhdPath = GetCorrectTemplateFilePath(templatesPath, osTemplateFile); + vm.OperatingSystemTemplatePath = correctVhdPath; + vm.VirtualHardDrivePath = Path.Combine(vm.RootFolderPath, hostname + Path.GetExtension(correctVhdPath)); + + // save meta-item + try + { + vm.Id = PackageController.AddPackageItem(vm); + } + catch (Exception ex) + { + res.AddError(VirtualizationErrorCodes.CREATE_META_ITEM_ERROR, ex); + return res; + } + + #endregion + + #region Start Asynchronous task + try + { + // asynchronous process starts here + CreateServerAsyncWorker worker = new CreateServerAsyncWorker(); + + worker.TaskId = vm.CurrentTaskId; // async task ID + worker.ThreadUserId = SecurityContext.User.UserId; + worker.Item = vm; + worker.OsTemplate = osTemplate; + + worker.ExternalAddressesNumber = externalAddressesNumber; + worker.RandomExternalAddresses = randomExternalAddresses; + worker.ExternalAddresses = externalAddresses; + + worker.PrivateAddressesNumber = privateAddressesNumber; + worker.RandomPrivateAddresses = randomPrivateAddresses; + worker.PrivateAddresses = privateAddresses; + + worker.SummaryLetterEmail = summaryLetterEmail; + + worker.CreateAsync(); + } + catch (Exception ex) + { + // delete meta item + PackageController.DeletePackageItem(vm.Id); + + // return from method + res.AddError(VirtualizationErrorCodes.CREATE_TASK_START_ERROR, ex); + return res; + } + #endregion + } + catch (Exception ex) + { + res.AddError(VirtualizationErrorCodes.CREATE_ERROR, ex); + return res; + } + + res.Value = vm.Id; + res.IsSuccess = true; + return res; + } + + private static string GetCorrectTemplateFilePath(string templatesPath, string osTemplateFile) + { + if (osTemplateFile.Trim().EndsWith(".vhdx")) + return Path.Combine(templatesPath, osTemplateFile); + + return Path.Combine(templatesPath, osTemplateFile + ".vhd"); + } + + internal static void CreateVirtualMachineInternal(string taskId, VirtualMachine vm, LibraryItem osTemplate, + int externalAddressesNumber, bool randomExternalAddresses, int[] externalAddresses, + int privateAddressesNumber, bool randomPrivateAddresses, string[] privateAddresses, + string summaryLetterEmail) + { + // start task + TaskManager.StartTask(taskId, "VPS2012", "CREATE", vm.Name, vm.Id, vm.PackageId); + + try + { + // set Error flag + vm.ProvisioningStatus = VirtualMachineProvisioningStatus.Error; + + // load proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(vm.ServiceId); + + #region Setup External network + TaskManager.Write("VPS_CREATE_SETUP_EXTERNAL_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress + + try + { + if (vm.ExternalNetworkEnabled) + { + // provision IP addresses + ResultObject privResult = AddVirtualMachineExternalIPAddresses(vm.Id, randomExternalAddresses, + externalAddressesNumber, externalAddresses, false); + + // set primary IP address + NetworkAdapterDetails extNic = GetExternalNetworkAdapterDetails(vm.Id); + if (extNic.IPAddresses.Length > 0) + SetVirtualMachinePrimaryExternalIPAddress(vm.Id, extNic.IPAddresses[0].AddressId, false); + + // connect to network + vm.ExternalSwitchId = settings["ExternalNetworkId"]; + vm.ExternalNicMacAddress = GenerateMacAddress(); + } + else + { + TaskManager.Write("VPS_CREATE_SETUP_EXTERNAL_NETWORK_SKIP"); + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_SETUP_EXTERNAL_NETWORK_ERROR"); + return; + } + #endregion + + #region Setup Management network + TaskManager.Write("VPS_CREATE_SETUP_MANAGEMENT_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress + + try + { + if (vm.ManagementNetworkEnabled) + { + // check that package contains unassigned IP + // that could be re-used + List packageIps = ServerController.GetPackageUnassignedIPAddresses( + vm.PackageId, IPAddressPool.VpsManagementNetwork); + + if (packageIps.Count == 0) + { + // must be fresh space + // allocate package IP from the pool + List ips = ServerController.GetUnallottedIPAddresses( + vm.PackageId, ResourceGroups.VPS2012, IPAddressPool.VpsManagementNetwork); + + if (ips.Count > 0) + { + // assign IP to the package + ServerController.AllocatePackageIPAddresses(vm.PackageId, new int[] { ips[0].AddressId }); + + // re-read package IPs + packageIps = ServerController.GetPackageUnassignedIPAddresses( + vm.PackageId, IPAddressPool.VpsManagementNetwork); + } + else + { + // nothing to allocate - pool empty + TaskManager.WriteWarning("VPS_CREATE_SETUP_MANAGEMENT_NETWORK_POOL_EMPTY"); + } + } + + if (packageIps.Count > 0) + { + // assign to the item + ServerController.AddItemIPAddress(vm.Id, packageIps[0].PackageAddressID); + + // set primary IP address + ServerController.SetItemPrimaryIPAddress(vm.Id, packageIps[0].PackageAddressID); + + // connect to network + vm.ManagementSwitchId = settings["ManagementNetworkId"]; + vm.ManagementNicMacAddress = GenerateMacAddress(); + } + } + else + { + TaskManager.Write("VPS_CREATE_SETUP_MANAGEMENT_NETWORK_SKIP"); + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_SETUP_MANAGEMENT_NETWORK_ERROR"); + return; + } + #endregion + + #region Setup Private network + TaskManager.Write("VPS_CREATE_SETUP_PRIVATE_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress + + try + { + if (vm.PrivateNetworkEnabled) + { + NetworkAdapterDetails privNic = GetPrivateNetworkDetailsInternal(vm.ServiceId); + + if (!privNic.IsDHCP) + { + // provision IP addresses + ResultObject extResult = AddVirtualMachinePrivateIPAddresses(vm.Id, randomPrivateAddresses, privateAddressesNumber, privateAddresses, false); + + // set primary IP address + privNic = GetPrivateNetworkAdapterDetails(vm.Id); + if (privNic.IPAddresses.Length > 0) + SetVirtualMachinePrimaryPrivateIPAddress(vm.Id, privNic.IPAddresses[0].AddressId, false); + } + + // connecto to network + vm.PrivateSwitchId = settings["PrivateNetworkId"]; + + if (String.IsNullOrEmpty(vm.PrivateSwitchId)) + { + // create/load private virtual switch + vm.PrivateSwitchId = EnsurePrivateVirtualSwitch(vm); + if (vm.PrivateSwitchId == null) + return; // exit on error + } + vm.PrivateNicMacAddress = GenerateMacAddress(); + } + else + { + TaskManager.Write("VPS_CREATE_SETUP_PRIVATE_NETWORK_SKIP"); + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_SETUP_PRIVATE_NETWORK_ERROR"); + return; + } + #endregion + + // update service item + VirtualMachineProvisioningStatus status = vm.ProvisioningStatus; + vm.ProvisioningStatus = VirtualMachineProvisioningStatus.InProgress; + PackageController.UpdatePackageItem(vm); + vm.ProvisioningStatus = status; + + #region Copy/convert VHD + JobResult result = null; + ReturnCode code = ReturnCode.OK; + TaskManager.Write("VPS_CREATE_OS_TEMPLATE", osTemplate.Name); + TaskManager.Write("VPS_CREATE_CONVERT_VHD"); + TaskManager.Write("VPS_CREATE_CONVERT_SOURCE_VHD", vm.OperatingSystemTemplatePath); + TaskManager.Write("VPS_CREATE_CONVERT_DEST_VHD", vm.VirtualHardDrivePath); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress + try + { + // convert VHD + VirtualHardDiskType vhdType = (VirtualHardDiskType)Enum.Parse(typeof(VirtualHardDiskType), settings["VirtualDiskType"], true); + result = vs.ConvertVirtualHardDisk(vm.OperatingSystemTemplatePath, vm.VirtualHardDrivePath, vhdType); + + // check return + if (result.ReturnValue != ReturnCode.JobStarted) + { + TaskManager.WriteError("VPS_CREATE_CONVERT_VHD_ERROR_JOB_START", result.ReturnValue.ToString()); + return; + } + + // wait for completion + if (!JobCompleted(vs, result.Job)) + { + TaskManager.WriteError("VPS_CREATE_CONVERT_VHD_ERROR_JOB_EXEC", result.Job.ErrorDescription.ToString()); + return; + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_CONVERT_VHD_ERROR"); + return; + } + #endregion + + #region Get VHD info + VirtualHardDiskInfo vhdInfo = null; + try + { + vhdInfo = vs.GetVirtualHardDiskInfo(vm.VirtualHardDrivePath); + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_GET_VHD_INFO"); + return; + } + + if (vhdInfo == null || vhdInfo.InUse) + { + // master VHD is in use + TaskManager.WriteError("VPS_CREATE_MASTER_VHD_IN_USE"); + return; + } + + // check if it should be expanded + int hddSizeGB = Convert.ToInt32(vhdInfo.MaxInternalSize / Size1G); + + TaskManager.Write("VPS_CREATE_EXPAND_SOURCE_VHD_SIZE", hddSizeGB.ToString()); + TaskManager.Write("VPS_CREATE_EXPAND_DEST_VHD_SIZE", vm.HddSize.ToString()); + #endregion + + #region Expand VHD + bool expanded = false; + if (vm.HddSize > hddSizeGB) + { + TaskManager.Write("VPS_CREATE_EXPAND_VHD"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress + + // expand VHD + try + { + result = vs.ExpandVirtualHardDisk(vm.VirtualHardDrivePath, (ulong)vm.HddSize); + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_EXPAND_VHD_ERROR"); + return; + } + + // check return + if (result.ReturnValue != ReturnCode.JobStarted) + { + // error starting Expand job + TaskManager.WriteError("VPS_CREATE_EXPAND_VHD_ERROR_JOB_START", result.ReturnValue.ToString()); + return; + } + + // wait for completion + if (!JobCompleted(vs, result.Job)) + { + // error executing Expand job + TaskManager.WriteError("VPS_CREATE_EXPAND_VHD_ERROR_JOB_EXEC", result.Job.ErrorDescription); + return; + } + expanded = true; + } + else + { + // skip expanding + TaskManager.Write("VPS_CREATE_EXPAND_VHD_SKIP"); + } + #endregion + + #region Process VHD contents + // mount VHD + if ((expanded && osTemplate.ProcessVolume != -1) + || (osTemplate.SysprepFiles != null && osTemplate.SysprepFiles.Length > 0)) + { + try + { + #region Mount VHD + MountedDiskInfo mountedInfo = vs.MountVirtualHardDisk(vm.VirtualHardDrivePath); + if (mountedInfo == null) + { + // mount returned NULL + TaskManager.WriteError("VPS_CREATE_MOUNT_VHD_NULL"); + return; + } + #endregion + + #region Expand volume + if (expanded && osTemplate.ProcessVolume != -1 && mountedInfo.DiskVolumes.Length > 0) + { + try + { + vs.ExpandDiskVolume(mountedInfo.DiskAddress, mountedInfo.DiskVolumes[osTemplate.ProcessVolume]); + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_DISKPART_ERROR"); + } + } + else + { + TaskManager.Write("VPS_CREATE_EXPAND_VHD_SKIP_NO_VOLUMES"); + } + #endregion + + #region Sysprep + if (mountedInfo.DiskVolumes.Length > 0 + && osTemplate.ProcessVolume != -1 + && osTemplate.SysprepFiles != null && osTemplate.SysprepFiles.Length > 0) + { + foreach (string remoteFile in osTemplate.SysprepFiles) + { + try + { + TaskManager.Write("VPS_CREATE_SYSPREP_FILE", remoteFile); + + // build remote path + string path = remoteFile; + if (!remoteFile.StartsWith("\\")) + path = remoteFile.Substring(remoteFile.IndexOf("\\")); + + path = String.Format("{0}:{1}", mountedInfo.DiskVolumes[osTemplate.ProcessVolume], path); + + // read remote file + string contents = vs.ReadRemoteFile(path); + if (contents == null) + { + TaskManager.Write("VPS_CREATE_SYSPREP_FILE_NOT_FOUND", remoteFile); + continue; + } + + // process file contents + contents = EvaluateVirtualMachineTemplate(vm.Id, false, false, contents); + + // write remote file + vs.WriteRemoteFile(path, contents); + } + catch (Exception ex) + { + TaskManager.WriteError("VPS_CREATE_SYSPREP_FILE_ERROR", ex.Message); + } + } + } + #endregion + + #region Unmount VHD + try + { + code = vs.UnmountVirtualHardDisk(vm.VirtualHardDrivePath); + if (code != ReturnCode.OK) + { + TaskManager.WriteError("VPS_CREATE_UNMOUNT_ERROR_JOB_START", code.ToString()); + return; + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_UNMOUNT_ERROR"); + return; + } + #endregion + } + catch (Exception ex) + { + // error mounting + TaskManager.WriteError(ex, "VPS_CREATE_MOUNT_VHD"); + return; + } + } // end if (expanded ... + #endregion + + #region Create Virtual Machine + TaskManager.Write("VPS_CREATE_CPU_CORES", vm.CpuCores.ToString()); + TaskManager.Write("VPS_CREATE_RAM_SIZE", vm.RamSize.ToString()); + TaskManager.Write("VPS_CREATE_CREATE_VM"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress + // create virtual machine + try + { + // create + vm = vs.CreateVirtualMachine(vm); + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_CREATE_VM_ERROR"); + return; + } + + // update meta item + PackageController.UpdatePackageItem(vm); + + TaskManager.Write("VPS_CREATE_CREATED_VM"); + #endregion + + // set OK flag + vm.ProvisioningStatus = VirtualMachineProvisioningStatus.OK; + + #region Send KVP + // configure computer name + if (osTemplate.ProvisionComputerName) + { + TaskManager.Write("VPS_CREATE_SET_COMPUTER_NAME_KVP"); + SendComputerNameKVP(vm.Id, vm.Name); + } + + // change administrator password + if (osTemplate.ProvisionAdministratorPassword) + { + TaskManager.Write("VPS_CREATE_SET_PASSWORD_KVP"); + SendAdministratorPasswordKVP(vm.Id, CryptoUtils.Decrypt(vm.AdministratorPassword)); + } + + // configure network adapters + if(osTemplate.ProvisionNetworkAdapters) + { + // external NIC + TaskManager.Write("VPS_CREATE_SET_EXTERNAL_NIC_KVP"); + if (vm.ExternalNetworkEnabled) + { + result = SendNetworkAdapterKVP(vm.Id, "External"); + + if (result.ReturnValue != ReturnCode.JobStarted) + TaskManager.WriteWarning("VPS_CREATE_SET_EXTERNAL_NIC_KVP_ERROR", result.ReturnValue.ToString()); + } + + // management NIC + TaskManager.Write("VPS_CREATE_SET_MANAGEMENT_NIC_KVP"); + if (vm.ManagementNetworkEnabled) + { + result = SendNetworkAdapterKVP(vm.Id, "Management"); + + if (result.ReturnValue != ReturnCode.JobStarted) + TaskManager.WriteWarning("VPS_CREATE_SET_MANAGEMENT_NIC_KVP_ERROR", result.ReturnValue.ToString()); + } + + // private NIC + TaskManager.Write("VPS_CREATE_SET_PRIVATE_NIC_KVP"); + if (vm.PrivateNetworkEnabled) + { + result = SendNetworkAdapterKVP(vm.Id, "Private"); + + if (result.ReturnValue != ReturnCode.JobStarted) + TaskManager.WriteWarning("VPS_CREATE_SET_PRIVATE_NIC_KVP_ERROR", result.ReturnValue.ToString()); + } + } + #endregion + + #region Start VPS + TaskManager.Write("VPS_CREATE_START_VPS"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress + + try + { + // start virtual machine + result = vs.ChangeVirtualMachineState(vm.VirtualMachineId, VirtualMachineRequestedState.Start); + + // check return + if (result.ReturnValue == ReturnCode.JobStarted) + { + // wait for completion + if (!JobCompleted(vs, result.Job)) + { + TaskManager.WriteWarning("VPS_CREATE_START_VPS_ERROR_JOB_EXEC", result.Job.ErrorDescription.ToString()); + } + } + else + { + TaskManager.WriteWarning("VPS_CREATE_START_VPS_ERROR_JOB_START", result.ReturnValue.ToString()); + } + } + catch (Exception ex) + { + TaskManager.WriteWarning("VPS_CREATE_START_VPS_ERROR", ex.Message); + } + TaskManager.Write("VPS_CREATE_STARTED_VPS"); + #endregion + + #region Send Summary letter + // send summary e-mail + if (!String.IsNullOrEmpty(summaryLetterEmail)) + { + SendVirtualMachineSummaryLetter(vm.Id, summaryLetterEmail, null, true); + } + #endregion + + } + catch (Exception ex) + { + TaskManager.WriteError(ex, VirtualizationErrorCodes.CREATE_ERROR); + return; + } + finally + { + // reset task ID + vm.CurrentTaskId = null; + PackageController.UpdatePackageItem(vm); + + if (vm.ProvisioningStatus == VirtualMachineProvisioningStatus.OK) + TaskManager.Write("VPS_CREATE_SUCCESS"); + else if (vm.ProvisioningStatus == VirtualMachineProvisioningStatus.Error) + TaskManager.Write("VPS_CREATE_ERROR_END"); + + // complete task + TaskManager.CompleteTask(); + } + } + + private static void CheckNumericQuota(PackageContext cntx, List errors, string quotaName, long currentVal, long val, string messageKey) + { + CheckQuotaValue(cntx, errors, quotaName, currentVal, val, messageKey); + } + private static void CheckNumericQuota(PackageContext cntx, List errors, string quotaName, int currentVal, int val, string messageKey) + { + CheckQuotaValue(cntx, errors, quotaName, Convert.ToInt64(currentVal), Convert.ToInt64(val), messageKey); + } + + private static void CheckNumericQuota(PackageContext cntx, List errors, string quotaName, int val, string messageKey) + { + CheckQuotaValue(cntx, errors, quotaName, 0, val, messageKey); + } + + private static void CheckBooleanQuota(PackageContext cntx, List errors, string quotaName, bool val, string messageKey) + { + CheckQuotaValue(cntx, errors, quotaName, 0, val ? 1 : 0, messageKey); + } + + private static void CheckListsQuota(PackageContext cntx, List errors, string quotaName, string messageKey) + { + CheckQuotaValue(cntx, errors, quotaName, 0, -1, messageKey); + } + + private static void CheckQuotaValue(PackageContext cntx, List errors, string quotaName, long currentVal, long val, string messageKey) + { + if (!cntx.Quotas.ContainsKey(quotaName)) + return; + + QuotaValueInfo quota = cntx.Quotas[quotaName]; + + if(val == -1 && quota.QuotaExhausted) // check if quota already reached + { + errors.Add(messageKey + ":" + quota.QuotaAllocatedValue); + } + else if(quota.QuotaAllocatedValue == -1) + return; // unlimited + else if (quota.QuotaTypeId == 1 && val == 1 && quota.QuotaAllocatedValue == 0) // bool quota + errors.Add(messageKey); + else if (quota.QuotaTypeId == 2) + { + long maxValue = quota.QuotaAllocatedValue - quota.QuotaUsedValue + currentVal; + if(val > maxValue) + errors.Add(messageKey + ":" + maxValue); + } + else if (quota.QuotaTypeId == 3 && val > quota.QuotaAllocatedValue) + { + int maxValue = quota.QuotaAllocatedValue; + errors.Add(messageKey + ":" + maxValue); + } + } + + public static IntResult ImportVirtualMachine(int packageId, + int serviceId, string vmId, + string osTemplateFile, string adminPassword, + bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, + string externalNicMacAddress, int[] externalAddresses, + string managementNicMacAddress, int managementAddress) + { + // result object + IntResult res = new IntResult(); + + // meta item + VirtualMachine item = null; + + try + { + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive | DemandAccount.IsAdmin)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, packageId, DemandPackage.IsActive)) + return res; + + #endregion + + // load package context + PackageContext cntx = PackageController.GetPackageContext(packageId); + + item = new VirtualMachine(); + item.ServiceId = serviceId; + item.PackageId = packageId; + item.VirtualMachineId = vmId; + + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + + // load virtual machine info from service + VirtualizationServer vs = GetVirtualizationProxy(serviceId); + VirtualMachine vm = vs.GetVirtualMachineEx(vmId); + + // set VM properties + item.Name = vm.Name; + item.ProvisioningStatus = VirtualMachineProvisioningStatus.OK; + + item.CpuCores = vm.CpuCores; + item.RamSize = vm.RamSize; + item.HddSize = vm.HddSize; + item.VirtualHardDrivePath = vm.VirtualHardDrivePath; + item.RootFolderPath = Path.GetDirectoryName(vm.VirtualHardDrivePath); + item.SnapshotsNumber = cntx.Quotas[Quotas.VPS2012_SNAPSHOTS_NUMBER].QuotaAllocatedValue; + item.DvdDriveInstalled = vm.DvdDriveInstalled; + item.BootFromCD = vm.BootFromCD; + item.NumLockEnabled = vm.NumLockEnabled; + item.StartTurnOffAllowed = startShutdownAllowed; + item.PauseResumeAllowed = pauseResumeAllowed; + item.RebootAllowed = rebootAllowed; + item.ResetAllowed = resetAllowed; + item.ReinstallAllowed = reinstallAllowed; + + // remote desktop + if(!String.IsNullOrEmpty(adminPassword)) + { + item.RemoteDesktopEnabled = true; + item.AdministratorPassword = CryptoUtils.Encrypt(adminPassword); + } + + // set OS template + string templatesPath = settings["OsTemplatesPath"]; + var correctVhdPath = GetCorrectTemplateFilePath(templatesPath, osTemplateFile); + item.OperatingSystemTemplatePath = correctVhdPath; + try + { + LibraryItem[] osTemplates = GetOperatingSystemTemplatesByServiceId(serviceId); + foreach (LibraryItem osTemplate in osTemplates) + { + if (String.Compare(osTemplate.Path, osTemplateFile, true) == 0) + { + item.OperatingSystemTemplate = osTemplate.Name; + item.LegacyNetworkAdapter = osTemplate.LegacyNetworkAdapter; + break; + } + } + } + catch (Exception ex) + { + res.AddError(VirtualizationErrorCodes.GET_OS_TEMPLATES_ERROR, ex); + return res; + } + + // save item + int itemId = PackageController.AddPackageItem(item); + item.Id = itemId; + res.Value = itemId; + + #region Setup external network + // setup external network + if (!String.IsNullOrEmpty(externalNicMacAddress)) + { + item.ExternalNetworkEnabled = true; + item.ExternalNicMacAddress = externalNicMacAddress; + item.ExternalSwitchId = settings["ExternalNetworkId"]; + + // assign selected IP addresses to package + ServerController.AllocatePackageIPAddresses(packageId, externalAddresses); + + // re-read package IPs + List packageIPs = ServerController.GetPackageUnassignedIPAddresses( + packageId, IPAddressPool.VpsExternalNetwork); + + // assign IP addresses to VM + for(int i = 0; i < externalAddresses.Length; i++) + { + foreach (PackageIPAddress ip in packageIPs) + { + if (ip.AddressID == externalAddresses[i]) + { + // assign to the item + ServerController.AddItemIPAddress(itemId, ip.PackageAddressID); + + // set primary IP address + if(i == 0) + ServerController.SetItemPrimaryIPAddress(itemId, ip.PackageAddressID); + + break; + } + } + } + } + #endregion + + #region Setup management network + // setup management network + if (!String.IsNullOrEmpty(managementNicMacAddress)) + { + item.ManagementNetworkEnabled = true; + item.ManagementNicMacAddress = managementNicMacAddress; + item.ManagementSwitchId = settings["ManagementNetworkId"]; + + // assign selected IP addresses to package + ServerController.AllocatePackageIPAddresses(packageId, new int[] { managementAddress }); + + // re-read package IPs + List packageIPs = ServerController.GetPackageUnassignedIPAddresses( + packageId, IPAddressPool.VpsManagementNetwork); + + // assign IP addresses to VM + foreach (PackageIPAddress ip in packageIPs) + { + if (ip.AddressID == managementAddress) + { + // assign to the item + ServerController.AddItemIPAddress(itemId, ip.PackageAddressID); + + break; + } + } + } + #endregion + + // save item once again + PackageController.UpdatePackageItem(item); + } + catch (Exception ex) + { + res.AddError(VirtualizationErrorCodes.IMPORT_ERROR, ex); + return res; + } + + res.IsSuccess = true; + return res; + } + + private static JobResult SendNetworkAdapterKVP(int itemId, string adapterName) + { + // load item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + if (vm == null) + return null; + + // build task parameters + Dictionary props = new Dictionary(); + NetworkAdapterDetails nic = null; + + if(String.Compare(adapterName, "external", true) == 0) + { + // external + nic = GetExternalNetworkAdapterDetails(itemId); + } + else if(String.Compare(adapterName, "private", true) == 0) + { + // private + nic = GetPrivateNetworkAdapterDetails(itemId); + } + else + { + // management + nic = GetManagementNetworkAdapterDetails(itemId); + } + + // network format + if (nic != null && !String.IsNullOrEmpty(nic.MacAddress)) + { + props["MAC"] = nic.MacAddress.Replace("-", ":"); + props["EnableDHCP"] = nic.IsDHCP.ToString(); + if (!nic.IsDHCP) + { + string[] ips = new string[nic.IPAddresses.Length]; + string[] subnetMasks = new string[nic.IPAddresses.Length]; + for (int i = 0; i < ips.Length; i++) + { + ips[i] = nic.IPAddresses[i].IPAddress; + subnetMasks[i] = nic.IPAddresses[i].SubnetMask; + + // set gateway from the first (primary) IP + if (i == 0) + props["DefaultIPGateway"] = nic.IPAddresses[i].DefaultGateway; + } + + props["IPAddress"] = String.Join(";", ips); + props["SubnetMask"] = String.Join(";", subnetMasks); + + // name servers + props["PreferredDNSServer"] = nic.PreferredNameServer; + if (!String.IsNullOrEmpty(nic.AlternateNameServer)) + props["PreferredDNSServer"] += ";" + nic.AlternateNameServer; + } + } + + // DNS + if (!props.ContainsKey("PreferredDNSServer") + || String.IsNullOrEmpty(props["PreferredDNSServer"])) + { + props["PreferredDNSServer"] = "0.0.0.0"; // obtain automatically + } + + // send items + return SendKvpItems(itemId, "SetupNetworkAdapter", props); + } + + private static string GetSymbolDelimitedMacAddress(string mac, string delimiter) + { + if (String.IsNullOrEmpty(mac)) + return mac; + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 6; i++) + { + sb.Append(mac[i * 2]).Append(mac[i * 2 + 1]); + if (i < 5) sb.Append(delimiter); + } + return sb.ToString(); + } + + private static JobResult SendComputerNameKVP(int itemId, string computerName) + { + // load item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + if (vm == null) + return null; + + // build task parameters + Dictionary props = new Dictionary(); + + props["FullComputerName"] = computerName; + + // send items + return SendKvpItems(itemId, "ChangeComputerName", props); + } + + private static JobResult SendAdministratorPasswordKVP(int itemId, string password) + { + // load item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + if (vm == null) + return null; + + // build task parameters + Dictionary props = new Dictionary(); + + props["Password"] = password; + + // send items + return SendKvpItems(itemId, "ChangeAdministratorPassword", props); + } + + private static JobResult SendKvpItems(int itemId, string taskName, Dictionary taskProps) + { + string TASK_PREFIX = "WSP-"; + + // load item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + if (vm == null) + return null; + + JobResult result = null; + + // load proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + try + { + // delete completed task definitions + List completedTasks = new List(); + KvpExchangeDataItem[] vmKvps = vs.GetKVPItems(vm.VirtualMachineId); + foreach (KvpExchangeDataItem vmKvp in vmKvps) + { + if (vmKvp.Name.StartsWith(TASK_PREFIX)) + completedTasks.Add(vmKvp.Name); + } + + // delete completed items + vs.RemoveKVPItems(vm.VirtualMachineId, completedTasks.ToArray()); + } + catch (Exception ex) + { + // log error + TaskManager.WriteWarning(String.Format("Error deleting KVP items: {0}", ex.Message)); + } + + // build items array + List items = new List(); + foreach (string propName in taskProps.Keys) + items.Add(propName + "=" + taskProps[propName]); + + taskName = String.Format("{0}{1}-{2}", TASK_PREFIX, taskName, DateTime.Now.Ticks); + string taskData = String.Join("|", items.ToArray()); + + // create KVP item + KvpExchangeDataItem[] kvp = new KvpExchangeDataItem[1]; + kvp[0] = new KvpExchangeDataItem(); + kvp[0].Name = taskName; + kvp[0].Data = taskData; + + try + { + // try adding KVP items + result = vs.AddKVPItems(vm.VirtualMachineId, kvp); + + if (result.Job != null && result.Job.JobState == ConcreteJobState.Exception) + { + // try updating KVP items + return vs.ModifyKVPItems(vm.VirtualMachineId, kvp); + } + else + { + return result; + } + } + catch (Exception ex) + { + // log error + TaskManager.WriteWarning(String.Format("Error setting KVP items '{0}': {1}", kvp[0].Data, ex.Message)); + } + + return null; + } + + private static string EnsurePrivateVirtualSwitch(ServiceProviderItem item) + { + // try locate switch in the package + List items = PackageController.GetPackageItemsByType(item.PackageId, typeof(VirtualSwitch)); + + // exists - return ID + if (items.Count > 0) + return ((VirtualSwitch)items[0]).SwitchId; + + // switch name + string name = EvaluateItemVariables("[username] - [space_name]", item); + + // log + TaskManager.Write("VPS_CREATE_PRIVATE_VIRTUAL_SWITCH", name); + + try + { + // create switch + // load proxy + VirtualizationServer vs = GetVirtualizationProxy(item.ServiceId); + + // create switch + VirtualSwitch sw = vs.CreateSwitch(name); + sw.ServiceId = item.ServiceId; + sw.PackageId = item.PackageId; + + // save item + PackageController.AddPackageItem(sw); + + return sw.SwitchId; + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "VPS_CREATE_PRIVATE_VIRTUAL_SWITCH_ERROR"); + return null; + } + } + + private static string EvaluateItemVariables(string str, ServiceProviderItem item) + { + str = Utils.ReplaceStringVariable(str, "vps_hostname", item.Name); + + return EvaluateSpaceVariables(str, item.PackageId); + } + + private static string EvaluateSpaceVariables(string str, int packageId) + { + // load package + PackageInfo package = PackageController.GetPackage(packageId); + UserInfo user = UserController.GetUser(package.UserId); + str = Utils.ReplaceStringVariable(str, "space_id", packageId.ToString()); + str = Utils.ReplaceStringVariable(str, "space_name", package.PackageName); + str = Utils.ReplaceStringVariable(str, "user_id", user.UserId.ToString()); + str = Utils.ReplaceStringVariable(str, "username", user.Username); + + return str; + } + #endregion + + #region VPS – General + + public static List GetVirtualMachineJobs(int itemId) + { + // load meta item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + + if (vm == null) + return null; + + // get proxy + VirtualizationServer vps = GetVirtualizationProxy(vm.ServiceId); + + // load jobs + ConcreteJob[] jobs = vps.GetVirtualMachineJobs(vm.VirtualMachineId); + List retJobs = new List(); + + foreach (ConcreteJob job in jobs) + { + if (job.JobState == ConcreteJobState.Running) + { + retJobs.Add(job); + } + } + + return retJobs; + } + + public static byte[] GetVirtualMachineThumbnail(int itemId, ThumbnailSize size) + { + // load meta item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + + if (vm == null) + return null; + + // get proxy + VirtualizationServer vps = GetVirtualizationProxy(vm.ServiceId); + + // return thumbnail + return vps.GetVirtualMachineThumbnailImage(vm.VirtualMachineId, size); + } + + public static VirtualMachine GetVirtualMachineGeneralDetails(int itemId) + { + // load meta item + VirtualMachine machine = GetVirtualMachineByItemId(itemId); + + if (machine == null || String.IsNullOrEmpty(machine.VirtualMachineId)) + return null; + + // get proxy + VirtualizationServer vps = GetVirtualizationProxy(machine.ServiceId); + + // load details + VirtualMachine vm = vps.GetVirtualMachine(machine.VirtualMachineId); + + // add meta props + vm.Id = machine.Id; + vm.Name = machine.Name; + vm.RamSize = machine.RamSize; + vm.ServiceId = machine.ServiceId; + + return vm; + } + + public static VirtualMachine GetVirtualMachineExtendedInfo(int serviceId, string vmId) + { + // get proxy + VirtualizationServer vps = GetVirtualizationProxy(serviceId); + + // load details + return vps.GetVirtualMachineEx(vmId); + } + + public static int CancelVirtualMachineJob(string jobId) + { + // VPS - CANCEL_JOB + return 0; + } + + public static ResultObject UpdateVirtualMachineHostName(int itemId, string hostname, bool updateNetBIOS) + { + if (String.IsNullOrEmpty(hostname)) + throw new ArgumentNullException("hostname"); + + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "UPDATE_HOSTNAME", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // update virtual machine name + JobResult result = vs.RenameVirtualMachine(vm.VirtualMachineId, hostname); + if (result.ReturnValue != ReturnCode.OK) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + // update meta item + vm.Name = hostname; + PackageController.UpdatePackageItem(vm); + + // update NetBIOS name if required + if (updateNetBIOS) + { + result = SendComputerNameKVP(itemId, hostname); + if (result.ReturnValue != ReturnCode.JobStarted + && result.Job.JobState == ConcreteJobState.Completed) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CHANGE_ADMIN_PASSWORD_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject ChangeVirtualMachineStateExternal(int itemId, VirtualMachineRequestedState state) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + #region Check Quotas + // check quotas + List quotaResults = new List(); + + if ((state == VirtualMachineRequestedState.Start + || state == VirtualMachineRequestedState.TurnOff + || state == VirtualMachineRequestedState.ShutDown) + && !vm.StartTurnOffAllowed) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_EXCEEDED_START_SHUTDOWN_ALLOWED); + + else if ((state == VirtualMachineRequestedState.Pause + || state == VirtualMachineRequestedState.Resume) + && !vm.PauseResumeAllowed) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_EXCEEDED_PAUSE_RESUME_ALLOWED); + + else if (state == VirtualMachineRequestedState.Reboot + && !vm.RebootAllowed) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_EXCEEDED_REBOOT_ALLOWED); + + else if (state == VirtualMachineRequestedState.Reset + && !vm.ResetAllowed) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_EXCEEDED_RESET_ALOWED); + + if (quotaResults.Count > 0) + { + res.ErrorCodes.AddRange(quotaResults); + res.IsSuccess = false; + TaskManager.CompleteResultTask(); + return res; + } + #endregion + + return ChangeVirtualMachineState(itemId, state); + } + + private static ResultObject ChangeVirtualMachineState(int itemId, VirtualMachineRequestedState state) + { + // start task + ResultObject res = TaskManager.StartResultTask("VPS", "CHANGE_STATE"); + + try + { + // load service item + VirtualMachine machine = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (machine == null) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + BackgroundTask topTask = TaskManager.TopTask; + topTask.ItemId = machine.Id; + topTask.ItemName = machine.Name; + topTask.PackageId = machine.PackageId; + + TaskController.UpdateTask(topTask); + + TaskManager.WriteParameter("New state", state); + + // load proxy + VirtualizationServer vps = GetVirtualizationProxy(machine.ServiceId); + + try + { + if (state == VirtualMachineRequestedState.ShutDown) + { + ReturnCode code = vps.ShutDownVirtualMachine(machine.VirtualMachineId, true, SHUTDOWN_REASON); + if (code != ReturnCode.OK) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.JOB_START_ERROR + ":" + code); + TaskManager.CompleteResultTask(res); + return res; + } + + // spin until fully stopped + VirtualMachine vm = vps.GetVirtualMachine(machine.VirtualMachineId); + while (vm.State != VirtualMachineState.Off) + { + System.Threading.Thread.Sleep(1000); // sleep 1 second + vm = vps.GetVirtualMachine(machine.VirtualMachineId); + } + } + else if (state == VirtualMachineRequestedState.Reboot) + { + // shutdown first + ResultObject shutdownResult = ChangeVirtualMachineState(itemId, + VirtualMachineRequestedState.ShutDown); + if (!shutdownResult.IsSuccess) + { + TaskManager.CompleteResultTask(res); + return shutdownResult; + } + + // start machine + ResultObject startResult = ChangeVirtualMachineState(itemId, VirtualMachineRequestedState.Start); + if (!startResult.IsSuccess) + { + TaskManager.CompleteResultTask(res); + return startResult; + } + } + else + { + if (state == VirtualMachineRequestedState.Resume) + state = VirtualMachineRequestedState.Start; + + JobResult result = vps.ChangeVirtualMachineState(machine.VirtualMachineId, state); + + if (result.Job.JobState == ConcreteJobState.Completed) + { + LogReturnValueResult(res, result); + TaskManager.CompleteTask(); + return res; + } + else + { + // check return + if (result.ReturnValue != ReturnCode.JobStarted) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + // wait for completion + if (!JobCompleted(vps, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + } + } + catch(Exception ex) + { + res.IsSuccess = false; + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_CHANGE_VIRTUAL_SERVER_STATE); + TaskManager.WriteError(ex); + } + } + catch (Exception ex) + { + res.IsSuccess = false; + res.ErrorCodes.Add(VirtualizationErrorCodes.CHANGE_VIRTUAL_MACHINE_STATE_GENERAL_ERROR); + TaskManager.WriteError(ex); + return res; + } + + TaskManager.CompleteTask(); + return res; + } + #endregion + + #region VPS - Configuration + public static ResultObject ChangeAdministratorPassword(int itemId, string password) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "CHANGE_ADMIN_PASSWORD", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // change administrator password + JobResult result = SendAdministratorPasswordKVP(itemId, password); + if (result.ReturnValue != ReturnCode.JobStarted + && result.Job.JobState == ConcreteJobState.Completed) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + // update meta item + vm.AdministratorPassword = CryptoUtils.Encrypt(password); + PackageController.UpdatePackageItem(vm); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CHANGE_ADMIN_PASSWORD_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + #endregion + + #region VPS – Edit Configuration + public static ResultObject UpdateVirtualMachineConfiguration(int itemId, int cpuCores, int ramMB, int hddGB, int snapshots, + bool dvdInstalled, bool bootFromCD, bool numLock, + bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, + bool externalNetworkEnabled, + bool privateNetworkEnabled) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + #region Check Quotas + // check quotas + List quotaResults = new List(); + PackageContext cntx = PackageController.GetPackageContext(vm.PackageId); + + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_CPU_NUMBER, cpuCores, VirtualizationErrorCodes.QUOTA_EXCEEDED_CPU); + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_RAM, vm.RamSize, ramMB, VirtualizationErrorCodes.QUOTA_EXCEEDED_RAM); + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_HDD, vm.HddSize, hddGB, VirtualizationErrorCodes.QUOTA_EXCEEDED_HDD); + CheckNumericQuota(cntx, quotaResults, Quotas.VPS2012_SNAPSHOTS_NUMBER, snapshots, VirtualizationErrorCodes.QUOTA_EXCEEDED_SNAPSHOTS); + + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_DVD_ENABLED, dvdInstalled, VirtualizationErrorCodes.QUOTA_EXCEEDED_DVD_ENABLED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_BOOT_CD_ALLOWED, bootFromCD, VirtualizationErrorCodes.QUOTA_EXCEEDED_CD_ALLOWED); + + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_START_SHUTDOWN_ALLOWED, startShutdownAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_START_SHUTDOWN_ALLOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_PAUSE_RESUME_ALLOWED, pauseResumeAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_PAUSE_RESUME_ALLOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_REBOOT_ALLOWED, rebootAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_REBOOT_ALLOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_RESET_ALOWED, resetAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_RESET_ALOWED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_REINSTALL_ALLOWED, reinstallAllowed, VirtualizationErrorCodes.QUOTA_EXCEEDED_REINSTALL_ALLOWED); + + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED, externalNetworkEnabled, VirtualizationErrorCodes.QUOTA_EXCEEDED_EXTERNAL_NETWORK_ENABLED); + CheckBooleanQuota(cntx, quotaResults, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED, privateNetworkEnabled, VirtualizationErrorCodes.QUOTA_EXCEEDED_PRIVATE_NETWORK_ENABLED); + + // check acceptable values + if (ramMB <= 0) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_WRONG_RAM); + if (hddGB <= 0) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_WRONG_HDD); + if (snapshots < 0) + quotaResults.Add(VirtualizationErrorCodes.QUOTA_WRONG_SNAPSHOTS); + + if (quotaResults.Count > 0) + { + res.ErrorCodes.AddRange(quotaResults); + return res; + } + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "UPDATE_CONFIGURATION", vm.Id, vm.Name, vm.PackageId); + + try + { + JobResult result = null; + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // stop VPS if required + VirtualMachine vps = vs.GetVirtualMachine(vm.VirtualMachineId); + + bool wasStarted = false; + + // stop (shut down) virtual machine + if (vps.State != VirtualMachineState.Off) + { + wasStarted = true; + ReturnCode code = vs.ShutDownVirtualMachine(vm.VirtualMachineId, true, SHUTDOWN_REASON_CHANGE_CONFIG); + if (code == ReturnCode.OK) + { + // spin until fully stopped + vps = vs.GetVirtualMachine(vm.VirtualMachineId); + while (vps.State != VirtualMachineState.Off) + { + System.Threading.Thread.Sleep(1000); // sleep 1 second + vps = vs.GetVirtualMachine(vm.VirtualMachineId); + } + } + else + { + // turn off + result = vs.ChangeVirtualMachineState(vm.VirtualMachineId, VirtualMachineRequestedState.TurnOff); + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + } // end OFF + + // update meta-item + vm.CpuCores = cpuCores; + vm.RamSize = ramMB; + vm.HddSize = hddGB; + vm.SnapshotsNumber = snapshots; + + vm.BootFromCD = bootFromCD; + vm.NumLockEnabled = numLock; + vm.DvdDriveInstalled = dvdInstalled; + + vm.StartTurnOffAllowed = startShutdownAllowed; + vm.PauseResumeAllowed = pauseResumeAllowed; + vm.ResetAllowed = resetAllowed; + vm.RebootAllowed = rebootAllowed; + vm.ReinstallAllowed = reinstallAllowed; + + vm.ExternalNetworkEnabled = externalNetworkEnabled; + vm.PrivateNetworkEnabled = privateNetworkEnabled; + + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(vm.ServiceId); + + #region setup external network + if (vm.ExternalNetworkEnabled + && String.IsNullOrEmpty(vm.ExternalNicMacAddress)) + { + // connect to network + vm.ExternalSwitchId = settings["ExternalNetworkId"]; + vm.ExternalNicMacAddress = GenerateMacAddress(); + } + #endregion + + #region setup private network + if (vm.PrivateNetworkEnabled + && String.IsNullOrEmpty(vm.PrivateNicMacAddress)) + { + // connecto to network + vm.PrivateSwitchId = settings["PrivateNetworkId"]; + + if (String.IsNullOrEmpty(vm.PrivateSwitchId)) + { + // create/load private virtual switch + vm.PrivateSwitchId = EnsurePrivateVirtualSwitch(vm); + } + vm.PrivateNicMacAddress = GenerateMacAddress(); + } + #endregion + + // update configuration on virtualization server + vm = vs.UpdateVirtualMachine(vm); + + // update meta item + PackageController.UpdatePackageItem(vm); + + // unprovision external IP addresses + if (!vm.ExternalNetworkEnabled) + ServerController.DeleteItemIPAddresses(itemId); + else + // send KVP config items + SendNetworkAdapterKVP(itemId, "External"); + + // unprovision private IP addresses + if (!vm.PrivateNetworkEnabled) + DataProvider.DeleteItemPrivateIPAddresses(SecurityContext.User.UserId, itemId); + else + // send KVP config items + SendNetworkAdapterKVP(itemId, "Private"); + + // start if required + if (wasStarted) + { + result = vs.ChangeVirtualMachineState(vm.VirtualMachineId, VirtualMachineRequestedState.Start); + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.CHANGE_VM_CONFIGURATION, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + #endregion + + #region DVD + public static LibraryItem GetInsertedDvdDisk(int itemId) + { + // load item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + string isoPath = vs.GetInsertedDVD(vm.VirtualMachineId); + + if (String.IsNullOrEmpty(isoPath)) + return null; + + // load library items + LibraryItem[] disks = GetLibraryDisks(itemId); + + // find required disk + isoPath = Path.GetFileName(isoPath); + foreach (LibraryItem disk in disks) + { + if (String.Compare(isoPath, disk.Path, true) == 0) + return disk; + } + return null; + } + + public static LibraryItem[] GetLibraryDisks(int itemId) + { + // load item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(vm.ServiceId); + string path = settings["DvdLibraryPath"]; + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + return vs.GetLibraryItems(path); + } + + public static ResultObject InsertDvdDisk(int itemId, string isoPath) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "INSERT_DVD_DISK", vm.Id, vm.Name, vm.PackageId); + + try + { + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(vm.ServiceId); + string libPath = settings["DvdLibraryPath"]; + + // combine full path + string fullPath = Path.Combine(libPath, isoPath); + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // insert DVD + JobResult result = vs.InsertDVD(vm.VirtualMachineId, fullPath); + if (result.ReturnValue != ReturnCode.OK) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.INSERT_DVD_DISK_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject EjectDvdDisk(int itemId) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "EJECT_DVD_DISK", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // insert DVD + JobResult result = vs.EjectDVD(vm.VirtualMachineId); + if (result.ReturnValue != ReturnCode.OK) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.EJECT_DVD_DISK_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + #endregion + + #region Snaphosts + public static VirtualMachineSnapshot[] GetVirtualMachineSnapshots(int itemId) + { + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + return null; + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + return vs.GetVirtualMachineSnapshots(vm.VirtualMachineId); + } + + public static VirtualMachineSnapshot GetSnapshot(int itemId, string snaphostId) + { + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + return null; + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + return vs.GetSnapshot(snaphostId); + } + + public static ResultObject CreateSnapshot(int itemId) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "TAKE_SNAPSHOT", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + #region Check Quotas + // check quotas + List quotaResults = new List(); + PackageContext cntx = PackageController.GetPackageContext(vm.PackageId); + + // check the number of created snapshots + int createdNumber = vs.GetVirtualMachineSnapshots(vm.VirtualMachineId).Length; + if (createdNumber >= vm.SnapshotsNumber) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.QUOTA_EXCEEDED_SNAPSHOTS + ":" + vm.SnapshotsNumber); + return res; + } + #endregion + + // take snapshot + JobResult result = vs.CreateSnapshot(vm.VirtualMachineId); + if (result.ReturnValue != ReturnCode.JobStarted) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.TAKE_SNAPSHOT_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject ApplySnapshot(int itemId, string snapshotId) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "APPLY_SNAPSHOT", vm.Id, vm.Name, vm.PackageId); + + try + { + JobResult result = null; + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // check VM state + VirtualMachine vps = vs.GetVirtualMachine(vm.VirtualMachineId); + + // stop virtual machine + if (vps.State != VirtualMachineState.Off) + { + result = vs.ChangeVirtualMachineState(vm.VirtualMachineId, VirtualMachineRequestedState.TurnOff); + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + + // take snapshot + result = vs.ApplySnapshot(vm.VirtualMachineId, snapshotId); + if (result.ReturnValue != ReturnCode.OK) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.APPLY_SNAPSHOT_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject RenameSnapshot(int itemId, string snapshotId, string newName) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "RENAME_SNAPSHOT", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // take snapshot + JobResult result = vs.RenameSnapshot(vm.VirtualMachineId, snapshotId, newName); + if (result.ReturnValue != ReturnCode.OK) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.RENAME_SNAPSHOT_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject DeleteSnapshot(int itemId, string snapshotId) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "DELETE_SNAPSHOT", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // take snapshot + JobResult result = vs.DeleteSnapshot(snapshotId); + if (result.ReturnValue != ReturnCode.JobStarted) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.DELETE_SNAPSHOT_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject DeleteSnapshotSubtree(int itemId, string snapshotId) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "DELETE_SNAPSHOT_SUBTREE", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // take snapshot + JobResult result = vs.DeleteSnapshotSubtree(snapshotId); + if (result.ReturnValue != ReturnCode.JobStarted) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.DELETE_SNAPSHOT_SUBTREE_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static byte[] GetSnapshotThumbnail(int itemId, string snapshotId, ThumbnailSize size) + { + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + return null; + + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + return vs.GetSnapshotThumbnailImage(snapshotId, size); + } + #endregion + + #region Network - External + public static NetworkAdapterDetails GetExternalNetworkDetails(int packageId) + { + // load service + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.VPS2012); + + return GetExternalNetworkDetailsInternal(serviceId); + } + + public static NetworkAdapterDetails GetExternalNetworkAdapterDetails(int itemId) + { + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + return null; + + // get default NIC + NetworkAdapterDetails nic = GetExternalNetworkDetailsInternal(vm.ServiceId); + + // update NIC + nic.MacAddress = GetSymbolDelimitedMacAddress(vm.ExternalNicMacAddress, "-"); + + // load IP addresses + nic.IPAddresses = ObjectUtils.CreateListFromDataReader( + DataProvider.GetItemIPAddresses(SecurityContext.User.UserId, itemId, (int)IPAddressPool.VpsExternalNetwork)).ToArray(); + + // update subnet CIDR + foreach (NetworkAdapterIPAddress ip in nic.IPAddresses) + ip.SubnetMaskCidr = GetSubnetMaskCidr(ip.SubnetMask); + + if (nic.IPAddresses.Length > 0) + { + // from primary address + nic.SubnetMask = nic.IPAddresses[0].SubnetMask; + nic.SubnetMaskCidr = GetSubnetMaskCidr(nic.SubnetMask); + nic.DefaultGateway = nic.IPAddresses[0].DefaultGateway; + } + + return nic; + } + + public static NetworkAdapterDetails GetManagementNetworkDetails(int packageId) + { + // load service + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.VPS2012); + return GetManagementNetworkDetailsInternal(serviceId); + } + + private static NetworkAdapterDetails GetExternalNetworkDetailsInternal(int serviceId) + { + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + + // create NIC object + NetworkAdapterDetails nic = new NetworkAdapterDetails(); + nic.NetworkId = settings["ExternalNetworkId"]; + nic.PreferredNameServer = settings["ExternalPreferredNameServer"]; + nic.AlternateNameServer = settings["ExternalAlternateNameServer"]; + return nic; + } + + public static NetworkAdapterDetails GetManagementNetworkAdapterDetails(int itemId) + { + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + return null; + + // get default NIC + NetworkAdapterDetails nic = GetManagementNetworkDetailsInternal(vm.ServiceId); + + // update NIC + nic.MacAddress = GetSymbolDelimitedMacAddress(vm.ManagementNicMacAddress, "-"); + + // load IP addresses + nic.IPAddresses = ObjectUtils.CreateListFromDataReader( + DataProvider.GetItemIPAddresses(SecurityContext.User.UserId, itemId, (int)IPAddressPool.VpsManagementNetwork)).ToArray(); + + // update subnet CIDR + foreach (NetworkAdapterIPAddress ip in nic.IPAddresses) + ip.SubnetMaskCidr = GetSubnetMaskCidr(ip.SubnetMask); + + if (nic.IPAddresses.Length > 0) + { + // from primary address + nic.SubnetMask = nic.IPAddresses[0].SubnetMask; + nic.SubnetMaskCidr = GetSubnetMaskCidr(nic.SubnetMask); + nic.DefaultGateway = nic.IPAddresses[0].DefaultGateway; + } + + return nic; + } + + private static NetworkAdapterDetails GetManagementNetworkDetailsInternal(int serviceId) + { + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + + // create NIC object + NetworkAdapterDetails nic = new NetworkAdapterDetails(); + nic.NetworkId = settings["ManagementNetworkId"]; + nic.IsDHCP = (String.Compare(settings["ManagementNicConfig"], "DHCP", true) == 0); + + if (!nic.IsDHCP) + { + nic.PreferredNameServer = settings["ManagementPreferredNameServer"]; + nic.AlternateNameServer = settings["ManagementAlternateNameServer"]; + } + return nic; + } + + public static ResultObject AddVirtualMachineExternalIPAddresses(int itemId, bool selectRandom, int addressesNumber, int[] addressIds, bool provisionKvp) + { + if (addressIds == null) + throw new ArgumentNullException("addressIds"); + + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "ADD_EXTERNAL_IP", vm.Id, vm.Name, vm.PackageId); + + try + { + if (selectRandom) + { + List ips = ServerController.GetPackageUnassignedIPAddresses(vm.PackageId, IPAddressPool.VpsExternalNetwork); + if (addressesNumber > ips.Count) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.NOT_ENOUGH_PACKAGE_IP_ADDRESSES); + return res; + } + + // get next N unassigned addresses + addressIds = new int[addressesNumber]; + for (int i = 0; i < addressesNumber; i++) + addressIds[i] = ips[i].PackageAddressID; + } + + // add addresses + foreach (int addressId in addressIds) + ServerController.AddItemIPAddress(itemId, addressId); + + // send KVP config items + if(provisionKvp) + SendNetworkAdapterKVP(itemId, "External"); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.ADD_VIRTUAL_MACHINE_EXTERNAL_IP_ADDRESS_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject SetVirtualMachinePrimaryExternalIPAddress(int itemId, int packageAddressId, bool provisionKvp) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "SET_PRIMARY_EXTERNAL_IP", vm.Id, vm.Name, vm.PackageId); + + try + { + // call database + ServerController.SetItemPrimaryIPAddress(itemId, packageAddressId); + + // send KVP config items + if(provisionKvp) + SendNetworkAdapterKVP(itemId, "External"); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.SET_VIRTUAL_MACHINE_PRIMARY_EXTERNAL_IP_ADDRESS_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject DeleteVirtualMachineExternalIPAddresses(int itemId, int[] packageAddressIds, bool provisionKvp) + { + if (packageAddressIds == null) + throw new ArgumentNullException("addressIds"); + + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "DELETE_EXTERNAL_IP", vm.Id, vm.Name, vm.PackageId); + + try + { + // call database + foreach (int packageAddressId in packageAddressIds) + ServerController.DeleteItemIPAddress(itemId, packageAddressId); + + // send KVP config items + if(provisionKvp) + SendNetworkAdapterKVP(itemId, "External"); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.DELETE_VIRTUAL_MACHINE_EXTERNAL_IP_ADDRESS_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + #endregion + + #region Network – Private + public static NetworkAdapterDetails GetPrivateNetworkDetails(int packageId) + { + // load service + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.VPS2012); + + return GetPrivateNetworkDetailsInternal(serviceId); + } + + public static NetworkAdapterDetails GetPrivateNetworkAdapterDetails(int itemId) + { + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + return null; + + // load default internal adapter + NetworkAdapterDetails nic = GetPrivateNetworkDetailsInternal(vm.ServiceId); + + // update NIC + nic.MacAddress = GetSymbolDelimitedMacAddress(vm.PrivateNicMacAddress, "-"); + + // load IP addresses + nic.IPAddresses = ObjectUtils.CreateListFromDataReader( + DataProvider.GetItemPrivateIPAddresses(SecurityContext.User.UserId, itemId)).ToArray(); + + foreach (NetworkAdapterIPAddress ip in nic.IPAddresses) + { + ip.SubnetMask = nic.SubnetMask; + ip.SubnetMaskCidr = nic.SubnetMaskCidr; + ip.DefaultGateway = nic.DefaultGateway; + } + + return nic; + } + + private static NetworkAdapterDetails GetPrivateNetworkDetailsInternal(int serviceId) + { + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + + // create NIC object + NetworkAdapterDetails nic = new NetworkAdapterDetails(); + + string networkFormat = settings["PrivateNetworkFormat"]; + if (String.IsNullOrEmpty(networkFormat)) + { + // custom format + nic.NetworkFormat = settings["PrivateIPAddress"]; + var v6 = IPAddress.Parse(nic.NetworkFormat).V6; + nic.SubnetMask = GetPrivateNetworkSubnetMask(settings["PrivateSubnetMask"], v6); + } + else + { + // standard format + string[] formatPair = settings["PrivateNetworkFormat"].Split('/'); + nic.NetworkFormat = formatPair[0]; + var v6 = IPAddress.Parse(nic.NetworkFormat).V6; + nic.SubnetMask = GetPrivateNetworkSubnetMask(formatPair[1], v6); + } + + nic.SubnetMaskCidr = GetSubnetMaskCidr(nic.SubnetMask); + nic.DefaultGateway = settings["PrivateDefaultGateway"]; + nic.PreferredNameServer = settings["PrivatePreferredNameServer"]; + nic.AlternateNameServer = settings["PrivateAlternateNameServer"]; + + return nic; + } + + public static ResultObject AddVirtualMachinePrivateIPAddresses(int itemId, bool selectRandom, int addressesNumber, string[] addresses, bool provisionKvp) + { + // trace info + Trace.TraceInformation("Entering AddVirtualMachinePrivateIPAddresses()"); + Trace.TraceInformation("Item ID: {0}", itemId); + Trace.TraceInformation("SelectRandom: {0}", selectRandom); + Trace.TraceInformation("AddressesNumber: {0}", addressesNumber); + + if (addresses != null) + { + foreach(var address in addresses) + Trace.TraceInformation("addresses[n]: {0}", address); + } + + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "ADD_PRIVATE_IP", vm.Id, vm.Name, vm.PackageId); + + try + { + // load network adapter + NetworkAdapterDetails nic = GetPrivateNetworkAdapterDetails(itemId); + + bool wasEmptyList = (nic.IPAddresses.Length == 0); + + if(wasEmptyList) + Trace.TraceInformation("NIC IP addresses list is empty"); + + // check IP addresses if they are specified + List checkResults = CheckPrivateIPAddresses(vm.PackageId, addresses); + if (checkResults.Count > 0) + { + res.ErrorCodes.AddRange(checkResults); + res.IsSuccess = false; + TaskManager.CompleteResultTask(); + return res; + } + + // load all existing private IP addresses + List ips = GetPackagePrivateIPAddresses(vm.PackageId); + + // sort them + SortedList sortedIps = GetSortedNormalizedIPAddresses(ips, nic.SubnetMask); + + if (selectRandom) + { + // generate N number of IP addresses + addresses = new string[addressesNumber]; + for (int i = 0; i < addressesNumber; i++) + addresses[i] = GenerateNextAvailablePrivateIP(sortedIps, nic.SubnetMask, nic.NetworkFormat); + } + + PackageContext cntx = PackageController.GetPackageContext(vm.PackageId); + QuotaValueInfo quota = cntx.Quotas[Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER]; + if (quota.QuotaAllocatedValue != -1) + { + int maxAddresses = quota.QuotaAllocatedValue - nic.IPAddresses.Length; + + if (addresses.Length > maxAddresses) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.QUOTA_EXCEEDED_PRIVATE_ADDRESSES_NUMBER + ":" + maxAddresses); + return res; + } + } + + // add addresses to database + foreach (string address in addresses) + DataProvider.AddItemPrivateIPAddress(SecurityContext.User.UserId, itemId, address); + + // set primary IP address + if (wasEmptyList) + { + nic = GetPrivateNetworkAdapterDetails(itemId); + if (nic.IPAddresses.Length > 0) + SetVirtualMachinePrimaryPrivateIPAddress(itemId, nic.IPAddresses[0].AddressId, false); + } + + // send KVP config items + if(provisionKvp) + SendNetworkAdapterKVP(itemId, "Private"); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.ADD_VIRTUAL_MACHINE_PRIVATE_IP_ADDRESS_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + private static List CheckPrivateIPAddresses(int packageId, string[] addresses) + { + List codes = new List(); + + // check IP addresses if they are specified + if (addresses != null && addresses.Length > 0) + { + // load network adapter + NetworkAdapterDetails nic = GetPrivateNetworkDetails(packageId); + + foreach (string address in addresses) + { + if (!CheckPrivateIPAddress(nic.SubnetMask, address)) + codes.Add(VirtualizationErrorCodes.WRONG_PRIVATE_IP_ADDRESS_FORMAT + ":" + address); + } + } + + return codes; + } + + public static ResultObject SetVirtualMachinePrimaryPrivateIPAddress(int itemId, int addressId, bool provisionKvp) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "SET_PRIMARY_PRIVATE_IP", vm.Id, vm.Name, vm.PackageId); + + try + { + // call data access layer + DataProvider.SetItemPrivatePrimaryIPAddress(SecurityContext.User.UserId, itemId, addressId); + + // send KVP config items + if(provisionKvp) + SendNetworkAdapterKVP(itemId, "Private"); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.SET_VIRTUAL_MACHINE_PRIMARY_PRIVATE_IP_ADDRESS_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static ResultObject DeleteVirtualMachinePrivateIPAddresses(int itemId, int[] addressIds, bool provisionKvp) + { + if (addressIds == null) + throw new ArgumentNullException("addressIds"); + + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "DELETE_PRIVATE_IP", vm.Id, vm.Name, vm.PackageId); + + try + { + // call data access layer + foreach (int addressId in addressIds) + DataProvider.DeleteItemPrivateIPAddress(SecurityContext.User.UserId, itemId, addressId); + + // send KVP config items + if(provisionKvp) + SendNetworkAdapterKVP(itemId, "Private"); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.DELETE_VIRTUAL_MACHINE_PRIVATE_IP_ADDRESS_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + private static string GenerateNextAvailablePrivateIP(SortedList ips, string subnetMask, string startIPAddress) + { + Trace.TraceInformation("Entering GenerateNextAvailablePrivateIP()"); + Trace.TraceInformation("Param - number of sorted IPs in the list: {0}", ips.Count); + Trace.TraceInformation("Param - startIPAddress: {0}", startIPAddress); + Trace.TraceInformation("Param - subnetMask: {0}", subnetMask); + + // start IP address + var ip = IPAddress.Parse(startIPAddress) - 1; + + Trace.TraceInformation("Start looking for next available IP"); + foreach (var addr in ips.Keys) + { + if ((addr - ip) > 1) + { + // it is a gap + break; + } + else + { + ip = addr; + } + } + + // final IP found + ip = ip + 1; + + string genIP = ip.ToString(); + Trace.TraceInformation("Generated IP: {0}", genIP); + + // store in cache + Trace.TraceInformation("Adding to sorted list"); + ips.Add(ip, genIP); + + Trace.TraceInformation("Leaving GenerateNextAvailablePrivateIP()"); + return genIP; + } + + private static SortedList GetSortedNormalizedIPAddresses(List ips, string subnetMask) + { + Trace.TraceInformation("Entering GetSortedNormalizedIPAddresses()"); + Trace.TraceInformation("Param - subnetMask: {0}", subnetMask); + + var mask = IPAddress.Parse(subnetMask); + SortedList sortedIps = new SortedList(); + foreach (PrivateIPAddress ip in ips) + { + var addr = IPAddress.Parse(ip.IPAddress); + sortedIps.Add(addr, ip.IPAddress); + + Trace.TraceInformation("Added {0} to sorted IPs list with key: {1} ", ip.IPAddress, addr.ToString()); + } + Trace.TraceInformation("Leaving GetSortedNormalizedIPAddresses()"); + return sortedIps; + } + + private static string GetPrivateNetworkSubnetMask(string cidr, bool v6) { + if (v6) + { + return "/" + cidr; + } + else + { + return IPAddress.Parse("/" + cidr).ToV4MaskString(); + } + } + + private static string GetSubnetMaskCidr(string subnetMask) { + if (String.IsNullOrEmpty(subnetMask)) + return subnetMask; + var ip = IPAddress.Parse(subnetMask); + if (ip.V4) { + int cidr = 32; + var mask = ip.Address; + while ((mask & 1) == 0 && cidr > 0) { + mask >>= 1; + cidr -= 1; + } + return cidr.ToString(); + } else { + return ip.Cidr.ToString(); + } + } + + private static bool CheckPrivateIPAddress(string subnetMask, string ipAddress) + { + var mask = IPAddress.Parse(subnetMask); + var ip = IPAddress.Parse(ipAddress); + + //return ((mask & ip) == mask); + return true; + } + #endregion + + #region Virtual Machine Permissions + public static List GetVirtualMachinePermissions(int itemId) + { + List result = new List(); + return result; + } + + public static int UpdateVirtualMachineUserPermissions(int itemId, VirtualMachinePermission[] permissions) + { + // VPS - UPDATE_PERMISSIONS + return 0; + } + #endregion + + #region Virtual Switches + public static VirtualSwitch[] GetExternalSwitches(int serviceId, string computerName) + { + VirtualizationServer vs = new VirtualizationServer(); + ServiceProviderProxy.Init(vs, serviceId); + return vs.GetExternalSwitches(computerName); + } + #endregion + + #region Tools + public static ResultObject DeleteVirtualMachine(int itemId, bool saveFiles, bool exportVps, string exportPath) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "DELETE", vm.Id, vm.Name, vm.PackageId); + + try + { + // get proxy + VirtualizationServer vs = GetVirtualizationProxy(vm.ServiceId); + + // check VM state + VirtualMachine vps = vs.GetVirtualMachine(vm.VirtualMachineId); + + JobResult result = null; + + if (vps != null) + { + #region turn off machine (if required) + + // stop virtual machine + if (vps.State != VirtualMachineState.Off) + { + TaskManager.Write("VPS_DELETE_TURN_OFF"); + result = vs.ChangeVirtualMachineState(vm.VirtualMachineId, VirtualMachineRequestedState.TurnOff); + // check result + if (result.ReturnValue != ReturnCode.JobStarted) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + // wait for completion + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + #endregion + + #region export machine + if (exportVps && !String.IsNullOrEmpty(exportPath)) + { + TaskManager.Write("VPS_DELETE_EXPORT"); + result = vs.ExportVirtualMachine(vm.VirtualMachineId, exportPath); + + // check result + if (result.ReturnValue != ReturnCode.JobStarted) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + // wait for completion + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + } + #endregion + + #region delete machine + TaskManager.Write("VPS_DELETE_DELETE"); + result = vs.DeleteVirtualMachine(vm.VirtualMachineId); + + // check result + if (result.ReturnValue != ReturnCode.JobStarted) + { + LogReturnValueResult(res, result); + TaskManager.CompleteResultTask(res); + return res; + } + + // wait for completion + if (!JobCompleted(vs, result.Job)) + { + LogJobResult(res, result.Job); + TaskManager.CompleteResultTask(res); + return res; + } + #endregion + } + + #region delete files + if (!saveFiles) + { + TaskManager.Write("VPS_DELETE_FILES", vm.RootFolderPath); + try + { + vs.DeleteRemoteFile(vm.RootFolderPath); + } + catch (Exception ex) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.DELETE_VM_FILES_ERROR + ": " + ex.Message); + } + } + #endregion + + // delete meta item + PackageController.DeletePackageItem(itemId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.DELETE_ERROR, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static int ReinstallVirtualMachine(int itemId, string adminPassword, bool preserveVirtualDiskFiles, + bool saveVirtualDisk, bool exportVps, string exportPath) + { + // VPS - REINSTALL + return 0; + } + #endregion + + #region Help + public static string GetVirtualMachineSummaryText(int itemId, bool emailMode, bool creation) + { + // load item + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + + // load user info + UserInfo user = PackageController.GetPackageOwner(vm.PackageId); + + // get letter settings + UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.VPS_SUMMARY_LETTER); + + string settingName = user.HtmlMail ? "HtmlBody" : "TextBody"; + string body = settings[settingName]; + if (String.IsNullOrEmpty(body)) + return null; + + string result = EvaluateVirtualMachineTemplate(itemId, emailMode, creation, body); + return user.HtmlMail ? result : result.Replace("\n", "
"); + } + + public static ResultObject SendVirtualMachineSummaryLetter(int itemId, string to, string bcc, bool creation) + { + ResultObject res = new ResultObject(); + + // load service item + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.CANNOT_FIND_VIRTUAL_MACHINE_META_ITEM); + return res; + } + + #region Check account and space statuses + // check account + if (!SecurityContext.CheckAccount(res, DemandAccount.NotDemo | DemandAccount.IsActive)) + return res; + + // check package + if (!SecurityContext.CheckPackage(res, vm.PackageId, DemandPackage.IsActive)) + return res; + #endregion + + // start task + res = TaskManager.StartResultTask("VPS", "SEND_SUMMARY_LETTER", vm.Id, vm.Name, vm.PackageId); + + try + { + // load user info + UserInfo user = PackageController.GetPackageOwner(vm.PackageId); + + // get letter settings + UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.VPS_SUMMARY_LETTER); + + string from = settings["From"]; + if (bcc == null) + bcc = settings["CC"]; + string subject = settings["Subject"]; + string body = user.HtmlMail ? settings["HtmlBody"] : settings["TextBody"]; + bool isHtml = user.HtmlMail; + + MailPriority priority = MailPriority.Normal; + if (!String.IsNullOrEmpty(settings["Priority"])) + priority = (MailPriority)Enum.Parse(typeof(MailPriority), settings["Priority"], true); + + if (String.IsNullOrEmpty(body)) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.SUMMARY_TEMPLATE_IS_EMPTY); + return res; + } + + // load user info + if (to == null) + to = user.Email; + + subject = EvaluateVirtualMachineTemplate(itemId, true, creation, subject); + body = EvaluateVirtualMachineTemplate(itemId, true, creation, body); + + // send message + int result = MailHelper.SendMessage(from, to, bcc, subject, body, priority, isHtml); + + if (result != 0) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.SEND_SUMMARY_LETTER_CODE + ":" + result); + TaskManager.WriteWarning("VPS_SEND_SUMMARY_LETTER_ERROR_CODE", result.ToString()); + return res; + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, VirtualizationErrorCodes.SEND_SUMMARY_LETTER, ex); + TaskManager.WriteWarning("VPS_SEND_SUMMARY_LETTER_ERROR", ex.Message); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static string EvaluateVirtualMachineTemplate(int itemId, bool emailMode, bool creation, string template) + { + Hashtable items = new Hashtable(); + + // load machine details + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + if (vm == null) + throw new Exception("VPS with the specified ID was not found."); + + // space info + PackageInfo package = PackageController.GetPackage(vm.PackageId); + items["space"] = package; + + // user info + items["user"] = PackageController.GetPackageOwner(vm.PackageId); + + // VM item + items["vm"] = vm; + + // load external NIC + items["external_nic"] = GetExternalNetworkAdapterDetails(itemId); + + // load private NIC + items["private_nic"] = GetPrivateNetworkAdapterDetails(itemId); + + // load private NIC + items["management_nic"] = GetManagementNetworkAdapterDetails(itemId); + + // load service settings + StringDictionary settings = ServerController.GetServiceSettings(vm.ServiceId); + + foreach (string key in settings.Keys) + items[key] = settings[key]; + + // service items + items["email"] = emailMode; + items["creation"] = creation; + + // evaluate template + return PackageController.EvaluateTemplate(template, items); + } + #endregion + + #region Helper methods + private static int GetServiceId(int packageId) + { + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.VPS2012); + return serviceId; + } + + private static VirtualizationServer GetVirtualizationProxyByPackageId(int packageId) + { + // get service + int serviceId = GetServiceId(packageId); + + return GetVirtualizationProxy(serviceId); + } + + private static VirtualizationServer GetVirtualizationProxy(int serviceId) + { + VirtualizationServer ws = new VirtualizationServer(); + ServiceProviderProxy.Init(ws, serviceId); + return ws; + } + + public static VirtualMachine GetVirtualMachineByItemId(int itemId) + { + VirtualMachine vm = (VirtualMachine)PackageController.GetPackageItem(itemId); + if (vm == null) + return null; + + // host name + int dotIdx = vm.Name.IndexOf("."); + if (dotIdx > -1) + { + vm.Hostname = vm.Name.Substring(0, dotIdx); + vm.Domain = vm.Name.Substring(dotIdx + 1); + } + else + { + vm.Hostname = vm.Name; + vm.Domain = ""; + } + + // check if task was aborted during provisioning + if (!String.IsNullOrEmpty(vm.CurrentTaskId) + && TaskManager.GetTask(vm.CurrentTaskId) == null) + { + // set to error + vm.CurrentTaskId = null; + vm.ProvisioningStatus = VirtualMachineProvisioningStatus.Error; + PackageController.UpdatePackageItem(vm); + } + + vm.AdministratorPassword = CryptoUtils.Decrypt(vm.AdministratorPassword); + return vm; + } + + private static void LogReturnValueResult(ResultObject res, JobResult job) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.JOB_START_ERROR + ":" + job.ReturnValue); + } + + private static void LogJobResult(ResultObject res, ConcreteJob job) + { + res.ErrorCodes.Add(VirtualizationErrorCodes.JOB_FAILED_ERROR + ":" + job.ErrorDescription); + } + + private static bool JobCompleted(VirtualizationServer vs, ConcreteJob job) + { + TaskManager.IndicatorMaximum = 100; + bool jobCompleted = true; + + while (job.JobState == ConcreteJobState.Starting || + job.JobState == ConcreteJobState.Running) + { + System.Threading.Thread.Sleep(1000); + job = vs.GetJob(job.Id); + TaskManager.IndicatorCurrent = job.PercentComplete; + } + + if (job.JobState != ConcreteJobState.Completed) + { + jobCompleted = false; + } + + TaskManager.IndicatorCurrent = 0; // reset indicator + + return jobCompleted; + } + + private static string GenerateMacAddress() + { + return MS_MAC_PREFIX + Utils.GetRandomHexString(3); + } + + #endregion + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj index 58c17bbf..04b9a326 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj @@ -173,6 +173,8 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj index c18d5220..5dbd1017 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -123,6 +123,7 @@ + @@ -176,6 +177,10 @@ esLync.asmx Component + + esVirtualizationServer2012.asmx + Component + esVirtualizationServerForPrivateCloud.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx new file mode 100644 index 00000000..328640b4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="esVirtualizationServer2012.asmx.cs" Class="WebsitePanel.EnterpriseServer.esVirtualizationServer2012" %> diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx.cs new file mode 100644 index 00000000..bd486169 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esVirtualizationServer2012.asmx.cs @@ -0,0 +1,476 @@ +// 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.Collections.Generic; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.ComponentModel; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.ResultObjects; +using Microsoft.Web.Services3; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.EnterpriseServer +{ + /// + /// Summary description for esVirtualizationServer + /// + [WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [Policy("ServerPolicy")] + [ToolboxItem(false)] + public class esVirtualizationServer2012 : System.Web.Services.WebService + { + #region Virtual Machines + [WebMethod] + public VirtualMachineMetaItemsPaged GetVirtualMachines(int packageId, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool recursive) + { + return VirtualizationServerController2012.GetVirtualMachines(packageId, + filterColumn, filterValue, sortColumn, startRow, maximumRows, recursive); + } + + [WebMethod] + public VirtualMachine[] GetVirtualMachinesByServiceId(int serviceId) + { + return VirtualizationServerController2012.GetVirtualMachinesByServiceId(serviceId); + } + + [WebMethod] + public VirtualMachine GetVirtualMachineItem(int itemId) + { + return VirtualizationServerController2012.GetVirtualMachineByItemId(itemId); + } + + [WebMethod] + public string EvaluateVirtualMachineTemplate(int itemId, string template) + { + if (SecurityContext.CheckAccount(DemandAccount.IsActive | DemandAccount.IsAdmin | DemandAccount.NotDemo) != 0) + throw new Exception("This method could be called by serveradmin only."); + + return VirtualizationServerController2012.EvaluateVirtualMachineTemplate(itemId, false, false, template); + } + #endregion + + #region External Network + [WebMethod] + public NetworkAdapterDetails GetExternalNetworkDetails(int packageId) + { + return VirtualizationServerController2012.GetExternalNetworkDetails(packageId); + } + #endregion + + #region Private Network + [WebMethod] + public PrivateIPAddressesPaged GetPackagePrivateIPAddressesPaged(int packageId, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return VirtualizationServerController2012.GetPackagePrivateIPAddressesPaged(packageId, + filterColumn, filterValue, sortColumn, startRow, maximumRows); + } + + [WebMethod] + public List GetPackagePrivateIPAddresses(int packageId) + { + return VirtualizationServerController2012.GetPackagePrivateIPAddresses(packageId); + } + + [WebMethod] + public NetworkAdapterDetails GetPrivateNetworkDetails(int packageId) + { + return VirtualizationServerController2012.GetPrivateNetworkDetails(packageId); + } + #endregion + + #region User Permissions + [WebMethod] + public List GetSpaceUserPermissions(int packageId) + { + return VirtualizationServerController2012.GetSpaceUserPermissions(packageId); + } + + [WebMethod] + public int UpdateSpaceUserPermissions(int packageId, VirtualMachinePermission[] permissions) + { + return VirtualizationServerController2012.UpdateSpaceUserPermissions(packageId, permissions); + } + #endregion + + #region Audit Log + [WebMethod] + public List GetSpaceAuditLog(int packageId, DateTime startPeriod, DateTime endPeriod, + int severity, string sortColumn, int startRow, int maximumRows) + { + return VirtualizationServerController2012.GetSpaceAuditLog(packageId, startPeriod, endPeriod, + severity, sortColumn, startRow, maximumRows); + } + + [WebMethod] + public List GetVirtualMachineAuditLog(int itemId, DateTime startPeriod, DateTime endPeriod, + int severity, string sortColumn, int startRow, int maximumRows) + { + return VirtualizationServerController2012.GetVirtualMachineAuditLog(itemId, startPeriod, endPeriod, + severity, sortColumn, startRow, maximumRows); + } + #endregion + + #region VPS Create – Name & OS + [WebMethod] + public LibraryItem[] GetOperatingSystemTemplates(int packageId) + { + return VirtualizationServerController2012.GetOperatingSystemTemplates(packageId); + } + + [WebMethod] + public LibraryItem[] GetOperatingSystemTemplatesByServiceId(int serviceId) + { + return VirtualizationServerController2012.GetOperatingSystemTemplatesByServiceId(serviceId); + } + #endregion + + #region VPS Create - Configuration + [WebMethod] + public int GetMaximumCpuCoresNumber(int packageId) + { + return VirtualizationServerController2012.GetMaximumCpuCoresNumber(packageId); + } + + [WebMethod] + public string GetDefaultExportPath(int itemId) + { + return VirtualizationServerController2012.GetDefaultExportPath(itemId); + } + #endregion + + #region VPS Create + [WebMethod] + public IntResult CreateDefaultVirtualMachine(int packageId, + string hostname, string osTemplate, string password, string summaryLetterEmail) + { + return VirtualizationServerController2012.CreateDefaultVirtualMachine(packageId, hostname, osTemplate, password, summaryLetterEmail); + } + + [WebMethod] + public IntResult CreateVirtualMachine(int packageId, + string hostname, string osTemplateFile, string password, string summaryLetterEmail, + int generation, int cpuCores, int ramMB, int hddGB, int snapshots, bool dvdInstalled, bool bootFromCD, bool numLock, + bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, + bool externalNetworkEnabled, int externalAddressesNumber, bool randomExternalAddresses, int[] externalAddresses, + bool privateNetworkEnabled, int privateAddressesNumber, bool randomPrivateAddresses, string[] privateAddresses) + { + return VirtualizationServerController2012.CreateVirtualMachine(packageId, + hostname, osTemplateFile, password, summaryLetterEmail, + generation, cpuCores, ramMB, hddGB, snapshots, dvdInstalled, bootFromCD, numLock, + startShutdownAllowed, pauseResumeAllowed, rebootAllowed, resetAllowed, reinstallAllowed, + externalNetworkEnabled, externalAddressesNumber, randomExternalAddresses, externalAddresses, + privateNetworkEnabled, privateAddressesNumber, randomPrivateAddresses, privateAddresses); + } + #endregion + + #region VPS - Import + [WebMethod] + public IntResult ImportVirtualMachine(int packageId, + int serviceId, string vmId, + string osTemplateFile, string adminPassword, + bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, + string externalNicMacAddress, int[] externalAddresses, + string managementNicMacAddress, int managementAddress) + { + return VirtualizationServerController2012.ImportVirtualMachine(packageId, + serviceId, vmId, + osTemplateFile, adminPassword, + startShutdownAllowed, pauseResumeAllowed, rebootAllowed, resetAllowed, reinstallAllowed, + externalNicMacAddress, externalAddresses, + managementNicMacAddress, managementAddress); + } + #endregion + + #region VPS – General + [WebMethod] + public byte[] GetVirtualMachineThumbnail(int itemId, ThumbnailSize size) + { + return VirtualizationServerController2012.GetVirtualMachineThumbnail(itemId, size); + } + + [WebMethod] + public VirtualMachine GetVirtualMachineGeneralDetails(int itemId) + { + return VirtualizationServerController2012.GetVirtualMachineGeneralDetails(itemId); + } + + [WebMethod] + public VirtualMachine GetVirtualMachineExtendedInfo(int serviceId, string vmId) + { + return VirtualizationServerController2012.GetVirtualMachineExtendedInfo(serviceId, vmId); + } + + [WebMethod] + public int CancelVirtualMachineJob(string jobId) + { + return VirtualizationServerController2012.CancelVirtualMachineJob(jobId); + } + + [WebMethod] + public ResultObject UpdateVirtualMachineHostName(int itemId, string hostname, bool updateNetBIOS) + { + return VirtualizationServerController2012.UpdateVirtualMachineHostName(itemId, hostname, updateNetBIOS); + } + + [WebMethod] + public ResultObject ChangeVirtualMachineState(int itemId, VirtualMachineRequestedState state) + { + return VirtualizationServerController2012.ChangeVirtualMachineStateExternal(itemId, state); + } + + + [WebMethod] + public List GetVirtualMachineJobs(int itemId) + { + return VirtualizationServerController2012.GetVirtualMachineJobs(itemId); + + } + #endregion + + #region VPS - Configuration + [WebMethod] + public ResultObject ChangeAdministratorPassword(int itemId, string password) + { + return VirtualizationServerController2012.ChangeAdministratorPassword(itemId, password); + } + #endregion + + #region VPS – Edit Configuration + [WebMethod] + public ResultObject UpdateVirtualMachineConfiguration(int itemId, int cpuCores, int ramMB, int hddGB, int snapshots, + bool dvdInstalled, bool bootFromCD, bool numLock, + bool startShutdownAllowed, bool pauseResumeAllowed, bool rebootAllowed, bool resetAllowed, bool reinstallAllowed, + bool externalNetworkEnabled, + bool privateNetworkEnabled) + { + return VirtualizationServerController2012.UpdateVirtualMachineConfiguration( + itemId, cpuCores, ramMB, hddGB, snapshots, + dvdInstalled, bootFromCD, numLock, + startShutdownAllowed, pauseResumeAllowed, rebootAllowed, resetAllowed, reinstallAllowed, + externalNetworkEnabled, + privateNetworkEnabled); + } + #endregion + + #region DVD + [WebMethod] + public LibraryItem GetInsertedDvdDisk(int itemId) + { + return VirtualizationServerController2012.GetInsertedDvdDisk(itemId); + } + + [WebMethod] + public LibraryItem[] GetLibraryDisks(int itemId) + { + return VirtualizationServerController2012.GetLibraryDisks(itemId); + } + + [WebMethod] + public ResultObject InsertDvdDisk(int itemId, string isoPath) + { + return VirtualizationServerController2012.InsertDvdDisk(itemId, isoPath); + } + + [WebMethod] + public ResultObject EjectDvdDisk(int itemId) + { + return VirtualizationServerController2012.EjectDvdDisk(itemId); + } + #endregion + + #region Snaphosts + [WebMethod] + public VirtualMachineSnapshot[] GetVirtualMachineSnapshots(int itemId) + { + return VirtualizationServerController2012.GetVirtualMachineSnapshots(itemId); + } + + [WebMethod] + public VirtualMachineSnapshot GetSnapshot(int itemId, string snaphostId) + { + return VirtualizationServerController2012.GetSnapshot(itemId, snaphostId); + } + + [WebMethod] + public ResultObject CreateSnapshot(int itemId) + { + return VirtualizationServerController2012.CreateSnapshot(itemId); + } + + [WebMethod] + public ResultObject ApplySnapshot(int itemId, string snapshotId) + { + return VirtualizationServerController2012.ApplySnapshot(itemId, snapshotId); + } + + [WebMethod] + public ResultObject RenameSnapshot(int itemId, string snapshotId, string newName) + { + return VirtualizationServerController2012.RenameSnapshot(itemId, snapshotId, newName); + } + + [WebMethod] + public ResultObject DeleteSnapshot(int itemId, string snapshotId) + { + return VirtualizationServerController2012.DeleteSnapshot(itemId, snapshotId); + } + + [WebMethod] + public ResultObject DeleteSnapshotSubtree(int itemId, string snapshotId) + { + return VirtualizationServerController2012.DeleteSnapshotSubtree(itemId, snapshotId); + } + + [WebMethod] + public byte[] GetSnapshotThumbnail(int itemId, string snapshotId, ThumbnailSize size) + { + return VirtualizationServerController2012.GetSnapshotThumbnail(itemId, snapshotId, size); + } + #endregion + + #region VPS - External Network + [WebMethod] + public NetworkAdapterDetails GetExternalNetworkAdapterDetails(int itemId) + { + return VirtualizationServerController2012.GetExternalNetworkAdapterDetails(itemId); + } + + [WebMethod] + public ResultObject AddVirtualMachineExternalIPAddresses(int itemId, bool selectRandom, + int addressesNumber, int[] addressId) + { + return VirtualizationServerController2012.AddVirtualMachineExternalIPAddresses(itemId, selectRandom, + addressesNumber, addressId, true); + } + + [WebMethod] + public ResultObject SetVirtualMachinePrimaryExternalIPAddress(int itemId, int addressId) + { + return VirtualizationServerController2012.SetVirtualMachinePrimaryExternalIPAddress(itemId, addressId, true); + } + + [WebMethod] + public ResultObject DeleteVirtualMachineExternalIPAddresses(int itemId, int[] addressId) + { + return VirtualizationServerController2012.DeleteVirtualMachineExternalIPAddresses(itemId, addressId, true); + } + #endregion + + #region VPS – Private Network + [WebMethod] + public NetworkAdapterDetails GetPrivateNetworkAdapterDetails(int itemId) + { + return VirtualizationServerController2012.GetPrivateNetworkAdapterDetails(itemId); + } + + [WebMethod] + public ResultObject AddVirtualMachinePrivateIPAddresses(int itemId, bool selectRandom, + int addressesNumber, string[] addresses) + { + return VirtualizationServerController2012.AddVirtualMachinePrivateIPAddresses(itemId, selectRandom, + addressesNumber, addresses, true); + } + + [WebMethod] + public ResultObject SetVirtualMachinePrimaryPrivateIPAddress(int itemId, int addressId) + { + return VirtualizationServerController2012.SetVirtualMachinePrimaryPrivateIPAddress(itemId, addressId, true); + } + + [WebMethod] + public ResultObject DeleteVirtualMachinePrivateIPAddresses(int itemId, int[] addressId) + { + return VirtualizationServerController2012.DeleteVirtualMachinePrivateIPAddresses(itemId, addressId, true); + } + #endregion + + #region Virtual Machine Permissions + [WebMethod] + public List GetVirtualMachinePermissions(int itemId) + { + return VirtualizationServerController2012.GetVirtualMachinePermissions(itemId); + } + + [WebMethod] + public int UpdateVirtualMachineUserPermissions(int itemId, VirtualMachinePermission[] permissions) + { + return VirtualizationServerController2012.UpdateVirtualMachineUserPermissions(itemId, permissions); + } + #endregion + + #region Virtual Switches + [WebMethod] + public VirtualSwitch[] GetExternalSwitches(int serviceId, string computerName) + { + return VirtualizationServerController2012.GetExternalSwitches(serviceId, computerName); + } + #endregion + + #region Tools + [WebMethod] + public ResultObject DeleteVirtualMachine(int itemId, bool saveFiles, bool exportVps, string exportPath) + { + return VirtualizationServerController2012.DeleteVirtualMachine(itemId, saveFiles, exportVps, exportPath); + } + + [WebMethod] + public int ReinstallVirtualMachine(int itemId, string adminPassword, bool preserveVirtualDiskFiles, + bool saveVirtualDisk, bool exportVps, string exportPath) + { + return VirtualizationServerController2012.ReinstallVirtualMachine(itemId, adminPassword, preserveVirtualDiskFiles, + saveVirtualDisk, exportVps, exportPath); + } + #endregion + + #region Help + [WebMethod] + public string GetVirtualMachineSummaryText(int itemId) + { + return VirtualizationServerController2012.GetVirtualMachineSummaryText(itemId, false, false); + } + + [WebMethod] + public ResultObject SendVirtualMachineSummaryLetter(int itemId, string to, string bcc) + { + return VirtualizationServerController2012.SendVirtualMachineSummaryLetter(itemId, to, bcc, false); + } + #endregion + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Containers/Default/VPS2012.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Containers/Default/VPS2012.ascx new file mode 100644 index 00000000..89c6426c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Containers/Default/VPS2012.ascx @@ -0,0 +1,10 @@ +<%@ Control Language="C#" AutoEventWireup="false" %> +
+
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config index 54627906..6a632d9b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config @@ -69,6 +69,7 @@ + @@ -123,6 +124,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>The form allows allocating of additional External IP addresses to this hosting space. These IP addresses are used to configure VPS network adapter connected to External network.</p><p>VPS module is looking for free external IP addresses in "VPS External Network" pool, so WebsitePanel administrator must make sure there are sufficient number of unallotted IP addresses in that pool.</p> + + + Allocate IP Addresses + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAuditLog.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAuditLog.ascx.resx new file mode 100644 index 00000000..0ec75155 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcAuditLog.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>Audit log displays the chronology of events for all VPS located in the hosting space.</p><p>By default audit log displays all today's events. You may filter the log by date (day, week, month), severity, task and item name (VPS host name).</p><p>To see task details click the link with task name in "Task" column.</p><p>To export log in CSV format click "Export Log" button.</p> + + + Audit Log + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcCreateServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcCreateServer.ascx.resx new file mode 100644 index 00000000..dab48649 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcCreateServer.ascx.resx @@ -0,0 +1,375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Create + + + Next > + + + < Back + + + <p><b>Welcome to VPS Creation Wizard!</b></p><p>The wizard allows specifying parameters of new VPS such as host name, operating system template, administrator password, External and Private (if allowed in the hosting plan) network parameters.</p><p>If e-mail address is specified in "Send summary letter to" then VPS summary information will be sent on that e-mail upon provisioning process completion.</p><p>After clicking "Create" button on the last step of the wizard the process of provisioning a new VPS will be started. The process is asynchronous, so it's not necessary to wait until it's finished.</p> + + + Configuration + + + External Network + + + Name & OS + + + Private Network + + + Summary + + + Enter domain name + + + Enter the number of external IP addresses + + + Enter host name + + + Enter the number of private IP addresses + + + Enter the size of hard disk drive + + + Enter amount of RAM allocated to new VPS + + + Enter the maximum number of snapshots + + + Enter e-mail address to send summary letter + + + Boot from CD + + + DVD drive installed + + + External network enabled + + + "Num Lock" enabled + + + Pause, Resume + + + Private network enabled + + + Reboot + + + Re-install + + + Reset + + + Send summary e-mail to: + + + Start, Turn off and Shutdown + + + CPU: + + + HDD: + + + RAM: + + + Administrator password: + + + Boot from CD: + + + Configuration + + + cores + + + CPU cores: + + + DVD Drive installed: + + + Number of IP addresses: + + + IP addresses list: + + + Number of IP addresses: + + + External Network + + + External network enabled: + + + GB + + + Hard disk size, GB: + + + * Hold CTRL key to select multiple addresses + + + Host name: + + + MB + + + Name and Operating System + + + "Num Lock" enabled: + + + * Type one IP address per line + + + Operating system: + + + Pause, resume allowed: + + + Number of IP addresses: + + + IP addresses list: + + + Number of IP addresses: + + + Private Network + + + Private network enabled: + + + Network addresses format: + + + Subnet mask: + + + RAM, MB: + + + Reboot allowed: + + + Re-install allowed: + + + Reset allowed: + + + Number of snapshots: + + + Start, turn off and shutdown allowed: + + + Summary + + + Create New VPS + + + Randomly select IP addresses from the pool + + + Select IP addresses from the list + + + Randomly select next available IP addresses to the addresses format + + + Assign specified IP addresses + + + Allowed actions + + + BIOS + + + DVD + + + Resources + + + Snapshots + + + Select operating system template + + + <Select OS template> + + + ShowProgressDialog('Creating Virtual Server...'); + + + ({0} max) + + + ({0} max) + + + The pool of available external IP addresses is empty. All IP addresses allocated to the current hosting space are assigned to existing virtual servers. More external IP addresses could be allocated by the host. + + + Enter correct host name, for example "vps01" + + + Enter correct domain name, for example "mydomain.com" + + + Generation: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcExternalNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcExternalNetwork.ascx.resx new file mode 100644 index 00000000..a0d73a20 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcExternalNetwork.ascx.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>The form displays the list of IP addresses from "VPS External Network" pool allocated to the hosting space. Alternatively, this form could be considered as a "map" of external IP addresses and their assignments to virtual machines.</p><p>If any IP has already assigned to some VPS then there will be VPS host name in the "Item name" column.</p><p>If there are lot of VPS in the hosting space you can easily search them by their external IP.</p><p>"Number of IP addresses" quota shows the maximum number of external IP addresses that could be allocated to this space.</p> + + + Bandwidth, GB: + + + Number of IP Addresses: + + + External Network + + + Quotas + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcHome.ascx.resx new file mode 100644 index 00000000..8b86f534 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcHome.ascx.resx @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Create VM + + + <p>The form displays the list of Virtual Private Servers created in the hosting space.</p><p>In terms of WebsitePanel VPS module hosting space could be compared to the Virtual Dedicated Center (VDC). You can see VPS bindings to external and private IP addresses as well as search VPS by these fields.</p><p>Quotas in the bottom of the forms show the total amount of computer resources available for VPS.</p> + + + No VPS have been created. To create a new VPS click "Create VPS" button. + + + External IP + + + Host name + + + Private IP + + + Space + + + User + + + External IP + + + Private IP + + + VPS Name + + + User Name + + + Delete + + + HDD, GB: + + + RAM, MB: + + + Virtual Private Servers + + + Number of VPS: + + + Quotas + + + Import VPS + + + return confirm('Remove this VM from meta-base?'); + + + Detach + + + Move + + + Fast Create VM + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcImportServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcImportServer.ascx.resx new file mode 100644 index 00000000..d8cecd56 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcImportServer.ascx.resx @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Pause, Resume + + + Reboot + + + Reset + + + Start, Turn off and Shutdown + + + Cancel + + + Import + + + Enable Remote Desktop Web Connection + + + <p>This wizard allows you to import existing Virtual Machine to control panel meta-base to provide its owner self-service functions.</p><p>Importing is absolutely safe for VM as nor VM configuration, nor its state are changing during the process.</p><p>To import VM, first, select registered in control panel Hyper-V service where VM is located. Then select VM, specify its allowed actions and select network adapter bindings.</p><p>External and management networks are determined on appropriate Hyper-V service properties page.</p><p>To enable Remote Desktop Web connections you have to provide real guest OS administrator password (for automatic sign-on).</p> + + + Administrator password: + + + Boot from CD + + + CPU, cores: + + + DVD drive is installed + + + Connected NIC: + + + Assign IP addresses: + + + HDD, Gb: + + + Hyper-V Service: + + + Connected NIC: + + + Assign IP addresses: + + + Num Lock + + + RAM, Mb: + + + Import Existing VPS + + + VHD location: + + + Virtual Machine: + + + Allowed Actions + + + BIOS + + + Configuration + + + DVD + + + External Network + + + Management Network + + + OS Template: + + + <Select Hyper-V service> + + + <Select virtual machine> + + + Please select OS template + + + Please select virtual machine to import + + + Please select Hyper-V service to import VPS from + + + <Select Operating System template> + + + ShowProgressDialog('Importing Virtual Server...'); + + + Please enter guest OS administrator password + + + Select at least one External IP address + + + Select at least one Management IP address + + + <Not connected> + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcManagementNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcManagementNetwork.ascx.resx new file mode 100644 index 00000000..ead4bdcd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcManagementNetwork.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p><b>This form is visible to administrators only.</b></p><p> Management network is not available to resellers and users and it's being managed by WebsitePanel on their behalf.</p><p>Management network is a back-end company network used by system administrators to manage customers' VPS. This network is also used by VPS to access various utility resources and services such as DNS, KMS, backups, etc.</p><p>If Management network is enabled on Hyper-V service properties then every created VPS will be assigned one IP address from "VPS Management Network" pool, so WebsitePanel administrator must make sure there are sufficient number of IP addresses in that pool.</p> + + + Management Network + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPermissions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPermissions.ascx.resx new file mode 100644 index 00000000..101f29ae --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPermissions.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Updating permissions...'); + + + ShowProgressDialog('Updating permissions...'); + + + User permissions allow... + + + No peers exist under your user account. + + + No peers exist under your user account. + + + User Permissions + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPrivateNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPrivateNetwork.ascx.resx new file mode 100644 index 00000000..c3aa3949 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VdcPrivateNetwork.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>If this form is available in the hosting space then it means that all VPS in this hosting space are connected to dedicated private network available only to this hosting space.</p> <p>Private network is a very powerful mechanizm that allows additional increase of network security. For example, you might have only one front-end server (e.g. server with Exchange CAS and HUB roles installed) connected to External network and all the rest of servers connected to private (internal) network only (e.g. one server with Exchange MB role and second one with DC).</p><p>Quota in the bottom of the form displays the maximum number of private IP addresses that could be assigned to every VPS.</p> + + + No private IP addresses have been used in this hosting space. + + + IP Address + + + VPS Name + + + IP + + + VPS + + + Primary + + + Private Network + + + IP addresses per VPS: + + + Quotas + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddExternalAddress.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddExternalAddress.ascx.resx new file mode 100644 index 00000000..17810cf9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddExternalAddress.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add + + + Cancel + + + Enter the number of IP addresses + + + <p>This form allows assigning of new IP addresses to VPS "External" network adapter.</p><p>Additional IP addresses could be assigned to the VPS if only there is enough number of free (unassigned) external IP addresses allocated to this hosting space.</p><p>After clicking "Add" button special configuration instructions will be sent to VPS, so it may take some time (up to few minutes) until network adapter parameters are changed.</p> + + + Number of IP addresses: + + + * Hold CTRL key to select multiple addresses + + + Add External IP Addresses + + + Network + + + Randomly select IP addresses from the pool + + + Select IP addresses from the list + + + ({0} max) + + + The pool of available external IP addresses is empty. All IP addresses allocated to the current hosting space are assigned to existing virtual servers. More external IP addresses could be allocated by the host. + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddPrivateAddress.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddPrivateAddress.ascx.resx new file mode 100644 index 00000000..63bd6af6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAddPrivateAddress.ascx.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add + + + Cancel + + + <p>This form allows assigning of new IP addresses to VPS "Private" network adapter.</p><p>In the private network you could assign any IP addresses to VPS, however if you decide to leave this job for WebsitePanel then it will generate private IP addresses for you by the algorithm set on the service level and make sure IPs are not duplicated.</p><p>After clicking "Add" button special configuration instructions will be sent to VPS, so it may take some time (up to few minutes) until network adapter parameters are changed.</p> + + + * Type one IP address per line + + + Number of IP addresses: + + + Add Private IP Addresses + + + Network + + + Enter the number of private IP addresses + + + Randomly select next available IP addresses to the addresses format + + + Assign specified IP addresses + + + ({0} max) + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAuditLog.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAuditLog.ascx.resx new file mode 100644 index 00000000..b3ea1412 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsAuditLog.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + <p>Audit log displays the chronology of events for this VPS.</p><p>By default audit log displays all today's events. You may filter the log by date (day, week, month), severity, task and item name (VPS host name).</p><p>To see task details click the link with task name in "Task" column.</p><p>To export log in CSV format click "Export Log" button.</p> + + + Audit Log + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsConfiguration.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsConfiguration.ascx.resx new file mode 100644 index 00000000..c2391630 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsConfiguration.ascx.resx @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Changing password...', 'PasswordModal'); + + + {0} cores + + + {0} GB + + + {0} MB + + + Network + + + Cancel + + + Change password + + + Change + + + Edit configuration + + + <p>This form shows VPS configuration.</p><p>To change VPS Administrator account password click "Change" link in "Software" section.<br/>To change password special configuration instructions will be sent to VPS, so it may take some time (up to few minutes) until it is changed.</p><p>To change VPS configuration (if allowed in the hosting plan) click "Edit configuration" button.</p> + + + CPU: + + + HDD: + + + RAM: + + + Administrator password: + + + Change Administrator Password + + + Enter new password: + + + Operating system: + + + Number of snapshots: + + + Configuration + + + Boot from CD + + + DVD drive installed + + + External network enabled + + + Num Lock enabled + + + Pause, Resume + + + Private network enabled + + + Reboot + + + Re-Install + + + Reset + + + Start, Turn off and Shutdown + + + Server Actions + + + BIOS + + + DVD + + + Resources + + + Snapshots + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsDvd.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsDvd.ascx.resx new file mode 100644 index 00000000..7357567a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsDvd.ascx.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Ejecting disk...'); + + + <empty> + + + Eject + + + Insert Disk... + + + <p>The form shows the status of DVD drive. If there is <b>&lt;empty&gt;</b> then there is no disk in the drive.</p><p>Click <b>"Insert Disk..."</b> button to browse Media Library.</p><p>Click <b>"Eject"</b> button to remove disk from DVD drive.</p> + + + DVD Drive: + + + DVD + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsEditConfiguration.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsEditConfiguration.ascx.resx new file mode 100644 index 00000000..f01b77a7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsEditConfiguration.ascx.resx @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + if(!confirm('Before applying new configuration VPS will be stopped.\n\nAfter the configuration is changed it will be started again automatically.\n\nDo you want to proceed?')) return false; ShowProgressDialog('Updating configuration...'); + + + Update + + + Boot from CD + + + DVD drive installed + + + External network enabled + + + Num Lock enabled + + + Pause, Resume + + + Private network enabled + + + Reboot + + + Re-Install + + + Reset + + + Start, Turn off and Shutdown + + + <p>Change VPS configuration and click "Update" button.</p><p><b>Before applying new configuration settings VPS will be stopped. After new configuration is applied it will be started again.</b></p> + + + CPU: + + + HDD: + + + RAM: + + + cores + + + GB + + + MB + + + Number of snapshots: + + + Edit Configuration + + + Edit Configuration + + + Please specify HDD size + + + Please specify RAM size + + + Server Actions + + + BIOS + + + DVD + + + Network + + + Resources + + + Snapshots + + + Please enter the number of snapshots + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsGeneral.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsGeneral.ascx.resx new file mode 100644 index 00000000..5d662ca5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsGeneral.ascx.resx @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Changing host name...', 'ChangeHostnameModal'); + + + Delete + + + Pause + + + Reboot + + + Reset + + + Resume + + + Shut&nbsp;Down + + + Snapshot + + + Start + + + Turn&nbsp;Off + + + {0}% + + + {0}% + + + Used: {0} MB, Total: {1} MB + + + if(!confirm('Pause VPS?')) return false; ShowProgressDialog('Pausing...'); + + + if(!confirm('Reboot VPS?')) return false; ShowProgressDialog('Rebooting...'); + + + if(!confirm('Reset VPS?')) return false; ShowProgressDialog('Resetting...'); + + + ShowProgressDialog('Resuming...'); + + + if(!confirm('Shut down VPS?')) return false; ShowProgressDialog('Shutting down...'); + + + ShowProgressDialog('Taking snapshot...'); + + + ShowProgressDialog('Starting...'); + + + if(!confirm('Turn off VPS?')) return false; ShowProgressDialog('Turning off...'); + + + Host&nbsp;name: + + + Cancel + + + Change + + + Edit + + + Update computer network name + + + <p><b>Status</b> shows the current state of VPS. The list of available VPS action buttons on the right depends on the current status.</p><p><b>Uptime</b> is the time since the last VPS start.</p><b>Heartbeat</b> is a very useful indicator as it shows whether VPS operating system is active and respond. If there is "No contact" then it means the system is not started yet, but if there is an "Error" then it means OS does not respond to the host machine.</p><p><b>CPU</b> meter displays VPS processor utilization.</p><p><b>RAM</b> and <b>HDD</b> meters show real-time data provided by VPS operating system.</p> + + + Error + + + Lost communication + + + No contact + + + None + + + OK + + + Paused + + + Change VPS Host Name + + + CPU: + + + Created: + + + Domain: + + + Heartbeat: + + + Host name: + + + RAM: + + + Status: + + + General + + + Uptime: + + + Deleted + + + Migrating + + + Off + + + Paused + + + Pausing + + + Saved + + + Saving + + + Taking Snapshot + + + Running + + + Starting + + + Running + + + Stopping + + + Enter correct host name, for example "vps01" + + + Enter correct domain name, for example "mydomain.com" + + + {0}% + + + Free: {0} GB, Total: {1} GB on {2} drive(s) + + + HDD: + + + Domain: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsHelp.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsHelp.ascx.resx new file mode 100644 index 00000000..59a45d4c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsHelp.ascx.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Sending e-mail...'); + + + Send + + + <p>This form displays VPS summary information prepared by the host.</p><p>This information could be re-send to any e-mail address specified in "Send instructions by e-mail" section. This section is collapsed by default.</p> + + + BCC: + + + To: + + + Help + + + Send instructions by e-mail + + + Please enter e-mail address + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsInsertDvd.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsInsertDvd.ascx.resx new file mode 100644 index 00000000..5f5792c4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsInsertDvd.ascx.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + ShowProgressDialog('Inserting disk...'); + + + Insert + + + <p>Browse Media Library and click <b>"Insert"</b> button in the row with DVD you want to insert into drive.</p><p>Click <b>"Cancel"</b> button to return to DVD drive properties screen.</p> + + + No disks found in the media library. + + + Title + + + Browse Media Library + + + DVD + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsNetwork.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsNetwork.ascx.resx new file mode 100644 index 00000000..98dfebbe --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsNetwork.ascx.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add IP... + + + Add IP... + + + Delete + + + Delete + + + Set As Primary + + + Set As Primary + + + <p>This form shows VPS network configuration.</p><p>To assign additional IP addresses to "External" or "Private" adapter click "Add" button in the appropriate section.</p><p>When you delete external or private IP or change network adapter primary IP address the system sends special configuration instructions to VPS operating system, so it may take some time (up to few minutes) until network adapter parameters are changed.</p> + + + No IP addresses are assigned to external network adapter. + + + IP Address + + + Primary + + + No IP addresses are assigned to private network adapter. + + + Server address: + + + Default gateway: + + + Subnet mask: + + + Server address: + + + Network format: + + + Subnet mask: + + + Network + + + IP addresses: + + + IP addresses: + + + External Network + + + Private Network + + + &lt;auto&gt; + + + Gateway + + + Subnet Mask + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsPermissions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsPermissions.ascx.resx new file mode 100644 index 00000000..867a4a7f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsPermissions.ascx.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Updating permissions...'); + + + User permissions allow... + + + No peers exist under your user account. + + + Permissions + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsSnapshots.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsSnapshots.ascx.resx new file mode 100644 index 00000000..3b106beb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsSnapshots.ascx.resx @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + if(this.disabled) return false;if(!confirm('Do you want to apply selected snapshot to VPS?')) return false;ShowProgressDialog('Applying snapshot...'); + + + if(this.disabled) return false;if(!confirm('Do you want to completely delete selected snapshot?')) return false;ShowProgressDialog('Deleting snapshot...'); + + + if(!confirm('Do you want to completely delete selected snapshot and all its sub-tree?')) return false;ShowProgressDialog('Deleting snapshot sub-tree...'); + + + ShowProgressDialog('Renaming snapshot...', 'RenameSnapshotModal'); + + + ShowProgressDialog('Taking snapshot...'); + + + Now + + + This virtual server has no snapshots. + + + Apply + + + Cancel + + + Delete + + + Delete Subtree + + + Rename + + + Rename + + + <p>To take a <b>snapshot</b> is much like to take a picture of current VPS state: its configuration, memory and hard disk.</p><p>Snapshots maybe used as backup/restore points when installing new software or using VPS for development or testing purposes. If something has gone wrong there is an ability to roll-back and <b>"Apply"</b> a snapshot with good configuration.</p><p><b>"Rename"</b> button allows renaming snapshot and giving it some informative name, for example "Before applying service pack".</p> + + + Created: + + + Number of Snapshots: + + + Rename Snapshot + + + Snapshots + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsTools.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsTools.ascx.resx new file mode 100644 index 00000000..0f143aa1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsTools.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete VPS + + + Re-install VPS + + + + + + Completely removes VPS and all its data. + + + Re-creates VPS with the same configuration settings and operating system template. The wizard allows to preserve existing virtual disk data. + + + Tools + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsMoveServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsMoveServer.ascx.resx new file mode 100644 index 00000000..166a5167 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsMoveServer.ascx.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + <p>This wizard allows you to change Hyper-V service binding for existing Virtual Machine meta-item.</p><p>The wizard <b>DOES NOT PERFORM</b> physical virtual machine migration, but it could be used to point control panel to the right Hyper-V service AFTER virtual machine was moved with some external management tool like Hyper-V manager or SCVMM.</p> + + + Move VPS + + + ShowProgressDialog('Moving Virtual Server...'); + + + Move + + + Destination Hyper-V Service: + + + Please select Hyper-V where VPS has been moved + + + Source Hyper-V service: + + + <Select Hyper-V service> + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsDeleteServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsDeleteServer.ascx.resx new file mode 100644 index 00000000..93428664 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsDeleteServer.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + ShowProgressDialog('Deleting Virtual Server...'); + + + Delete + + + Delete this Virtual Server + + + Export VPS before deletion to the following folder: + + + Do not delete VPS files (virtual hard disk, snapshots) + + + Please enter export path + + + <p>This form confirms deletion of VPS.</p><p>In order to confirm "Delete this virtual server" checkbox must be checked.</p> + + + Administrator options + + + This wizard will delete VPS and all its contents from the virtualization server. + + + Delete VPS Server + + + Delete Server + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsReinstallServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsReinstallServer.ascx.resx new file mode 100644 index 00000000..ae295246 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsToolsReinstallServer.ascx.resx @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Re-install + + + Yes, I confirm re-installation of this VPS + + + Export VPS before re-installation to the following folder: + + + Save existing VPS hard drive files + + + Do not delete VPS virtual hard drive file + + + Enter export path + + + + + + This wizard will re-create VPS with the same configuration settings from scratch and then apply current OS template. + + + New administrator password: + + + All files from existing hard drive will be copied to &quot;old&quot; disk folder on hard drive of new VPS. + + + Re-install VPS Server + + + Re-install Server + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/App_LocalResources/Connect.aspx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/App_LocalResources/Connect.aspx.resx new file mode 100644 index 00000000..2c7a42b1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/App_LocalResources/Connect.aspx.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Remote Desktop Connection + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx new file mode 100644 index 00000000..4222b165 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx @@ -0,0 +1,231 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Connect.aspx.cs" Inherits="WebsitePanel.Portal.VPS2012.RemoteDesktop.Connect" %> + + + + + + <asp:Literal ID="litServerName" runat="server"></asp:Literal> + <asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Remote Desktop Web Connection"></asp:Localize> + + + + + + + + + +
+
+ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.cs new file mode 100644 index 00000000..ea83ecab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.cs @@ -0,0 +1,56 @@ +// 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 WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.RemoteDesktop +{ + public partial class Connect : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + resolution.Text = Request["Resolution"]; + + // load server info + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + litServerName.Text = vm.Name + " - "; + username.Text = "Administrator"; + password.Text = vm.AdministratorPassword; + + // load external network parameters + NetworkAdapterDetails nic = ES.Services.VPS2012.GetExternalNetworkAdapterDetails(PanelRequest.ItemID); + if (nic.IPAddresses.Length > 0) + { + NetworkAdapterIPAddress ip = nic.IPAddresses[0]; + serverName.Text = !String.IsNullOrEmpty(ip.NATAddress) ? ip.NATAddress : ip.IPAddress; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.designer.cs new file mode 100644 index 00000000..b9b9ff55 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.RemoteDesktop { + + + public partial class Connect { + + /// + /// litServerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litServerName; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// resolution control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal resolution; + + /// + /// serverName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal serverName; + + /// + /// username control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal username; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal password; + + /// + /// AspForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm AspForm; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/msrdp.cab b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/msrdp.cab new file mode 100644 index 00000000..695c0137 Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/msrdp.cab differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx new file mode 100644 index 00000000..31661d8d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx @@ -0,0 +1,46 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestVirtualMachineTemplate.aspx.cs" Inherits="WebsitePanel.Portal.VPS2012.TestVirtualMachineTemplate" %> + +<%@ Register src="../UserControls/MessageBox.ascx" tagname="MessageBox" tagprefix="wsp" %> + +<%@ Register src="../UserControls/SimpleMessageBox.ascx" tagname="SimpleMessageBox" tagprefix="uc1" %> + + + + + Test VPS2012 Summary Template + + + +
+
+

Test VPS2012 Summary Template +

+ + + +

+ Item ID:
+ +

+

+ Template:
+ +
+ +

+

+ Results: +
+

+

+
+
+ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.cs new file mode 100644 index 00000000..479d409d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.cs @@ -0,0 +1,55 @@ +// 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.Web; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class TestVirtualMachineTemplate : System.Web.UI.Page + { + public const string EVALUATE_VIRTUAL_MACHINE_TEMPLATE = "EVALUATE_VIRTUAL_MACHINE_TEMPLATE"; + + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnEvaluate_Click(object sender, EventArgs e) + { + try + { + litResults.Text = HttpUtility.HtmlEncode(ES.Services.VPS2012.EvaluateVirtualMachineTemplate(Utils.ParseInt(txtItemId.Text.Trim(), 0), txtTemplate.Text)); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage(EVALUATE_VIRTUAL_MACHINE_TEMPLATE, ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.designer.cs new file mode 100644 index 00000000..2cd00d39 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/TestVirtualMachineTemplate.aspx.designer.cs @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class TestVirtualMachineTemplate { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// txtItemId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtItemId; + + /// + /// txtTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtTemplate; + + /// + /// btnEvaluate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEvaluate; + + /// + /// litResults control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litResults; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Breadcrumb.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Breadcrumb.ascx.resx new file mode 100644 index 00000000..5ea0895e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Breadcrumb.ascx.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/DynamicMemory.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/DynamicMemory.ascx.resx new file mode 100644 index 00000000..de7f7771 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/DynamicMemory.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Dymanic memory: + + + Dymanic memory + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Generation.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Generation.ascx.resx new file mode 100644 index 00000000..5b5b2e6f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Generation.ascx.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + First + + + Second + + + Generation: + + + Generation + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Menu.ascx.resx new file mode 100644 index 00000000..a4af7bf0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/Menu.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Audit Log + + + External Network + + + Management Network + + + Private Network + + + User Permissions + + + Virtual Private Servers + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx new file mode 100644 index 00000000..eaf0db7c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/App_LocalResources/ServerTabs.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + return CancelOperation('Cancel current operation?', 'Cancelling operation...'); + + + Audit Log + + + Configuration + + + DVD + + + General + + + Help + + + Network + + + Permissions + + + Snapshots + + + Tools + + + Elapsed: + + + Started: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx new file mode 100644 index 00000000..2dd3eb5c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx @@ -0,0 +1,4 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Breadcrumb.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.cs new file mode 100644 index 00000000..1bf7495d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.cs @@ -0,0 +1,50 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class Breadcrumb : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // bind package name + PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); + litSpaceName.Text = package.PackageName; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.designer.cs new file mode 100644 index 00000000..4231a1d5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Breadcrumb.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class Breadcrumb { + + /// + /// litSpaceName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSpaceName; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx new file mode 100644 index 00000000..acf4d304 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx @@ -0,0 +1,17 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DynamicMemory.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.DynamicMemory" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../../UserControls/CollapsiblePanel.ascx" %> + + + + + + + + + +
+ + +
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx.cs new file mode 100644 index 00000000..0ab36ea9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx.cs @@ -0,0 +1,50 @@ +// 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 WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class DynamicMemory : WebsitePanelControlBase, IVirtualMachineSettingsControl + { + protected void Page_Load(object sender, EventArgs e) + { + } + + public bool IsEditMode { get; set; } + + public void BindItem(VirtualMachine item) + { + } + + public void SaveItem(VirtualMachine item) + { + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx.designer.cs new file mode 100644 index 00000000..5124bc48 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/DynamicMemory.ascx.designer.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class DynamicMemory { + + /// + /// secDymanicMemory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDymanicMemory; + + /// + /// DymanicMemoryPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DymanicMemoryPanel; + + /// + /// locDymanicMemory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDymanicMemory; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx new file mode 100644 index 00000000..4a361f2b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx @@ -0,0 +1,4 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FormTitle.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.FormTitle" %> + +- + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.cs new file mode 100644 index 00000000..bc88fcea --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.cs @@ -0,0 +1,53 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class FormTitle : WebsitePanelControlBase + { + public string Text + { + get { return litTitle.Text; } + set { litTitle.Text = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + if (vm != null) + litServerName.Text = vm.Name; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.designer.cs new file mode 100644 index 00000000..e56c4e0e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/FormTitle.ascx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class FormTitle { + + /// + /// litTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litTitle; + + /// + /// litServerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litServerName; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx new file mode 100644 index 00000000..423a7077 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx @@ -0,0 +1,24 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Generation.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.Generation" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../../UserControls/CollapsiblePanel.ascx" %> + + + + + + + + +
+ + + <% if (IsEditMode) + { %> + + 1 + 2 + + <% } else { %> + + <% } %> +
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.cs new file mode 100644 index 00000000..12299712 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.cs @@ -0,0 +1,54 @@ +// 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 WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class Generation : WebsitePanelControlBase, IVirtualMachineSettingsControl + { + protected void Page_Load(object sender, EventArgs e) + { + } + + public bool IsEditMode { get; set; } + + public void BindItem(VirtualMachine item) + { + var generation = item.Generation > 1 ? item.Generation : 1; + ddlGeneration.SelectedValue = generation.ToString(); + lblGeneration.Text = generation.ToString(); + } + + public void SaveItem(VirtualMachine item) + { + item.Generation = Convert.ToInt32(ddlGeneration.SelectedValue); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.designer.cs new file mode 100644 index 00000000..7ae3a102 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Generation.ascx.designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class Generation { + + /// + /// secGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secGeneration; + + /// + /// GenerationPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel GenerationPanel; + + /// + /// locGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGeneration; + + /// + /// ddlGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlGeneration; + + /// + /// lblGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGeneration; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx new file mode 100644 index 00000000..10902dd6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx @@ -0,0 +1,18 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Menu.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.UserControls.Menu" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.cs new file mode 100644 index 00000000..fe628e86 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.cs @@ -0,0 +1,129 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class Menu : WebsitePanelControlBase + { + public class MenuItem + { + private string url; + private string text; + private string key; + + public string Url + { + get { return url; } + set { url = value; } + } + + public string Text + { + get { return text; } + set { text = value; } + } + + public string Key + { + get { return key; } + set { key = value; } + } + } + + private string selectedItem; + public string SelectedItem + { + get { return selectedItem; } + set { selectedItem = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + BindMenu(); + } + + private void BindMenu() + { + bool isAdmin = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); + + // build the list of menu items + List items = new List(); + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + // add items + items.Add(CreateMenuItem("Vps", "")); + + if(cntx.Quotas.ContainsKey(Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED) + && !cntx.Quotas[Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED].QuotaExhausted + || (PanelSecurity.PackageId == 1 && isAdmin)) + items.Add(CreateMenuItem("ExternalNetwork", "vdc_external_network")); + + if (isAdmin) + items.Add(CreateMenuItem("ManagementNetwork", "vdc_management_network")); + + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_PRIVATE_NETWORK_ENABLED) + && !cntx.Quotas[Quotas.VPS2012_PRIVATE_NETWORK_ENABLED].QuotaExhausted) + items.Add(CreateMenuItem("PrivateNetwork", "vdc_private_network")); + + //items.Add(CreateMenuItem("UserPermissions", "vdc_permissions")); + items.Add(CreateMenuItem("AuditLog", "vdc_audit_log")); + + // selected menu item + for (int i = 0; i < items.Count; i++) + { + if (String.Compare(items[i].Key, SelectedItem, true) == 0) + { + MenuItems.SelectedIndex = i; + break; + } + } + + // bind items + MenuItems.DataSource = items; + MenuItems.DataBind(); + } + + private MenuItem CreateMenuItem(string text, string key) + { + MenuItem item = new MenuItem(); + item.Key = key; + item.Text = GetLocalizedString("Text." + text); + item.Url = HostModule.EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), key); + return item; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.designer.cs new file mode 100644 index 00000000..625e22b8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/Menu.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class Menu { + + /// + /// MenuItems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList MenuItems; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx new file mode 100644 index 00000000..d5a9c3ea --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx @@ -0,0 +1,75 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ServerTabs.ascx.cs" + Inherits="WebsitePanel.Portal.VPS2012.UserControls.ServerTabs" %> +<%@ Register Src="../../UserControls/Gauge.ascx" TagName="Gauge" TagPrefix="wsp" %> +<%@ Register Src="../../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> + + + + + + + + + + + + + + + + + + + + + + + +
+ +
 
+ + +
+ + +
 
+ + +
+ + +
+
+
+
+ + + + + +
+    + + + + + <%# Eval("Name") %> + + + + + + <%# Eval("Name") %> + + + +
+
+ + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs new file mode 100644 index 00000000..f5b51d3a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.cs @@ -0,0 +1,230 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012.UserControls +{ + public partial class ServerTabs : WebsitePanelControlBase + { + class Tab + { + string id; + string name; + string url; + + public Tab(string id, string name, string url) + { + this.id = id; + this.name = name; + this.url = url; + } + + public string Id + { + get { return this.id; } + set { this.id = value; } + } + + public string Name + { + get { return this.name; } + set { this.name = value; } + } + + public string Url + { + get { return this.url; } + set { this.url = value; } + } + } + + private string selectedTab; + public string SelectedTab + { + get { return selectedTab; } + set { selectedTab = value; } + } + + private BackgroundTask task = null; + + protected void Page_Load(object sender, EventArgs e) + { + BindTabs(); + } + + private void BindTabs() + { + // load item + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + + if (!String.IsNullOrEmpty(vm.CurrentTaskId)) + { + // show panel + TaskTable.Visible = true; + + // bind task details + BindTask(vm); + + return; + } + + if (TaskTable.Visible) + Response.Redirect(Request.Url.ToString()); // refresh screen + + // show tabs + TabsTable.Visible = true; + + // disable timer + refreshTimer.Enabled = false; + + // check if VPS2012 created with error + bool createError = (vm.ProvisioningStatus == VirtualMachineProvisioningStatus.Error); + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + // build tabs list + List tabsList = new List(); + + tabsList.Add(CreateTab("vps_general", "Tab.General")); + + if (!createError) + tabsList.Add(CreateTab("vps_config", "Tab.Configuration")); + + if (vm.DvdDriveInstalled && !createError) + tabsList.Add(CreateTab("vps_dvd", "Tab.DVD")); + + if (vm.SnapshotsNumber > 0 && !createError) + tabsList.Add(CreateTab("vps_snapshots", "Tab.Snapshots")); + + if ((vm.ExternalNetworkEnabled || vm.PrivateNetworkEnabled) && !createError) + tabsList.Add(CreateTab("vps_network", "Tab.Network")); + + //tabsList.Add(CreateTab("vps_permissions", "Tab.Permissions")); + //tabsList.Add(CreateTab("vps_tools", "Tab.Tools")); + tabsList.Add(CreateTab("vps_audit_log", "Tab.AuditLog")); + + if (!createError) + tabsList.Add(CreateTab("vps_help", "Tab.Help")); + + + // find selected menu item + int idx = 0; + foreach (Tab tab in tabsList) + { + if (String.Compare(tab.Id, SelectedTab, true) == 0) + break; + idx++; + } + dlTabs.SelectedIndex = idx; + + dlTabs.DataSource = tabsList; + dlTabs.DataBind(); + + // show provision error message + if(createError && idx == 0) + messageBox.ShowErrorMessage("VPS_PROVISION_ERROR"); + } + + private void BindTask(VirtualMachine vm) + { + task = ES.Services.Tasks.GetTaskWithLogRecords(vm.CurrentTaskId, DateTime.MinValue); + if (task == null) + return; + + // bind task details + litTaskName.Text = String.Format("{0} "{1}"", + GetAuditLogTaskName(task.Source, task.TaskName), + task.ItemName); + + // time + litStarted.Text = task.StartDate.ToString("T"); + TimeSpan d = (TimeSpan)(DateTime.Now - task.StartDate); + litElapsed.Text = new TimeSpan(d.Hours, d.Minutes, d.Seconds).ToString(); + + // bind records + repRecords.DataSource = task.GetLogs(); + repRecords.DataBind(); + } + + private Tab CreateTab(string id, string text) + { + return new Tab(id, GetLocalizedString(text), + HostModule.EditUrl("ItemID", PanelRequest.ItemID.ToString(), id, + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void repRecords_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + BackgroundTaskLogRecord record = (BackgroundTaskLogRecord)e.Item.DataItem; + + Literal litRecord = (Literal)e.Item.FindControl("litRecord"); + Gauge gauge = (Gauge)e.Item.FindControl("gauge"); + + if (litRecord != null) + { + string text = record.Text; + + // localize text + string locText = GetSharedLocalizedString("TaskActivity." + text); + if (locText != null) + text = locText; + + // format parameters + if (record.TextParameters != null + && record.TextParameters.Length > 0 + && record.Severity == 0) + text = String.Format(text, record.TextParameters); + + litRecord.Text = text; + + // gauge + gauge.Visible = false; + if (e.Item.ItemIndex == task.GetLogs().Count - 1) + { + if (task.IndicatorCurrent == -1) + litRecord.Text += "..."; + else + { + gauge.Visible = true; + gauge.Total = task.IndicatorMaximum; + gauge.Progress = task.IndicatorCurrent; + } + } + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.designer.cs new file mode 100644 index 00000000..fd9d70f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/UserControls/ServerTabs.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012.UserControls { + + + public partial class ServerTabs { + + /// + /// refreshTimer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.Timer refreshTimer; + + /// + /// TabsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel TabsPanel; + + /// + /// TaskTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable TaskTable; + + /// + /// litTaskName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litTaskName; + + /// + /// locStarted control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locStarted; + + /// + /// litStarted control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litStarted; + + /// + /// locElapsed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locElapsed; + + /// + /// litElapsed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litElapsed; + + /// + /// repRecords control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater repRecords; + + /// + /// TabsTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable TabsTable; + + /// + /// dlTabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList dlTabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx new file mode 100644 index 00000000..b589e4ec --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx @@ -0,0 +1,39 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcAddExternalAddress.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcAddExternalAddress" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AllocatePackageIPAddresses.ascx" TagName="AllocatePackageIPAddresses" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+
+
+ +
+
+ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.cs new file mode 100644 index 00000000..38ee774d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.cs @@ -0,0 +1,43 @@ +// 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.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcAddExternalAddress : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.designer.cs new file mode 100644 index 00000000..37393f5f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAddExternalAddress.ascx.designer.cs @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcAddExternalAddress { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// allocateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.AllocatePackageIPAddresses allocateAddresses; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx new file mode 100644 index 00000000..3df88dc9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx @@ -0,0 +1,34 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcAuditLog.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcAuditLog" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AuditLogControl.ascx" TagName="AuditLogControl" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.cs new file mode 100644 index 00000000..f2fea5eb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.cs @@ -0,0 +1,44 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcAuditLog : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.designer.cs new file mode 100644 index 00000000..8b560f54 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcAuditLog.ascx.designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcAuditLog { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// auditLog control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.AuditLogControl auditLog; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx new file mode 100644 index 00000000..6a22866b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx @@ -0,0 +1,570 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcCreateServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcCreate" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="Generation" Src="UserControls/Generation.ascx" %> +<%@ Register TagPrefix="wsp" TagName="DynamicMemory" Src="UserControls/DynamicMemory.ascx" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + * + + + + . + + + * + + +
 
+ + + * +
 
+ + + +
 
+ + + + * +
+
+ +
+ + +

+
+ + + + + + + + + + +
+ + +
+ + + + + + +
+ + * +
+ + + + + + +
+ + * +
+
+ + + + + + + + + + + + + +
+ + + * +
+
+ + + + + + + + +
+ +
+
+ + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+ +
+ + + + +

+
+ +

+ +

+ +
+ +
+ + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+
+
+ + + + +

+
+ +

+ +

+ + + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+
+ + + + + + + + + + +
+ +
+ +
+ + + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
 
+ +
 
+ +
 
+ +
+
+
+
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.cs new file mode 100644 index 00000000..8a0f8508 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.cs @@ -0,0 +1,375 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcCreate : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindFormControls(); + } + + // remove non-required steps + ToggleWizardSteps(); + + // toggle + ToggleControls(); + } + + private void ToggleWizardSteps() + { + // external network + if (!PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED)) + { + wizard.WizardSteps.Remove(stepExternalNetwork); + chkExternalNetworkEnabled.Checked = false; + } + + // private network + if (!PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED)) + { + wizard.WizardSteps.Remove(stepPrivateNetwork); + chkPrivateNetworkEnabled.Checked = false; + } + } + + private void BindFormControls() + { + // bind password policy + password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.VPS_POLICY, "AdministratorPasswordPolicy"); + + // OS templates + listOperatingSystems.DataSource = ES.Services.VPS2012.GetOperatingSystemTemplates(PanelSecurity.PackageId); + listOperatingSystems.DataBind(); + listOperatingSystems.Items.Insert(0, new ListItem(GetLocalizedString("SelectOsTemplate.Text"), "")); + + // summary letter e-mail + PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); + if (package != null) + { + UserInfo user = ES.Services.Users.GetUserById(package.UserId); + if (user != null) + { + chkSendSummary.Checked = true; + txtSummaryEmail.Text = user.Email; + } + } + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + // bind CPU cores + int maxCores = ES.Services.VPS2012.GetMaximumCpuCoresNumber(PanelSecurity.PackageId); + + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_CPU_NUMBER)) + { + QuotaValueInfo cpuQuota = cntx.Quotas[Quotas.VPS2012_CPU_NUMBER]; + + if (cpuQuota.QuotaAllocatedValue != -1 + && maxCores > cpuQuota.QuotaAllocatedValue) + maxCores = cpuQuota.QuotaAllocatedValue; + } + + for (int i = 1; i < maxCores + 1; i++) + ddlCpu.Items.Add(i.ToString()); + + ddlCpu.SelectedIndex = ddlCpu.Items.Count - 1; // select last (maximum) item + + // the user controls + GenerationSetting.BindItem(new VirtualMachine()); + DynamicMemorySetting.BindItem(new VirtualMachine()); + + // external network details + if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED)) + { + // bind list + PackageIPAddress[] ips = ES.Services.Servers.GetPackageUnassignedIPAddresses(PanelSecurity.PackageId, 0, IPAddressPool.VpsExternalNetwork); + foreach (PackageIPAddress ip in ips) + { + string txt = ip.ExternalIP; + if (!String.IsNullOrEmpty(ip.DefaultGateway)) + txt += "/" + ip.DefaultGateway; + listExternalAddresses.Items.Add(new ListItem(txt, ip.PackageAddressID.ToString())); + } + + // toggle controls + int maxAddresses = listExternalAddresses.Items.Count; + litMaxExternalAddresses.Text = String.Format(GetLocalizedString("litMaxExternalAddresses.Text"), maxAddresses); + if (maxAddresses > 0) + txtExternalAddressesNumber.Text = "1"; + } + + // private network + if (PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED)) + { + NetworkAdapterDetails nic = ES.Services.VPS2012.GetPrivateNetworkDetails(PanelSecurity.PackageId); + litPrivateNetworkFormat.Text = nic.NetworkFormat; + litPrivateSubnetMask.Text = nic.SubnetMask; + + // set max number + QuotaValueInfo privQuota = cntx.Quotas[Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER]; + int maxPrivate = privQuota.QuotaAllocatedValue; + if (maxPrivate == -1) + maxPrivate = 10; + + // handle DHCP mode + if (nic.IsDHCP) + { + maxPrivate = 0; + ViewState["DHCP"] = true; + } + + txtPrivateAddressesNumber.Text = "1"; + litMaxPrivateAddresses.Text = String.Format(GetLocalizedString("litMaxPrivateAddresses.Text"), maxPrivate); + } + + // RAM size + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_RAM)) + { + QuotaValueInfo ramQuota = cntx.Quotas[Quotas.VPS2012_RAM]; + if (ramQuota.QuotaAllocatedValue == -1) + { + // unlimited RAM + txtRam.Text = ""; + } + else + { + int availSize = ramQuota.QuotaAllocatedValue - ramQuota.QuotaUsedValue; + txtRam.Text = availSize < 0 ? "" : availSize.ToString(); + } + } + + // HDD size + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_HDD)) + { + QuotaValueInfo hddQuota = cntx.Quotas[Quotas.VPS2012_HDD]; + if (hddQuota.QuotaAllocatedValue == -1) + { + // unlimited HDD + txtHdd.Text = ""; + } + else + { + int availSize = hddQuota.QuotaAllocatedValue - hddQuota.QuotaUsedValue; + txtHdd.Text = availSize < 0 ? "" : availSize.ToString(); + } + } + + // snapshots number + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_SNAPSHOTS_NUMBER)) + { + int snapsNumber = cntx.Quotas[Quotas.VPS2012_SNAPSHOTS_NUMBER].QuotaAllocatedValue; + txtSnapshots.Text = (snapsNumber != -1) ? snapsNumber.ToString() : ""; + txtSnapshots.Enabled = (snapsNumber != 0); + } + + // toggle controls + BindCheckboxOption(chkDvdInstalled, Quotas.VPS2012_DVD_ENABLED); + chkBootFromCd.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_BOOT_CD_ALLOWED); + + BindCheckboxOption(chkStartShutdown, Quotas.VPS2012_START_SHUTDOWN_ALLOWED); + BindCheckboxOption(chkPauseResume, Quotas.VPS2012_PAUSE_RESUME_ALLOWED); + BindCheckboxOption(chkReset, Quotas.VPS2012_RESET_ALOWED); + BindCheckboxOption(chkReboot, Quotas.VPS2012_REBOOT_ALLOWED); + BindCheckboxOption(chkReinstall, Quotas.VPS2012_REINSTALL_ALLOWED); + } + + private void BindCheckboxOption(CheckBox chk, string quotaName) + { + chk.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, quotaName); + chk.Checked = chk.Enabled; + } + + private void ToggleControls() + { + // send letter + txtSummaryEmail.Enabled = chkSendSummary.Checked; + SummaryEmailValidator.Enabled = chkSendSummary.Checked; + + // external network + bool emptyIps = listExternalAddresses.Items.Count == 0; + EmptyExternalAddressesMessage.Visible = emptyIps; + tableExternalNetwork.Visible = chkExternalNetworkEnabled.Checked && !emptyIps; + chkExternalNetworkEnabled.Enabled = !emptyIps; + chkExternalNetworkEnabled.Checked = chkExternalNetworkEnabled.Checked && !emptyIps; + ExternalAddressesNumberRow.Visible = radioExternalRandom.Checked; + ExternalAddressesListRow.Visible = radioExternalSelected.Checked; + + // private network + tablePrivateNetwork.Visible = chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); + PrivateAddressesNumberRow.Visible = radioPrivateRandom.Checked; + PrivateAddressesListRow.Visible = radioPrivateSelected.Checked; + } + + private void BindSummary() + { + //VirtualMachine virtualMachine = new VirtualMachine(); + + //// the user controls + //GenerationSetting.SaveItem(virtualMachine); + //DynamicMemorySetting.BindItem(virtualMachine); + + // general + litHostname.Text = PortalAntiXSS.Encode(String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim())); + litOperatingSystem.Text = listOperatingSystems.SelectedItem.Text; + + litSummaryEmail.Text = PortalAntiXSS.Encode(txtSummaryEmail.Text.Trim()); + SummSummaryEmailRow.Visible = chkSendSummary.Checked; + + // config + litCpu.Text = PortalAntiXSS.Encode(ddlCpu.SelectedValue); + litRam.Text = PortalAntiXSS.Encode(txtRam.Text.Trim()); + //litGeneration.Text = CreareSettingsProviderControl != null ? PortalAntiXSS.Encode(virtualMachine.Generation.ToString()) : "1"; + litHdd.Text = PortalAntiXSS.Encode(txtHdd.Text.Trim()); + litSnapshots.Text = PortalAntiXSS.Encode(txtSnapshots.Text.Trim()); + optionDvdInstalled.Value = chkDvdInstalled.Checked; + optionBootFromCd.Value = chkBootFromCd.Checked; + optionNumLock.Value = chkNumLock.Checked; + optionStartShutdown.Value = chkStartShutdown.Checked; + optionPauseResume.Value = chkPauseResume.Checked; + optionReboot.Value = chkReboot.Checked; + optionReset.Value = chkReset.Checked; + optionReinstall.Value = chkReinstall.Checked; + + // external network + optionExternalNetwork.Value = chkExternalNetworkEnabled.Checked; + SummExternalAddressesNumberRow.Visible = radioExternalRandom.Checked && chkExternalNetworkEnabled.Checked; + litExternalAddressesNumber.Text = PortalAntiXSS.Encode(txtExternalAddressesNumber.Text.Trim()); + SummExternalAddressesListRow.Visible = radioExternalSelected.Checked && chkExternalNetworkEnabled.Checked; + + List ipAddresses = new List(); + foreach (ListItem li in listExternalAddresses.Items) + if (li.Selected) + ipAddresses.Add(li.Text); + litExternalAddresses.Text = PortalAntiXSS.Encode(String.Join(", ", ipAddresses.ToArray())); + + // private network + optionPrivateNetwork.Value = chkPrivateNetworkEnabled.Checked; + SummPrivateAddressesNumberRow.Visible = radioPrivateRandom.Checked && chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); + litPrivateAddressesNumber.Text = PortalAntiXSS.Encode(txtPrivateAddressesNumber.Text.Trim()); + SummPrivateAddressesListRow.Visible = radioPrivateSelected.Checked && chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); + + string[] privIps = Utils.ParseDelimitedString(txtPrivateAddressesList.Text, '\n', '\r', ' ', '\t'); + litPrivateAddressesList.Text = PortalAntiXSS.Encode(String.Join(", ", privIps)); + } + + protected void wizard_FinishButtonClick(object sender, WizardNavigationEventArgs e) + { + if (!Page.IsValid) + return; + + try + { + VirtualMachine virtualMachine = new VirtualMachine(); + + // the user controls + GenerationSetting.BindItem(virtualMachine); + DynamicMemorySetting.BindItem(virtualMachine); + + // collect and prepare data + string hostname = String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim()); + + string adminPassword = (string)ViewState["Password"]; + + // external IPs + List extIps = new List(); + foreach (ListItem li in listExternalAddresses.Items) + if (li.Selected) extIps.Add(Utils.ParseInt(li.Value)); + + // private IPs + string[] privIps = Utils.ParseDelimitedString(txtPrivateAddressesList.Text, '\n', '\r', ' ', '\t'); + + string summaryEmail = chkSendSummary.Checked ? txtSummaryEmail.Text.Trim() : null; + + // create virtual machine + IntResult res = ES.Services.VPS2012.CreateVirtualMachine(PanelSecurity.PackageId, + hostname, listOperatingSystems.SelectedValue, adminPassword, summaryEmail, + virtualMachine.Generation, Utils.ParseInt(ddlCpu.SelectedValue), Utils.ParseInt(txtRam.Text.Trim()), + Utils.ParseInt(txtHdd.Text.Trim()), Utils.ParseInt(txtSnapshots.Text.Trim()), + chkDvdInstalled.Checked, chkBootFromCd.Checked, chkNumLock.Checked, + chkStartShutdown.Checked, chkPauseResume.Checked, chkReboot.Checked, chkReset.Checked, chkReinstall.Checked, + chkExternalNetworkEnabled.Checked, Utils.ParseInt(txtExternalAddressesNumber.Text.Trim()), radioExternalRandom.Checked, extIps.ToArray(), + chkPrivateNetworkEnabled.Checked, Utils.ParseInt(txtPrivateAddressesNumber.Text.Trim()), radioPrivateRandom.Checked, privIps); + + if (res.IsSuccess) + { + Response.Redirect(EditUrl("ItemID", res.Value.ToString(), "vps_general", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_CREATE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_CREATE", ex); + } + } + + protected void wizard_SideBarButtonClick(object sender, WizardNavigationEventArgs e) + { + if (e.NextStepIndex < e.CurrentStepIndex) + return; + + // save password + if (wizard.ActiveStepIndex == 0) + ViewState["Password"] = password.Password; + + Page.Validate("VpsWizard"); + + if (!Page.IsValid) + e.Cancel = true; + } + + protected void wizard_ActiveStepChanged(object sender, EventArgs e) + { + BindSummary(); + } + + protected void wizard_NextButtonClick(object sender, WizardNavigationEventArgs e) + { + // save password + if (wizard.ActiveStepIndex == 0) + ViewState["Password"] = password.Password; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.designer.cs new file mode 100644 index 00000000..51cbe0be --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcCreateServer.ascx.designer.cs @@ -0,0 +1,1365 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcCreate { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// wizard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Wizard wizard; + + /// + /// stepName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepName; + + /// + /// locNameStepTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNameStepTitle; + + /// + /// locHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHostname; + + /// + /// txtHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHostname; + + /// + /// HostnameValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator HostnameValidator; + + /// + /// valCorrectHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectHostname; + + /// + /// txtDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDomain; + + /// + /// DomainValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator DomainValidator; + + /// + /// valNewDomainFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valNewDomainFormat; + + /// + /// locOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOperatingSystem; + + /// + /// listOperatingSystems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList listOperatingSystems; + + /// + /// OperatingSystemValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator OperatingSystemValidator; + + /// + /// locAdminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdminPassword; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.PasswordControl password; + + /// + /// chkSendSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendSummary; + + /// + /// txtSummaryEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSummaryEmail; + + /// + /// SummaryEmailValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SummaryEmailValidator; + + /// + /// stepConfig control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepConfig; + + /// + /// locConfigStepTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locConfigStepTitle; + + /// + /// secResources control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secResources; + + /// + /// ResourcesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ResourcesPanel; + + /// + /// lblCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCpu; + + /// + /// ddlCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlCpu; + + /// + /// locCores control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCores; + + /// + /// lblRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRam; + + /// + /// txtRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRam; + + /// + /// RequireRamValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireRamValidator; + + /// + /// locMB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMB; + + /// + /// lblHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblHdd; + + /// + /// txtHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHdd; + + /// + /// RequireHddValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireHddValidator; + + /// + /// locGB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGB; + + /// + /// GenerationSetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Generation GenerationSetting; + + /// + /// DynamicMemorySetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.DynamicMemory DynamicMemorySetting; + + /// + /// secSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSnapshots; + + /// + /// SnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SnapshotsPanel; + + /// + /// locSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots; + + /// + /// txtSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSnapshots; + + /// + /// SnapshotsValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SnapshotsValidator; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// chkDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDvdInstalled; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// chkBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkBootFromCd; + + /// + /// chkNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNumLock; + + /// + /// secActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secActions; + + /// + /// ActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ActionsPanel; + + /// + /// chkStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkStartShutdown; + + /// + /// chkReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReset; + + /// + /// chkPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPauseResume; + + /// + /// chkReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReinstall; + + /// + /// chkReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReboot; + + /// + /// stepExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepExternalNetwork; + + /// + /// locExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalNetwork; + + /// + /// chkExternalNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExternalNetworkEnabled; + + /// + /// EmptyExternalAddressesMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl EmptyExternalAddressesMessage; + + /// + /// locNotEnoughExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNotEnoughExternalAddresses; + + /// + /// tableExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tableExternalNetwork; + + /// + /// radioExternalRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalRandom; + + /// + /// ExternalAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesNumberRow; + + /// + /// locExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddresses; + + /// + /// txtExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExternalAddressesNumber; + + /// + /// ExternalAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExternalAddressesValidator; + + /// + /// litMaxExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxExternalAddresses; + + /// + /// radioExternalSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalSelected; + + /// + /// ExternalAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesListRow; + + /// + /// listExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox listExternalAddresses; + + /// + /// locHoldCtrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHoldCtrl; + + /// + /// stepPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepPrivateNetwork; + + /// + /// locPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetwork; + + /// + /// chkPrivateNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPrivateNetworkEnabled; + + /// + /// tablePrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tablePrivateNetwork; + + /// + /// radioPrivateRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateRandom; + + /// + /// PrivateAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesNumberRow; + + /// + /// locPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddresses; + + /// + /// txtPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesNumber; + + /// + /// PrivateAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator PrivateAddressesValidator; + + /// + /// litMaxPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxPrivateAddresses; + + /// + /// radioPrivateSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateSelected; + + /// + /// PrivateAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesListRow; + + /// + /// txtPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesList; + + /// + /// locOnePerLine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOnePerLine; + + /// + /// locPrivateNetworkFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetworkFormat; + + /// + /// litPrivateNetworkFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateNetworkFormat; + + /// + /// locPrivateSubnetMask control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateSubnetMask; + + /// + /// litPrivateSubnetMask control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateSubnetMask; + + /// + /// stepSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.WizardStep stepSummary; + + /// + /// locSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSummary; + + /// + /// locNameStepTitle2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNameStepTitle2; + + /// + /// Localize1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize Localize1; + + /// + /// litHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHostname; + + /// + /// Localize2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize Localize2; + + /// + /// litOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litOperatingSystem; + + /// + /// SummSummaryEmailRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummSummaryEmailRow; + + /// + /// locSendSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSendSummary; + + /// + /// litSummaryEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSummaryEmail; + + /// + /// locConfig2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locConfig2; + + /// + /// locCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCpu; + + /// + /// litCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpu; + + /// + /// locRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRam; + + /// + /// litRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRam; + + /// + /// locGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGeneration; + + /// + /// litGeneration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litGeneration; + + /// + /// locHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHdd; + + /// + /// litHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHdd; + + /// + /// locSnapshots2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots2; + + /// + /// litSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSnapshots; + + /// + /// locDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdInstalled; + + /// + /// optionDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionDvdInstalled; + + /// + /// locBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBootFromCd; + + /// + /// optionBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionBootFromCd; + + /// + /// locNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNumLock; + + /// + /// optionNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionNumLock; + + /// + /// locStartShutdownAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locStartShutdownAllowed; + + /// + /// optionStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionStartShutdown; + + /// + /// locPauseResumeAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPauseResumeAllowed; + + /// + /// optionPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPauseResume; + + /// + /// locRebootAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRebootAllowed; + + /// + /// optionReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReboot; + + /// + /// locResetAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locResetAllowed; + + /// + /// optionReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReset; + + /// + /// locReinstallAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locReinstallAllowed; + + /// + /// optionReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReinstall; + + /// + /// locExternalNetwork2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalNetwork2; + + /// + /// locExternalNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalNetworkEnabled; + + /// + /// optionExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionExternalNetwork; + + /// + /// SummExternalAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummExternalAddressesNumberRow; + + /// + /// locExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddressesNumber; + + /// + /// litExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExternalAddressesNumber; + + /// + /// SummExternalAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummExternalAddressesListRow; + + /// + /// locExternalAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddressesList; + + /// + /// litExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExternalAddresses; + + /// + /// locPrivateNetwork2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetwork2; + + /// + /// locPrivateNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateNetworkEnabled; + + /// + /// optionPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPrivateNetwork; + + /// + /// SummPrivateAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummPrivateAddressesNumberRow; + + /// + /// locPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddressesNumber; + + /// + /// litPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateAddressesNumber; + + /// + /// SummPrivateAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow SummPrivateAddressesListRow; + + /// + /// locPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddressesList; + + /// + /// litPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivateAddressesList; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx new file mode 100644 index 00000000..7d150f05 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx @@ -0,0 +1,61 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcExternalNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcExternalNetwork" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PackageIPAddresses.ascx" TagName="PackageIPAddresses" TagPrefix="wsp" %> + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +
+ + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.cs new file mode 100644 index 00000000..e8b3ec31 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.cs @@ -0,0 +1,45 @@ +// 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.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.WebPortal; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcExternalNetwork : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + packageAddresses.ManageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.designer.cs new file mode 100644 index 00000000..c31d05c7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcExternalNetwork.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcExternalNetwork { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// packageAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.PackageIPAddresses packageAddresses; + + /// + /// secQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas; + + /// + /// QuotasPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel QuotasPanel; + + /// + /// locIPQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locIPQuota; + + /// + /// addressesQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota addressesQuota; + + /// + /// locBandwidthQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBandwidthQuota; + + /// + /// bandwidthQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota bandwidthQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx new file mode 100644 index 00000000..8e1fbfce --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx @@ -0,0 +1,139 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcHome.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcHome" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+
+ + +
+
+ +
+
+ + + + + + + + + <%# Eval("ItemName") %> + + + + + + + + + <%# Eval("PackageName") %> + + + + + + + <%# Eval("UserName") %> + + + + + + + + + + + +   + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs new file mode 100644 index 00000000..b1adc433 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.cs @@ -0,0 +1,138 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcHome : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); + searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username")); + searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP")); + searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); + } + + // toggle columns + bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User; + gvServers.Columns[3].Visible = !isUserSelected; + gvServers.Columns[4].Visible = !isUserSelected; + + // check package quotas + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + + btnCreate.Visible = manageAllowed; + btnImport.Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); + gvServers.Columns[5].Visible = manageAllowed; // delete column + + // admin operations column + gvServers.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); + } + + public string GetServerEditUrl(string itemID) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_general", + "ItemID=" + itemID); + } + + public string GetSpaceHomeUrl(string spaceId) + { + return EditUrl("SpaceID", spaceId, ""); + } + + public string GetUserHomeUrl(int userId) + { + return PortalUtils.GetUserHomePageUrl(userId); + } + + protected void odsServersPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOXES", e.Exception); + e.ExceptionHandled = true; + } + } + + protected void btnCreate_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vdc_create_server")); + } + + protected void btnImport_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vdc_import_server")); + } + + protected void gvServers_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + // get server ID + int itemId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + // go to delete page + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_tools_delete", + "ItemID=" + itemId)); + } + else if (e.CommandName == "Detach") + { + // remove item from meta base + int itemId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + int result = ES.Services.Packages.DetachPackageItem(itemId); + if (result < 0) + { + ShowResultMessage(result); + return; + } + + // refresh the list + gvServers.DataBind(); + } + else if (e.CommandName == "Move") + { + // get server ID + int itemId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + // go to delete page + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_tools_move", + "ItemID=" + itemId)); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.designer.cs new file mode 100644 index 00000000..0425a5ad --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcHome { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnCreate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreate; + + /// + /// btnImport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnImport; + + /// + /// searchBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.SearchBox searchBox; + + /// + /// gvServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvServers; + + /// + /// odsServersPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsServersPaged; + + /// + /// secQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas; + + /// + /// QuotasPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel QuotasPanel; + + /// + /// locVpsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVpsQuota; + + /// + /// vpsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota vpsQuota; + + /// + /// locRamQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRamQuota; + + /// + /// ramQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota ramQuota; + + /// + /// locHddQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHddQuota; + + /// + /// hddQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota hddQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx new file mode 100644 index 00000000..c9e4f6e5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx @@ -0,0 +1,283 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcImportServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcImportServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
 
+ +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + +
+ + + + + +
+
+ + + + + + + + +
+ + +
+
+ + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+
+ + + + + + + + + + + + + +
+ + + +
+ + + + + +
+
+
+ +

+ + +

+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.cs new file mode 100644 index 00000000..11a4c795 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.cs @@ -0,0 +1,231 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcImportServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // bind hyper-V services + BindHyperVServices(); + + // bind virtual machines + BindVirtualMachines(); + + // bind OS templates + BindOsTemplates(); + + // bind IP addresses + BindExternalAddresses(); + BindManagementAddresses(); + } + + ToggleControls(); + } + + private void ToggleControls() + { + AdminPasswordPanel.Visible = EnableRemoteDesktop.Checked; + RequiredAdminPassword.Enabled = EnableRemoteDesktop.Checked; + VirtualMachinePanel.Visible = (VirtualMachines.SelectedValue != ""); + ExternalAddressesRow.Visible = (ExternalAdapters.SelectedIndex != 0); + ManagementAddressesRow.Visible = (ManagementAdapters.SelectedIndex != 0); + } + + public void BindHyperVServices() + { + // bind + HyperVServices.DataSource = ES.Services.Servers.GetRawServicesByGroupName(ResourceGroups.VPS2012).Tables[0].DefaultView; + HyperVServices.DataBind(); + + // add select value + HyperVServices.Items.Insert(0, new ListItem(GetLocalizedString("SelectHyperVService.Text"), "")); + } + + public void BindVirtualMachines() + { + // clear list + VirtualMachines.Items.Clear(); + + // bind + int serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0); + if (serviceId > 0) + { + VirtualMachines.DataSource = ES.Services.VPS2012.GetVirtualMachinesByServiceId(serviceId); + VirtualMachines.DataBind(); + } + + // add select value + VirtualMachines.Items.Insert(0, new ListItem(GetLocalizedString("SelectVirtualMachine.Text"), "")); + } + + public void BindOsTemplates() + { + // clear list + OsTemplates.Items.Clear(); + + int serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0); + if (serviceId > 0) + { + OsTemplates.DataSource = ES.Services.VPS2012.GetOperatingSystemTemplatesByServiceId(serviceId); + OsTemplates.DataBind(); + } + OsTemplates.Items.Insert(0, new ListItem(GetLocalizedString("SelectOsTemplate.Text"), "")); + } + + public void BindVirtualMachineDetails() + { + int serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0); + string vmId = VirtualMachines.SelectedValue; + if (serviceId > 0 && vmId != "") + { + VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineExtendedInfo(serviceId, vmId); + if (vm != null) + { + // bind VM + CpuCores.Text = vm.CpuCores.ToString(); + RamSize.Text = vm.RamSize.ToString(); + HddSize.Text = vm.HddSize.ToString(); + VhdPath.Text = vm.VirtualHardDrivePath; + + // other settings + NumLockEnabled.Value = vm.NumLockEnabled; + BootFromCd.Value = vm.BootFromCD; + DvdInstalled.Value = vm.DvdDriveInstalled; + + // network adapters + ExternalAdapters.DataSource = vm.Adapters; + ExternalAdapters.DataBind(); + ExternalAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), "")); + + ManagementAdapters.DataSource = vm.Adapters; + ManagementAdapters.DataBind(); + ManagementAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), "")); + } + } + } + + public void BindExternalAddresses() + { + BindAddresses(ExternalAddresses, IPAddressPool.VpsExternalNetwork); + } + + public void BindManagementAddresses() + { + BindAddresses(ManagementAddresses, IPAddressPool.VpsManagementNetwork); + } + + public void BindAddresses(ListBox list, IPAddressPool pool) + { + IPAddressInfo[] ips = ES.Services.Servers.GetUnallottedIPAddresses(PanelSecurity.PackageId, ResourceGroups.VPS2012, pool); + foreach (IPAddressInfo ip in ips) + { + string txt = ip.ExternalIP; + if (!String.IsNullOrEmpty(ip.DefaultGateway)) + txt += "/" + ip.DefaultGateway; + list.Items.Add(new ListItem(txt, ip.AddressId.ToString())); + } + } + + protected void btnImport_Click(object sender, EventArgs e) + { + try + { + // external IPs + List extIps = new List(); + foreach (ListItem li in ExternalAddresses.Items) + if (li.Selected) extIps.Add(Utils.ParseInt(li.Value)); + + // management IPs + int manIp = 0; + foreach (ListItem li in ManagementAddresses.Items) + if (li.Selected) + { + manIp = Utils.ParseInt(li.Value); + break; + } + + // create virtual machine + IntResult res = ES.Services.VPS2012.ImportVirtualMachine(PanelSecurity.PackageId, + Utils.ParseInt(HyperVServices.SelectedValue), + VirtualMachines.SelectedValue, + OsTemplates.SelectedValue, adminPassword.Text, + AllowStartShutdown.Checked, AllowPause.Checked, AllowReboot.Checked, AllowReset.Checked, false, + ExternalAdapters.SelectedValue, extIps.ToArray(), + ManagementAdapters.SelectedValue, manIp); + + if (res.IsSuccess) + { + Response.Redirect(EditUrl("ItemID", res.Value.ToString(), "vps_general", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_IMPORT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_IMPORT", ex); + } + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + } + + protected void HyperVServices_SelectedIndexChanged(object sender, EventArgs e) + { + // bind VMs + BindVirtualMachines(); + + // bind OS templates + BindOsTemplates(); + } + + protected void VirtualMachines_SelectedIndexChanged(object sender, EventArgs e) + { + BindVirtualMachineDetails(); + ToggleControls(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.designer.cs new file mode 100644 index 00000000..6b29702f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcImportServer.ascx.designer.cs @@ -0,0 +1,627 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcImportServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHyperVService; + + /// + /// HyperVServices control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList HyperVServices; + + /// + /// RequireHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireHyperVService; + + /// + /// locVirtualMachine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVirtualMachine; + + /// + /// VirtualMachines control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList VirtualMachines; + + /// + /// RequiredVirtualMachine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredVirtualMachine; + + /// + /// secOsTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secOsTemplate; + + /// + /// OsTemplatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel OsTemplatePanel; + + /// + /// locOsTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOsTemplate; + + /// + /// OsTemplates control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList OsTemplates; + + /// + /// RequiredOsTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredOsTemplate; + + /// + /// EnableRemoteDesktop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox EnableRemoteDesktop; + + /// + /// AdminPasswordPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow AdminPasswordPanel; + + /// + /// locAdminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdminPassword; + + /// + /// adminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox adminPassword; + + /// + /// RequiredAdminPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredAdminPassword; + + /// + /// VirtualMachinePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel VirtualMachinePanel; + + /// + /// secConfiguration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secConfiguration; + + /// + /// ConfigurationPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ConfigurationPanel; + + /// + /// locCPU control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCPU; + + /// + /// CpuCores control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal CpuCores; + + /// + /// locRAM control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRAM; + + /// + /// RamSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal RamSize; + + /// + /// locHDD control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHDD; + + /// + /// HddSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal HddSize; + + /// + /// locVhdPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVhdPath; + + /// + /// VhdPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal VhdPath; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// BootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption BootFromCd; + + /// + /// locBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locBootFromCd; + + /// + /// NumLockEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption NumLockEnabled; + + /// + /// locNumLockEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNumLockEnabled; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// DvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption DvdInstalled; + + /// + /// locDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdInstalled; + + /// + /// secAllowedActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secAllowedActions; + + /// + /// AllowedActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel AllowedActionsPanel; + + /// + /// AllowStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowStartShutdown; + + /// + /// AllowReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowReboot; + + /// + /// AllowPause control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowPause; + + /// + /// AllowReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox AllowReset; + + /// + /// secExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secExternalNetwork; + + /// + /// ExternalNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ExternalNetworkPanel; + + /// + /// locExternalAdapter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAdapter; + + /// + /// ExternalAdapters control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ExternalAdapters; + + /// + /// ExternalAddressesRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesRow; + + /// + /// locExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddresses; + + /// + /// ExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox ExternalAddresses; + + /// + /// RequiredExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredExternalAddresses; + + /// + /// secManagementNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secManagementNetwork; + + /// + /// ManagementNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ManagementNetworkPanel; + + /// + /// locManagementAdapter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locManagementAdapter; + + /// + /// ManagementAdapters control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ManagementAdapters; + + /// + /// ManagementAddressesRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ManagementAddressesRow; + + /// + /// locManagementAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locManagementAddresses; + + /// + /// ManagementAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox ManagementAddresses; + + /// + /// RequiredManagementAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredManagementAddresses; + + /// + /// btnImport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnImport; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx new file mode 100644 index 00000000..60247599 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx @@ -0,0 +1,39 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcManagementNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcManagementNetwork" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PackageIPAddresses.ascx" TagName="PackageIPAddresses" TagPrefix="wsp" %> + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.cs new file mode 100644 index 00000000..121d9c43 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.cs @@ -0,0 +1,44 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcManagementNetwork : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.designer.cs new file mode 100644 index 00000000..55cc9f69 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcManagementNetwork.ascx.designer.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcManagementNetwork { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// packageAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.PackageIPAddresses packageAddresses; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx new file mode 100644 index 00000000..5e4cbd79 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx @@ -0,0 +1,121 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcPermissions.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcPermissions" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.cs new file mode 100644 index 00000000..b36dba6d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.cs @@ -0,0 +1,56 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcPermissions : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnUpdateVdcPermissions_Click(object sender, EventArgs e) + { + System.Threading.Thread.Sleep(5000); + messageBox.ShowSuccessMessage("VDC_PERMISSIONS_VDC_UPDATED"); + } + + protected void btnUpdateVpsPermissions_Click(object sender, EventArgs e) + { + System.Threading.Thread.Sleep(5000); + messageBox.ShowSuccessMessage("VDC_PERMISSIONS_VPS_UPDATED"); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.designer.cs new file mode 100644 index 00000000..48ccd1ab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPermissions.ascx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcPermissions { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secVdcPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secVdcPermissions; + + /// + /// VdcPermissionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel VdcPermissionsPanel; + + /// + /// gvVdcPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvVdcPermissions; + + /// + /// btnUpdateVdcPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdateVdcPermissions; + + /// + /// secVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secVpsPermissions; + + /// + /// VpsPermissionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel VpsPermissionsPanel; + + /// + /// gvVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvVpsPermissions; + + /// + /// btnUpdateVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdateVpsPermissions; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx new file mode 100644 index 00000000..694c1296 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx @@ -0,0 +1,98 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VdcPrivateNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VdcPrivateNetwork" %> +<%@ Import Namespace="WebsitePanel.Portal" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + +
+
+
+
+ +
+
+ + + + + + + + + <%# Eval("ItemName") %> + + + + + + +   + + + + + + + + + + + +
+ + + + + + + + + + +
+ + +
+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs new file mode 100644 index 00000000..62f0076e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.cs @@ -0,0 +1,66 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.WebPortal; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VdcPrivateNetwork : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + searchBox.AddCriteria("IPAddress", GetLocalizedString("SearchField.IPAddress")); + searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName")); + } + } + + public string GetServerEditUrl(string itemID) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "vps_general", + "ItemID=" + itemID); + } + + protected void odsPrivateAddressesPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOXES", e.Exception); + e.ExceptionHandled = true; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.designer.cs new file mode 100644 index 00000000..94d7c078 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcPrivateNetwork.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VdcPrivateNetwork { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// searchBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.SearchBox searchBox; + + /// + /// gvAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvAddresses; + + /// + /// odsPrivateAddressesPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsPrivateAddressesPaged; + + /// + /// secQuotas control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas; + + /// + /// QuotasPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel QuotasPanel; + + /// + /// locVpsAddressesQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locVpsAddressesQuota; + + /// + /// addressesPerVps control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota addressesPerVps; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx new file mode 100644 index 00000000..2151135a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="VirtualMachineImage.ashx.cs" Class="WebsitePanel.Portal.VPS2012.VirtualMachineImage" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx.cs new file mode 100644 index 00000000..4b09917e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx.cs @@ -0,0 +1,66 @@ +// 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.Text; +using System.Web; +using System.Web.Services; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + /// + /// Summary description for $codebehindclassname$ + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + public class VirtualMachineImage : IHttpHandler + { + + public void ProcessRequest(HttpContext context) + { + context.Response.Clear(); + context.Response.ContentType = "image/png"; + + int itemId = Utils.ParseInt(context.Request.QueryString["ItemID"]); + byte[] buffer = ES.Services.VPS2012.GetVirtualMachineThumbnail(itemId, + WebsitePanel.Providers.Virtualization.ThumbnailSize.Medium160x120); + if (buffer != null) + { + context.Response.OutputStream.Write(buffer, 0, buffer.Length); + } + } + + public bool IsReusable + { + get + { + return false; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx new file mode 100644 index 00000000..4ce22da5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="VirtualMachineSnapshotImage.ashx.cs" Class="WebsitePanel.Portal.VPS2012.VirtualMachineSnapshotImage" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx.cs new file mode 100644 index 00000000..12ad091c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx.cs @@ -0,0 +1,71 @@ +// 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.Web; +using System.Web.Services; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + /// + /// Summary description for $codebehindclassname$ + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + public class VirtualMachineSnapshotImage : IHttpHandler + { + + public void ProcessRequest(HttpContext context) + { + context.Response.Clear(); + context.Response.ContentType = "image/png"; + + HttpRequest req = context.Request; + + int itemId = Utils.ParseInt(req["ItemID"]); + string snapshotId = req["SnapshotID"]; + + byte[] res = ES.Services.VPS2012.GetSnapshotThumbnail(itemId, snapshotId, + WebsitePanel.Providers.Virtualization.ThumbnailSize.Medium160x120); + if (res != null) + { + context.Response.OutputStream.Write(res, 0, res.Length); + } + } + + public bool IsReusable + { + get + { + return false; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx new file mode 100644 index 00000000..84bcae9d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx @@ -0,0 +1,101 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsAddExternalAddress.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsAddExternalAddress" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + +

+ +

+ +
+ +
+ + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+ +

+ + +

+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.cs new file mode 100644 index 00000000..3cfabfb0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.cs @@ -0,0 +1,119 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsAddExternalAddress : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + ToggleControls(); + + if (!IsPostBack) + { + BindExternalIPAddresses(); + } + } + + private void BindExternalIPAddresses() + { + PackageIPAddress[] ips = ES.Services.Servers.GetPackageUnassignedIPAddresses(PanelSecurity.PackageId, 0, IPAddressPool.VpsExternalNetwork); + foreach (PackageIPAddress ip in ips) + { + string txt = ip.ExternalIP; + if (!String.IsNullOrEmpty(ip.DefaultGateway)) + txt += "/" + ip.DefaultGateway; + listExternalAddresses.Items.Add(new ListItem(txt, ip.PackageAddressID.ToString())); + } + + // toggle controls + int maxAddresses = listExternalAddresses.Items.Count; + litMaxExternalAddresses.Text = String.Format(GetLocalizedString("litMaxExternalAddresses.Text"), maxAddresses); + + bool empty = maxAddresses == 0; + EmptyExternalAddressesMessage.Visible = empty; + ExternalAddressesTable.Visible = !empty; + btnAdd.Enabled = !empty; + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack(); + } + + private void RedirectBack() + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_network", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + private void ToggleControls() + { + // external network + ExternalAddressesNumberRow.Visible = radioExternalRandom.Checked; + ExternalAddressesListRow.Visible = radioExternalSelected.Checked; + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + int number = Utils.ParseInt(txtExternalAddressesNumber.Text.Trim(), 0); + List addressIds = new List(); + foreach (ListItem li in listExternalAddresses.Items) + if (li.Selected) + addressIds.Add(Utils.ParseInt(li.Value, 0)); + + try + { + ResultObject res = ES.Services.VPS2012.AddVirtualMachineExternalIPAddresses(PanelRequest.ItemID, + radioExternalRandom.Checked, number, addressIds.ToArray()); + + if (res.IsSuccess) + { + RedirectBack(); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_ADDING_IP_ADDRESS", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_ADDING_IP_ADDRESS", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.designer.cs new file mode 100644 index 00000000..3608ce14 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddExternalAddress.ascx.designer.cs @@ -0,0 +1,231 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsAddExternalAddress { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// EmptyExternalAddressesMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl EmptyExternalAddressesMessage; + + /// + /// locNotEnoughExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNotEnoughExternalAddresses; + + /// + /// ExternalAddressesTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable ExternalAddressesTable; + + /// + /// radioExternalRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalRandom; + + /// + /// ExternalAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesNumberRow; + + /// + /// locExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExternalAddresses; + + /// + /// txtExternalAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExternalAddressesNumber; + + /// + /// ExternalAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExternalAddressesValidator; + + /// + /// litMaxExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxExternalAddresses; + + /// + /// radioExternalSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioExternalSelected; + + /// + /// ExternalAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow ExternalAddressesListRow; + + /// + /// listExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox listExternalAddresses; + + /// + /// locHoldCtrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHoldCtrl; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx new file mode 100644 index 00000000..868b526e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx @@ -0,0 +1,96 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsAddPrivateAddress.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsAddPrivateAddress" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + +

+ +

+ + + + + + + + + + + + + + +
+ +
+ + + + + * + + +
+ +
+ +
+ +
+ +

+ + +

+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.cs new file mode 100644 index 00000000..76f01916 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.cs @@ -0,0 +1,118 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsAddPrivateAddress : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindControls(); + } + + ToggleControls(); + } + + private void BindControls() + { + // load adapter details + NetworkAdapterDetails nic = ES.Services.VPS2012.GetPrivateNetworkAdapterDetails(PanelRequest.ItemID); + + // load package context + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER)) + { + // set max number + QuotaValueInfo privQuota = cntx.Quotas[Quotas.VPS2012_PRIVATE_IP_ADDRESSES_NUMBER]; + int maxPrivate = privQuota.QuotaAllocatedValue; + if (maxPrivate == -1) + maxPrivate = 10; + + maxPrivate -= nic.IPAddresses.Length; + + txtPrivateAddressesNumber.Text = maxPrivate.ToString(); + litMaxPrivateAddresses.Text = String.Format(GetLocalizedString("litMaxPrivateAddresses.Text"), maxPrivate); + btnAdd.Enabled = maxPrivate > 0; + } + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + int number = Utils.ParseInt(txtPrivateAddressesNumber.Text.Trim(), 0); + string[] privIps = Utils.ParseDelimitedString(txtPrivateAddressesList.Text, '\n', '\r', ' ', '\t'); + + try + { + ResultObject res = ES.Services.VPS2012.AddVirtualMachinePrivateIPAddresses(PanelRequest.ItemID, + radioPrivateRandom.Checked, number, privIps); + + if (res.IsSuccess) + { + RedirectBack(); + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_ADDING_IP_ADDRESS", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_ADDING_IP_ADDRESS", ex); + } + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack(); + } + + private void RedirectBack() + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_network", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + private void ToggleControls() + { + // private network + PrivateAddressesNumberRow.Visible = radioPrivateRandom.Checked; + PrivateAddressesListRow.Visible = radioPrivateSelected.Checked; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.designer.cs new file mode 100644 index 00000000..3ebff9d0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAddPrivateAddress.ascx.designer.cs @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsAddPrivateAddress { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// tablePrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tablePrivateNetwork; + + /// + /// radioPrivateRandom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateRandom; + + /// + /// PrivateAddressesNumberRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesNumberRow; + + /// + /// locPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivateAddresses; + + /// + /// txtPrivateAddressesNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesNumber; + + /// + /// PrivateAddressesValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator PrivateAddressesValidator; + + /// + /// litMaxPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litMaxPrivateAddresses; + + /// + /// radioPrivateSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton radioPrivateSelected; + + /// + /// PrivateAddressesListRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow PrivateAddressesListRow; + + /// + /// txtPrivateAddressesList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateAddressesList; + + /// + /// locOnePerLine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOnePerLine; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx new file mode 100644 index 00000000..f5036c28 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx @@ -0,0 +1,37 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsAuditLog.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsAuditLog" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/AuditLogControl.ascx" TagName="AuditLogControl" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.cs new file mode 100644 index 00000000..47d49b34 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.cs @@ -0,0 +1,44 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsAuditLog : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.designer.cs new file mode 100644 index 00000000..d629a48c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsAuditLog.ascx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsAuditLog { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// auditLog control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.AuditLogControl auditLog; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx new file mode 100644 index 00000000..2dbb9845 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx @@ -0,0 +1,257 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsConfiguration.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsConfiguration" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + +
+ +
+ ******** + +
+
+ + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+
+ + + + + + + + + +
+ +
+
+ + + + + + + + +
+ +
+
+ + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + +
+
+
+
+ +

+ +

+ + +
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.cs new file mode 100644 index 00000000..18ec2f17 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.cs @@ -0,0 +1,132 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsConfiguration : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack && Request["action"] == "changed") + messageBox.ShowSuccessMessage("VPS_CHANGE_VM_CONFIGURATION"); + + if (!IsPostBack) + { + // config + BindConfiguration(); + + // bind password policy + password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.VPS_POLICY, "AdministratorPasswordPolicy"); + } + } + + private void BindConfiguration() + { + VirtualMachine vm = null; + + try + { + // load machine + vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + + if (vm == null) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM"); + return; + } + + // bind item + litOperatingSystem.Text = vm.OperatingSystemTemplate; + + litCpu.Text = String.Format(GetLocalizedString("CpuCores.Text"), vm.CpuCores); + litRam.Text = String.Format(GetLocalizedString("Ram.Text"), vm.RamSize); + litHdd.Text = String.Format(GetLocalizedString("Hdd.Text"), vm.HddSize); + litSnapshots.Text = vm.SnapshotsNumber.ToString(); + + optionDvdInstalled.Value = vm.DvdDriveInstalled; + optionBootFromCD.Value = vm.BootFromCD; + optionNumLock.Value = vm.NumLockEnabled; + + optionStartShutdown.Value = vm.StartTurnOffAllowed; + optionPauseResume.Value = vm.PauseResumeAllowed; + optionReset.Value = vm.ResetAllowed; + optionReboot.Value = vm.RebootAllowed; + optionReinstall.Value = vm.ReinstallAllowed; + + optionExternalNetwork.Value = vm.ExternalNetworkEnabled; + optionPrivateNetwork.Value = vm.PrivateNetworkEnabled; + + // toggle buttons + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + btnEdit.Visible = manageAllowed; + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM", ex); + } + } + + protected void btnChangePassword_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.ChangeAdministratorPassword(PanelRequest.ItemID, password.Password); + + if (res.IsSuccess) + { + // show success message + messageBox.ShowSuccessMessage("VPS_CHANGE_ADMIN_PASSWORD"); + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_CHANGE_ADMIN_PASSWORD", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_CHANGE_ADMIN_PASSWORD", ex); + } + } + + protected void btnEdit_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_edit_config", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.designer.cs new file mode 100644 index 00000000..ba604a17 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsConfiguration.ascx.designer.cs @@ -0,0 +1,474 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsConfiguration { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secSoftware control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSoftware; + + /// + /// SoftwarePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SoftwarePanel; + + /// + /// locOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOperatingSystem; + + /// + /// litOperatingSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litOperatingSystem; + + /// + /// locAdministratorPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdministratorPassword; + + /// + /// btnChangePasswordPopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnChangePasswordPopup; + + /// + /// secResources control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secResources; + + /// + /// ResourcesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ResourcesPanel; + + /// + /// lblCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize lblCpu; + + /// + /// litCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpu; + + /// + /// lblRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize lblRam; + + /// + /// litRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRam; + + /// + /// lblHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize lblHdd; + + /// + /// litHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHdd; + + /// + /// secSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSnapshots; + + /// + /// SnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SnapshotsPanel; + + /// + /// locSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots; + + /// + /// litSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litSnapshots; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// optionDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionDvdInstalled; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// optionBootFromCD control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionBootFromCD; + + /// + /// optionNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionNumLock; + + /// + /// secActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secActions; + + /// + /// ActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ActionsPanel; + + /// + /// optionStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionStartShutdown; + + /// + /// optionReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReset; + + /// + /// optionPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPauseResume; + + /// + /// optionReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReinstall; + + /// + /// optionReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionReboot; + + /// + /// secNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secNetwork; + + /// + /// NetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel NetworkPanel; + + /// + /// optionExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionExternalNetwork; + + /// + /// optionPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.CheckBoxOption optionPrivateNetwork; + + /// + /// btnEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEdit; + + /// + /// ChangePasswordPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ChangePasswordPanel; + + /// + /// locChangePassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locChangePassword; + + /// + /// locNewPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNewPassword; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.PasswordControl password; + + /// + /// btnChangePassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnChangePassword; + + /// + /// btnCancelChangePassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelChangePassword; + + /// + /// ChangePasswordModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender ChangePasswordModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx new file mode 100644 index 00000000..024aeec9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx @@ -0,0 +1,62 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsDvd.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsDvd" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + +
+ +
+
+
+ + +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.cs new file mode 100644 index 00000000..d8be6bad --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.cs @@ -0,0 +1,101 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsDvd : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack && Request["action"] == "inserted") + messageBox.ShowSuccessMessage("VPS_DVD_INSERTED"); + + if (!IsPostBack) + { + BindDvdDisk(); + } + } + + private void BindDvdDisk() + { + LibraryItem disk = ES.Services.VPS2012.GetInsertedDvdDisk(PanelRequest.ItemID); + + if (disk != null) + { + txtInsertedDisk.Text = disk.Name; + btnInsertDisk.Enabled = false; + btnEjectDisk.Enabled = true; + } + else + { + txtInsertedDisk.Text = GetLocalizedString("NoDisk.Text"); + btnInsertDisk.Enabled = true; + btnEjectDisk.Enabled = false; + } + } + + protected void btnInsertDisk_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_insert_dvd", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnEjectDisk_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.EjectDvdDisk(PanelRequest.ItemID); + + if (res.IsSuccess) + { + // re-bind + messageBox.ShowSuccessMessage("VPS_DVD_EJECTED"); + BindDvdDisk(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_EJECT_DVD_DISK", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_EJECT_DVD_DISK", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.designer.cs new file mode 100644 index 00000000..a53e046c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsDvd.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsDvd { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locDvdDrive control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDvdDrive; + + /// + /// txtInsertedDisk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtInsertedDisk; + + /// + /// btnInsertDisk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnInsertDisk; + + /// + /// btnEjectDisk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEjectDisk; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx new file mode 100644 index 00000000..6db26b25 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx @@ -0,0 +1,201 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsEditConfiguration.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsEditConfiguration" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +

+ +

+ + + + + + + + + + + + +
+ + +
+ + + + + + +
+ + * +
+ + + + + + +
+ + * +
+
+ + <%-- Additional Custom Settings. Provider Control --%> + + + + + + + + + + +
+ + + * +
+
+ + + + + + + + +
+ +
+
+ + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + +
+ +
+ +
+
+ +

+ + +

+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.cs new file mode 100644 index 00000000..8d5c08be --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.cs @@ -0,0 +1,209 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.Common; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsEditConfiguration : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + LoadCustomProviderControls(); + + if (!IsPostBack) + { + BindConfiguration(); + } + } + + private void LoadCustomProviderControls() + { + try + { + LoadProviderControl(PanelSecurity.PackageId, "VPS2012", editSettingsProviderControl, "Edit.ascx"); + } + catch { /* skip */ } + } + + private IVirtualMachineSettingsControl EditSettingsProviderControl + { + get + { + if (editSettingsProviderControl.Controls.Count == 0) + return null; + + return (IVirtualMachineSettingsControl)editSettingsProviderControl.Controls[0]; + } + } + + private void BindConfiguration() + { + VirtualMachine vm = null; + + try + { + // load machine + vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + + if (vm == null) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM"); + return; + } + + // bind CPU cores + int maxCores = ES.Services.VPS2012.GetMaximumCpuCoresNumber(vm.PackageId); + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Quotas.ContainsKey(Quotas.VPS2012_CPU_NUMBER)) + { + QuotaValueInfo cpuQuota = cntx.Quotas[Quotas.VPS2012_CPU_NUMBER]; + + if (cpuQuota.QuotaAllocatedValue != -1 + && maxCores > cpuQuota.QuotaAllocatedValue) + maxCores = cpuQuota.QuotaAllocatedValue; + } + + for (int i = 1; i < maxCores + 1; i++) + ddlCpu.Items.Add(i.ToString()); + + // bind item + ddlCpu.SelectedValue = vm.CpuCores.ToString(); + txtRam.Text = vm.RamSize.ToString(); + txtHdd.Text = vm.HddSize.ToString(); + txtSnapshots.Text = vm.SnapshotsNumber.ToString(); + + chkDvdInstalled.Checked = vm.DvdDriveInstalled; + chkBootFromCd.Checked = vm.BootFromCD; + chkNumLock.Checked = vm.NumLockEnabled; + + chkStartShutdown.Checked = vm.StartTurnOffAllowed; + chkPauseResume.Checked = vm.PauseResumeAllowed; + chkReset.Checked = vm.ResetAllowed; + chkReboot.Checked = vm.RebootAllowed; + chkReinstall.Checked = vm.ReinstallAllowed; + + chkExternalNetworkEnabled.Checked = vm.ExternalNetworkEnabled; + chkPrivateNetworkEnabled.Checked = vm.PrivateNetworkEnabled; + + // the custom provider control + if (EditSettingsProviderControl != null) EditSettingsProviderControl.BindItem(vm); + + // other quotas + BindCheckboxOption(chkDvdInstalled, Quotas.VPS2012_DVD_ENABLED); + chkBootFromCd.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, Quotas.VPS2012_BOOT_CD_ALLOWED); + + BindCheckboxOption(chkStartShutdown, Quotas.VPS2012_START_SHUTDOWN_ALLOWED); + BindCheckboxOption(chkPauseResume, Quotas.VPS2012_PAUSE_RESUME_ALLOWED); + BindCheckboxOption(chkReset, Quotas.VPS2012_RESET_ALOWED); + BindCheckboxOption(chkReboot, Quotas.VPS2012_REBOOT_ALLOWED); + BindCheckboxOption(chkReinstall, Quotas.VPS2012_REINSTALL_ALLOWED); + + BindCheckboxOption(chkExternalNetworkEnabled, Quotas.VPS2012_EXTERNAL_NETWORK_ENABLED); + BindCheckboxOption(chkPrivateNetworkEnabled, Quotas.VPS2012_PRIVATE_NETWORK_ENABLED); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_LOAD_VM_META_ITEM", ex); + } + } + + private void BindCheckboxOption(CheckBox chk, string quotaName) + { + chk.Enabled = PackagesHelper.IsQuotaEnabled(PanelSecurity.PackageId, quotaName); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack("cancel"); + } + + private void RedirectBack(string action) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_config", + "SpaceID=" + PanelSecurity.PackageId.ToString(), + "action=" + action)); + } + + protected void btnUpdate_Click(object sender, EventArgs e) + { + try + { + // check rights + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + if (!manageAllowed) + { + return; + } + + VirtualMachine virtualMachine = new VirtualMachine(); + + // the custom provider control + if (EditSettingsProviderControl != null) EditSettingsProviderControl.SaveItem(virtualMachine); + + ResultObject res = ES.Services.VPS2012.UpdateVirtualMachineConfiguration(PanelRequest.ItemID, + Utils.ParseInt(ddlCpu.SelectedValue), + Utils.ParseInt(txtRam.Text.Trim()), + Utils.ParseInt(txtHdd.Text.Trim()), + Utils.ParseInt(txtSnapshots.Text.Trim()), + chkDvdInstalled.Checked, + chkBootFromCd.Checked, + chkNumLock.Checked, + chkStartShutdown.Checked, + chkPauseResume.Checked, + chkReboot.Checked, + chkReset.Checked, + chkReinstall.Checked, + chkExternalNetworkEnabled.Checked, + chkPrivateNetworkEnabled.Checked); + + if (res.IsSuccess) + { + // redirect back + RedirectBack("changed"); + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_CHANGE_VM_CONFIGURATION", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_CHANGE_VM_CONFIGURATION", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.designer.cs new file mode 100644 index 00000000..e8e223a8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsEditConfiguration.ascx.designer.cs @@ -0,0 +1,447 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsEditConfiguration { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// secResources control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secResources; + + /// + /// ResourcesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ResourcesPanel; + + /// + /// lblCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCpu; + + /// + /// ddlCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlCpu; + + /// + /// locCores control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCores; + + /// + /// lblRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRam; + + /// + /// txtRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRam; + + /// + /// RequireRamValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireRamValidator; + + /// + /// locMB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMB; + + /// + /// lblHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblHdd; + + /// + /// txtHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHdd; + + /// + /// RequireHddValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequireHddValidator; + + /// + /// locGB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locGB; + + /// + /// editSettingsProviderControl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder editSettingsProviderControl; + + /// + /// secSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSnapshots; + + /// + /// SnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SnapshotsPanel; + + /// + /// locSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSnapshots; + + /// + /// txtSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSnapshots; + + /// + /// SnapshotsValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SnapshotsValidator; + + /// + /// secDvd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDvd; + + /// + /// DvdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel DvdPanel; + + /// + /// chkDvdInstalled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDvdInstalled; + + /// + /// secBios control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secBios; + + /// + /// BiosPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BiosPanel; + + /// + /// chkBootFromCd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkBootFromCd; + + /// + /// chkNumLock control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNumLock; + + /// + /// secActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secActions; + + /// + /// ActionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ActionsPanel; + + /// + /// chkStartShutdown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkStartShutdown; + + /// + /// chkReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReset; + + /// + /// chkPauseResume control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPauseResume; + + /// + /// chkReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReinstall; + + /// + /// chkReboot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReboot; + + /// + /// secNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secNetwork; + + /// + /// NetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel NetworkPanel; + + /// + /// chkExternalNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExternalNetworkEnabled; + + /// + /// chkPrivateNetworkEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPrivateNetworkEnabled; + + /// + /// btnUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdate; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx new file mode 100644 index 00000000..ef3ec791 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx @@ -0,0 +1,295 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsGeneral.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsGeneral" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/Gauge.ascx" TagName="Gauge" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + +
+ + + + + + + + + + +
+ +   + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + + + + + + + + + + + +
    + + +
  • + +
  • +
    +
    +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ +
+
+
+ +
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.cs new file mode 100644 index 00000000..48c6fa40 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.cs @@ -0,0 +1,299 @@ +// 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 WebsitePanel.Providers.Common; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Virtualization; +using System.Collections.Generic; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsGeneral : WebsitePanelModuleBase + { + private class ActionButton + { + public string Text { get; set; } + public string Command { get; set; } + public string Style { get; set; } + public string OnClientClick { get; set; } + } + + protected void Page_Load(object sender, EventArgs e) + { + BindGeneralDetails(); + } + + private void BindGeneralDetails() + { + VirtualMachine item = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + if (!String.IsNullOrEmpty(item.CurrentTaskId) + || item.ProvisioningStatus == VirtualMachineProvisioningStatus.Error) + { + DetailsTable.Visible = false; + return; + } + + VirtualMachine vm = null; + try + { + vm = ES.Services.VPS2012.GetVirtualMachineGeneralDetails(PanelRequest.ItemID); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_GET_VM_DETAILS", ex); + } + + if (vm != null) + { + bool displayRDP = (Request.Browser.Browser == "IE" + && Request.Browser.ActiveXControls + && Request.Browser.VBScript + && vm.State != VirtualMachineState.Off + && vm.State != VirtualMachineState.Paused + && vm.State != VirtualMachineState.Saved + && item.RemoteDesktopEnabled); + lnkHostname.Text = item.Hostname.ToUpper(); + lnkHostname.Visible = displayRDP; + + litHostname.Text = item.Hostname.ToUpper(); + litHostname.Visible = !displayRDP; + + litDomain.Text = item.Domain; + + if (!IsPostBack) + { + // set host name change form + txtHostname.Text = item.Hostname; + txtDomain.Text = item.Domain; + } + + litRdpPageUrl.Text = Page.ResolveUrl("~/DesktopModules/WebsitePanel/VPS2012/RemoteDesktop/Connect.aspx?ItemID=" + PanelRequest.ItemID + "&Resolution="); + + TimeSpan uptime = TimeSpan.FromMilliseconds(vm.Uptime); + uptime = uptime.Subtract(TimeSpan.FromMilliseconds(uptime.Milliseconds)); + litUptime.Text = uptime.ToString(); + litStatus.Text = GetLocalizedString("State." + vm.State); + litCreated.Text = vm.CreatedDate.ToString(); + litHeartbeat.Text = GetLocalizedString("Heartbeat." + vm.Heartbeat); + + // CPU + cpuGauge.Progress = vm.CpuUsage; + litCpuPercentage.Text = String.Format(GetLocalizedString("CpuPercentage.Text"), vm.CpuUsage); + + // RAM + if (vm.RamSize > 0) + { + int ramPercent = Convert.ToInt32((float)vm.RamUsage / (float)vm.RamSize * 100); + ramGauge.Total = vm.RamSize; + ramGauge.Progress = vm.RamUsage; + litRamPercentage.Text = String.Format(GetLocalizedString("MemoryPercentage.Text"), ramPercent); + litRamUsage.Text = String.Format(GetLocalizedString("MemoryUsage.Text"), vm.RamUsage, vm.RamSize); + } + + // HDD + if (vm.HddLogicalDisks != null && vm.HddLogicalDisks.Length > 0) + { + HddRow.Visible = true; + + int freeHdd = 0; + int sizeHdd = 0; + + foreach (LogicalDisk disk in vm.HddLogicalDisks) + { + freeHdd += disk.FreeSpace; + sizeHdd += disk.Size; + } + + int usedHdd = sizeHdd - freeHdd; + + int hddPercent = Convert.ToInt32((float)usedHdd / (float)sizeHdd * 100); + hddGauge.Total = sizeHdd; + hddGauge.Progress = usedHdd; + litHddPercentage.Text = String.Format(GetLocalizedString("HddPercentage.Text"), hddPercent); + litHddUsage.Text = String.Format(GetLocalizedString("HddUsage.Text"), freeHdd, sizeHdd, vm.HddLogicalDisks.Length); + } + + // update image + imgThumbnail.ImageUrl = + String.Format("~/DesktopModules/WebsitePanel/VPS2012/VirtualMachineImage.ashx?ItemID={0}&rnd={1}", + PanelRequest.ItemID, DateTime.Now.Ticks); + + // load virtual machine meta item + VirtualMachine vmi = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + + // draw buttons + List buttons = new List(); + + if (vmi.StartTurnOffAllowed + && (vm.State == VirtualMachineState.Off + || vm.State == VirtualMachineState.Saved)) + buttons.Add(CreateActionButton("Start", "start.png")); + + if (vm.State == VirtualMachineState.Running) + { + if(vmi.RebootAllowed) + buttons.Add(CreateActionButton("Reboot", "reboot.png")); + + if(vmi.StartTurnOffAllowed) + buttons.Add(CreateActionButton("ShutDown", "shutdown.png")); + } + + if (vmi.StartTurnOffAllowed + && (vm.State == VirtualMachineState.Running + || vm.State == VirtualMachineState.Paused)) + buttons.Add(CreateActionButton("TurnOff", "turnoff.png")); + + if (vmi.PauseResumeAllowed + && vm.State == VirtualMachineState.Running) + buttons.Add(CreateActionButton("Pause", "pause.png")); + + if (vmi.PauseResumeAllowed + && vm.State == VirtualMachineState.Paused) + buttons.Add(CreateActionButton("Resume", "start2.png")); + + if (vmi.ResetAllowed + && (vm.State == VirtualMachineState.Running + || vm.State == VirtualMachineState.Paused)) + buttons.Add(CreateActionButton("Reset", "reset2.png")); + + repButtons.DataSource = buttons; + repButtons.DataBind(); + + // other actions + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + btnChangeHostnamePopup.Visible = manageAllowed; + } + else + { + DetailsTable.Visible = false; + messageBox.ShowErrorMessage("VPS_LOAD_VM_ITEM"); + } + } + + private ActionButton CreateActionButton(string command, string icon) + { + ActionButton btn = new ActionButton(); + btn.Command = command; + btn.Style = String.Format( + "background: transparent url({0}) left center no-repeat;", + PortalUtils.GetThemedImage(String.Format("VPS/{0}", icon))); + + string localizedText = GetLocalizedString("Command." + command); + btn.Text = localizedText != null ? localizedText : command; + + btn.OnClientClick = GetLocalizedString("OnClientClick." + command); + + return btn; + } + + protected void repButtons_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) + { + try + { + ResultObject res = null; + + string command = e.CommandName; + if (command == "Snapshot") + { + res = ES.Services.VPS2012.CreateSnapshot(PanelRequest.ItemID); + } + else + { + // parse command + VirtualMachineRequestedState state = (VirtualMachineRequestedState)Enum.Parse( + typeof(VirtualMachineRequestedState), command, true); + + // call services + res = ES.Services.VPS2012.ChangeVirtualMachineState(PanelRequest.ItemID, state); + } + + // check results + if (res.IsSuccess) + { + if (command == "Snapshot") + { + // go to snapshots screen + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_snapshots", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + else + { + // return + BindGeneralDetails(); + return; + } + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_CHANGE_VM_STATE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_CHANGE_VM_STATE", ex); + } + } + + protected void btnChangeHostname_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + + try + { + string hostname = String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim()); + + ResultObject res = ES.Services.VPS2012.UpdateVirtualMachineHostName(PanelRequest.ItemID, + hostname, chkUpdateComputerName.Checked); + + if (res.IsSuccess) + { + // show success message + messageBox.ShowSuccessMessage("VPS_CHANGE_VM_HOSTNAME"); + BindGeneralDetails(); + + // clear fields + //txtHostname.Text = ""; + //txtDomain.Text = ""; + chkUpdateComputerName.Checked = false; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_CHANGE_VM_HOSTNAME", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_CHANGE_VM_HOSTNAME", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.designer.cs new file mode 100644 index 00000000..11517fb3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsGeneral.ascx.designer.cs @@ -0,0 +1,609 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsGeneral { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// operationTimer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.Timer operationTimer; + + /// + /// litRdpPageUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRdpPageUrl; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// DetailsTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable DetailsTable; + + /// + /// locHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHostname; + + /// + /// lnkHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkHostname; + + /// + /// litHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHostname; + + /// + /// btnChangeHostnamePopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnChangeHostnamePopup; + + /// + /// RdpPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel RdpPanel; + + /// + /// imgRdc control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgRdc; + + /// + /// locRdpText control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRdpText; + + /// + /// lnkRdpFull control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdpFull; + + /// + /// lnkRdp800 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdp800; + + /// + /// lnkRdp1024 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdp1024; + + /// + /// lnkRdp1280 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkRdp1280; + + /// + /// RdpPopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.PopupControlExtender RdpPopup; + + /// + /// RdpShadow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.DropShadowExtender RdpShadow; + + /// + /// locDomainTop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDomainTop; + + /// + /// litDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litDomain; + + /// + /// UpdatePanel2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel UpdatePanel2; + + /// + /// locStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locStatus; + + /// + /// litStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litStatus; + + /// + /// locUptime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locUptime; + + /// + /// litUptime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litUptime; + + /// + /// locHeartbeat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHeartbeat; + + /// + /// litHeartbeat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHeartbeat; + + /// + /// locCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCreated; + + /// + /// litCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCreated; + + /// + /// UpdatePanel1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel UpdatePanel1; + + /// + /// imgThumbnail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgThumbnail; + + /// + /// repButtons control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater repButtons; + + /// + /// UpdatePanel3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel UpdatePanel3; + + /// + /// locCpu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCpu; + + /// + /// cpuGauge control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Gauge cpuGauge; + + /// + /// litCpuPercentage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpuPercentage; + + /// + /// litCpuUsage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCpuUsage; + + /// + /// locRam control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRam; + + /// + /// ramGauge control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Gauge ramGauge; + + /// + /// litRamPercentage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRamPercentage; + + /// + /// litRamUsage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRamUsage; + + /// + /// HddRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow HddRow; + + /// + /// locHdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHdd; + + /// + /// hddGauge control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Gauge hddGauge; + + /// + /// litHddPercentage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHddPercentage; + + /// + /// litHddUsage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHddUsage; + + /// + /// ChangeHostnamePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ChangeHostnamePanel; + + /// + /// locChangeHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locChangeHostname; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locHostname1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locHostname1; + + /// + /// txtHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHostname; + + /// + /// HostnameValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator HostnameValidator; + + /// + /// valCorrectHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectHostname; + + /// + /// locDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDomain; + + /// + /// txtDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDomain; + + /// + /// DomainValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator DomainValidator; + + /// + /// valNewDomainFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valNewDomainFormat; + + /// + /// chkUpdateComputerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkUpdateComputerName; + + /// + /// btnChangeHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnChangeHostname; + + /// + /// btnCancelHostname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelHostname; + + /// + /// ChangeHostnameModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender ChangeHostnameModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx new file mode 100644 index 00000000..096a9f3c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx @@ -0,0 +1,76 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsHelp.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsHelp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+
+
+
+ + +
+ +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.cs new file mode 100644 index 00000000..1a91d5ee --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.cs @@ -0,0 +1,93 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsHelp : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSummaryInfo(); + } + } + + private void BindSummaryInfo() + { + // bind user details + PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); + if (package != null) + { + UserInfo user = ES.Services.Users.GetUserById(package.UserId); + if (user != null) + { + txtTo.Text = user.Email; + } + } + + // load template + string content = ES.Services.VPS2012.GetVirtualMachineSummaryText(PanelRequest.ItemID); + if (content != null) + litContent.Text = content; + } + + protected void btnSend_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.SendVirtualMachineSummaryLetter( + PanelRequest.ItemID, txtTo.Text.Trim(), txtBCC.Text.Trim()); + + if (res.IsSuccess) + { + // bind tree + messageBox.ShowSuccessMessage("VPS_ERROR_SEND_SUMMARY_LETTER"); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "ERROR_SEND_SUMMARY_LETTER", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_SEND_SUMMARY_LETTER", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.designer.cs new file mode 100644 index 00000000..1016a4c5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsHelp.ascx.designer.cs @@ -0,0 +1,168 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsHelp { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secEmail; + + /// + /// EmailPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel EmailPanel; + + /// + /// tblEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblEmail; + + /// + /// lblTo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTo; + + /// + /// txtTo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtTo; + + /// + /// valRequireEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireEmail; + + /// + /// lblBCC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBCC; + + /// + /// txtBCC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBCC; + + /// + /// btnSend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSend; + + /// + /// litContent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litContent; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx new file mode 100644 index 00000000..7e329730 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx @@ -0,0 +1,71 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsInsertDvd.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsInsertDvd" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + +

+ +

+ + + + + + +
+ <%# Eval("Name") %> +
+
+ <%# Eval("Description") %> +
+
+
+ + + + + + +
+
+
+ + +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.cs new file mode 100644 index 00000000..ccb35e77 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.cs @@ -0,0 +1,95 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsInsertDvd : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindDisks(); + } + } + + private void BindDisks() + { + gvDisks.DataSource = ES.Services.VPS2012.GetLibraryDisks(PanelRequest.ItemID); + gvDisks.DataBind(); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + RedirectBack("cancel"); + } + + protected void gvDisks_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "insert") + { + string path = e.CommandArgument.ToString(); + + try + { + ResultObject res = ES.Services.VPS2012.InsertDvdDisk(PanelRequest.ItemID, path); + + if (res.IsSuccess) + { + // return + RedirectBack("inserted"); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_INSERT_DVD_DISK", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_INSERT_DVD_DISK", ex); + } + } + } + + private void RedirectBack(string action) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_dvd", + "SpaceID=" + PanelSecurity.PackageId.ToString(), + "action=" + action)); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.designer.cs new file mode 100644 index 00000000..52f9dfb6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsInsertDvd.ascx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsInsertDvd { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// gvDisks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvDisks; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx new file mode 100644 index 00000000..83e4b413 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx @@ -0,0 +1,200 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsNetwork.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsNetwork" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + +
+   + +
+
+
+
+
+
+ +
+ + + +
+ +
+ + 0 +
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + <%# Eval("IPAddress")%> + + + + +
+   + +
+
+
+
+
+
+ +
+ + + +
+ +
+ + 0 +
+ +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.cs new file mode 100644 index 00000000..c8b86a8e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.cs @@ -0,0 +1,296 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Common; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsNetwork : WebsitePanelModuleBase + { + VirtualMachine vm = null; + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindVirtualMachine(); + BindExternalAddresses(); + BindPrivateAddresses(); + ToggleButtons(); + } + } + + private void BindVirtualMachine() + { + vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + + // external network + if (!vm.ExternalNetworkEnabled) + { + secExternalNetwork.Visible = false; + ExternalNetworkPanel.Visible = false; + } + + // private network + if (!vm.PrivateNetworkEnabled) + { + secPrivateNetwork.Visible = false; + PrivateNetworkPanel.Visible = false; + } + } + + private void BindExternalAddresses() + { + // load details + NetworkAdapterDetails nic = ES.Services.VPS2012.GetExternalNetworkAdapterDetails(PanelRequest.ItemID); + + // bind details + foreach (NetworkAdapterIPAddress ip in nic.IPAddresses) + { + if (ip.IsPrimary) + { + litExtAddress.Text = ip.IPAddress; + litExtSubnet.Text = ip.SubnetMask; + litExtGateway.Text = ip.DefaultGateway; + break; + } + } + lblTotalExternal.Text = nic.IPAddresses.Length.ToString(); + + // bind IP addresses + gvExternalAddresses.DataSource = nic.IPAddresses; + gvExternalAddresses.DataBind(); + } + + private void BindPrivateAddresses() + { + // load details + NetworkAdapterDetails nic = ES.Services.VPS2012.GetPrivateNetworkAdapterDetails(PanelRequest.ItemID); + + // bind details + foreach (NetworkAdapterIPAddress ip in nic.IPAddresses) + { + if (ip.IsPrimary) + { + litPrivAddress.Text = ip.IPAddress; + break; + } + } + litPrivSubnet.Text = nic.SubnetMask; + litPrivFormat.Text = nic.NetworkFormat; + lblTotalPrivate.Text = nic.IPAddresses.Length.ToString(); + + // bind IP addresses + gvPrivateAddresses.DataSource = nic.IPAddresses; + gvPrivateAddresses.DataBind(); + + if (nic.IsDHCP) + { + PrivateAddressesPanel.Visible = false; + litPrivAddress.Text = GetLocalizedString("Automatic.Text"); + } + } + + private void ToggleButtons() + { + bool manageAllowed = VirtualMachines2012Helper.IsVirtualMachineManagementAllowed(PanelSecurity.PackageId); + + btnAddExternalAddress.Visible = manageAllowed; + btnSetPrimaryExternal.Visible = manageAllowed; + btnDeleteExternal.Visible = manageAllowed; + gvExternalAddresses.Columns[0].Visible = manageAllowed; + + btnAddPrivateAddress.Visible = manageAllowed; + btnSetPrimaryPrivate.Visible = manageAllowed; + btnDeletePrivate.Visible = manageAllowed; + gvPrivateAddresses.Columns[0].Visible = manageAllowed; + } + + protected void btnAddExternalAddress_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_add_external_ip", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnAddPrivateAddress_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_add_private_ip", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnSetPrimaryPrivate_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvPrivateAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.SetVirtualMachinePrimaryPrivateIPAddress(PanelRequest.ItemID, addressIds[0]); + + if (res.IsSuccess) + { + BindPrivateAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_SETTING_PRIMARY_IP", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_SETTING_PRIMARY_IP", ex); + } + } + + protected void btnDeletePrivate_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvPrivateAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.DeleteVirtualMachinePrivateIPAddresses(PanelRequest.ItemID, addressIds); + + if (res.IsSuccess) + { + BindPrivateAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_DELETING_IP_ADDRESS", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETING_IP_ADDRESS", ex); + } + } + + protected void btnSetPrimaryExternal_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvExternalAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.SetVirtualMachinePrimaryExternalIPAddress(PanelRequest.ItemID, addressIds[0]); + + if (res.IsSuccess) + { + BindExternalAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_SETTING_PRIMARY_IP", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_SETTING_PRIMARY_IP", ex); + } + } + + protected void btnDeleteExternal_Click(object sender, EventArgs e) + { + int[] addressIds = GetSelectedItems(gvExternalAddresses); + + // check if at least one is selected + if (addressIds.Length == 0) + { + messageBox.ShowWarningMessage("IP_ADDRESS_NOT_SELECTED"); + return; + } + + try + { + ResultObject res = ES.Services.VPS2012.DeleteVirtualMachineExternalIPAddresses(PanelRequest.ItemID, addressIds); + + if (res.IsSuccess) + { + BindExternalAddresses(); + return; + } + else + { + messageBox.ShowMessage(res, "VPS_ERROR_DELETING_IP_ADDRESS", "VPS"); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETING_IP_ADDRESS", ex); + } + } + + private int[] GetSelectedItems(GridView gv) + { + List items = new List(); + + for (int i = 0; i < gv.Rows.Count; i++) + { + GridViewRow row = gv.Rows[i]; + CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); + if (chkSelect.Checked) + items.Add((int)gv.DataKeys[i].Value); + } + + return items.ToArray(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.designer.cs new file mode 100644 index 00000000..942ea529 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsNetwork.ascx.designer.cs @@ -0,0 +1,339 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsNetwork { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// secExternalNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secExternalNetwork; + + /// + /// ExternalNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ExternalNetworkPanel; + + /// + /// locExtAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExtAddress; + + /// + /// litExtAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExtAddress; + + /// + /// locExtSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExtSubnet; + + /// + /// litExtSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExtSubnet; + + /// + /// locExtGateway control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locExtGateway; + + /// + /// litExtGateway control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litExtGateway; + + /// + /// gvExternalAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvExternalAddresses; + + /// + /// btnAddExternalAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddExternalAddress; + + /// + /// btnSetPrimaryExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetPrimaryExternal; + + /// + /// btnDeleteExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDeleteExternal; + + /// + /// locTotalExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalExternal; + + /// + /// lblTotalExternal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalExternal; + + /// + /// secPrivateNetwork control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPrivateNetwork; + + /// + /// PrivateNetworkPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PrivateNetworkPanel; + + /// + /// locPrivAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivAddress; + + /// + /// litPrivAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivAddress; + + /// + /// locPrivFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivFormat; + + /// + /// litPrivFormat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivFormat; + + /// + /// locPrivSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPrivSubnet; + + /// + /// litPrivSubnet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litPrivSubnet; + + /// + /// PrivateAddressesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PrivateAddressesPanel; + + /// + /// gvPrivateAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPrivateAddresses; + + /// + /// btnAddPrivateAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddPrivateAddress; + + /// + /// btnSetPrimaryPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetPrimaryPrivate; + + /// + /// btnDeletePrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDeletePrivate; + + /// + /// locTotalPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalPrivate; + + /// + /// lblTotalPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalPrivate; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx new file mode 100644 index 00000000..d95158a7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx @@ -0,0 +1,75 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsPermissions.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsPermissions" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.cs new file mode 100644 index 00000000..56fd13fc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.cs @@ -0,0 +1,44 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsPermissions : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.designer.cs new file mode 100644 index 00000000..095004cc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsPermissions.ascx.designer.cs @@ -0,0 +1,96 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsPermissions { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// chkOverride control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkOverride; + + /// + /// gvVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvVpsPermissions; + + /// + /// btnUpdateVpsPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnUpdateVpsPermissions; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx new file mode 100644 index 00000000..c345ce97 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx @@ -0,0 +1,146 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsSnapshots.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsSnapshots" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + +
+ +
+ +
+
+ + + + + + + + +
+ +
+ +
+
+ +     + + +
+ +

+ + +

+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+ +
+
+ +
+ +
+
+ + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.cs new file mode 100644 index 00000000..26a0cfae --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.cs @@ -0,0 +1,262 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsSnapshots : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSnapshotsTree(); + } + } + + private void BindSnapshotsTree() + { + VirtualMachineSnapshot[] snapshots = ES.Services.VPS2012.GetVirtualMachineSnapshots(PanelRequest.ItemID); + + // clear tree + SnapshotsTree.Nodes.Clear(); + + // fill tree by root nodes + AddChildNodes(SnapshotsTree.Nodes, null, snapshots); + + // select first node + if (SnapshotsTree.Nodes.Count > 0) + { + SnapshotsTree.Nodes[0].Selected = true; + } + + // refresh + BindSelectedNode(); + + // quotas + VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + snapshotsQuota.QuotaUsedValue = snapshots.Length; + snapshotsQuota.QuotaValue = vm.SnapshotsNumber; + btnTakeSnapshot.Enabled = snapshots.Length < vm.SnapshotsNumber; + } + + private void BindSelectedNode() + { + TreeNode node = SnapshotsTree.SelectedNode; + + btnApply.Enabled = + btnRename.Enabled = + btnDelete.Enabled = + btnDeleteSubtree.Enabled = + SnapshotDetailsPanel.Visible = (node != null); + + NoSnapshotsPanel.Visible = (SnapshotsTree.Nodes.Count == 0); + + if (node != null) + { + // set name + txtSnapshotName.Text = node.Text; + + // load snapshot details + VirtualMachineSnapshot snapshot = ES.Services.VPS2012.GetSnapshot(PanelRequest.ItemID, node.Value); + if (snapshot != null) + litCreated.Text = snapshot.Created.ToString(); + + // set image + imgThumbnail.ImageUrl = + string.Format("~/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx?ItemID={0}&SnapshotID={1}&rnd={2}", + PanelRequest.ItemID, HttpUtility.UrlEncode(node.Value), DateTime.Now.Ticks); + } + } + + private void AddChildNodes(TreeNodeCollection parent, string parentId, VirtualMachineSnapshot[] snapshots) + { + foreach (VirtualMachineSnapshot snapshot in snapshots) + { + if (snapshot.ParentId == parentId) + { + // add node + TreeNode node = new TreeNode(snapshot.Name, snapshot.Id); + node.Expanded = true; + node.ImageUrl = PortalUtils.GetThemedImage("VPS/snapshot.png"); + parent.Add(node); + + // check if the current + if (snapshot.IsCurrent) + { + TreeNode nowNode = new TreeNode(GetLocalizedString("Now.Text"), ""); + nowNode.ImageUrl = PortalUtils.GetThemedImage("VPS/start2.png"); + nowNode.SelectAction = TreeNodeSelectAction.None; + node.ChildNodes.Add(nowNode); + } + + // fill children + AddChildNodes(node.ChildNodes, snapshot.Id, snapshots); + } + } + } + + protected void btnTakeSnapshot_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.CreateSnapshot(PanelRequest.ItemID); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_TAKE_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_TAKE_SNAPSHOT", ex); + } + } + + protected void btnApply_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.ApplySnapshot(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_APPLY_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_APPLY_SNAPSHOT", ex); + } + } + + protected void btnRenameSnapshot_Click(object sender, EventArgs e) + { + try + { + string newName = txtSnapshotName.Text.Trim(); + ResultObject res = ES.Services.VPS2012.RenameSnapshot(PanelRequest.ItemID, GetSelectedSnapshot(), newName); + + if (res.IsSuccess) + { + // bind tree + SnapshotsTree.SelectedNode.Text = newName; + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_RENAME_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_RENAME_SNAPSHOT", ex); + } + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.DeleteSnapshot(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE_SNAPSHOT", ex); + } + } + + protected void btnDeleteSubtree_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.DeleteSnapshotSubtree(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE_SNAPSHOT_SUBTREE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE_SNAPSHOT_SUBTREE", ex); + } + } + + private string GetSelectedSnapshot() + { + return SnapshotsTree.SelectedNode.Value; + } + + protected void SnapshotsTree_SelectedNodeChanged(object sender, EventArgs e) + { + BindSelectedNode(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.designer.cs new file mode 100644 index 00000000..7b57c599 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsSnapshots.ascx.designer.cs @@ -0,0 +1,267 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsSnapshots { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnTakeSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnTakeSnapshot; + + /// + /// SnapshotsTree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TreeView SnapshotsTree; + + /// + /// NoSnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl NoSnapshotsPanel; + + /// + /// locNoSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNoSnapshots; + + /// + /// locQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locQuota; + + /// + /// snapshotsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer snapshotsQuota; + + /// + /// SnapshotDetailsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableCell SnapshotDetailsPanel; + + /// + /// imgThumbnail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgThumbnail; + + /// + /// locCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCreated; + + /// + /// litCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCreated; + + /// + /// btnApply control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnApply; + + /// + /// btnRename control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnRename; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnDelete; + + /// + /// btnDeleteSubtree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnDeleteSubtree; + + /// + /// RenamePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel RenamePanel; + + /// + /// locRenameSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRenameSnapshot; + + /// + /// txtSnapshotName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSnapshotName; + + /// + /// SnapshotNameValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SnapshotNameValidator; + + /// + /// btnRenameSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRenameSnapshot; + + /// + /// btnCancelRename control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelRename; + + /// + /// RenameSnapshotModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender RenameSnapshotModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx new file mode 100644 index 00000000..3ec46195 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx @@ -0,0 +1,56 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsTools.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsTools" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + <%-- + + + --%> + + + + +
+ + + +
+ + + +
+
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.cs new file mode 100644 index 00000000..18d5fff1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.cs @@ -0,0 +1,56 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsTools : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnReinstall_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_tools_reinstall", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_tools_delete", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.designer.cs new file mode 100644 index 00000000..bd6726f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsTools.ascx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsDetailsTools { + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + + /// + /// locDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDelete; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx new file mode 100644 index 00000000..88a8006a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx @@ -0,0 +1,75 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsMoveServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsMoveServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CheckBoxOption.ascx" TagName="CheckBoxOption" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +

+ + +

+ +
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.cs new file mode 100644 index 00000000..a5a2b367 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.cs @@ -0,0 +1,112 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Virtualization; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsMoveServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindHyperVServices(); + BindSourceService(); + } + } + + public void BindHyperVServices() + { + // bind + HyperVServices.DataSource = ES.Services.Servers.GetRawServicesByGroupName(ResourceGroups.VPS2012).Tables[0].DefaultView; + HyperVServices.DataBind(); + + // add select value + HyperVServices.Items.Insert(0, new ListItem(GetLocalizedString("SelectHyperVService.Text"), "")); + } + + private void BindSourceService() + { + VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + if (vm == null) + ReturnBack(); + + ListItem sourceItem = null; + foreach (ListItem item in HyperVServices.Items) + { + if (item.Value == vm.ServiceId.ToString()) + { + sourceItem = item; + SourceHyperVService.Text = item.Text; + break; + } + } + + if (sourceItem != null) + HyperVServices.Items.Remove(sourceItem); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + ReturnBack(); + } + + private void ReturnBack() + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + } + + protected void btnMove_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + + // move item + int destinationServiceId = Utils.ParseInt(HyperVServices.SelectedValue); + int result = ES.Services.Packages.MovePackageItem(PanelRequest.ItemID, destinationServiceId); + if (result < 0) + { + ShowResultMessage(result); + return; + } + + // redirect to properties screen + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_general", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.designer.cs new file mode 100644 index 00000000..9ce6aa99 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsMoveServer.ascx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsMoveServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSourceService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSourceService; + + /// + /// SourceHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal SourceHyperVService; + + /// + /// locDestinationService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDestinationService; + + /// + /// HyperVServices control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList HyperVServices; + + /// + /// RequiredHyperVService control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredHyperVService; + + /// + /// btnMove control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnMove; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx new file mode 100644 index 00000000..b0ed67de --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx @@ -0,0 +1,92 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsToolsDeleteServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsToolsDeleteServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +

+ +

+

+ +

+

+ +

+ +
+ + + + + + + + + + + + + + +
+ +
+ +
+ + + * +
+
+ +

+ + +

+
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.cs new file mode 100644 index 00000000..d8715d75 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.cs @@ -0,0 +1,116 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsToolsDeleteServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindFormDetails(); + } + + ToogleControls(); + } + + private void ToogleControls() + { + txtExportPath.Visible = chkExport.Checked; + ExportPathValidator.Enabled = chkExport.Checked; + } + + private void BindFormDetails() + { + // load VM item + VirtualMachine vm = VirtualMachines2012Helper.GetCachedVirtualMachine(PanelRequest.ItemID); + if (!String.IsNullOrEmpty(vm.CurrentTaskId)) + { + messageBox.ShowWarningMessage("VPS_PROVISIONING_PROCESS"); + btnDelete.Enabled = false; + return; + } + + // load export settings + if (PanelSecurity.EffectiveUser.Role == WebsitePanel.EnterpriseServer.UserRole.Administrator) + { + txtExportPath.Text = ES.Services.VPS2012.GetDefaultExportPath(PanelRequest.ItemID); + } + else + { + AdminOptionsPanel.Visible = false; + } + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + if (!chkConfirmDelete.Checked) + { + messageBox.ShowWarningMessage("VPS_DELETE_CONFIRM"); + return; + } + + // delete machine + try + { + ResultObject res = ES.Services.VPS2012.DeleteVirtualMachine(PanelRequest.ItemID, + chkSaveFiles.Checked, chkExport.Checked, txtExportPath.Text.Trim()); + + if (res.IsSuccess) + { + // return to the list + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "")); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE", ex); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.designer.cs new file mode 100644 index 00000000..4186b99a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsDeleteServer.ascx.designer.cs @@ -0,0 +1,186 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsToolsDeleteServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// locDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDescription; + + /// + /// chkConfirmDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkConfirmDelete; + + /// + /// AdminOptionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl AdminOptionsPanel; + + /// + /// locAdminOptions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAdminOptions; + + /// + /// chkSaveFiles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSaveFiles; + + /// + /// chkExport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExport; + + /// + /// txtExportPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExportPath; + + /// + /// ExportPathValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExportPathValidator; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx new file mode 100644 index 00000000..fa853be3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx @@ -0,0 +1,109 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsToolsReinstallServer.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsToolsReinstallServer" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + + + + +

+ +

+

+ +

+

+ +

+ + + + + + + + + +
+ + + +
+ +
       + +
+
+ + + + + + + + + + +
+ +
+ +
+ + + * +
+ +

+ + + +

+
+
+
+ +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.cs new file mode 100644 index 00000000..c0efc5f2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.cs @@ -0,0 +1,58 @@ +// 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.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsToolsReinstallServer : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "vps_tools", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + protected void btnUpdate_Click(object sender, EventArgs e) + { + if (!chkConfirmReinstall.Checked) + { + messageBox.ShowWarningMessage("VPS_REINSTALL_CONFIRM"); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.designer.cs new file mode 100644 index 00000000..2c8b35d1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsToolsReinstallServer.ascx.designer.cs @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.VPS2012 { + + + public partial class VpsToolsReinstallServer { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// validatorsSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary; + + /// + /// locSubTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubTitle; + + /// + /// locDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDescription; + + /// + /// chkConfirmReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkConfirmReinstall; + + /// + /// locPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPassword; + + /// + /// password control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.PasswordControl password; + + /// + /// chkPreserveExistingFiles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPreserveExistingFiles; + + /// + /// locPreserveHelp control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPreserveHelp; + + /// + /// AdminOptionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable AdminOptionsPanel; + + /// + /// chkSaveVhd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSaveVhd; + + /// + /// chkExport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExport; + + /// + /// txtExportPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExportPath; + + /// + /// ExportPathValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ExportPathValidator; + + /// + /// btnReinstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnReinstall; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 4e2ba11d..423c3b49 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -189,6 +189,7 @@ + @@ -265,19 +266,242 @@ HyperV2012R2_Settings.ascx - - HyperV2012R2_Edit.ascx + + Connect.aspx ASPXCodeBehind - - HyperV2012R2_Edit.ascx + + Connect.aspx - - HyperV2012R2_Create.ascx + + TestVirtualMachineTemplate.aspx ASPXCodeBehind - - HyperV2012R2_Create.ascx + + TestVirtualMachineTemplate.aspx + + + Breadcrumb.ascx + ASPXCodeBehind + + + Breadcrumb.ascx + + + DynamicMemory.ascx + ASPXCodeBehind + + + DynamicMemory.ascx + + + FormTitle.ascx + ASPXCodeBehind + + + FormTitle.ascx + + + Generation.ascx + ASPXCodeBehind + + + Generation.ascx + + + Menu.ascx + ASPXCodeBehind + + + Menu.ascx + + + ServerTabs.ascx + ASPXCodeBehind + + + ServerTabs.ascx + + + VdcAddExternalAddress.ascx + ASPXCodeBehind + + + VdcAddExternalAddress.ascx + + + VdcAuditLog.ascx + ASPXCodeBehind + + + VdcAuditLog.ascx + + + VdcCreateServer.ascx + ASPXCodeBehind + + + VdcCreateServer.ascx + + + VdcExternalNetwork.ascx + ASPXCodeBehind + + + VdcExternalNetwork.ascx + + + VdcHome.ascx + ASPXCodeBehind + + + VdcHome.ascx + + + VdcImportServer.ascx + ASPXCodeBehind + + + VdcImportServer.ascx + + + VdcManagementNetwork.ascx + ASPXCodeBehind + + + VdcManagementNetwork.ascx + + + VdcPermissions.ascx + ASPXCodeBehind + + + VdcPermissions.ascx + + + VdcPrivateNetwork.ascx + ASPXCodeBehind + + + VdcPrivateNetwork.ascx + + + VirtualMachineImage.ashx + + + VirtualMachineSnapshotImage.ashx + + + VpsDetailsAddExternalAddress.ascx + ASPXCodeBehind + + + VpsDetailsAddExternalAddress.ascx + + + VpsDetailsAddPrivateAddress.ascx + ASPXCodeBehind + + + VpsDetailsAddPrivateAddress.ascx + + + VpsDetailsAuditLog.ascx + ASPXCodeBehind + + + VpsDetailsAuditLog.ascx + + + VpsDetailsConfiguration.ascx + ASPXCodeBehind + + + VpsDetailsConfiguration.ascx + + + VpsDetailsDvd.ascx + ASPXCodeBehind + + + VpsDetailsDvd.ascx + + + VpsDetailsEditConfiguration.ascx + ASPXCodeBehind + + + VpsDetailsEditConfiguration.ascx + + + VpsDetailsGeneral.ascx + ASPXCodeBehind + + + VpsDetailsGeneral.ascx + + + VpsDetailsHelp.ascx + ASPXCodeBehind + + + VpsDetailsHelp.ascx + + + VpsDetailsInsertDvd.ascx + ASPXCodeBehind + + + VpsDetailsInsertDvd.ascx + + + VpsDetailsNetwork.ascx + ASPXCodeBehind + + + VpsDetailsNetwork.ascx + + + VpsDetailsPermissions.ascx + ASPXCodeBehind + + + VpsDetailsPermissions.ascx + + + VpsDetailsSnapshots.ascx + ASPXCodeBehind + + + VpsDetailsSnapshots.ascx + + + VpsDetailsTools.ascx + ASPXCodeBehind + + + VpsDetailsTools.ascx + + + VpsMoveServer.ascx + ASPXCodeBehind + + + VpsMoveServer.ascx + + + VpsToolsDeleteServer.ascx + ASPXCodeBehind + + + VpsToolsDeleteServer.ascx + + + VpsToolsReinstallServer.ascx + ASPXCodeBehind + + + VpsToolsReinstallServer.ascx SmarterMail100_EditAccount.ascx @@ -4069,20 +4293,6 @@ VpsEventsLog.ascx - - DynamicMemory.ascx - ASPXCodeBehind - - - DynamicMemory.ascx - - - Generation.ascx - ASPXCodeBehind - - - Generation.ascx - VpsMoveServer.ascx ASPXCodeBehind @@ -4560,8 +4770,40 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4612,9 +4854,6 @@ - - Designer - Designer @@ -4803,8 +5042,6 @@ - - @@ -4822,7 +5059,97 @@ Designer - + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + Designer @@ -6973,6 +7300,8 @@ + + Designer diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj index 4b3119cd..b3fee22f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj @@ -105,6 +105,7 @@ + diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index 4f45afb7..51ae347e 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -35,8 +35,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorefrontProxy.cs REM %WSDL% %SERVER_URL%/ecStorehouse.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs /namespace:WebsitePanel.Ecommerce.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs -%WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs +REM %WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs REM %WSDL% %SERVER_URL%/esExchangeHostedEdition.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs @@ -56,8 +56,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OCSProxy.cs REM %WSDL% %SERVER_URL%/esOperatingSystems.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs -%WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs +REM %WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs REM %WSDL% %SERVER_URL%/esPackages.asmx /out:.\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs @@ -83,6 +83,9 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\UsersProxy.cs REM %WSDL% %SERVER_URL%/esVirtualizationServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy.cs +REM %WSDL% %SERVER_URL%/esVirtualizationServer2012.asmx /out:.\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy2012.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy2012.cs + REM %WSDL% %SERVER_URL%/esWebApplicationGallery.asmx /out:.\WebsitePanel.EnterpriseServer.Client\WebApplicationGalleryProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\WebApplicationGalleryProxy.cs