使用這些指令碼,從檔案手動匯入應用程式中繼資料。
這些指令碼會執行下列活動:
Windows 範例指令碼
透過複製下列指令碼以建立importMetadata.ps1
。將它儲存至本機目錄。
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw) $username="$($inputproperties.username)" $passwordfile="$($inputproperties.passwordfile)" $serviceURL="$($inputproperties.serviceURL)" $file1="$($inputproperties.file1)" $jobName="$($inputproperties.jobName)" epmautomate login ${username} ${passwordfile} ${serviceURL} epmautomate uploadfile ${file1} epmautomate importmetadata ${jobName} ${file1} epmautomate refreshcube epmautomate logout
Linux/UNIX 範例指令碼
透過複製下列指令碼以建立importMetadata.sh
。將它儲存至本機目錄。
#!/bin/bash . ./input.properties export JAVA_HOME=${javahome} ${epmautomatescript} login "${username}" "${passwordfile}" "${serviceURL}" ${epmautomatescript} uploadfile "${file1}" ${epmautomatescript} importmetadata "${jobName}" "${file1}" ${epmautomatescript} refreshcube ${epmautomatescript} logout
建立 input.properties 檔案
透過複製下列其中之一並根據您的環境資訊予以更新,以建立 input.properties
檔案。將檔案儲存至儲存 importMetadata.ps1
或 importMetadata.sh
的目錄。
username=exampleAdmin passwordfile=examplePassword.epw serviceURL=exampleURL File1=FILE_NAME.zip jobName=JOB_NAME
Linux/UNIX
javahome=JAVA_HOME epmautomatescript=EPM_AUTOMATE_LOCATION username=exampleAdmin passwordfile=examplePassword.epw serviceURL=exampleURL File1=FILE_NAME.zip jobName=JOB_NAME
表格 3-16 input.properties 參數
參數 | 描述 |
---|---|
javahome |
JAVA_HOME 位置。僅適用於 Linux/UNIX。 |
epmautomatescript |
EPM Automate 執行檔 (epmautomate.sh ) 的絕對路徑。僅適用於 Linux/UNIX。 |
username |
服務管理員的使用者名稱,該管理員也具備身分識別網域管理員角色。 |
password |
服務管理員的密碼,或加密密碼檔案所在的名稱和位置。 |
serviceURL |
環境的 URL,您會從這個環境產生快照。 |
File1 |
ZIP 檔案的名稱,這個 ZIP 檔案包含要匯入的中繼資料。 |
JobName |
匯入中繼資料時要使用的工作。 |
執行指令碼
importMetadata.ps1
或 importMetadata.sh
。input.properties
檔案並將它儲存至 importMetadata
指令碼所在的目錄。此檔案的內容因作業系統而異。請參閱建立 input.properties 檔案。
確保您在此目錄中具有寫入權限。至於 Windows,您可能需要使用以管理員身分執行選項來啟動 PowerShell,才能執行指令碼。
importMetadata.ps1
。./importMetadata.sh
。