A question about RESTful Design

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.