List Files (11.1.2.3.600)

This REST API lists the files in the Planning repository and returns information about the available file and application snapshots.

This topic describes the original version of this REST API. You can also use the simplified v2 version of the REST API. The v2 version contains all parameters in the payload and does not require URL encoding while calling the REST APIs. This makes the v2 API easier to use. The v2 version is backwards compatible.

This API provides details such as name, type, size and last modified time. Size and last modified are not available for LCM snapshots. See About EPM Automate in Working with EPM Automate.

Required Roles

Service Administrator

Any predefined role and the Migrations – Administer granular role

REST Resource

GET /interop/rest/11.1.2.3.600/applicationsnapshots

Supported Media Types: application/json

Response

Table 9-24 Parameters

Name Description
Details Will be published in case of error with the error string
Status See Migration Status Codes
Items  
Name Name of the application snapshot
Type

Can be LCM or EXTERNAL

Type signifies if this snapshot is for LCM or EXTERNAL. LCM indicates that the file is an LCM snapshot. EXTERNAL indicates that files are not LCM, such as Planning files.

Size Size of the application snapshot in bytes. Available only for type EXTERNAL
Lastmodifiedtime Time in Long value as per the last modified time of the file.
Links Detailed information about the link
Href Link to API call/ status API
Action The HTTP call type
Rel Will be self
Data Parameters as key value pairs passed in the request

Example of Response Body

{
	"status":0,
	"items":[{
		"name":"sample.csv",
		"type":"EXTERNAL",
		"size":"18",
		"lastmodifiedtime":"1422534438000"
		},{
		"name":"snapshot1",
		"type":"LCM",
		"size":null,
		"lastmodifiedtime":null
	}],
	"details":null,
	"links":[{
		"data":null,
		"action":"GET",
		"href":"https://<BASE-URL>/interop/rest/11.1.2.3.600/applicationsnapshots",
		"rel":"self"
	}]
}

cURL Sample

funcListFiles() {
	url=$SERVER_URL/interop/rest/$API_VERSION/applicationsnapshots
	funcExecuteRequest "GET" $url

	list=`cat response.txt | jq 'select(.items != null) | .items[].name'`
	if [[ ! -z $list ]]; then
		echo $list
	else
		echo "No files found"
	fi
	funcRemoveTempFiles "respHeader.txt" "response.txt"
}