diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-19 12:57:04 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-19 12:57:04 +0200 |
| commit | de762e7e5b346af5a12eff04cbaa0696eec15b8c (patch) | |
| tree | 76368bb6e9f62af738ab8420c4db19079b702fa3 /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate | |
| parent | 0f5a0b13fc4408952d90d2450c642a7948b88879 (diff) | |
| download | Tango-de762e7e5b346af5a12eff04cbaa0696eec15b8c.tar.gz Tango-de762e7e5b346af5a12eff04cbaa0696eec15b8c.zip | |
Moved all web transport to json :/
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate')
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 ce45258f5..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/PPC/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/PPC/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/PPC/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; } + } +} |
