Import a project
POST /project/import/{import_path}
Overview
This API imports a project to a new location, such as a production Snaplex.
Optionally, you can also update the accounts used and add expressions to the project while importing.
Prerequisites
- Environment (Org) admin permissions
Request
POST https://{controlplane_path}/api/1/rest/public/project/import/{import_path}?{query_parameters}
Path Parameters
Key | Description |
---|---|
controlplane_path |
Required. The path to the SnapLogic Control Plane:
elastic.snaplogic.com
For the UAT or EMEA control plane, substitute the name for elastic . For
example:
|
import_path |
The path to the target project. Format:
Note: The project will be created if it doesn't already exist, but the
Environment/Org and the project space must already exist.
|
Query Parameters
Key | Type | Description |
---|---|---|
duplicate_check |
string | Indicates how to handle duplicates between the source and the destination
during import. Valid values:
|
overwrite_types |
list | The types of assets that can be overwritten, if an asset with the same name
already exists in the destination project. Valid values:
Note: Policies are always overwritten.
|
Request Header
Specify Basic
for authorization and multipart/form-data
for content type.
Authorization: Basic {your_encoded_security_credentials}
Content-Type: multipart/form-data
Request Body
Key | Type | Description |
---|---|---|
file |
string | The unmodified zip file of the source project that was exported. Important: The project zip file must be exported from the source project
and must be imported without changes to the new location.
The name of this zip file does not indicate the name of the target project,
which is specified in |
file_account |
string | Optional. The JSON file containing the list of accounts
to modify. To create this file:
If this file is not provided, the accounts are not modified. |
file_expr |
string | Optional. A zip file containing expression files to add
to the root of the project in the new location. If an expression file with the same name already exists in the target location, it is overwritten. If this file is not provided, no additional expression files are added to the project. Important: If the zip file contains folders, the folder structure is
flattened. If duplicate filenames exist in different folders of the zip file,
only one of those files is copied to the new location.
Example: An expression library file (typically with
the
|
Response
Response Body
{
"response_map": {
"successful": [
{
"snode_id": "...",
"name": "..."
},
...
],
"failed": [
{
"status_code": 409,
"reason": "...",
"snode_id": "...",
"name": "..."
},
...
],
"warnings": [
{
"message": "...",
"snode_id": "...",
"name": "..."
},
...
]
},
"http_status_code": 200
}
Key | Type | Description |
---|---|---|
successful |
array | An array of objects that contain:
For successfully updated accounts, |
failed |
array | An array of objects that contain:
|
warnings |
array | An array of objects that contain:
|
Example
Example workflow mapping out import of the project
The following examples showcases the import of the project assets in the global control plane project space with Public API. This example maps out specific parameters and error codes.
Method
POST
Base URL
https://cdn.elastic.snaplogic.com/api/1Endpoint URL
/rest/public/project/import/test_org/importprojectspace/importprojectRequest URL
https://cdn.elastic.snaplogic.com/api/1/rest/public/project/test_org/importprojectspace/importproject?duplicate_check=true"Request Path Parameter
test_org/importprojectspace/importprojectRequest Query Parameter
?duplicate_check=trueRequest Header Parameter
Key | Value |
---|---|
Content-type |
multipart/form-data |
Authorization |
Basic {your_encoded_security_credentials} |
Request Body Parameter
Key | Value |
---|---|
Content-type |
.zip |
Example Response Body
{
"response_map": {
"successful": [
{
"snode_id": "65e04f276a658125f19a98e6",
"name": "SwaggerSpec_basic.json"
},
{
"snode_id": "65e04f1bec148c5ec39e7af2",
"name": "BasicAcc"
},
{
"snode_id": "65e04f4621c20fb935b8f46f",
"name": "TestPL"
},
{
"snode_id": "65e04f74fb8da320e46059fd",
"name": "TestPL Task"
}
],
},
"http_status_code": 200
}
Error Handling
HTTP Status Codes | Status | Description | Resolution |
---|---|---|---|
200 |
successful |
An array of objects that contain:
is successfully imported. |
N/A |
400 |
Bad Request |
The request was unacceptable, often due to missing a required parameter. |
|
409 |
Conflict |
This response is sent when a request conflicts with the current state of the server. |
|