UnionRemote#
The UnionRemote
Python API supports functionality similar to that of the union
CLI, enabling you to manage Union workflows, tasks, launch plans and artifacts from within your Python code.
Note
The primary use case of UnionRemote
is to automate the deployment of Union entities. As such, it is intended for use within scripts external to actual Union workflow and task code, for example CI/CD pipeline scripts.
In other words: Do not use UnionRemote
within task code.
Creating a UnionRemote
object#
Ensure that you have the union
SDK installed, import the UnionRemote
class and create the object like this:
from union import UnionRemote
remote = UnionRemote()
By default, when created with a no-argument constructor, UnionRemote
will use the prevailing configuration in the local environment to connect to Union, that is, the same configuration as would be used by the union
CLI in that environment (see Union CLI > union
CLI configuration search path).
In the default case, as with the union
CLI, all operations will be applied to the default project, flytesnacks
and default domain, development
.
Alternatively, you can initialize UnionRemote
by explicitly specifying a project, and a domain:
from union import UnionRemote
remote = UnionRemote(
default_project="my-project",
default_domain="my-domain",
)