CancelScheduledScript
Cancels a scheduled script
Service | Operation |
---|---|
script | CANCEL_SCHEDULED_SCRIPT |
Method Parameters
Parameter | Description |
---|---|
jobId | Identifies script job to cancel |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string jobId = "idsfihihfuvhvuh";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.ScriptService.CancelScheduledScript(jobId, successCallback, failureCallback);
const char *jobId = "idsfihihfuvhvuh";
_bc->getScriptService()->cancelScheduledScript(jobId, this);
NSString *jobId = @"idsfihihfuvhvuh";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc scriptService] cancelScheduledScript:jobId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String jobId = "idsfihihfuvhvuh";
this; // implements IServerCallback
_bc.getScriptService().cancelScheduledScript(jobId, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var jobId = "idsfihihfuvhvuh";
_bc.script.cancelScheduledScript(jobId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var jobId = "idsfihihfuvhvuh";
ServerResponse result = await _bc.scriptService.cancelScheduledScript(jobId:jobId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var jobId = "idsfihihfuvhvuh";
var scriptProxy = bridge.getScriptServiceProxy();
var postResult = scriptProxy.cancelScheduledScript(jobId);
if (postResult.status == 200) {
// Success!
}
{
"service":"script",
"operation":"CANCEL_SCHEDULED_SCRIPT",
"data":{
"jobId":"idsfihihfuvhvuh"
}
}
JSON Response
{
"status": 200,
"data": {
"result": {},
"jobType": "CloudCode",
"scriptName": "testScript",
"jobId": "3d3d4a7d-ad72-4bf1-9219-184f465e5c33",
"gameId": "20001",
"updatedAt": 1466579169118,
"runState": "Cancelled",
"description": null,
"createdAt": 1466579169118,
"runEndTime": 0,
"localTime": null,
"parameters": {
"testParm1": 1
},
"scheduledStartTime": 1466582769118,
"runStartTime": 0
}
}