Ask Your Question
0

what does the return code 201 mean when POST /v2.0/security-groups

asked 2018-01-13 03:56:20 -0600

tanggc gravatar image

https://developer.openstack.org/api-ref/network/v2/index.html#create-security-group (https://developer.openstack.org/api-r...)

when creating security group, the nomal return code is 201. what does that mean? means the security group was created and ready for use? if not ,why the response body not include some key-value represent the status("active/creating/error")?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2018-01-13 05:43:19 -0600

According to the API description:

This operation creates a security group with default security group rules for the IPv4 and IPv6 ether types.

and

Normal response codes: 201

201 means that the operation did not result in an error. In other words, it succeeded, and the security group was created.

Security groups have no status. They either exist or not. Therefore, no need for a status code.

edit flag offensive delete link more

Comments

if the security group was successful created .why use 201 instead of 200?

tanggc gravatar imagetanggc ( 2018-01-13 05:46:21 -0600 )edit

Wikipedia has a page on HTTP status codes. It says:

201 Created

The request has been fulfilled, resulting in the creation of a new resource.

Source: https://en.m.wikipedia.org/wiki/List_...

Bernd Bausch gravatar imageBernd Bausch ( 2018-01-13 06:34:29 -0600 )edit
0

answered 2018-01-14 23:19:27 -0600

tony.pearce gravatar image

Hi guys, error or status codes nowadays are usually following the HTTP codes:

2×× = SUCCESS

201 = CREATED

The request has been fulfilled and has resulted in one or more new resources being created.

ref: https://httpstatuses.com/201

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-01-13 03:56:20 -0600

Seen: 290 times

Last updated: Jan 14 '18