示例#1
0
        public ActionResult InitializeDataCenter(string id, string registration)
        {
            this.id = id;
            try
            {
                var settings = GetData <ConfigurationSettings>(registration);

                settings = configSetTasks.InitializeDatacenter(id, settings);
                return(Json(settings));
            }
            catch (Exception ex)
            {
                ex.Log();
                return(new HttpStatusCodeResult(500, ex.Message));
            }
        }
示例#2
0
        public HttpResponseMessage InitializeDataCenter(string id, [FromBody] ConfigurationSettings registration)
        {
            this.id = id;
            try
            {
                var settings = registration;

                settings = configSetTasks.InitializeDatacenter(id, settings);
                return(Request.CreateResponse(HttpStatusCode.OK, settings));
            }
            catch (Exception ex)
            {
                ex.Log();
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, string.Format("Error: {0}", ex.Message)));
            }
        }