aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-12-20 15:07:43 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-12-20 15:07:43 +0200
commit64367a944ebddc998b06eb2673928ef95ffc3627 (patch)
treeb30eff3671d388d23c10a91a82cc25a6d42d548f /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate
parent4554080793bd46fcb8f55578d2f67917584dc332 (diff)
parentd204e56c57dcf52f31c9e64222f32a678150e721 (diff)
downloadTango-64367a944ebddc998b06eb2673928ef95ffc3627.tar.gz
Tango-64367a944ebddc998b06eb2673928ef95ffc3627.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateRequest.cs15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateResponse.cs15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateRequest.cs14
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateResponse.cs20
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBRequest.cs14
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBResponse.cs16
7 files changed, 100 insertions, 6 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateRequest.cs
new file mode 100644
index 000000000..cd5789393
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateRequest.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.PPC.Common.MachineUpdate
+{
+ public class CheckForUpdateRequest : WebRequestMessage
+ {
+ public String SerialNumber { get; set; }
+ public String Version { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateResponse.cs
new file mode 100644
index 000000000..cbf6c8c64
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/CheckForUpdateResponse.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.PPC.Common.MachineUpdate
+{
+ public class CheckForUpdateResponse : WebResponseMessage
+ {
+ public bool IsUpdateAvailable { get; set; }
+ public String Version { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateRequest.cs
new file mode 100644
index 000000000..9369a2a94
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateRequest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.PPC.Common.MachineUpdate
+{
+ public class DownloadUpdateRequest : WebRequestMessage
+ {
+ public String SerialNumber { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateResponse.cs
new file mode 100644
index 000000000..c42c06f3b
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/DownloadUpdateResponse.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.PPC.Common.MachineUpdate
+{
+ public class DownloadUpdateResponse : WebResponseMessage
+ {
+ public String Version { get; set; }
+
+ public String BlobAddress { get; set; }
+
+ public String DbAddress { get; set; }
+ public String DbUserName { get; set; }
+ public String DbPassword { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
index 9ae77df6f..6df7117d7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
@@ -111,9 +111,9 @@ namespace Tango.PPC.Common.MachineUpdate
DownloadUpdateResponse update_response = null;
- using (var http = new ProtoWebClient())
+ using (var http = new WebTransportClient())
{
- update_response = await http.Post<DownloadUpdateRequest, DownloadUpdateResponse>(machineServiceAddress + "/api/Synchronization/MachineUpdate", request);
+ update_response = await http.PostJson<DownloadUpdateRequest, DownloadUpdateResponse>(machineServiceAddress + "/api/PPC/MachineUpdate", request);
}
LogManager.Log($"Machine update response received: {Environment.NewLine}{update_response.ToJsonString()}");
@@ -292,9 +292,9 @@ namespace Tango.PPC.Common.MachineUpdate
CheckForUpdateResponse update_response = null;
- using (var http = new ProtoWebClient())
+ using (var http = new WebTransportClient())
{
- update_response = http.Post<CheckForUpdateRequest, CheckForUpdateResponse>(machineServiceAddress + "/api/Synchronization/CheckForUpdate", request).Result;
+ update_response = http.PostJson<CheckForUpdateRequest, CheckForUpdateResponse>(machineServiceAddress + "/api/PPC/CheckForUpdate", request).Result;
}
LogManager.Log($"Check for update response received: {Environment.NewLine}{update_response.ToJsonString()}");
@@ -403,9 +403,9 @@ namespace Tango.PPC.Common.MachineUpdate
UpdateDBResponse update_response = null;
- using (var http = new ProtoWebClient())
+ using (var http = new WebTransportClient())
{
- update_response = http.Post<UpdateDBRequest, UpdateDBResponse>(machineServiceAddress + "/api/Synchronization/UpdateDB", request).Result;
+ update_response = http.PostJson<UpdateDBRequest, UpdateDBResponse>(machineServiceAddress + "/api/PPC/UpdateDB", request).Result;
}
LogManager.Log($"Update DB response received: {Environment.NewLine}{update_response.ToJsonString()}");
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBRequest.cs
new file mode 100644
index 000000000..1d0caa5a9
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBRequest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.PPC.Common.MachineUpdate
+{
+ public class UpdateDBRequest : WebRequestMessage
+ {
+ public String SerialNumber { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBResponse.cs
new file mode 100644
index 000000000..212cd02d2
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/UpdateDBResponse.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Transport.Web;
+
+namespace Tango.PPC.Common.MachineUpdate
+{
+ public class UpdateDBResponse : WebResponseMessage
+ {
+ public String DbAddress { get; set; }
+ public String DbUserName { get; set; }
+ public String DbPassword { get; set; }
+ }
+}