Create Folder with Rest API

Nathan1980

Dabbler
Joined
Aug 21, 2021
Messages
12
Is there a way to create a folder (mkdir) with the rest API?
Or is there a way to execute a shell command "mkdir" over the rest API?

Any hint would be helpful. Thank you :).
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,545
There's no method to mkdir. We also don't expose the ability to run arbitrary commands via rest. You can enable SSH though and make your directories through that. What directories are you trying to make?
 

Nathan1980

Dabbler
Joined
Aug 21, 2021
Messages
12
You can create Datasets and users through API.
But i also need to create a bunch of default direcotrys in the home direcotry of each newly created dataset.
Would be a shame to expose SSH and use it only for this reason.
Is it possible to extend the API with this command easily?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,545


Merged this into master. It will be in SCALE 21.10, but will not be backported to 12 / 13. This should give a template though if you want to manually apply changes to Core.
 

Nathan1980

Dabbler
Joined
Aug 21, 2021
Messages
12
Thank you for adding this feature so quickly!

As a workaround, i create a user with the API, SCP the direcotrys and delete the users. This is my encapsulated "mkdir" funktion in the backend...
 

Nathan1980

Dabbler
Joined
Aug 21, 2021
Messages
12
Found an API Call to create folder:

Make a new user, and set this new folder als his home direcotry.
API will create this folder.
Then delete the user again :).
After that use API to change owner and permissions of this folder.
 
Top