File Resource
The file resource gives you access to view and manipulate files using the CloudRest API.
Files can be attached to the following entities:
• Product
• Provisioning
• Execution
• User
The following actions are available through the product resource.
Upload File
Upload a file associated with a specified entity.
Use the PUT method for this action.
URL
https://datacloud2.pervasive.com/EntityAPIService/REST/{entityType}/{entityId}/file?filename={filename}&s={sessionId}
Parameters
Example
Request
Header
PUT https://datacloud2.pervasive.com/EntityAPIService/REST/product/00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9/file?s=49bfe32d-df30-4797-a8b1-96da5c1b5609&filename=sampleFile.txt HTTP/1.1
Content-Type: application/octet-stream
Host: datacloud2.pervasive.com
appliction/octet-stream
This is the content of a sample file named sampleFile.txt
Second line of the sample file content.
End of the Sample content
Response
Header
HTTP/1.1 200 OK
Content-Type: application/xml
Date: Thu, 10 Nov 2011 19:38:14 GMT
Server: Sun GlassFish Enterprise Server v2.1.1
X-Powered-By: Servlet/2.5
Content-Length: 0
Connection: keep-alive
Download File
Download a file associated with a specified entity.
Use the GET method for this action.
URL
https://datacloud2.pervasive.com/EntityAPIService/REST/{entityType}/{entityId}/file?filename={filename}&s={sessionId}
Only the application/octet-stream response type is available for this action.
Parameters
Example
Request
GET https://datacloud2.pervasive.com/EntityAPIService/REST/product/00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9/file?s=49bfe32d-df30-4797-a8b1-96da5c1b5609&filename=sampleFile.txt HTTP/1.1
Accept: application/octet-stream
Host: datacloud2.pervasive.com
Response
Header
HTTP/1.1 200 OK
content-disposition: attachment; filename=sampleFile.txt
Content-Type: application/octet-stream
Date: Thu, 10 Nov 2011 19:49:38 GMT
Server: Sun GlassFish Enterprise Server v2.1.1
X-Powered-By: Servlet/2.5
Content-Length: 365
Connection: keep-alive
application/octet-stream
This is the content of a sample file named sampleFile.txt
Second line of the sample file content.
End of the Sample content
Delete File
Delete a file associated with a specified entity.
Use the DELETE method for this action.
URL
https://datacloud2.pervasive.com/EntityAPIService/REST/{entityType}/{entityId}/file?filename={filename}&s={sessionId}
Parameters
Example
Request
DELETE https://datacloud2.pervasive.com/EntityAPIService/REST/product/00c55ba1-2fcb-4109-aa73-8ff2aa8d4af9/file?s=49bfe32d-df30-4797-a8b1-96da5c1b5609&filename=sampleFile.txt HTTP/1.1
Host: datacloud2.pervasive.com
Response
Header
HTTP/1.1 200 OK
Content-Type: application/xml
Date: Thu, 10 Nov 2011 19:54:11 GMT
Server: Sun GlassFish Enterprise Server v2.1.1
X-Powered-By: Servlet/2.5
Content-Length: 0
Connection: keep-alive
Last modified date: 12/17/2021