sitesSyntheticTests := client .SitesSyntheticTests ()
SitesSyntheticTests
Get Site Device Synthetic Test
Get Device Synthetic Test
GetSiteDeviceSyntheticTest (
ctx context .Context ,
siteId uuid .UUID ,
deviceId uuid .UUID ) (
models .ApiResponse [models .SynthetictestInfo ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
deviceId
uuid.UUID
Template, Required
-
models.SynthetictestInfo
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
deviceId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
apiResponse , err := sitesSyntheticTests .GetSiteDeviceSyntheticTest (ctx , siteId , deviceId )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Example Response (as JSON)
{
"device_type" : " gateway" ,
"mac" : " 5c5b35584a6f" ,
"port_id" : " ge-0/0/1.100" ,
"start_time" : 1675718807 ,
"status" : " inprogress" ,
"type" : " speedtest"
}
Search Site Synthetic Test
Search Site Synthetic Testing
SearchSiteSyntheticTest (
ctx context .Context ,
siteId uuid .UUID ,
mac * string ,
portId * string ,
vlanId * string ,
by * string ,
reason * string ,
mType * models .SynthetictestTypeEnum ,
protocol * models .SynthetictestProtocolEnum ,
tenant * string ) (
models .ApiResponse [models .ReponseSynthetictestSearch ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
mac
*string
Query, Optional
Device MAC Address
portId
*string
Query, Optional
port_id used to run the test (for SSR only)
vlanId
*string
Query, Optional
VLAN ID
by
*string
Query, Optional
entity who triggers the test
reason
*string
Query, Optional
test failure reason
mType
*models.SynthetictestTypeEnum
Query, Optional
synthetic test type
protocol
*models.SynthetictestProtocolEnum
Query, Optional
connectivity protocol
tenant
*string
Query, Optional
tenant network in which lan_connectivity test was run
models.ReponseSynthetictestSearch
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
apiResponse , err := sitesSyntheticTests .SearchSiteSyntheticTest (ctx , siteId , nil , nil , nil , nil , nil , nil , nil , nil )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Example Response (as JSON)
{
"end" : 0 ,
"limit" : 0 ,
"next" : " string" ,
"results" : [
{
"by" : " user" ,
"device_type" : " gateway" ,
"failed" : false ,
"latency" : 40 ,
"mac" : " aff827549235" ,
"port_id" : " ge-0/0/2" ,
"rx_mbps" : 322 ,
"timestamp" : 1706824045.059036 ,
"tx_mbps" : 199 ,
"type" : " speedtest" ,
"vlan_id" : 20
},
{
"by" : " marvis" ,
"device_type" : " gateway" ,
"failed" : true ,
"latency" : 0 ,
"mac" : " 8396cd006c8c" ,
"port_id" : " ge-0/0/2" ,
"reason" : " interface not ready to perform test" ,
"rx_mbps" : 0 ,
"timestamp" : 1706824045.059036 ,
"tx_mbps" : 0 ,
"type" : " speedtest" ,
"vlan_id" : 100
}
],
"start" : 0 ,
"total" : 0
}
Start Site Switch Radius Synthetic Test
Ping test from the AP to confirm ‘reachability’ of the Radius server. Utilize Juniper EX switch(to which an AP is connected to) radius test capabilities to get details on the Radius Server ‘availability’ .
StartSiteSwitchRadiusSyntheticTest (
ctx context .Context ,
siteId uuid .UUID ,
deviceId uuid .UUID ,
body * models .SynthetictestRadiusServer ) (
models .ApiResponse [models .WebsocketSession ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
deviceId
uuid.UUID
Template, Required
-
body
*models.SynthetictestRadiusServer
Body, Optional
-
models.WebsocketSession
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
deviceId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.SynthetictestRadiusServer {
Password : "string" ,
Profile : models .ToPointer ("dot1x" ),
User : "string" ,
}
apiResponse , err := sitesSyntheticTests .StartSiteSwitchRadiusSyntheticTest (ctx , siteId , deviceId , & body )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Trigger Site Device Synthetic Test
Trigger Device Synthetic Test
TriggerSiteDeviceSyntheticTest (
ctx context .Context ,
siteId uuid .UUID ,
deviceId uuid .UUID ,
body * models .SynthetictestDevice ) (
http .Response ,
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
deviceId
uuid.UUID
Template, Required
-
body
*models.SynthetictestDevice
Body, Optional
-
``
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
deviceId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.SynthetictestDevice {
Host : models .ToPointer ("www.example.com" ),
Hostname : models .ToPointer ("google.com\" " ),
Ip : models .ToPointer ("192.168.3.5" ),
Password : models .ToPointer ("test123" ),
PingCount : models .ToPointer (10 ),
PingDetails : models .ToPointer (false ),
PingSize : models .ToPointer (56 ),
PortId : models .ToPointer ("wan0" ),
Protocol : models .ToPointer (models .SynthetictestDeviceProtocolEnum ("ping+traceroute" )),
Tenant : models .ToPointer ("lan_network1" ),
TracerouteUdpPort : models .ToPointer (33434 ),
Type : models .SynthetictestTypeEnum ("radius" ),
Url : models .ToPointer ("https://www.example.com" ),
Username : models .ToPointer ("user" ),
}
resp , err := sitesSyntheticTests .TriggerSiteDeviceSyntheticTest (ctx , siteId , deviceId , & body )
if err != nil {
log .Fatalln (err )
} else {
fmt .Println (resp .StatusCode )
}
Trigger Site Synthetic Test
Trigger Synthetic Testing
TriggerSiteSyntheticTest (
ctx context .Context ,
siteId uuid .UUID ,
body * models .Synthetictest ) (
models .ApiResponse [models .ReponseSynthetictest ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
body
*models.Synthetictest
Body, Optional
-
models.ReponseSynthetictest
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.Synthetictest {
Email : models .ToPointer ("test@mist.com" ),
}
apiResponse , err := sitesSyntheticTests .TriggerSiteSyntheticTest (ctx , siteId , & body )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Example Response (as JSON)
{
"id" : " a42775f6-edc8-69b5-f979-542fa1b43ff9" ,
"message" : " Successfully queued synthetic test for the site." ,
"status" : " string"
}