Recently, I was writing about aws-related development. For example, operations on instances include creating, restarting, stopping, and deleting instances. How should I implement them according to the RESTful design style? {Code...}, restart, stop, and other operations? Use PUT? Recently, I was writing about aws-related development. For example, operations on instances include creating, restarting, stopping, and deleting instances. How should I implement them according to the RESTful design style?
GET/etc/instance/GET instancePOST/ec2/instance/create instanceDELETE/etc/instance/delete instance
What about restart, stop, and other operations? Use PUT?
Reply content:
Recently, I was writing about aws-related development. For example, operations on instances include creating, restarting, stopping, and deleting instances. How should I implement them according to the RESTful design style?
GET/etc/instance/GET instancePOST/ec2/instance/create instanceDELETE/etc/instance/delete instance
What about restart, stop, and other operations? Use PUT?
I am working on a RESTSful api design for management services. Let's talk about my design ideas for reference.
# Create POST/ec2/instance # query status GET/ec2/instance/: id # DELETE (terminate) DELETE/ec2/instance /: id # startup, restart, and so on are regarded as modifying the status. It is assumed that the status attribute of the instance is being modified # Start PUT/ec2/instance/: idForm data: status = start # stop PUT/ec2/instance/: idForm data: status = stop # start. If it is started, restart PUT/ec2/instance/: id? Force = 1 Form data: status = start
Answer with a rails url design.
What is RESTful?