Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong http response code on successful userGroup creation #2908

Open
LucaMH opened this issue Aug 14, 2024 · 1 comment
Open

wrong http response code on successful userGroup creation #2908

LucaMH opened this issue Aug 14, 2024 · 1 comment

Comments

@LucaMH
Copy link

LucaMH commented Aug 14, 2024

Expected Behavior

when creating a userGroup via the http api and the object gets created successfully, the response code should be 201 Created

curl -k -s -u ''"$myuser"':'"$mypassword"'' -H 'Accept: application/json' -X POST 'https://icinga/icingaweb2/director/userGroup/add' -d '{ "object_name": "test1" , "object_type": "object" }' -v
[...]
< HTTP/1.1 201 Created
[...]

Current Behavior

when creating a userGroup via the http api, 500 Internal Server Error with "{"status":"error","message":"Not found"}" gets returned but object gets created as requested

curl -k -s -u ''"$myuser"':'"$mypassword"'' -H 'Accept: application/json' -X POST 'https://icinga/icingaweb2/director/userGroup/add' -d '{ "object_name": "test1" , "object_type": "object" }' -v
[...]
< HTTP/1.1 500 Internal Server Error
[...]
{"status":"error","message":"Not found"}

Possible Solution

fix message and responscode when object successfully got created

Steps to Reproduce (for bugs)

run

curl -k -s -u ''"$myuser"':'"$mypassword"'' -H 'Accept: application/json' -X POST 'https://icinga/icingaweb2/director/userGroup/add' -d '{ "object_name": "test1" , "object_type": "object" }' -v

and check the response code

Your Environment

  • Director version (System - About):
  • Icinga Web 2: 2.12.1
  • Icinga Director: 1.11.1
  • Icinga 2 version: r2.14.2-1
  • Operating System and version: Ubuntu 22.04.4 LTS (5.15.0-117-generic)
  • Webserver: apache2 2.4.52
  • PHP version: 8.1.2
@tbauriedel
Copy link
Member

ref/NC/812677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants