RUCKUS Community Forums are now in READ-ONLY mode while we migrate to a new platform.
You will still be able to read posts and knowledge articles, but will be unable to post new content until Go Live on the new platform Monday August 17.
Lennar Smart Home customers: please contact [email protected] for assistance during the week of August 9-17.
09-26-2017 10:47 PM
03-06-2019 02:10 PM
#!/usr/bin/env python
import csv, threading, requests
host = '<>'
adminname = '<>'
adminpassword = '<>'
zoneid = '<>'
wlanid = '<>'
newwifikey = '<>'
def loginRuckus():
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
session = requests.session()
urlsession = 'https://%s:8443/wsg/api/public/v8_0/session' % (host)
response = session.post(urlsession, json={"username":adminname, "password":adminpassword }, verify=False)
print(response.text)
return session
def change_enc_key(session):
url = 'https://%s:8443/wsg/api/public/v8_0/rkszones/%s/wlans/%s/encryption' % (host, zoneid, wlanid)
response = session.patch(url, json={"method":"WPA2","passphrase":newwifikey}, verify=False)
print(response.text)
print(response)
return
def main():
change_enc_key(loginRuckus())
return
if __name__ == '__main__':
main()
06-09-2019 05:58 PM
# Queries vSZ controllers using powershell
$UrlBase = "https://vsz:8443/wsg/api/public";
$apiVer = "v8_0"
$Body = [pscustomobject]@{
username = 'admin'
password = 'admin'
timeZoneUtcOffset = "+08:00"
}
$json = $Body | ConvertTo-Json
$session = Invoke-WebRequest -Uri $UrlBase/$apiVer/session -Method Post -Body $json -ContentType 'application/json' -SessionVariable websession
# Translate Cookie header into useable string
$stringCookie = [string]$session.Headers["Set-Cookie"]
$cookie = $stringCookie.substring(0,($stringCookie.length - 21))
# Add cookie to header
$headers = @{}
$headers.Add("Cookie",$cookie)
Invoke-RestMethod -Uri $UrlBase/$apiVer/session -Method GET -Headers $headers -ContentType 'application/json' -WebSession $websession
Invoke-RestMethod -Uri $UrlBase/apiInfo -Method GET -Headers $headers -ContentType 'application/json' -WebSession $websession
