influxdata / influxdata/influxdb

InfluxDB 2.x Swagger: POST `/packages/stacks` returns 200 instead of 201 in OSS and Cloud 2

Open
#19,378 1 comment 0 reactions 0 assignees View on GitHub
team/compute
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

@stephanie-engel commented on [Tue Aug 11 2020](https://github.com/influxdata/idpe/issues/8176)

**Description:**
When referencing the [swagger spec](https://github.com/influxdata/influxdb/blob/86f183278bc999cfe0bfa29b4f70e19ac8a6a89c/http/swagger.yml#L4382) for `/packages/stacks`, the POST method returns a response of 200 OK instead of a 201 Created for OSS

**Steps:**
1) While running an influxdb 2.x instance, create a stack:
```
curl -o /dev/null -s -w "%{http_code}\n" --request POST 'http://localhost:9999/api/v2/packages/stacks' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token myToken' \
--data-raw '{
"orgID": "55c3aa7ac37ba306",
"name": "new stack 123",
"description": "this describes the new stack"
}'
```

2) Look at the response code:
```
200
```

**This issue is also happening on Cloud 2.** On 8/17/20, I deleted a re-created my fenv cloud 2 cluster `se-cluster` and now I'm also seeing a `200` response instead if `201`.

Contributor guide

Open the contributing guide

Research direction

Start with http/swagger.yml around line 4382 and the implementation of POST /api/v2/packages/stacks. Reproduce the request against an OSS 2.x instance, then verify that creating a stack returns 201 Created rather than 200 OK, including the reported Cloud 2 behavior if that environment is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.