ファイルのリストまたはダウンロード
/essbase/rest/v1/files/{path}
ファイルのリストを返すか、指定されたファイルをダウンロードします。ファイルをリストするには、AcceptヘッダーにAccept='application/json'
を使用します。ダウンロードするには、AcceptヘッダーにAccept='application/octet-stream'
を使用します。
リクエスト
- path(required): string
パターン:
.+
applications
、shared
またはusers
で始まるカタログ・パス。ファイルをリストする場合、これはフォルダ・パスです。ファイルをダウンロードする場合、これはファイル・パスです。例:
applications/sample
shared
users/ksmith
- action: string
アップロードを検証します。サポートされているアクション値は、
validateUpload
および'Accept=application/json'
または'Accept=application/xml'
です。 - fileSize: integer(int64)
十分な空きスペースがあるかどうかを検証します。問合せパラメータ
action='validateUpload'
およびAccept='application/json'
またはAccept='application/xml'
がある場合のみ適用できます。 - filter: string
ファイルのリストをフィルタします。
- limit: integer(int32)
返される最大ファイル数。ファイルのリストの場合のみ適用できます。
- offset: integer(int32)
結果セットの先頭から省略するアイテムの数。デフォルト値は0です。ファイルのリストの場合のみ適用できます。
- overwrite: boolean
trueの場合は、ファイルを上書きします。falseの場合、既存のファイルは、検証されますが上書きはされません。問合せパラメータ
action=validateUpload
およびAccept='application/json'
またはAccept='application/xml'
がある場合のみ適用できます。デフォルト値はFALSEです。デフォルト値:false
- recursive: boolean
検索結果を再帰として取得するための再帰パラメータ。
デフォルト値:false
- type: string
タイプ別にファイルをリストします。typeが指定されていない場合は、すべてのファイルを返します。ファイルのリストの場合のみ適用できます。
レスポンス
- application/json
- application/xml
200 レスポンス
OK
レスポンス・タイプは、Acceptヘッダーに応じてJSON/XMLまたはストリームにできます。Accept=application/json
またはAccept=application/xml
である場合は、レスポンスで、ファイルおよび現在のフォルダ詳細がリストされます。Accept=application/octet-stream
である場合は、レスポンスはストリームとして返されます。問合せパラメータにaction=validateUpload
およびAccept='application/json'
またはAccept='application/xml'
が含まれる場合、レスポンスは空になります。
object
400 レスポンス
不正なリクエスト
問合せパラメータにaction=validateUpload
およびAccept='application/json'
またはAccept='application/xml'
が含まれているときに、ログインしているユーザーに適切な権限がないかファイルがすでに存在する可能性があります。
500 レスポンス
サーバーの内部エラーです。
例
次の例では、ファイルをリストまたはダウンロードする方法を示します。
この例では、cURLを使用して、Windowsシェル・スクリプトからREST APIにアクセスします。呼出し元ユーザーのIDおよびパスワードは変数であり、properties.bat
内でその変数値が設定されています。
cURLコマンドを含むスクリプト - ユーザー・ファイルのリスト
次の例では、ユーザー・ディレクトリ内のファイルをリストする方法を示します。リストには、ファイルをダウンロードするためのリンクが含まれています。
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1" -H "accept: application/json" -u %User%:%Password%
レスポンス本体の例
{
"currentFolder": {
"name": "power1",
"fullPath": "/users/power1",
"type": "folder",
"permissions": {
"addFolder": true,
"addFile": true
}
},
"items": [
{
"name": "groups.csv",
"fullPath": "/users/power1/groups.csv",
"type": "csv",
"modifiedTime": 1585088753000,
"sizeInBytes": 50,
"permissions": {
"delete": true
},
"links": [
{
"rel": "download",
"href": "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1/groups.csv",
"method": "GET",
"type": "application/octet-stream"
}
]
},
{
"name": "testexamp.txt",
"fullPath": "/users/power1/testexamp.txt",
"type": "txt",
"modifiedTime": 1585088753000,
"sizeInBytes": 1074,
"permissions": {
"delete": true
},
"links": [
{
"rel": "download",
"href": "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1/testexamp.txt",
"method": "GET",
"type": "application/octet-stream"
}
]
}
]
}
cURLコマンドを含むスクリプト - キューブ・ファイルのリスト
次の例では、Essbaseキューブ・ディレクトリ内のルール・ファイル(タイプがrul
のファイル)のみをリストする方法を示します。ダウンロード・リンクは抑制されます。
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/applications/Sample/Basic?type=rul&links=none" -H "accept: application/json" -u %User%:%Password%
レスポンス本体の例
{
"currentFolder" : {
"name" : "Basic",
"fullPath" : "/applications/Sample/Basic",
"type" : "folder",
"permissions" : {
"addFile" : true
}
},
"items" : [ {
"name" : "Data.rul",
"fullPath" : "/applications/Sample/Basic/Data.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1255,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Caffeinated.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Caffeinated.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1032,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Intro_Date.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Intro_Date.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1029,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Market.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Market.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1503,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Measures.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Measures.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1896,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Ounces.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Ounces.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1017,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Pkg_Type.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Pkg_Type.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1023,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Population.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Population.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1149,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Product.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Product.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1920,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Scenario.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Scenario.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1517,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Year.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Year.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1254,
"permissions" : {
"delete" : true
}
}, {
"name" : "oci_dblink.rul",
"fullPath" : "/applications/Sample/Basic/oci_dblink.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1000,
"permissions" : {
"delete" : true
}
} ]
}
cURLコマンドを含むスクリプト - ユーザー・ディレクトリからのファイルのダウンロード
次の例では、ユーザー・ディレクトリからテキスト・ファイルをダウンロードする方法を示します。
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1/ASO_Sample_Data.txt" -H "accept:application/octet-stream" -o ASO_Sample_Data.txt -u %User%:%Password%
cURLコマンドを含むスクリプト - キューブ・ディレクトリからのファイルのダウンロード
次の例では、キューブ・ディレクトリからルール・ファイルをダウンロードし、その名前のファイルがすでにダウンロードされている場合に上書きする方法を示します。
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/applications/Sample/Basic/Data.rul?overwrite=true" -H "accept:application/octet-stream" -o Data.rul -u %User%:%Password%