Essbaseスクリプトの更新
put
/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/scripts/{scriptName}
指定されたアプリケーションおよびデータベース内の指定されたスクリプトを更新し、更新後のスクリプトを返します。
リクエスト
サポートされているメディア・タイプ
- application/json
パス・パラメータ
- applicationName(required): string
アプリケーション名。
- databaseName(required): string
データベース名。
- scriptName(required): string
スクリプト名。
問合せパラメータ
- file: string
スクリプト・ファイルのタイプ。
デフォルト値:calc
スクリプトの詳細。
レスポンス
200 レスポンス
OK
スクリプトが正常に更新されました。スクリプト詳細、スクリプトを取得、編集または削除するためのリンク、その内容を取得するためのリンクが含まれます。
400 レスポンス
不正なリクエスト
スクリプトの更新に失敗しました。アプリケーション名またはデータベース名が正しくないか、スクリプトのJSONが正しくないか、指定したスクリプト名がすでに存在する可能性があります。
415 レスポンス
受入れできません
メディア・タイプがサポートされていないか指定されていません。
500 レスポンス
サーバーの内部エラーです。
例
次の例では、REST APIを使用して既存のEssbaseスクリプトを更新する方法を示します。
この例では、cURLを使用して、Windowsシェル・スクリプトからREST APIにアクセスします。呼出し元ユーザーのIDおよびパスワードは変数であり、properties.bat
内でその変数値が設定されています。
計算スクリプトの更新
call properties.bat
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/dataexpoptions?links=none" -H "accept: application/json" -H "Content-Type:application/json" -d '{"name": "export_inventory", "content": "SET DATAEXPORTOPTIONS \r\n {\r\n DataExportLevel \"ALL\";\r\n DataExportColHeader \"Measures\";\r\n DataExportColFormat ON;\r\n DataExportDimHeader ON;\r\n DataExportDynamicCalc OFF;\r\n DataExportDecimal 0;\r\n DataExportDryRun OFF;\r\n DataExportOverwriteFile ON;\r\n };\r\n\r\nFIX(\"Qtr1\")\r\n DATAEXPORT \"File\" \",\" \"log.txt\" ;\r\nENDFIX;"}' -u %User%:%Password%
レスポンス本体の例
{
"name" : "dataexpoptions",
"modifiedTime" : 1721687847823,
"sizeInBytes" : 311
}
MDXスクリプトの更新
call properties.bat
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/export_inventory?file=mdx&links=none" -H "accept: application/json" -H "Content-Type:application/json" -d '{"name": "grantfilter", "content": "EXPORT INTO FILE \"sample_exp\" OVERWRITE\r\nSELECT \r\n {[Mar],[Apr]} \r\nON COLUMNS,\r\n Crossjoin({[New York]},\r\n Crossjoin({[Actual],[Budget]},\r\n {[Opening Inventory],[Ending Inventory]})) \r\nON ROWS\r\nFROM [Sample].[Basic]\r\nWHERE ([100]);"}' -u %User%:%Password%
レスポンス本体の例
{
"name" : "export_inventory",
"modifiedTime" : 1721686781209,
"sizeInBytes" : 240
}