The Connection object
The Connection
class is one of the most important parts of the Python ArupCompute client. It controls all authentication and most settings related to the client. It is a required input in most other functions related to ArupCompute.
This object also controls when to use AC Local.
The Connection
object also replaces the old authentication methods. If you are working on an older Python script that has not yet updated to use the Connection
object then you should perform this upgrade as older authentication methods may stop working.
Constructor properties
Name | Description | Default |
---|---|---|
jobnumber: str | The job number to use for all calculations run with this Connection instance | N/A, value must be provided |
id: str | The name of the environment variable that contains the Azure Client Id that should be used for authentication, in most cases this should not be changed | COMPUTE_CLIENTID |
secret: str | The name of the environment variable that contains the Azure Client Secret that should be used for authentication, in most cases this should not be changed | COMPUTE_CLIENTSECRET |
serverConfig: ServerConfig | A set of settings for use when the Python Client is running on a server, more info on this object can be found here | None |
Example use
The Connection
object is very easy to use. In most cases, simply create and instance, pass in your job number, and then pass it into any method that requires it. The object will handle all authentication and find where to send your request for you.
Creating the object:
jobNumber = "00000000" # please use a real job number
connection = arupcomputepy.Connection(jobNumber)