Programming Set IP address for OPC-UA Device?

I would like to be able to programmatically set the host name of a Allen Bradley Device Connection (For OPC-UA) on the gateway using a python script.

Basically I want to be able to let the user set the IP address to the PLC on the Perspective screen, but that can come later.

Is this possible? If so how would I go about it?

How about system.device.setDeviceHostname?