Scenario 3: Export and Download Metadata and Data

This scenario shows how to use the EPM Cloud REST APIs to export and download metadata and data.

Example 5-7 Java

public void integrationScenarioExportMetadataAndDataAndDownloadFiles() throws Exception {
	executeJob("EXPORT_METADATA", "exportentitymetadata", "{exportZipFileName:entitydata.zip}");
	executeJob("EXPORT_DATA", "Forecastdata", "{exportFileName:forecastdata.zip}");
	listFiles();       
	downloadFile("entitydata.zip");
	downloadFile("forecastdata.zip");  
}

Common Functions: See Common Helper Functions for Java.

Dependent APIs: see Java Sample – DownloadFile.java and Java Sample – ExecuteJob.java in Upload and Download Files.

Example 5-8 cURL

funcIntegrationScenarioExportMetadataAndDataAndDownloadFiles() {
	funcExecuteJob "EXPORT_METADATA" "exportentitymetadata" "{exportZipFileName=entitydata.zip}"
	funcExecuteJob "EXPORT_DATA" "Forecastdata" "{exportFileName=forecastdata.zip}"
	funcListFiles      
	funcDownloadFile "entitydata.zip"
	funcDownloadFile "forecastdata.zip"
}

Example 5-9 Groovy

def integrationScenarioExportMetadataAndDataAndDownloadFiles() {
	executeJob("EXPORT_METADATA", "exportentitymetadata", "exportZipFileName=entitydata.zip");
	executeJob("EXPORT_DATA", "Forecastdata", "exportFileName=forecastdata.zip");
	listFiles();       
	downloadFile("entitydata.zip");
	downloadFile("forecastdata.zip");  
}