Migrate an API version

POST https://{controlplane_path}/api/1/rest/public/apim/migrate_version/{version_path}      

Migrate an API version, including the selected asset types, to another version.

The destination version can be in the same or another API, Project, Environment/Org, or Snaplex.

Important: This page describes a Classic APIM API.

Prerequisites

  • Read access to the source project
  • Write access to the target Org

Example

This example uses Basic authentication. For a JWT example, refer to Authentication.

curl -X 'POST' \
  'https://elastic.snaplogic.com/api/1/rest/public/apim/migrate_version/acme/apim/BookStore/1.0' \
  -H 'Authorization: Basic {base64_encoded email:password}' \
  -H 'Content-Type: application/json' \
  -d '{
  "dest_version_path": "/acme-staging/apim/BookStore/1.0",
  "dest_plex_path": "/acme-staging/shared/my-snaplex",
  "asset_types": ["Pipeline", "Account", "File"],
  "duplicate_check": true,
  "async_mode": true
}'

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
version_path Required. The path of the source API version.

Format: {org}/apim/{apiname}/{apiversion}

Example: snaplogic/apim/My%20User%20API/1.0

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_version_path" : "...",
  "dest_plex_path" : "...",
  "asset_types" : [ ... ],
  "duplicate_check" : true,
  "async_mode" : true
}
Key Type Description
dest_version_path string
The path to the destination API version.
  • The path comparison is case-sensitive.
  • The path must be URL-escaped. That is, spaces must be replaced with %20.

Format: /{env_org}/apim/{api_name}/{api_version}

dest_plex_path string
The path to the destination Snaplex.
  • The path comparison is case-sensitive.
  • The path must be URL-escaped. That is, spaces must be replaced with %20.

Format: /{env_org}/{project_space}/{project_name}/{snaplex_name}

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

If true, throws an exception if a project with the same name already exists at the destination path.

If false, overwrites any existing project with the same name at the destination path.

Default: true

async_mode Boolean If true, the migration proceeds asynchronously.

A response is immediately returned with status_token and status_url, which you can use to check on the status of the migration (Started, Completed, or Failed).

Default: true

Response

 {
  "response_map": {
    "successful": [
      {
        "snode_id": "...",
        "name": "..."
      },
      ...
    ],
    "failed": [ ... ],
    "warnings": [ ... ]
  },
  "http_status_code": 200
}
Key Type Description
successful array An array of objects containing information about assets that were successfully migrated.
failed array An array of objects containing information about assets that were not migrated.
warnings array An array of warnings encountered during the migration.
snode_id string The ID of the asset in the destination JCC node.
name string The name of the copied asset.

Error handling

HTTP status codes Message Resolution
400 {dest_version_path} is not an Api Version Verify the destination path points to a valid API version.
400 The Plex assigned to an Api Version must be a groundplex or have a load balancer Assign a valid Snaplex to the destination API version.
401 Unauthorized Verify your credentials and permissions on both source and destination.
404 Not Found Verify the source version path, Org, and Snaplex path are correct and exist.
409 There is an Api Version with same name in the destination path. Use duplicate_check=False to overwrite the assets on migration Set duplicate_check to false to overwrite, or use a different destination path.