Example #1
0
	def setMgmtBridge(request, server):
		name = HttpUtils.getFieldInPost(request, "mgmtBridge-name")
		mac = HttpUtils.getFieldInPost(request, "mgmtBridge-mac")
		server.setMgmtBridge(name, mac)
Example #2
0
    def createOrUpdateServerFromPOST(request, instance):
		#return XenServer.constructor(server.getName(),server.getOSType(),server.getOSDistribution(),server.getOSVersion(),server.getAgentURL(),save=True)
		server = XenServer.objects.get(uuid = instance.getUUID())
		if server:
			return server.updateServer(HttpUtils.getFieldInPost(request,VTServer, "name"),
				HttpUtils.getFieldInPost(request,VTServer, "operatingSystemType"),
				HttpUtils.getFieldInPost(request,VTServer, "operatingSystemDistribution"),
				HttpUtils.getFieldInPost(request,VTServer, "operatingSystemVersion"),
				HttpUtils.getFieldInPost(request,VTServer, "numberOfCPUs"),
				HttpUtils.getFieldInPost(request,VTServer, "CPUFrequency"),
				HttpUtils.getFieldInPost(request,VTServer, "memory"),
				HttpUtils.getFieldInPost(request,VTServer, "discSpaceGB"),
				HttpUtils.getFieldInPost(request,VTServer, "agentURL"),
				save=True)
		else:
			return XenServer.constructor(HttpUtils.getFieldInPost(request,VTServer, "name"),
							HttpUtils.getFieldInPost(request,VTServer, "operatingSystemType"),
							HttpUtils.getFieldInPost(request,VTServer, "operatingSystemDistribution"),
							HttpUtils.getFieldInPost(request,VTServer, "operatingSystemVersion"),
							HttpUtils.getFieldInPost(request,VTServer, "numberOfCPUs"),
							HttpUtils.getFieldInPost(request,VTServer, "CPUFrequency"),
							HttpUtils.getFieldInPost(request,VTServer, "memory"),
							HttpUtils.getFieldInPost(request,VTServer, "discSpaceGB"),
							HttpUtils.getFieldInPost(request,VTServer, "agentURL"),
							save=True)
Example #3
0
	def createServerFromPOST(request, instance):
		from vt_manager_kvm.models.VTServer import VTServer
		controller = VTDriver.getDriver(HttpUtils.getFieldInPost(request,VTServer,"virtTech"))
		return controller.createOrUpdateServerFromPOST(request, instance)