Migrate a Service version

POST https://{controlplane_path}/api/1/rest/public/apim_service/migrate_service_version/{src_path}      
Important: This API applies to APIM 3.0, not Classic APIM.

Migrate a Service version, including the asset types specified in the request body, to another environment. The destination Service must already exist in the target environment.

Prerequisites

  • Environment admin permissions, or read permission on the source project and write permission on the target.
  • The destination Service must already exist in the target environment. You can create an empty Service from the Services Catalog.

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",
  "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:
  • uat.elastic.snaplogic.com
  • emea.snaplogic.com
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 in this format: /{org}/{project_space}/{project}/{service}. For example, /my-environment/my-proj-space/my-proj/BookStoreService. Do not include the version name; the migration creates the version automatically. The destination Service must already exist; you can create an empty Service from the Services Catalog. If the path doesn't start with /, it is added automatically.
asset_types array The list of asset types to migrate.
Valid values:
  • Account
  • File
  • Job (task)
  • Pipeline
  • Policy

Default: All valid asset types.

Important:
If you are migrating or copying accounts or policies to a different environment (Org):
  • The source environment must recognize the destination as a trusted environment.
  • The destination environment must have at least the same security level as the source environment.
Learn how to add a trusted 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 Retrieve the status of a migration API to check the migration progress.

Note: The Get Service migration status endpoint (/apim_service/migration_status/{org_name}) is for Classic APIM to APIM 3.0 asset migration only. Do not use it for cross-environment Service version migration.

{
  "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.