Problems with the Storage API

Hi all,

so I'm making good progress ... however with the Storage API I'm having a bit of trouble.

If I call the following url in the Swagger UI:

https://192.168.42.100/storage/api/v1/media

I get this response:

[  {
    "uuid": "C2E7-F514",
"label": "Extreme SSD",
"mounted": false,
"format": "exfat",
"size": 1000169226752,
"device": "sda1" }, { "uuid": "d2d26aa9-0ab9-4ecf-aff8-f8194080ee02",
"label": "ubuntu-data",
"mounted": true,
"format": "ext4",
"size": 2917068800,
"used": 1074192384,
"device": "mmcblk0p4",
"internal": true }, { "uuid": "4A65-4441",
"mounted": false,
"format": "fat32",
"size": 15633219584,
"device": "mmcblk1p1" } ]

I guess my "extreme" SSD should probably be an "extern" SSD (because that's what it is). 

As you can see, I added an external USB SSD device as well as an micoSD card in the card reader slot.
The problem is, that I can't decode the response from the generated client as the "exfat" format is not specified in the spec. I'll probably manually add this in order to be able to continue, but I thought I'd report this, so it can be added to the list of constants.

Best reply by Sgilk

The command below is working on my micro-SD in Ext4 format.

 

curl -X 'POST' \
  'https://192.168.1.100/storage/api/v1/tasks' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTg5NjYxODQsImlhdCI6MTY5ODkzNzM4NCwiaWQiOiIxMDAwIiwibmFtZSI6ImJvc2NocmV4cm90aCIsIm5vbmNlIjoiNzU4NjU1MjQtM2Q3MC00YzNmLWExNDAtZTA1NzI5ZjBmOWFmIiwicGxjaGFuZGxlIjowLCJyZW1vdGVhdXRoIjoiIiwic2NvcGUiOlsicmV4cm90aC1kZXZpY2UuYWxsLnJ3eCJdfQ.ydKR7RzYQGrR8VOG4ZpY3aUAwT2yH1yOua8XpZdkypuVH5BtTW4cm0me6m9duZo1F3GH73siOOQD8kQaAkQOlRY4uCLF9I_Zq-t3sGA119r_wTjMslI8XpHe2Wic1Mns' \
  -H 'Content-Type: application/json' \
  -d '{
  "action": "mount",
  "parameters": {
    "media": "91f34d0c-9859-42be-b945-d0eeaa805d8d",
    "assignment": "data-exchange"
  }
}'

 

Response:

 

{
  "id": "2",
  "state": "pending",
  "eta": "2023-11-02T10:06:37.43626618-05:00",
  "action": "mount",
  "parameters": {
    "assignment": "data-exchange",
    "media": "91f34d0c-9859-42be-b945-d0eeaa805d8d"
  },
  "result": {
    "type": "",
    "title": ""
  }
}

 

The 400 error makes it seem like your REST API request format is incorrect, although admittedly the error message isn't very helpful. I also think you will need to format your disc to Ext4 or Fat32.

See: Formatting External Storage 

View original
7 replies