Import an API version
POST /apim/import_version/{import_path}
Overview
This API imports an API version from one Control plane/Org to another using a public API. Alternatively, you can also update the accounts used and add expressions to the API version while importing.
Prerequisites
- Write permission on the target API to import the API version
Request
POSThttps://{control_plane_path}/api/1/rest/public/apim/import_version/{import_path}?{query_parameter}
Example
https://cdn.elastic.snaplogic.com/api/1/rest/public/apim/import_version/test_org/openapi/1.0?duplicate_check=true/
Path Parameters
Key | Description |
---|---|
import_path | The path to the target API.
|
Query Parameters
Key | Type | Description |
---|---|---|
duplicate_check |
boolean |
|
overwrite_types |
list |
The types of assets that can be overwritten, if an asset with the same name already exists in the destination API version. Valid values:
Note: Policy is always overwritten
|
The parameter setting is same for import of API version between different Orgs.
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 |
|
file_account |
string |
The JSON file containing the list of accounts to modify.
|
file_expr |
string |
Note: 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
.expr extension) might
contain:
|
Response
Example 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
}
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. |
|