NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

ONTAP Rest API Discussions

Write File to netapp using rest api

Philippschumacher
1,270 Views

I am currently migrating our old code accessing netapp using ontap and replacing it by using REST. 

I tried to write a file to netapp using POSTMAN by calling the following URL (http method POST):

https://ms-netapp.m-s.ch/api/storage/volumes/{volumeid}/files/{path}

 

My content type is multipart-formdata and I have two elements in it

first element: Json with the following content.

{
"target": "Test",
"is_empty": "",
"name": "Test.pdf",
"path": "TestPH",
"type": "file"
}

second element: my actual file

 

this leads to an http-400 error without further information about the cause. The funny thing about it is, that if I remove the second element, it creates a file that contains the submitted json. 

I tried to implement the api using the following information: https://docs.netapp.com/us-en/ontap-restapi-9121/ontap/swagger-ui/index.html#/storage/file_info_create

 

 

0 REPLIES 0
Public