#Folder creation in a volume using CLI
1 messages · Page 1 of 1 (latest)
Not in a supported way, no. What are you trying to do? A directory doesn't do anything without client access anyway?
It is in order to create and configure CIFS shares in a volume fully from the CLI. if the path does not exist in the volume, I cannot create the share before creating the folder manually first... 😢 Should be a good point to have an option in the create share command to create the folder in the path if it doesn't exist.
You could create a qtree instead.
we were doing it using the powershell command New-NcDirectory, but I have to find a new way to perform the same thing because I have NAS in env without Powershell possible.
the c$ share always exists though and you can connect to that to create the directory you want
sure, but some SVM on my cluster is in different AD Domain and i have to connect to others jump host in order to access to c$. I cannot automatize this
you can use the New-NcDirectory Cmdlet from the ONTAP PowerShell Toolkit
yes but in the secure env, I don't have the right to use external powershell toolkit 😅😂
you can probably cobble together the REST or XMLRPC API call without the PSTK though
that's why I'm searching a way to do it
if someone know the rest api version, i have access to a linux with curl 😅
I don't think it's in the REST API already. You probably need to use the XMLRPC (ZAPI) version
ZExplore (from the Manageability SDK) can help you create the API call
note that XMLRPC is much trickier to do "by hand" (without the proper modules/libraries) than REST
so good luck in getting it to work without access to any "external" modules/libraries
The ONTAPI to REST API mapping documentation delivers:
POST /api/storage/volumes/{volume.uuid}/files/{path}
https://docs.netapp.com/us-en/ontap-restmap/file.html#file-create-directory
okay I was only looking at the swagger docs and there I couldn't find it