StopTask
General
URL
https://{host}/attunityenterprisemanager/api/v1/servers/{ServerName}/tasks/{TaskName}?action=stop&timeout={timeout}
Description
Stop the selected task.
HTTP method
POST
Required user role
See Required Enterprise Manager permissions.
Request parameters
| Location | Name | Required | Description/Example | 
|---|---|---|---|
| 
                                 URL  | 
                            
                                 host [string]  | 
                            
                                 Yes  | 
                            
                                 computer.network.net  | 
                        
| URL | 
                                 ServerName [string]  | 
                            
                                 Yes  | 
                            
                                 myrepsrv1  | 
                        
| 
                                 URL  | 
                            
                                 TaskName [string]  | 
                            
                                 Yes  | 
                            
                                
  | 
                        
| 
                                 URL  | 
                            
                                 Timeout [int32]  | 
                            
                                 Optional (default is 60 seconds)  | 
                            
                                 60 (seconds)  | 
                        
| 
                                 Header  | 
                            
                                 EnterpriseManager.APISessionID [string]  | 
                            
                                 Yes  | 
                            
                                 wCo0_KvjEUFROvfHF5KGrw  | 
                        
| 
                                 Header  | 
                            
                                 Content-Length  | 
                            
                                 Yes  | 
                            
                                 Content-Length: 0 Note that the Content-Length value must be "0".  | 
                        
Response body
{
"state":"{enum task_state}",
"error_message":""
}
Response parameters
| Name | Description | 
|---|---|
| 
                                 state [enum task_state]  | 
                            
                                 The current state of the task.  | 
                        
| 
                                 error_message  | 
                            
                                 The description of the error.  | 
                        
cURL example
Request
curl -i -k -X POST --header "EnterpriseManager.APISessionID: wCo0_KvjEUFROvfHF5KGrw" --header "Content-Length: 0" https:// computer.network.net/attunityenterprisemanager/api/
v1/servers/myrepsrv1/tasks/SalesDBBackup/
?action=stop
                
Response
Header:
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Content-Length: 38
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Mon, 26 Dec 2016 16:31:01 GMT
Payload
{
"state":"STOPPED",
"error_message":""
}
Error response
| HTTP Code | Enterprise Manager Code | Text | Description | 
|---|---|---|---|
| 
                                 500  | 
                            
                                 AEM_TASK_ALREADY_STOPPED  | 
                            
                                 Replicate task {task} on server {server} is already stopped.  | 
                            
                                 Cannot stop a task that is in Stopped state.  | 
                        
| 
                                 500  | 
                            
                                 AEM_STOP_TASK_INNER_ERR  | 
                            
                                 Failed to stop Replicate task {0} on server {1}: <{2}>  | 
                            
                                 An error occurred while trying to stop the task.  | 
                        
| 
                                 500  | 
                            
                                 AEM_STOP_TASK_TIMEOUT  | 
                            
                                 A timeout occurred when trying to stop Replicate task {0} on server {1}  | 
                            
                                 A timeout occurred while trying to stop the task.  |