Upload File or Create Folder
/essbase/rest/v1/files/{path}
Uploads a file to Essbase.
Supported file types include text files, rules files, calculation script files, and MaxL script files.
If there is no content type, and a folder name is specified in the URL, a folder is created.
Request
- application/octet-stream
-
path: string
Pattern:
.+
Catalog path. If
Content-Type=application/octet-stream
, this is a file name. Otherwise, it is a folder name.
-
overwrite: boolean
Applicable only for adding a file. Overwriting folders is not supported.
Default Value:false
-
append(optional): boolean
Append to existing file?
Default Value:false
Response
- application/json
- application/xml
200 Response
OK
The file uploaded successfully (if Content-Type is application/octet-stream
), or the folder was created successfully (if there is no Content-Type).
object
400 Response
Bad Request
Logged in user may not have appropriate permissions, or the file or folder may already exist.
500 Response
Internal Server Error.
Examples
The following examples show 1) how to upload files to an Essbase cube directory, and 2) how to upload a file to a shared directory.
cURL Command 1
curl -X PUT "https://192.0.2.1:443/essbase/rest/v1/files/applications/Sample/Basic/Data_Basic.txt?overwrite=true"
-H "accept: application/json"
Response Body 1
[
{
"rel": "download",
"href": "https://192.0.2.1:443/essbase/rest/v1/files/applications/Sample/Basic/Data_Basic.txt",
"method": "GET",
"type": "application/octet-stream"
}
]
cURL Command 2
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/files/shared/datafile.txt" -H Accept:application/json -H Content-Type:application/octet-stream --data-binary @datafile.txt -u %User%:%Password%
Response Body 2
[ {
"rel" : "download",
"href" : "https://myserver.example.com:9001/essbase/rest/v1/files/shared/datafile.txt",
"method" : "GET",
"type" : "application/octet-stream"
} ]