Skip to main content

Store File

Encrypt and store any file

Description

Used to encrypt and store raw files in the object store. See Encrypted Object Store for additional information.

Files are passed in as multi-part form objects.

info

See API Key and Permissioning Others sections for more detail on which keys are used for encryption.

Usage

URL: https://{host}/api/v1/eos/file

Method: POST

Headers:

info

Supply one x-uuid header when running locally.

KeyValue
Content-Typemultipart/form-data
x-uuid<Provenance Member UUID>

Form Data:

FieldDescriptionData Type
objectStoreAddressThe URL to the encrypted object store to run againstString
idFile IdentifierString
fileFile to be encrypted and storedFilePart
permissionsObject containing PermissionInfo (See Permissioning Others)JSON

Response Status Codes:

CodeMeaning
200File accepted and stored
400Illegal arguments
500Server error

Response Body:

{
"hash": "string",
"uri": "string",
"bucket": "string",
"name": "string"
}
FieldDescriptionData Type
hashThe returned hash of the saved object in EOSString
uriThe location of the saved objectString
bucketThe volume path of the saved dataString
nameThe name of the saved dataString

Example

Sample Request

To follow along, download this sample.pdf file or use any file on your machine.

curl --location --request POST 'localhost:8080/p8e-cee-api/external/api/v1/eos/file' \
--header 'x-uuid: deadbeef-face-479b-860c-facefaceface' \
--form 'objectStoreAddress="grpc://localhost:5001"' \
--form 'id="foo"' \
--form 'file=@"<path_to_file>"' \
--form 'permissions="{\"permissionDart\":true,\"permissionPortfolioManager\":true}"'
info

Swap out the <path_to___file> with a real path to the file you wish to upload.

Sample Response

{
"hash": "gE8i+JHSwPss2y6sEs41m2I1o6M+NZaPeSTEudtqosw=",
"uri": "object://localhost:8080/gE8i+JHSwPss2y6sEs41m2I1o6M+NZaPeSTEudtqosw=",
"bucket": "/mnt/data",
"name": "b923d6fb-ae73-4ace-8831-433512e83269"
}