title: API Design Questions using Django for OS tasks (REST vs RPC)
body: <p>Background:</p>
  <p>I have an application that is supposed to automate some infrastructure &amp; OS-heavy tasks that happen on a network file system (for example: mounting volumes, shutting down / bringing up servers, creating directories, moving data around, ssh-ing etc). Ultimately there are a lot of OS-level commands that need to be run in a sequence for each action. Our consumer/client likely does not know this sequence, but knows &quot;I want to do X task&quot;.</p>
  <p>Tech stack: Python/Django</p>
  <p>I have been tasked with setting this application up but am perplexed on the best way to approach for modularity from the API standpoint &amp; just overall design. Currently, we have a similar application that is a SOAP-style (rpc) but the way it is written is not very modular. Like for example, one function will have a ton of random hardcoded subprocess commands - not the approach I want to emulate here.</p>
  <p>Initially I was leaning more towards REST API since Django has a nice django rest framework plug-in, but am having trouble modelling these very action-oriented tasks. The more I read other things online, the more I come to believe I really need to think of every little action as a resource with the client having to GET/POST/PUT to each of these to keep things very modular but when I boil that down further it looks like I may need to set up 15+ endpoints for each situation needed and the client likely isn't going to want to call all 15 endpoints to get their singular behavior they want. That being said - moving to rpc so users can have one endpoint that 'moves the moon on a single call' might not be the best approach either.</p>
  <p>I think one of the issues I see is our application is doing a lot of work on a file system, not all contained within our application's database. I reckon that's kind of a central point of this application, but I have trouble modelling things that require file system actions outside our application's database.</p>
  <p>Question 1:</p>
  <p>One example action that our client might want to call would be responsible for ssh-ing to a remote server and running a command. How might you model this in REST?</p>
  <p>Question 2:</p>
  <p>How do you all model file system actions in your applications?</p>
  <p>Question 3:</p>
  <p>After reviewing the above, does RPC seem like the better option?</p>
  <p>Other:</p>
  <p>Any other help or feedback (even in generally is much appreciated).</p>