Migrate a proxy

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

Overview

Migrate a proxy, including all its endpoints, policies, and files.

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.
Important: This page describes a Classic APIM API.

Prerequisites

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

Request

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

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_proxy' \
  -H 'Authorization: Basic {base64_encoded email:password}' \
  -H 'Content-Type: application/json' \
  -d '{
  "source_org": "acme",
  "source_proxy_name": "BookStore",
  "dest_org": "acme-staging",
  "dest_proxy_name": "BookStore",
  "duplicate_check": 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

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

 {
  "source_org" : "...",
  "source_proxy_name" : "...",
  "dest_org" : "...",
  "dest_proxy_name" : "...",
  "duplicate_check" : true
}
Key Type Description
source_org string Required. The name of the source Environment/Org.
source_proxy_name string Required. The name of the source proxy.
dest_org string Required. The name of the destination Environment/Org.
dest_proxy_name string The name of the destination proxy. Required if migrating within the same Environment/Org.
duplicate_check Boolean

If true, throws an exception if a proxy with the same name already exists in the destination Environment/Org.

If false, overwrites any existing proxy with the same name in the destination Environment/Org.

Default: true

Response

 {
  "response_map": {
    "source_proxy_path": "...",
    "destination_proxy_path": "...",
    "proxy_status": {
      "deleted_duplicate_proxy": {
        "proxy_path": "...",
        "snode_id": "..."
      },
      "status": "...",
      "snode_id": "...",
      "migrated_policies": [ ... ],
      "files": [
        {
          "status": "...",
          "file_name": "...",
          "file_path": "...",
          "snode_id": "..."
        }
      ]
    },
    "proxy_endpoint_status": {
      "status": "...",
      "proxy_endpoints": [
        {
          "myEndpoint1": {
            "proxy_endpoint_path": "...",
            "snode_id": "...",
            "policies": [ ... ]
          }
        }
      ],
      "reason": "..."
    }
  },
  "http_status_code": 200
}
Key Type Description
source_proxy_path string The path to the source proxy.

Format: /{env_org}/apim/{proxy_name}

destination_proxy_path string The path to the destination proxy.

Format: /{env_org}/apim/{proxy_name}

proxy_status object Information about the migration of the proxy and its policies.
proxy_status » deleted_duplicate_proxy object If duplicate_check was set to false, information about the existing proxy with the same name, if any, in the destination Environment/Org.
  • proxy_path. (string) The path to the existing proxy with the same name.
  • snode_id. (string) The ID of the JCC node that performed the operation.
proxy_status » status string The status of the migration of the proxy.
Possible values:
  • Migrated proxy.
  • Not migrated.
proxy_status » snode_id string The ID of the JCC node that performed the operation.
proxy_status » migrated_policies array An array of strings containing the friendly names of the policies that were migrated with the proxy.
proxy_status » files array An array of objects containing information about the migrated files. Each object contains the following information:
  • status. (string) The status of the migration of the file.
    Possible values:
    • Migrated file.
    • Not migrated.
  • file_name. (string) The name of the file.
  • file_path. (string) The path to the file.
  • snode_id. (string) The ID of the JCC node that performed the operation.
proxy_endpoint_status object Information about the migration of the proxy's endpoints.
proxy_endpoint_status » status string The status of the migration of the proxy endpoints.
Possible values:
  • Migrated proxy endpoints.
  • Not migrated.
proxy_endpoint_status » proxy_endpoints array An array of objects containing information about the migrated endpoints. Each object contains a key-value pair.
  • Key: The endpoint name.
  • Value: An object with the following information:
    • proxy_endpoint_path. (string) The path to the endpoint.
    • snode_id. (string) The ID of the JCC node that performed the operation.
    • policies. (array) An array of strings containing the friendly names of the policies that were migrated with the endpoint.
reason string If the migration failed, the reason for the failure.

Error handling

HTTP status codes Message Resolution
400 Not migrated Check the reason in the response for details about the migration failure.
401 Unauthorized Verify your credentials and permissions.
409 Proxy name exists where duplicate proxies are not permitted Rename the proxy or remove the existing proxy at the destination.