Migrate a Service version
POST https://{controlplane_path}/api/1/rest/public/apim_service/migrate_service_version/{src_path}
Migrate a Service version, including the asset types specified in the request body, to another environment.
Prerequisites
Environment admin permissions, or read permission on the source project and write permission on the target.
Example
This example uses basic authentication. For a JWT example, refer to Authentication.
The following cURL example uses my-environment for the environment name.
curl -X 'POST' \
'https://elastic.snaplogic.com/api/1/rest/public/apim_service/migrate_service_version/my-environment/my-proj-space/my-proj/BookStoreService/1.0' \
-H 'Authorization: Basic {base64_encoded email:password}' \
-H 'Content-Type: application/json' \
-d '{
"dest_path": "/target-env/my-proj-space/my-proj/BookStoreService/1.0",
"asset_types": ["Pipeline", "Account", "File"],
"duplicate_check": false
}'
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:
|
src_path |
The path to the source Service version in this format:
/{org}/{project_space}/{project}/{service}/{version}. If the path doesn't
start with /, it is added automatically. |
Query parameters
None.
Request header
Use the application/json content type with basic authentication (email
and password) or a JWT. For examples, refer to Authentication.
Request body
{
"dest_path" : "...",
"asset_types" : [ ... ],
"duplicate_check" : false
}
| Key | Type | Description |
|---|---|---|
dest_path |
string | Required. The path to the destination Service version in this format:
/{env}/{project_space}/{project}/{service}/{version}. For example,
/my-environment/my-proj-space/my-proj/service-1/0.1. If the path doesn't
start with /, it is added automatically. |
asset_types |
array | The list of asset types to migrate. Valid values:
Default: All valid asset types. Important:
If you are migrating or copying accounts or policies to
a different environment (Org):
|
duplicate_check |
boolean | Optional. If true, the migration checks for duplicate assets in the
destination path. Default: false. |
Response
The migration always runs asynchronously. The response contains a
status_token that you can use with the Get Service migration status API to
check the migration progress.
{
"response_map": {
"status_token": "17ed9720-05b2-4e22-9955-04c4534451ae"
},
"http_status_code": 200
}
Error handling
| HTTP status codes | Message | Resolution |
|---|---|---|
| 401 | Unauthorized | Verify your credentials and that you have read permission on the source project and write permission on the target. |
| 404 | Not Found | Verify the source Org and Service version path are correct and exist. |
| 409 | Service version already exists at destination | The destination already contains a Service version with the same name. Set
duplicate_check to false to overwrite, or use a
different destination path. |