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

Data source phpipam_address returns an error for an unallocated/unreserved ip address #37

Closed
MisterRaviolii opened this issue Jan 17, 2022 · 3 comments · Fixed by #45
Closed
Labels
bug Something isn't working

Comments

@MisterRaviolii
Copy link

Affected Resource(s)
phpipam_address data source

Terraform Version
v1.0.8

Provider Version
v1.2.8

Terraform Script
data "phpipam_address" "address" {
ip_address="10.18.160.132"
}

Output
Error: JSON parsing error: json: cannot unmarshal number into Go struct field APIResponse.Success of type bool - Response body: {"code":200,"success":0,"message":"Address not found","time":0.006}

Actual Behavior
For IP addresses that are not reserved or allocated in IPAM, the data sources throws an error. Can you please resolve this?

Expected Behavior
Data source returns an empty record or a record with 'Address not found'.

@MrKoopaKiller
Copy link

Same behaviour for sections:

data "phpipam_section" "section" {
  name = "notexists"
}

Error: Error from API (404): Not Found

It would be nice if it returns an empty record

@lord-kyron
Copy link
Owner

@pavel-z1 - can you help with this one also?
Thanks!

@pavel-z1
Copy link
Collaborator

Hi @MrKoopaKiller @MisterRaviolii
Try now with latest PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants