ImportAll
General
URL
https://{Host}/attunityenterprisemanager/api/v1/servers/{ServerName}?action=import
Description
Import the JSON definitions provided in the request body into the requested server repository on the selected server.
Supported only with replicate 5.2 and later.
The ApiImportAll method uses "merge" semantics. In particular:
- All valid JSON definitions provided in the request body will be imported. This includes server settings, task settings, endpoints, and other definitions.
- Items that existed in the target server before the import and have no new JSON definition in the request body will not be modified and in particular will not be removed. This means that ApiImportAll provides no way of removing old definitions that are no longer needed.
HTTP method
POST
Required user role
See Required Enterprise Manager permissions.
Request parameters
Location | Name | Required | Example |
---|---|---|---|
URL |
Host [string] |
Yes |
computer.network.net |
URL |
ServerName [string] |
Yes |
myrepsrv1 |
Header |
EnterpriseManager.APISessionID [string] |
Yes |
wCo0_KvjEUFROvfHF5KGrw |
Header |
This is the number of bytes in the content body. Note that the number of bytes that you specify must be exactly the same as the number of bytes in the JSON file. This number can be ascertained by copy-pasting the text into a text editor such as Notepad ++ (which shows the number of bytes as "Length" at the bottom of its console). |
Yes |
"Content-Length: 110952"
|
Body |
A JSON document to import [stream] |
Yes |
localServer1.json |
Response
JSON File (stream)
cURL example
Request
CURL.EXE -i -k -X POST --header "EnterpriseManager.APISessionID: wCo0_KvjEUFROvfHF5KGrw" --header "Content-Length: 110952" --header "Content-Type: application/json" " https://computer.network.net/attunityenterprisemanager/api/v1/servers/ myrepsrv1?action=import" -T "C:\exports\localServer1.json"
Response
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Content-Length: 0
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Tue, 28 Feb 2017 19:05:12 GMT
Error response
HTTP Code | Enterprise Manager Code | Text | Description |
---|---|---|---|
500 |
AEM_METHOD_NOT_SUPPORTED_VERSION |
ImportAll is only supported on Replicate 5.2 or above. |
The method requires Replicate 5.2 or above. |
500 |
AEM_IMPORT_NO_PERMISSION_ON_TASK |
Failed to import all tasks to replication server {server} as the logged in user does not have permission to add tasks. |
Stream cannot be imported because the user does not have the permissions to add tasks. |
500 |
AEM_IMPORT_NO_PERMISSION_ON_ENDPOINT |
Failed to import all tasks to replication server {server} as the logged in user does not have permission to add endpoints. |
Stream cannot be imported because the user does not have the permissions to add endpoints |
500 |
AEM_IMPORT_CONTENT_EMPTY |
Failed to import all tasks to replication server {server} as the JSON file is empty. |
Stream cannot be imported because it contains no content. |
500 |
AEM_IMPORT_INVALID_CONTENT |
Failed to import all tasks to replication server {server} as the JSON file contains invalid content. |
Stream cannot be imported because it contains invalid content. |