File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,24 @@ public static Models.Device[] GetDeviceList()
3333 }
3434 }
3535
36+ public static bool SetServerEnvironmentForThisDevice ( string environmentName )
37+ {
38+ var deviceid = Logger . Identity ( ) ? . DeviceID ;
39+
40+ if ( deviceid == null )
41+ throw new Exception ( "Unable to evaluate current device id" ) ;
42+
43+ return SetServerEnvironmentByID ( deviceid . Value , environmentName ) ;
44+ }
45+
46+ public static bool SetServerEnvironmentByID ( int id , string environmentName )
47+ {
48+ var response = client . POSTAndGetResponse ( System . Web . VirtualPathUtility . AppendTrailingSlash ( client . BaseAPIUrl ) +
49+ "API/Device/SetServerEnvironmentByID/?id=" + id + "&environmentName=" + environmentName , null ) ;
50+
51+ return response . StatusCode == HttpStatusCode . OK ;
52+ }
53+
3654 public static bool RemoveServerByID ( int id , bool uninstallAgent = false )
3755 {
3856 var response = client . POSTAndGetResponse ( System . Web . VirtualPathUtility . AppendTrailingSlash ( client . BaseAPIUrl ) +
You can’t perform that action at this time.
0 commit comments