Skip to content
Snippets Groups Projects
Commit e0e07bba authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Add Nomad Job Updater

parent 23e19f8e
Branches
Tags
No related merge requests found
......@@ -14,15 +14,25 @@ namespace ConfigurationUpdater
public static string UpdateJob(string jobId)
{
string jobUrl = "http://localhost:4646/v1/job/" + jobId;
string postUrl = "http://localhost:4646/v1/job/" + jobId;
var httpWebRequest = (HttpWebRequest)WebRequest.Create(postUrl);
var request = (HttpWebRequest)WebRequest.Create(jobUrl);
var response = (HttpWebResponse)request.GetResponse();
var jobString = "";
using (var streamReader = new StreamReader(response.GetResponseStream()))
{
jobString = streamReader.ReadToEnd();
}
var httpWebRequest = (HttpWebRequest)WebRequest.Create(jobUrl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
string json = "{\"Job\": {}}";
string json = "{\"Job\":" + jobString + "}";
streamWriter.Write(json);
streamWriter.Flush();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment