Initial project's source code check-in.

This commit is contained in:
ptsurbeleu 2011-07-13 16:07:32 -07:00
commit b03b0b373f
4573 changed files with 981205 additions and 0 deletions

View file

@ -0,0 +1,49 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum ChangeJobStateReturnCode
{
OK = 0,
NotSupported = 1,
UnspecifiedError = 2,
CannotCompleteWithinTimeoutPeriod = 3,
Failed = 4,
InvalidParameter = 5,
InUse = 6,
TransitionStarted = 4096,
InvalidStateTransition = 4097,
UseofTimeoutParameterNotSupported = 4098,
Busy = 4099
}
}

View file

@ -0,0 +1,50 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
namespace WebsitePanel.Providers.Virtualization
{
public class ConcreteJob
{
public string Id { get; set; }
public ConcreteJobState JobState { get; set; }
public bool Cancellable { get; set; }
public string Caption { get; set; }
public string Description { get; set; }
public DateTime ElapsedTime { get; set; }
public DateTime StartTime { get; set; }
public int ErrorCode { get; set; }
public string ErrorDescription { get; set; }
public int PercentComplete { get; set; }
public VMComputerSystemStateInfo TargetState { get; set; }
}
}

View file

@ -0,0 +1,42 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum ConcreteJobRequestedState
{
Start = 2,
Suspend = 3,
Terminate = 4,
Kill = 5
}
}

View file

@ -0,0 +1,47 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum ConcreteJobState
{
New = 2,
Starting = 3,
Running = 4,
Suspended = 5,
ShuttingDown = 6,
Completed = 7,
Terminated = 8,
Killed = 9,
Exception = 10
}
}

View file

@ -0,0 +1,103 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public interface IVirtualizationServer
{
// Virtual Machines
VirtualMachine GetVirtualMachine(string vmId);
VirtualMachine GetVirtualMachineEx(string vmId);
List<VirtualMachine> GetVirtualMachines();
byte[] GetVirtualMachineThumbnailImage(string vmId, ThumbnailSize size);
VirtualMachine CreateVirtualMachine(VirtualMachine vm);
VirtualMachine UpdateVirtualMachine(VirtualMachine vm);
JobResult ChangeVirtualMachineState(string vmId, VirtualMachineRequestedState newState);
ReturnCode ShutDownVirtualMachine(string vmId, bool force, string reason);
List<ConcreteJob> GetVirtualMachineJobs(string vmId);
JobResult RenameVirtualMachine(string vmId, string name);
JobResult ExportVirtualMachine(string vmId, string exportPath);
JobResult DeleteVirtualMachine(string vmId);
// Snapshots
List<VirtualMachineSnapshot> GetVirtualMachineSnapshots(string vmId);
VirtualMachineSnapshot GetSnapshot(string snapshotId);
JobResult CreateSnapshot(string vmId);
JobResult RenameSnapshot(string vmId, string snapshotId, string name);
JobResult ApplySnapshot(string vmId, string snapshotId);
JobResult DeleteSnapshot(string snapshotId);
JobResult DeleteSnapshotSubtree(string snapshotId);
byte[] GetSnapshotThumbnailImage(string snapshotId, ThumbnailSize size);
// Virtual Switches
List<VirtualSwitch> GetExternalSwitches(string computerName);
List<VirtualSwitch> GetSwitches();
bool SwitchExists(string switchId);
VirtualSwitch CreateSwitch(string name);
ReturnCode DeleteSwitch(string switchId);
// DVD operations
string GetInsertedDVD(string vmId);
JobResult InsertDVD(string vmId, string isoPath);
JobResult EjectDVD(string vmId);
// KVP items
List<KvpExchangeDataItem> GetKVPItems(string vmId);
List<KvpExchangeDataItem> GetStandardKVPItems(string vmId);
JobResult AddKVPItems(string vmId, KvpExchangeDataItem[] items);
JobResult RemoveKVPItems(string vmId, string[] itemNames);
JobResult ModifyKVPItems(string vmId, KvpExchangeDataItem[] items);
// Library
LibraryItem[] GetLibraryItems(string path);
// Storage
VirtualHardDiskInfo GetVirtualHardDiskInfo(string vhdPath);
MountedDiskInfo MountVirtualHardDisk(string vhdPath);
ReturnCode UnmountVirtualHardDisk(string vhdPath);
JobResult ExpandVirtualHardDisk(string vhdPath, UInt64 sizeGB);
JobResult ConvertVirtualHardDisk(string sourcePath, string destinationPath, VirtualHardDiskType diskType);
void ExpandDiskVolume(string diskAddress, string volumeName);
void DeleteRemoteFile(string path);
string ReadRemoteFile(string path);
void WriteRemoteFile(string path, string content);
// Jobs
ConcreteJob GetJob(string jobId);
List<ConcreteJob> GetAllJobs();
ChangeJobStateReturnCode ChangeJobState(string jobId, ConcreteJobRequestedState newState);
// Configuration
int GetProcessorCoresNumber();
}
}

View file

@ -0,0 +1,121 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
using WebsitePanel.Providers.Virtualization;
namespace WebsitePanel.Providers.VirtualizationForPC
{
public interface IVirtualizationServerForPC
{
// Virtual Machines
VMInfo GetVirtualMachine(string vmId);
VirtualMachine GetVirtualMachineEx(string vmId);
List<VirtualMachine> GetVirtualMachines();
byte[] GetVirtualMachineThumbnailImage(string vmId, ThumbnailSize size);
VMInfo CreateVirtualMachine(VMInfo vm);
VMInfo CreateVMFromVM(string sourceName, VMInfo vmTemplate, Guid taskGuid);
VMInfo UpdateVirtualMachine(VMInfo vm);
JobResult ChangeVirtualMachineState(string vmId, VirtualMachineRequestedState newState);
ReturnCode ShutDownVirtualMachine(string vmId, bool force, string reason);
List<ConcreteJob> GetVirtualMachineJobs(string vmId);
JobResult RenameVirtualMachine(string vmId, string name);
//JobResult ExportVirtualMachine(string vmId, string exportPath);
JobResult DeleteVirtualMachine(string vmId);
VMInfo MoveVM(VMInfo vmForMove);
//TODO: Может быть прийдется менять возвращаемый результат
void ConfigureCreatedVMNetworkAdapters(VMInfo vmInfo);
// Snapshots
List<VirtualMachineSnapshot> GetVirtualMachineSnapshots(string vmId);
VirtualMachineSnapshot GetSnapshot(string snapshotId);
JobResult CreateSnapshot(string vmId);
JobResult RenameSnapshot(string vmId, string snapshotId, string name);
JobResult ApplySnapshot(string vmId, string snapshotId);
JobResult DeleteSnapshot(string vmId, string snapshotId);
JobResult DeleteSnapshotSubtree(string snapshotId);
byte[] GetSnapshotThumbnailImage(string snapshotId, ThumbnailSize size);
// Virtual Switches
List<VirtualSwitch> GetExternalSwitches(string computerName);
List<VirtualSwitch> GetSwitches();
bool SwitchExists(string switchId);
VirtualSwitch CreateSwitch(string name);
ReturnCode DeleteSwitch(string switchId);
// DVD operations
string GetInsertedDVD(string vmId);
JobResult InsertDVD(string vmId, string isoPath);
JobResult EjectDVD(string vmId);
// KVP items
List<KvpExchangeDataItem> GetKVPItems(string vmId);
List<KvpExchangeDataItem> GetStandardKVPItems(string vmId);
JobResult AddKVPItems(string vmId, KvpExchangeDataItem[] items);
JobResult RemoveKVPItems(string vmId, string[] itemNames);
JobResult ModifyKVPItems(string vmId, KvpExchangeDataItem[] items);
// Library
LibraryItem[] GetLibraryItems(string path);
LibraryItem[] GetOSLibraryItems();
LibraryItem[] GetHosts();
LibraryItem[] GetClusters();
// Storage
VirtualHardDiskInfo GetVirtualHardDiskInfo(string vhdPath);
MountedDiskInfo MountVirtualHardDisk(string vhdPath);
ReturnCode UnmountVirtualHardDisk(string vhdPath);
JobResult ExpandVirtualHardDisk(string vhdPath, UInt64 sizeGB);
JobResult ConvertVirtualHardDisk(string sourcePath, string destinationPath, VirtualHardDiskType diskType);
void ExpandDiskVolume(string diskAddress, string volumeName);
void DeleteRemoteFile(string path);
string ReadRemoteFile(string path);
void WriteRemoteFile(string path, string content);
// Jobs
ConcreteJob GetJob(string jobId);
List<ConcreteJob> GetAllJobs();
ChangeJobStateReturnCode ChangeJobState(string jobId, ConcreteJobRequestedState newState);
// Configuration
int GetProcessorCoresNumber(string templateId);
// Monitoring
List<MonitoredObjectEvent> GetDeviceEvents(string serviceName, string displayName);
List<MonitoredObjectAlert> GetMonitoringAlerts(string serviceName, string virtualMachineName);
List<PerformanceDataValue> GetPerfomanceValue(string VmName, PerformanceType perf, DateTime startPeriod, DateTime endPeriod);
// Networks
VirtualNetworkInfo[] GetVirtualNetworkByHostName(string hostName);
bool CheckServerState(VMForPCSettingsName control, string connString, string connName);
}
}

View file

@ -0,0 +1,40 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class JobResult
{
public ConcreteJob Job { get; set; }
public ReturnCode ReturnValue { get; set; }
}
}

View file

@ -0,0 +1,62 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class KvpExchangeDataItem
{
string name;
string data;
public KvpExchangeDataItem()
{
}
public KvpExchangeDataItem(string name, string data)
{
this.name = name;
this.data = data;
}
public string Name
{
get { return name; }
set { name = value; }
}
public string Data
{
get { return data; }
set { data = value; }
}
}
}

View file

@ -0,0 +1,51 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class LibraryItem
{
public string Path { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool LegacyNetworkAdapter { get; set; }
public bool RemoteDesktop { get; set; }
public int DiskSize { get; set; }
public int ProcessVolume { get; set; }
public string[] SysprepFiles { get; set; }
public bool ProvisionAdministratorPassword { get; set; }
public bool ProvisionComputerName { get; set; }
public bool ProvisionNetworkAdapters { get; set; }
public VirtualNetworkInfo[] Networks { get; set; }
}
}

View file

@ -0,0 +1,41 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class LogicalDisk
{
public string DriveLetter { get; set; }
public int FreeSpace { get; set; }
public int Size { get; set; }
}
}

View file

@ -0,0 +1,12 @@
namespace WebsitePanel.Providers.Virtualization
{
public class MonitoredObjectAlert
{
public System.DateTime Created { get; set; }
public string Description { get; set; }
public string Name { get; set; }
public string ResolutionState { get; set; }
public string Severity { get; set; }
public string Source { get; set; }
}
}

View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class MonitoredObjectEvent
{
public string Category { get; set; }
public string Decription { get; set; }
public string EventData { get; set; }
public string Level { get; set; }
public int Number { get; set; }
public DateTime TimeGenerated { get; set; }
}
}

View file

@ -0,0 +1,40 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class MountedDiskInfo
{
public string DiskAddress { get; set; }
public string[] DiskVolumes { get; set; }
}
}

View file

@ -0,0 +1,43 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum OperationalStatus
{
None = 0,
OK = 2,
Error = 6,
NoContact = 12,
LostCommunication = 13
}
}

View file

@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum PerformanceType
{
Processor = 0,
Memory = 1,
Network = 2,
DiskIO = 4
}
public partial class PerformanceDataValue : object, System.ComponentModel.INotifyPropertyChanged
{
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
private System.Nullable<double> SampleValueField;
private System.DateTime TimeAddedField;
private System.DateTime TimeSampledField;
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
{
return this.extensionDataField;
}
set
{
this.extensionDataField = value;
}
}
public System.Nullable<double> SampleValue
{
get
{
return this.SampleValueField;
}
set
{
if ((this.SampleValueField.Equals(value) != true))
{
this.SampleValueField = value;
this.RaisePropertyChanged("SampleValue");
}
}
}
public System.DateTime TimeAdded
{
get
{
return this.TimeAddedField;
}
set
{
if ((this.TimeAddedField.Equals(value) != true))
{
this.TimeAddedField = value;
this.RaisePropertyChanged("TimeAdded");
}
}
}
public System.DateTime TimeSampled
{
get
{
return this.TimeSampledField;
}
set
{
if ((this.TimeSampledField.Equals(value) != true))
{
this.TimeSampledField = value;
this.RaisePropertyChanged("TimeSampled");
}
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName)
{
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null))
{
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
}

View file

@ -0,0 +1,51 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum ReturnCode
{
OK = 0,
JobStarted = 4096,
Failed = 32768,
AccessDenied = 32769,
NotSupported = 32770,
Unknown = 32771,
Timeout = 32772,
InvalidParameter = 32773,
SystemIsInUse = 32774,
InvalidStateForThisOperation = 32775,
IncorrectDataType = 32776,
SystemIsNotAvailable = 32777,
OutOfMemory = 32778
}
}

View file

@ -0,0 +1,56 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum SummaryInformationRequest
{
Name = 0,
ElementName = 1,
CreationTime = 2,
Notes = 3,
NumberOfProcessors = 4,
SmallThumbnailImage = 5, // (80x60)
MediumThumbnailImage = 6, // (160x120)
LargeThumbnailImage = 7, // (320x240)
EnabledState = 100,
ProcessorLoad = 101,
ProcessorLoadHistory = 102,
MemoryUsage = 103,
Heartbeat = 104,
Uptime = 105,
GuestOperatingSystem = 106,
Snapshots = 107,
AsynchronousTasks = 108,
HealthState = 109
}
}

View file

@ -0,0 +1,41 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum ThumbnailSize
{
Small80x60 = 5,
Medium160x120 = 6,
Large320x240 = 7
}
}

View file

@ -0,0 +1,45 @@
using System;
namespace WebsitePanel.Providers.Virtualization
{
public enum VMComputerSystemStateInfo : int
{
CheckpointFailed = 213,
CreatingCheckpoint = 210,
CreationFailed = 101,
CustomizationFailed = 105,
Deleting = 13,
DeletingCheckpoint = 211,
DiscardingDrives = 80,
DiscardSavedState = 10,
FinishingCheckpointOperation = 215,
HostNotResponding = 221,
IncompleteVMConfig = 223,
InitializingCheckpointOperation = 214,
MergingDrives = 12,
MigrationFailed = 201,
Missing = 220,
P2VCreationFailed = 240,
Paused = 6,
Pausing = 81,
PoweringOff = 2,
PowerOff = 1,
RecoveringCheckpoint = 212,
Restoring = 5,
Running = 0,
Saved = 3,
Saving = 4,
Starting = 11,
Stored = 102,
TemplateCreationFailed = 104,
UnderCreation = 100,
UnderMigration = 200,
UnderTemplateCreation = 103,
UnderUpdate = 106,
Unsupported = 222,
UnsupportedCluster = 225,
UnsupportedSharedFiles = 224,
UpdateFailed = 107,
V2VCreationFailed = 250
}
}

View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum VMForPCSettingsName
{
SCVMMServer = 0
, SCOMServer = 1
, SCDPMServer = 2
, SCCMServer = 3
, SCVMMPrincipalName = 4
, SCOMPrincipalName = 5
, SCDPMEndPoint = 6
, SCCMEndPoint = 7
, StorageEndPoint = 8
, CoreSvcEndpoint = 9
, VPServer = 10
}
}

View file

@ -0,0 +1,44 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class VirtualHardDiskInfo
{
public long FileSize { get; set; }
public bool InSavedState { get; set; }
public bool InUse { get; set; }
public long MaxInternalSize { get; set; }
public string ParentPath { get; set; }
public VirtualHardDiskType DiskType { get; set; }
}
}

View file

@ -0,0 +1,42 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum VirtualHardDiskType
{
Fixed = 2,
Dynamic = 3,
Differencing = 4,
PhysicalDrive = 5
}
}

View file

@ -0,0 +1,127 @@
// Copyright (c) 2011, 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;
namespace WebsitePanel.Providers.Virtualization
{
public class VirtualMachine : ServiceProviderItem
{
public VirtualMachine()
{
}
// properties
[Persistent]
public string VirtualMachineId { get; set; }
public string Hostname { get; set; }
public string Domain { get; set; }
public VirtualMachineState State { get; set; }
public long Uptime { get; set; }
public OperationalStatus Heartbeat { get; set; }
[Persistent]
public string RootFolderPath { get; set; }
[Persistent]
public string VirtualHardDrivePath { get; set; }
[Persistent]
public string OperatingSystemTemplate { get; set; }
[Persistent]
public string OperatingSystemTemplatePath { get; set; }
[Persistent]
public string AdministratorPassword { get; set; }
[Persistent]
public string CurrentTaskId { get; set; }
[Persistent]
public VirtualMachineProvisioningStatus ProvisioningStatus { get; set; }
[Persistent]
public int CpuCores { get; set; }
public int CpuUsage { get; set; }
[Persistent]
public int RamSize { get; set; }
public int RamUsage { get; set; }
[Persistent]
public int HddSize { get; set; }
public LogicalDisk[] HddLogicalDisks { get; set; }
[Persistent]
public int SnapshotsNumber { get; set; }
[Persistent]
public bool DvdDriveInstalled { get; set; }
[Persistent]
public bool BootFromCD { get; set; }
[Persistent]
public bool NumLockEnabled { get; set; }
[Persistent]
public bool StartTurnOffAllowed { get; set; }
[Persistent]
public bool PauseResumeAllowed { get; set; }
[Persistent]
public bool RebootAllowed { get; set; }
[Persistent]
public bool ResetAllowed { get; set; }
[Persistent]
public bool ReinstallAllowed { get; set; }
[Persistent]
public bool LegacyNetworkAdapter { get; set; }
[Persistent]
public bool RemoteDesktopEnabled { get; set; }
[Persistent]
public bool ExternalNetworkEnabled { get; set; }
[Persistent]
public string ExternalNicMacAddress { get; set; }
[Persistent]
public string ExternalSwitchId { get; set; }
[Persistent]
public bool PrivateNetworkEnabled { get; set; }
[Persistent]
public string PrivateNicMacAddress { get; set; }
[Persistent]
public string PrivateSwitchId { get; set; }
[Persistent]
public bool ManagementNetworkEnabled { get; set; }
[Persistent]
public string ManagementNicMacAddress { get; set; }
[Persistent]
public string ManagementSwitchId { get; set; }
// for GetVirtualMachineEx used in import method
public VirtualMachineNetworkAdapter[] Adapters { get; set; }
}
}

View file

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class VMInfo : ServiceProviderItem
{
[Persistent]
public int VmId {get; set; }
[Persistent]
public Guid VmGuid { get; set; }
[Persistent]
public Guid TemplateId { get; set; }
[Persistent]
public string TemplateName { get; set; }
[Persistent]
public string CurrentTaskId { get; set; }
[Persistent]
public string VmPath { get; set; }
[Persistent]
public string ProductKey { get; set; }
[Persistent]
public string HostName { get; set; }
[Persistent]
public string ComputerName { get; set; }
[Persistent]
public string Owner { get; set; }
[Persistent]
public string AdminUserName { get; set; }
[Persistent]
public string AdminPassword { get; set; }
public string JoinDomain { get; set; }
public string JoinDomainUserName { get; set; }
public string JoinDomainPassword { get; set; }
public bool MergeAnswerFile { get; set; }
[Persistent]
public int CPUCount { get; set; }
[Persistent]
public int CPUUtilization { get; set; }
public int PerfCPUUtilization { get; set; }
[Persistent]
public int Memory { get; set; }
public int ProcessMemory { get; set; }
[Persistent]
public bool NumLockEnabled { get; set; }
[Persistent]
public bool DvdDriver { get; set; }
[Persistent]
public int HddSize { get; set; }
[Persistent]
public int SnapshotsNumber { get; set; }
[Persistent]
public bool BootFromCD { get; set; }
public LogicalDisk[] HddLogicalDisks { get; set; }
[Persistent]
public bool ExternalNetworkEnabled { get; set; }
[Persistent]
public string ExternalNicMacAddress { get; set; }
[Persistent]
public string ExternalVirtualNetwork { get; set; }
[Persistent]
public string ExternalNetworkLocation { get; set; }
[Persistent]
public bool PrivateNetworkEnabled { get; set; }
[Persistent]
public string PrivateNicMacAddress { get; set; }
[Persistent]
public string PrivateVirtualNetwork { get; set; }
[Persistent]
public ushort PrivateVLanID { get; set; }
[Persistent]
public string PrivateNetworkLocation { get; set; }
[Persistent]
public bool ManagementNetworkEnabled { get; set; }
[Persistent]
public string ManagementNicMacAddress { get; set; }
[Persistent]
public VirtualMachineProvisioningStatus ProvisioningStatus { get; set; }
[Persistent]
public VMComputerSystemStateInfo State { get; set; }
public string ModifiedTime { get; set; }
// User configuration
[Persistent]
public bool StartTurnOffAllowed { get; set; }
[Persistent]
public bool PauseResumeAllowed { get; set; }
[Persistent]
public bool RebootAllowed { get; set; }
[Persistent]
public bool ResetAllowed { get; set; }
[Persistent]
public bool ReinstallAllowed { get; set; }
[Persistent]
public ConcreteJob CurrentJob { get; set; }
public string exMessage { get; set; }
public string logMessage { get; set; }
}
}

View file

@ -0,0 +1,40 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class VirtualMachineNetworkAdapter
{
public string Name { get; set; }
public string MacAddress { get; set; }
}
}

View file

@ -0,0 +1,43 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum VirtualMachineProvisioningStatus
{
Unknown = 0,
OK = 1,
Warning = 2,
Error = 3,
InProgress = 4
}
}

View file

@ -0,0 +1,48 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum VirtualMachineRequestedState
{
Start = 2,
TurnOff = 3,
ShutDown = 4,
Reset = 10, // 11 - reset
Pause = 32768, // pause
Save = 32769, // save,
// artificial
Reboot = 5,
Resume = 6
}
}

View file

@ -0,0 +1,44 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public class VirtualMachineSnapshot
{
public string Id { get; set; }
public string CheckPointId { get; set; }
public string Name { get; set; }
public string ParentId { get; set; }
public DateTime Created { get; set; }
public bool IsCurrent { get; set; }
}
}

View file

@ -0,0 +1,51 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public enum VirtualMachineState
{
Unknown = 0,
Started = 2, // start
Off = 3, // turn off
Reset = 10, // reset
Paused = 32768, // pause
Saved = 32769, // save
Starting = 32770,
Snapshotting = 32771,
Migrating = 32772,
Saving = 32773,
Stopping = 32774,
Deleted = 32775,
Pausing = 32776
}
}

View file

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.Virtualization
{
public partial class VirtualNetworkInfo
{
public bool BoundToVMHost {get;set;}
public string DNSServers { get; set; }
public string DefaultGatewayAddress { get; set; }
public string Description { get; set; }
public string EnablingIPAddress { get; set; }
public bool HighlyAvailable { get; set; }
public ushort HostBoundVlanId { get; set; }
public System.Guid Id { get; set; }
public string Name { get; set; }
public string NetworkAddress { get; set; }
public string NetworkMask { get; set; }
public string Tag { get; set; }
public string VMHost { get; set; }
public System.Guid VMHostId { get; set; }
public string WINServers { get; set; }
}
}

View file

@ -0,0 +1,41 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
namespace WebsitePanel.Providers.Virtualization
{
public class VirtualSwitch : ServiceProviderItem
{
[Persistent]
public string SwitchId { get; set; }
}
}