Closed ragu2k8 closed 2 years ago
It does not update it the first time. The first time only adds it in Terraform as a resource. Following changes to the resource.tf settings will call the update ISE.
@wastorga thanks for clarifying. however when i do changes for below probes, its not getting updated for probes where list is empty but whereas other probes works radius = [] nmap = [] above just need empty list right nothing required to pass its not being updated properly
so i tried manually enabling probe on server and run terraform file, it disables the probes if we send empty list.
In API :
radius = null -> disables it
radius = [] -> enables it (passing empty list)
looks when it pull resources first time,it defaults all probes to empty list
and also getting below error:
ciscoise_node_services_profiler_probe_config.configure_profiling_probe: Modifying... [id=hostname:=isenode1]
╷
│ Error: Failure when executing SetProfilerProbeConfig
│
│ with ciscoise_node_services_profiler_probe_config.configure_profiling_probe,
│ on deployment.tf line 77, in resource "ciscoise_node_services_profiler_probe_config" "configure_profiling_probe":
│ 77: resource "ciscoise_node_services_profiler_probe_config" "configure_profiling_probe" {
│
│ unexpected end of JSON input
resource:
resource "ciscoise_node_services_profiler_probe_config" "configure_profiling_probe" {
parameters {
hostname = "isenode1"
active_directory {
days_before_rescan = 1
}
http {
interfaces {
interface = "GigabitEthernet 0"
}
}
dhcp {
interfaces {
interface = "GigabitEthernet 0"
}
port = 67
}
radius =[]
dns {
timeout = 3
}
snmp_query {
retries = 2
timeout = 1000
event_timeout = 30
}
nmap = []
pxgrid = []
}
}
@ragu2k8
I lack the means of testing for the moment. However, I suspect it is related to the isEmptyValue
function, which does not allow the empty array/slice to be added in the update context. I will look into it as soon as I can.
sure @wastorga let me know. I did bit more testing and i can add more details if you need.
@wastorga any luck?
Some, @ragu2k8. The API's empty probes (i.e., without properties to set) behave more like boolean (true if it has an array, false if null). So, considering Terraform Default behavior, I am tempted to change them to a TypeString with enum values ["", true, false], where the empty string represents that it does not want any change. I'll get back to you tomorrow with an update.
sure @wastorga thanks for update
@ragu2k8 I released the new version, v0.1.0-rc.3, a couple of minutes ago. The resource (node_services_profiler_probe_config) now performs the update at Tf (resource) creation. As discussed earlier, it also has new parameters' types for Nmap, pxGrid, and Radius.
@wastorga awesome..i have just tested it and it works fine. Thanks for support.
@wastorga when we run below resource, its not updated on server side(probes are not enabled) and its not showing any error on terraform either however direct api works without issues.
log: Changes to Outputs: