LCM Import (v1)

Initiates import of a Migration snapshot so that the contents of the application snapshot are imported into the application. You can complete these tasks for imported users: set a specific password for all users in the snapshot, set a unique temporary password for each user in the snapshot, and force password reset at first login.

The presence of status -1 in the response indicates that the import is in progress. You should use the job status URI to determine whether the import is complete.

If the Job completes with status 1, the task details will be mentioned in the items from which the source, destination, and URL to fetch the first set of errors is available. All issues for a particular task can be fetched in the manner of pagination. Acceptable values for msgtype are: error/warn/info; limit represents the number of issues requested per request, and offset marks the beginning number to fetch the issues.

This API is version 11.1.2.3.600.

Required Roles

Service Administrator

Power User assigned to the Migration Administrator Profitability and Cost Management application role

Identity Domain Administrator role is required to import user and predefined roles

REST Resource

POST /interop/rest/{api_version}/applicationsnapshots/{applicationSnapshotName}/migration?q={type:"import"}

Note:

Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.

Table 9-7 Tasks for LCM Import

Task Request REST Resource
LCM Import POST

/interop/rest/{api_version}/applicationsnapshots/{applicationSnapshotName}/migration?q={type:"import"}

Import Status; the 9 in the resource is used as an example here GET /interop/rest/{api_version}/applicationsnapshots/{applicationSnapshotName}/migration/9
Details GET /interop/rest/{api_version}/applicationsnapshots/{applicationSnapshotName}/migration/9/0/details?limit=25&msgtype=error&offset=0

Request

Supported Media Types: application/json

The following table summarizes the request parameters.

Table 9-8 Parameters

Name Description Type Required Default
api_version Specific API version Path Yes None
applicationSnapshotName Application snapshot that is to be imported Path Yes None
type Type of migration being performed, import Query Yes None
importUsers Whether to import users; true imports users and their predefined role assignments. The import fails if the user does not have the Identity Domain Administrator role. Query No false
userPassword The default password for the imported users. Query No A unique temporary password is assigned to each user
resetPassword Whether to force reset password for the imported users on first login, true or false Query No true

Response

Supported Media Types: application/json

Table 9-9 Parameters

Parameters Description
details In case of errors, details are published with the error string
status See Migration Status Codes
links Detailed information about the link
href Links to API call
action The HTTP call type
rel Can be self and/or Job Status. If set to Job Status, you can use the href to get the status of the import operation
data Parameters as key value pairs passed in the request
items Details about the resource
source From where the navigation is being performed
destination To where the navigation is being performed
name Name of the task, usually "Task Information"
links Details of the first URL to be requested to get the job details; rel is "Job Details"

Examples of Response Body

The following are examples of the response body in JSON format.

Example 1: Job is in Progress

{
	"details":null,
	"status":-1,
	"links":[{
		"data":null,
		"action":"POST",
		"rel":"self",
		"href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migrationq={type:"import"}"
		},{
		"data":null,
		"action":"POST",
		"rel":"Job Status",
		"href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/2"
	}]
}

Example 2: Job Completes with Errors

{"status":1, 
"items":[{
   "source":"/Nasdaq/HSS-Shared Services",
   "name":"Task Information",
   "destination":"Shared Services",
   "links":[{
      "data":null,
      "action":"GET",
      "rel":"Job Details",
      "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=25&offset=0&msgtype=error"}]
   },
   {"source":"/Artifact Snapshot/HP-SS2",
   "name":"Task Information",
   "destination":"",
   "links":[{
      "data":null,
      "action":"GET",
      "rel":"Job Details",
      "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/1/details?limit=25&offset=0&msgtype=error"}]
   }],
   "details":null,
   "links":[{
      "data":null,
      "action":"POST",
      "rel":"self",
      "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1"}
      ]}
         }

Example 3: Each Type of Task Informaton is Requested

{"status":0,
"items":[{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0026 not found. Please ensure that a user exists in the system.",
      "msgCategory":"14000: Error reported.",
   "msgCategory":"14000: Error reported." 
   },{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0025 not found. Please ensure that a user exists in the system.",
   "msgCategory":"14000: Error reported." }
   ],
"details":null,
"links":[{
   "data":null,
   "action":"GET",
   "rel":"self",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&msgtype=error&offset=25"},
   {"data":null,
   "action":"GET",
   "rel":"next",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=27&msgType=error"},
   {"data":null,
   "action":"GET",
   "rel":"prev",
   "href":https://<BASE-URL>/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=23&msgType=error
   }]
      }

Java Sample – lcmImport.java

Prerequisites: json.jar

Common Functions: See Common Helper Functions for Java

{"status":0,
"items":[{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0026 not found. Please ensure that a user exists in the system.",
      "msgCategory":"14000: Error reported.",
   "msgCategory":"14000: Error reported." 
   },{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0025 not found. Please ensure that a user exists in the system.",
   "msgCategory":"14000: Error reported." }
   ],
"details":null,
"links":[{
   "data":null,
   "action":"GET",
   "rel":"self",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&msgtype=error&offset=25"},
   {"data":null,
   "action":"GET",
   "rel":"next",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=27&msgType=error"},
   {"data":null,
   "action":"GET",
   "rel":"prev",
   "href":https://<BASE-URL>/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=23&msgType=error
   }]
      }

cURL Sample – LcmImport.sh

Prerequisites: jq (http://stedolan.github.io/jq/download/linux64/jq)

Common Functions: See Common Helper Functions for cURL

{"status":0,
"items":[{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0026 not found. Please ensure that a user exists in the system.",
      "msgCategory":"14000: Error reported.",
   "msgCategory":"14000: Error reported." 
   },{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0025 not found. Please ensure that a user exists in the system.",
   "msgCategory":"14000: Error reported." }
   ],
"details":null,
"links":[{
   "data":null,
   "action":"GET",
   "rel":"self",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&msgtype=error&offset=25"},
   {"data":null,
   "action":"GET",
   "rel":"next",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=27&msgType=error"},
   {"data":null,
   "action":"GET",
   "rel":"prev",
   "href":https://<BASE-URL>/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=23&msgType=error
   }]
      }

Groovy Sample – LcmImport.groovy

Prerequisites: json.jar

Common Functions: See CSS Common Helper Functions for Groovy

{"status":0,
"items":[{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0026 not found. Please ensure that a user exists in the system.",
      "msgCategory":"14000: Error reported.",
   "msgCategory":"14000: Error reported." 
   },{
   "msgType":"error",
   "artifact":"/Native Directory/Groups",
   "msgText":"EPMIE-00069: Failed to find user during group children import. User user0025 not found. Please ensure that a user exists in the system.",
   "msgCategory":"14000: Error reported." }
   ],
"details":null,
"links":[{
   "data":null,
   "action":"GET",
   "rel":"self",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&msgtype=error&offset=25"},
   {"data":null,
   "action":"GET",
   "rel":"next",
   "href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=27&msgType=error"},
   {"data":null,
   "action":"GET",
   "rel":"prev",
   "href":https://<BASE-URL>/rest/11.1.2.3.600/applicationsnapshots/ss2/migration/1/0/details?limit=2&offset=23&msgType=error
   }]
      }

Sample cURL Command Basic Auth

curl -X POST -s -u '<USERNAME>:<PASSWORD>' -H 
'Content-Type: application/x-www-form-urlencoded' 'https://<BASE-URL>
/interop/rest/11.1.2.3.600/applicationsnapshots/<APPLICATION-SNAPSHOT-NAME>/migration?
q={type:"import",importUsers:"true"}'

Sample cURL Command OAuth 2.0

curl -X POST --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H 
'Content-Type: application/x-www-form-urlencoded' 'https://<BASE-URL>
/interop/rest/11.1.2.3.600/applicationsnapshots/<APPLICATION-SNAPSHOT-NAME>/migration?
q={type:"import",importUsers:"true"}'