Issue using the "Get_file_information_for_package" Storage Service API

39 views
Skip to first unread message

arth...@gmail.com

unread,
Nov 14, 2018, 9:59:43 AM11/14/18
to archivematica
Hi,
we are using AM 1.7.1 and 1.7.2 (Storage Service 0.12.0) with AtoM 2.4 (two landscapes on Ubuntu and RedHat)
We urgently need to use the "Get_file_information_for_package" API which is documented here: https://wiki.archivematica.org/Storage_Service_API#Get_file_information_for_package.
When we use it, with call

http://{ipaddress}:{port}/api/v2/file/{sip_uuid}/contents?username=admin&api_key={api_key}

we always get an answer

{
     "files": [],
     "success": true,
     "package": "{sip_uuid}"
}

where the list of dictionaries ("files") is empty.
Actually we are sure that the AIP "{sip_uuid}" contains files in the ... /data/object directory but these are not listed by the JSON stream.
Are we doing something wrong or is it a bug?
Thanks in advance for your reply.

Arthy
Message has been deleted

arth...@gmail.com

unread,
Nov 14, 2018, 11:47:48 AM11/14/18
to archivematica
The Browse_location_path API also returns no lists.
If we use

http://{ipaddress}:{port}/api/v2/location/{location_uuid}/browse?username=admin&api_key={api_key}&path=/c245/549e/529c/405c/97a0/2c72/4380/87e2/TEST_CCO002-c245549e-529c-405C-97a0-2c72438087e2/data/objects

the returned JSON stream is

{
     "directories": [],
     "entries": [],
     "properties": {}
}

although in that path there are two folders (metadata and submissiondocumentation) and four files (three original and three normalized).
this seems strange to us.
Any idea?

Thanks...

Arthy

rspe...@artefactual.com

unread,
Nov 20, 2018, 12:48:09 PM11/20/18
to archivematica
Hi Arthy, 

I had a look into this yesterday. For the first post, I have logged this issue:

* File array is only returned by the API if a transfer is sent to Backlog:
  
For your second question, I can set the query string parameter as follows:

http -v --pretty=format  \
   Authorization:"ApiKey test:test"
   
The query is done using httpie.

The version of the Storage Service is 0.x which will soon be 0.13. And the 
endpoint is v1. If I use a v2 endpoint I just need to base encode the string
to the location in the storage service as base64:   

http -v --pretty=format \
    Authorization:"ApiKey test:test"
   
I can see one of the potential issues with the results you are seeing so have

I think keep in mind that the path you need to browse to needs to be absolute,
so to make this work, I am using:

/var/archivematica/sharedDirectory/www/AIPsStore/{uuid-part}/{uuid-part}/etc.

This aligns with what I'm seeing in the Storage Service for that location:



If you see ways that these endpoints can be improved, or recognize a need for
an alternative, feel free to post on the GitHub issues repository. We can begin 
a conversation about what that looks like in there.

I hope this helps!
Ross
Reply all
Reply to author
Forward
0 new messages