Skip to main content
A Node represents a deployed instance of a Service that another Service or System depends on. Subclasses of Node are generated from a published Service when you list it in your manifest and run uniac install.

Declaring a dependency

Add the Service to the dependencies array in uniac.json, run uniac install, then declare and initialize it:
from uniac import System
from logger import Logger  # generated Node subclass

class Greeter(System):
    logger: Logger   # annotation declares the dep

    def __init__(self):
        self.logger = Logger()  # you instantiate it
The framework walks class-level annotations across the MRO, asserts every Node slot is initialized, and records the owner relationship.

Consuming a dependency at runtime

A Node instance exposes:
  • .url — the live HTTP URL of the deployed Service. Populated by load() from the deploy-time wiring; None when called outside load().
  • .name — the published Service identifier.
@api.get("/log")
def log_something():
    requests.post(self.logger.url + "/info", json={"msg": "hello"})
In uniac dev, .url points at the locally-running simulator instance of the dep. After uniac deploy, it points at the live production endpoint.