Feature: Disco Device Registration

A method of 'Enrolling' devices which only updates the Disco database
(makes no changes to clients or AD). Can be easily called from a script
and used to add servers or any custom device.
This commit is contained in:
Gary Sharp
2014-07-31 15:52:42 +10:00
parent 12fc071786
commit 3b0286fe11
7 changed files with 276 additions and 20 deletions
@@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Disco.BI.Extensions;
using Disco.Data.Repository;
using Disco.Models.ClientServices;
using Disco.Services.Authorization;
using Newtonsoft.Json;
using System;
using System.Web;
using System.Web.Mvc;
using Disco.Models.ClientServices;
using Disco.BI;
using Disco.BI.Extensions;
using Disco.Data.Repository;
using System.Web.Script.Serialization;
using Newtonsoft.Json;
using Disco.Services.Authorization;
namespace Disco.Web.Areas.Services.Controllers
{
@@ -66,6 +63,13 @@ namespace Disco.Web.Areas.Services.Controllers
return Json(enrolResponse, JsonRequestBehavior.AllowGet);
}
}
case "register":
{
Register registerRequest = new Register();
this.UpdateModel(registerRequest);
RegisterResponse registerResponse = registerRequest.BuildResponse();
return Json(registerResponse);
}
}
throw new MissingMethodException(string.Format("Unknown Feature: {0}", feature));
}
@@ -92,6 +96,13 @@ namespace Disco.Web.Areas.Services.Controllers
EnrolResponse enrolResponse = enrolRequest.BuildResponse();
return Json(enrolResponse);
}
case "register":
{
Register registerRequest = new Register();
this.UpdateModel(registerRequest);
RegisterResponse registerResponse = registerRequest.BuildResponse();
return Json(registerResponse);
}
}
throw new MissingMethodException(string.Format("Unknown Feature: {0}", feature));
}