sitesPsks := client .SitesPsks ()
SitesPsks
Create Site PSK
When usage
==macs
, corresponding "macs" field will hold a list consisting of client mac addresses (["xx:xx:xx:xx:xx",...]) or mac patterns(["xx:xx:","xx ",...]) or both (["xx:xx:xx:xx:xx:xx", "xx:*", ...]). This list is capped at 5000
CreateSitePsk (
ctx context .Context ,
siteId uuid .UUID ,
body * models .Psk ) (
models .ApiResponse [models .Psk ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
body
*models.Psk
Body, Optional
Request Body
models.Psk
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.Psk {
Mac : models .ToPointer ("string" ),
Name : "string" ,
Passphrase : "stringst" ,
Ssid : "string" ,
Usage : models .ToPointer (models .PskUsageEnum ("multi" )),
VlanId : models .ToPointer (models .PskVlanIdContainer .FromNumber (1 )),
}
apiResponse , err := sitesPsks .CreateSitePsk (ctx , siteId , & body )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Delete Site PSK
DeleteSitePsk (
ctx context .Context ,
siteId uuid .UUID ,
pskId uuid .UUID ) (
http .Response ,
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
pskId
uuid.UUID
Template, Required
PSK ID
``
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
pskId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
resp , err := sitesPsks .DeleteSitePsk (ctx , siteId , pskId )
if err != nil {
log .Fatalln (err )
} else {
fmt .Println (resp .StatusCode )
}
Get Site PSK Details
GetSitePsk (
ctx context .Context ,
siteId uuid .UUID ,
pskId uuid .UUID ) (
models .ApiResponse [models .Psk ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
pskId
uuid.UUID
Template, Required
PSK ID
models.Psk
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
pskId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
apiResponse , err := sitesPsks .GetSitePsk (ctx , siteId , pskId )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Import PSK from CSV file or JSON
PSK Import CSV File Format:
name,ssid,passphrase,usage,vlan_id,mac
Common,warehouse,foryoureyesonly,single,35,a31425f31278
Justin,reception,visible,multi,1002
ImportSitePsks (
ctx context .Context ,
siteId uuid .UUID ,
file * models .FileWrapper ) (
models.ApiResponse [[]models.Psk ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
file
*models.FileWrapper
Form, Optional
-
[]models.Psk
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
apiResponse , err := sitesPsks .ImportSitePsks (ctx , siteId , 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)
[
{
"created_time" : 0 ,
"id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"mac" : " string" ,
"modified_time" : 0 ,
"name" : " string" ,
"org_id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"passphrase" : " stringst" ,
"site_id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"ssid" : " string" ,
"usage" : " multi" ,
"vlan_id" : 1
}
]
Get List of Site PSKs
ListSitePsks (
ctx context .Context ,
siteId uuid .UUID ,
ssid * string ,
role * string ,
name * string ,
limit * int ,
page * int ) (
models.ApiResponse [[]models.Psk ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
ssid
*string
Query, Optional
-
role
*string
Query, Optional
-
name
*string
Query, Optional
-
limit
*int
Query, Optional
Default : 100
Constraints : >= 0
page
*int
Query, Optional
Default : 1
Constraints : >= 1
[]models.Psk
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
limit := 100
page := 1
apiResponse , err := sitesPsks .ListSitePsks (ctx , siteId , nil , nil , nil , & limit , & page )
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)
[
{
"created_time" : 0 ,
"id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"mac" : " string" ,
"modified_time" : 0 ,
"name" : " string" ,
"org_id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"passphrase" : " stringst" ,
"site_id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"ssid" : " string" ,
"usage" : " multi" ,
"vlan_id" : 1
}
]
Update Site Multiple Psks
Update multiple PSKs
UpdateSiteMultiplePsks (
ctx context .Context ,
siteId uuid .UUID ,
body []models.Psk ) (
models.ApiResponse [[]models.Psk ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
body
[]models.Psk
Body, Optional
Constraints : Unique Items Required
[]models.Psk
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := []models.Psk {
models.Psk {
ExpireTime : models .NewOptional (models .ToPointer (1614990263 )),
Macs : []string {
"11:22:33:44:55:66" ,
"aa:bb:" ,
"53" ,
},
MaxUsage : models .ToPointer (0 ),
Name : "name6" ,
NotifyExpiry : models .ToPointer (false ),
Passphrase : "passphrase6" ,
Ssid : "ssid6" ,
Usage : models .ToPointer (models .PskUsageEnum ("multi" )),
},
}
apiResponse , err := sitesPsks .UpdateSiteMultiplePsks (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)
[
{
"created_time" : 0 ,
"id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"mac" : " string" ,
"modified_time" : 0 ,
"name" : " string" ,
"org_id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"passphrase" : " stringst" ,
"site_id" : " b069b358-4c97-5319-1f8c-7c5ca64d6ab1" ,
"ssid" : " string" ,
"usage" : " multi" ,
"vlan_id" : 1
}
]
Update Site PSK
UpdateSitePsk (
ctx context .Context ,
siteId uuid .UUID ,
pskId uuid .UUID ,
body * models .Psk ) (
models .ApiResponse [models .Psk ],
error )
Parameter
Type
Tags
Description
siteId
uuid.UUID
Template, Required
-
pskId
uuid.UUID
Template, Required
PSK ID
body
*models.Psk
Body, Optional
Request Body
models.Psk
ctx := context .Background ()
siteId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
pskId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.Psk {
Mac : models .ToPointer ("string" ),
Name : "string" ,
Passphrase : "stringst" ,
Ssid : "string" ,
Usage : models .ToPointer (models .PskUsageEnum ("multi" )),
VlanId : models .ToPointer (models .PskVlanIdContainer .FromNumber (1 )),
}
apiResponse , err := sitesPsks .UpdateSitePsk (ctx , siteId , pskId , & body )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}