Atomia.Provisioning.Modules.Haproxy.Commands.HaproxyCommandBase.ExecuteAdd C# (CSharp) Method

ExecuteAdd() protected method

protected ExecuteAdd ( ModuleService moduleService ) : void
moduleService ModuleService
return void
        protected override void ExecuteAdd(ModuleService moduleService)
        {
            Dictionary<string,string> response = this.REST_Execute_POST(this.GetResourceURL(service), this.GetPostData(service));
            if (response.ContainsKey("id"))
            {
                moduleService["Id"] = response["id"];
            }
            else
            {
                throw new Exception("id not found in response, which contained " + string.Join(", ", response.Select(pair => pair.Key + "='" + pair.Value + "'").ToArray()));
            }
        }