Closed mschedrin closed 10 months ago
Thanks for fixing this really quick @fmunozmiranda. BODY looks correct now and create operation works good. When it comes to update operation body looks correct too, however the resource still uses POST method which does not work well and for updating it should be used PUT method.
I have also tested refresh/read operation for some selected parameters and none of them is read: ntp_server, banner_message, dns_server. If you need example BODY from DNAC when sending GET request, you can find it in my first message in this issue.
Actually we have POST and PUT separated because of response is so different to request. https://registry.terraform.io/providers/cisco-en-programmability/dnacenter/latest/docs/resources/network_create https://registry.terraform.io/providers/cisco-en-programmability/dnacenter/latest/docs/resources/network_update
If you want to use it as a complete resource, you can use: https://registry.terraform.io/providers/cisco-en-programmability/dnacenter/latest/docs/resources/network_v2
In this case dnacenter_network_v2
, detecting external changes has not been contemplated either, due to the documentation, it was not clear how to achieve this.
If there was more detail about where each attribute of the request comes from in the response, something could be done.
https://developer.cisco.com/docs/dna-center/#!create-network-v2
https://developer.cisco.com/docs/dna-center/#!get-network
I didn't know that dnacenter_network_v2
was implemented. v1 is very buggy anyway so I have tried dnacenter_network_v2
and created issue #246
Prerequisites
Describe the bug
dnacenter_network_create
generates wrong, almost empty payload upon resource creation and update. State is also not being refreshed and changes made outside terraform are not detected. It looks like issue #99 has found it's way back in the current code.Terraform apply output:
Extract from debug log showing POST BODY that provider crafted and sent to DNAC:
The same payload is generated when the resource is planned to be updated in-place.
API reply when reading network settings from DNAC, for reference:
Expected behavior Correct body should be generated.
Screenshots Please provide an screenshot of the successful API call with cuRL, Postman, etc.
Environment (please complete the following information):