public PerformURLPOST ( bool async, String service, String>.IDictionary |
||
async | bool | True if this request should be asynchronous. |
service | String | The service. |
args | String>.IDictionary | The POST arguments. |
return | void |
/// <summary> /// Publish the specified file. /// </summary> /// <param name="stream">The stream.</param> /// <param name="publishedPath">Where to publish the file.</param> public void PublishFile(Stream stream, String publishedPath) { String uri = this.session + "publish" + publishedPath; CloudRequest request = new CloudRequest(); request.PerformURLPOST(uri, stream); }
/// <summary> /// Connect to the Encog cloud. /// </summary> /// <param name="uid">The user id.</param> /// <param name="pwd">The password.</param> public void Connect(String uid, String pwd) { CloudRequest request = new CloudRequest(); IDictionary <String, String> args = new Dictionary <String, String>(); args["uid"] = uid; args["pwd"] = pwd; request.PerformURLPOST(false, ConstructService("login"), args); if (!"success".Equals(request.Status)) { throw new EncogCloudError(request.Message); } this.session = request.Session; }
/// <summary> /// Set the status for this task. /// </summary> /// <param name="status">The status for this task.</param> public void SetStatus(String status) { if (this.taskURL == null) { throw new EncogCloudError("Can't set status for inactive task."); } CloudRequest request = new CloudRequest(); String url = this.taskURL + "update"; IDictionary <String, String> args = new Dictionary <String, String>(); args["status"] = status; request.PerformURLPOST(true, url, args); }
/// <summary> /// Setup this task. /// </summary> /// <param name="name">The name of this task.</param> public void Init(String name) { if (this.cloud.Session == null) { throw new EncogCloudError( "Session must be established before a task is created."); } CloudRequest request = new CloudRequest(); String url = this.cloud.Session; url += "task/create"; IDictionary <String, String> args = new Dictionary <String, String>(); args["name"] = name; args["status"] = "Starting..."; request.PerformURLPOST(false, url, args); this.taskURL = this.cloud.Session + "task/" + request.GetResponseProperty("id") + "/"; }
/// <summary> /// Stop this task. /// </summary> /// <param name="finalStatus">The final status for this task.</param> public void Stop(String finalStatus) { if (this.taskURL == null) { throw new EncogCloudError("Can't stop inactive task."); } // send final status CloudRequest request = new CloudRequest(); String url = this.taskURL + "update"; IDictionary <String, String> args = new Dictionary <String, String>(); args["status"] = finalStatus; request.PerformURLPOST(false, url, args); // stop url = this.taskURL + "stop"; request = new CloudRequest(); request.PerformURLGET(false, url); }
/// <summary> /// Connect to the Encog cloud. /// </summary> /// <param name="uid">The user id.</param> /// <param name="pwd">The password.</param> public void Connect(String uid, String pwd) { CloudRequest request = new CloudRequest(); IDictionary<String, String> args = new Dictionary<String, String>(); args["uid"] = uid; args["pwd"] = pwd; request.PerformURLPOST(false, ConstructService("login"), args); if (!"success".Equals(request.Status)) { throw new EncogCloudError(request.Message); } this.session = request.Session; }
/// <summary> /// Publish the specified file. /// </summary> /// <param name="stream">The stream.</param> /// <param name="publishedPath">Where to publish the file.</param> public void PublishFile(Stream stream, String publishedPath) { String uri = this.session + "publish" + publishedPath; CloudRequest request = new CloudRequest(); request.PerformURLPOST(uri, stream); }
/// <summary> /// Setup this task. /// </summary> /// <param name="name">The name of this task.</param> public void Init(String name) { if (this.cloud.Session == null) { throw new EncogCloudError( "Session must be established before a task is created."); } CloudRequest request = new CloudRequest(); String url = this.cloud.Session; url += "task/create"; IDictionary<String, String> args = new Dictionary<String, String>(); args["name"] = name; args["status"] = "Starting..."; request.PerformURLPOST(false, url, args); this.taskURL = this.cloud.Session + "task/" + request.GetResponseProperty("id") + "/"; }
/// <summary> /// Stop this task. /// </summary> /// <param name="finalStatus">The final status for this task.</param> public void Stop(String finalStatus) { if (this.taskURL == null) { throw new EncogCloudError("Can't stop inactive task."); } // send final status CloudRequest request = new CloudRequest(); String url = this.taskURL + "update"; IDictionary<String, String> args = new Dictionary<String, String>(); args["status"] = finalStatus; request.PerformURLPOST(false, url, args); // stop url = this.taskURL + "stop"; request = new CloudRequest(); request.PerformURLGET(false, url); }
/// <summary> /// Set the status for this task. /// </summary> /// <param name="status">The status for this task.</param> public void SetStatus(String status) { if (this.taskURL == null) { throw new EncogCloudError("Can't set status for inactive task."); } CloudRequest request = new CloudRequest(); String url = this.taskURL + "update"; IDictionary<String, String> args = new Dictionary<String, String>(); args["status"] = status; request.PerformURLPOST(true, url, args); }