Aaron Tindall · Sep 6, 2018

Programmatic access to CSP Server Access

Is there a way to modify the CSP Server Access settings programmatically, instead of through the management portal?

0 228
Discussion (5)1
Log in or sign up to continue

Probably. What setting do you need to modify?

Connection Security Level, User name, and password.

Hi, Alex!

Didn’t know that it is possible. Just a question: how username/password can be not valid if they are being set new with this API?


USER>set reg = $system.CSP.GetGatewayRegistry()

USER>set managers = reg.GetGatewayMgrs("a")

USER>write managers.Size // you can have many CSP Gateways connected to this Caché instance
USER>set mgr = managers.GetAt(1) // I only have one

USER>write mgr.GetThisServerName(.names)
USER>zwrite names // this server is listed in CSP Gateway Configuration as 'LOCAL'.
USER>kill params

USER>set params("Username")="CSPSystem"

USER>set params("Password")="very strong password"

USER>write mgr.SetServerParams("LOCAL",.params)

USER>write mgr.CloseConnections("LOCAL") // close connections, forcing to reconnect with new credentials.

Please be careful, if username/password are not valid for connection to Caché, then CSP Gateway will not be able to reconnect, and you'll loose connection with CSP Gateway and ability to modify settings using this API.

For more details see
2. Class reference for classes in package %CSP.Mgr

These are credentials for CSP Gateway to use for connecting to Caché. If there is no such username/password pair in Caché or if corresponding user does not have enough privileges, then this username/password pair is not valid.