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

One method of deleting ip address by api is not working #4059

Open
krisdusz opened this issue Mar 15, 2024 · 0 comments
Open

One method of deleting ip address by api is not working #4059

krisdusz opened this issue Mar 15, 2024 · 0 comments

Comments

@krisdusz
Copy link

Describe the bug
When using api only 1 metod of deleting ip address works.
Working:
DELETE /api/my_app/addresses/{id}/
Not working:
DELETE /api/my_app/addresses/{ip}/{subnetId}/

phpIPAM version
Phpipam docker image
tested on versions:
[[v1.6.0]]git [69e0e66]
and
[[v1.7.0]] dbversion 41 git [e7e0ebc]

Steps To Reproduce
Please include steps to reproduce the issue:

  1. Use api to get ip details using /api/my_app/addresses/{ip}/{subnetId}/
  2. Try to delete using /api/my_app/addresses/{ip}/{subnetId}/ (not working- No addresses found)
  3. Use motod /api/my_app/addresses/{id}/ to delete ip

Screenshots and error logs

GETTING IP INFO
`curl -X GET https:/phpipam.example.pl/api/example/addresses/172.18.3.201/1056/ --header "token: example" -i
HTTP/2 200
server: nginx
date: Fri, 15 Mar 2024 09:27:51 GMT
content-type: application/json; charset=utf-8
content-length: 414
x-powered-by: PHP/8.2.16
set-cookie: phpipam=example; expires=Sat, 16 Mar 2024 09:27:51 +0000; Max-Age=86400; path=/; SameSite=Lax; HttpOnly;
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-cache
pragma: no-cache
vary: Accept-Encoding

{"code":200,"success":true,"data":{"id":113895,"subnetId":1056,"ip_addr":"2886861769","is_gateway":0,"description":null,"hostname":null,"mac":null,"owner":null,"state":2,"switch":null,"location":null,"port":null,"note":null,"lastSeen":"1970-01-01 00:00:01","excludePing":"0","PTRignore":"0","PTR":0,"firewallAddressObject":null,"editDate":"2024-03-15 10:17:35","customer_id":null,"ip":"172.18.3.201"},"time":0.011}`

TRYING TO DELETE USING ALWAYS USED METHOD
`curl -X DELETE https:/phpipam.example.pl/api/example/addresses/172.18.3.201/1056/ --header "token: example" -i
HTTP/2 404
server: nginx
date: Fri, 15 Mar 2024 09:28:02 GMT
content-type: application/json; charset=utf-8
content-length: 72
x-powered-by: PHP/8.2.16
set-cookie: phpipam=example; expires=Sat, 16 Mar 2024 09:28:02 +0000; Max-Age=86400; path=/; SameSite=Lax; HttpOnly;
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-cache
pragma: no-cache
vary: Accept-Encoding

{"code":404,"success":false,"message":"No addresses found","time":0.006}`

DELETED USING DIFFERENT METHOD
`curl -X DELETE https:/phpipam.example.pl/api/example/addresses/113895/ --header "token: example" -i
HTTP/2 200
server: nginx
date: Fri, 15 Mar 2024 09:28:21 GMT
content-type: application/json; charset=utf-8
content-length: 68
x-powered-by: PHP/8.2.16
set-cookie: phpipam=example; expires=Sat, 16 Mar 2024 09:28:21 +0000; Max-Age=86400; path=/; SameSite=Lax; HttpOnly;
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-cache
pragma: no-cache
vary: Accept-Encoding

{"code":200,"success":true,"message":"Address deleted","time":0.012}`

Additional Info
Everything was working fine on version 1.5.4. Checked on 2 different instances with different versions.

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

No branches or pull requests

1 participant