I am looking for some help with refreshing data in a grid.
I read all I could regarding Endpoints and EndpointInitializaion, but its not sinking in for some reason.
I am working on a way to manipulate out load balancers via REST API. I have written some functions to help read the data, but am having issues when it comes to refreshing that data. Not the best at coding, but it works.
I currently have an external functions ps1 script that i load into my dashboard run script. I then setup a New-UDEndpointSchedule and an New-UDEndpoint, and a simple New-UDDashboard that displays a grid.
When I run the dashboard, everything loads except the grid data. When I enable UDlogging, I can see the the function is not loaded, I am thinking because I dont initialize the module? Not sure how to do this and initialize the endpoint?
import-module “Path to .ps1 functions” -force
$STM_FQDN = “HostName”
$TipSearchString = “XXX7”
$PoolSearchString = “XXX1”
$Schedule = New-UDEndpointSchedule -Every 30 -Second
$Endpoint = New-UDEndpoint -Schedule $Schedule -Endpoint {
$cache:Tips = Get-synTipStatus -STM_FQDN_Name $STM_FQDN -Search $TipSearchString
}
$dashboard = New-UDDashboard -Title “test” -Content {
New-UDGrid -title “Traffic IPs” -Headers @(“Name”, “IP Address”, “Active”, “Slave”, “Failover TIP”) -Properties @(“name”, “ipaddress”, “active”, “slaves”, “failover”) -NoFilter -Endpoint {
Cache:Tips | ForEach-Object {
[PSCustomObject]@{
name = .name
ipaddress = _.ipaddress
slaves = .slaves
active = $_.active
failover = New-UDButton -Text “Failover TIP”
}
} | Out-UDGridData
} -AutoRefresh -RefreshInterval 35
}
Get-UDDashboard | Stop-UDDashboard
Start-UDDashboard -Port 10000 -Dashboard $Dashboard -Endpoint $Endpoint