AAS Environment#

GitHub API

The BaSyx Go AAS Environment is a single runtime that provides the main APIs for storing, registering, discovering, importing, and exporting AAS data. Use it when these capabilities should run in one deployment and share one PostgreSQL database. Use the standalone components when they require independent lifecycles, scaling, or trust boundaries.

The AAS Environment service is distinct from the serialized AAS metamodel Environment object. The metamodel object is an import/export representation containing AASs, Submodels, and Concept Descriptions, while the AAS Environment service is the running HTTP application that persists this data and exposes the corresponding APIs. It runs these capabilities within a single process rather than starting separate Repository, Registry, or Discovery services.

Included APIs and Data#

One AAS Environment process provides:

All of these API areas are routes of the same runtime and use shared PostgreSQL persistence. Registry descriptors remain different resources from Repository content, and Discovery mappings remain different from both. Use the linked standalone component pages for detailed CRUD behavior and the shared Query Language for query syntax and the Environment’s hierarchy-spanning query scope. The routes behave as composed API areas here rather than as network calls between internal services.

The Environment also supports experimental Eventing for AAS, asset, and Submodel changes, including dedicated notifications for newly added Product Change Notification (PCN) records. Eventing is disabled by default and must be enabled explicitly; see Eventing for Event Feed and broker configuration.

The Environment can also serve an experimental Model Context Protocol (MCP) endpoint for AI agents such as Claude Code or Codex. Its tools call the Environment’s own REST API with the caller’s token, so the same authentication, authorization, and validation apply. The endpoint is disabled by default, and its write tools must be enabled separately.

/upload imports AAS Environment documents in JSON or XML format as well as AASX packages. For AASX input, the package is parsed into model content and supplementary files. /serialization creates an Environment representation from stored content. The AAS Environment does not expose the package-oriented /packages API. Use the standalone AASX File Server when clients must store, list, download, replace, or delete complete AASX package files by package identifier.

        ---
config:
  theme: base
  themeVariables:
    actorBkg: '#ffffff'
    actorBorder: '#cccccc'
    actorLineColor: '#666666'
    actorTextColor: '#000000'
    background: '#ffffff'
    clusterBkg: '#f9f9f9'
    clusterBorder: '#dddddd'
    edgeLabelBackground: '#ffffff'
    labelBoxBkgColor: '#ffffff'
    labelBoxBorderColor: '#cccccc'
    labelTextColor: '#000000'
    lineColor: '#666666'
    loopTextColor: '#000000'
    mainBkg: '#ffffff'
    nodeBkg: '#ffffff'
    nodeBorder: '#cccccc'
    noteBkgColor: '#ffffcc'
    noteBorderColor: '#cccccc'
    noteTextColor: '#000000'
    primaryBorderColor: '#444444'
    primaryColor: '#ffffff'
    primaryTextColor: '#000000'
    secondBkg: '#f5f5f5'
    secondaryColor: '#f0f0f0'
    signalColor: '#333333'
    signalTextColor: '#333333'
    tertiaryBkg: '#eeeeee'
    tertiaryColor: '#e8e8e8'

---
flowchart LR
    CLIENT[API client]
    DB[(PostgreSQL<br/>persistent state)]
    CONFIG[Configuration Service]

    subgraph ENV[AAS Environment runtime]
        HTTP[Environment HTTP API]
        REPOS[AAS / Submodel / Concept Description<br/>Repositories]
        REGS[AAS / Submodel Registries]
        DISC[Discovery]
        IO[Upload / Serialization]
        HTTP --> REPOS
        HTTP --> REGS
        HTTP --> DISC
        HTTP --> IO
    end

    CLIENT -->|HTTP| HTTP
    HTTP -->|SQL / persistent state| DB
    CONFIG -->|initialize / migrate| DB
    CONFIG -.->|Compose startup dependency| HTTP
    

The PostgreSQL schema must be initialized or migrated by a release-compatible Configuration Service before the AAS Environment starts. In the provided Compose setup, the Configuration Service runs as a one-shot job and the Environment starts only after it exits successfully. It is not part of normal request traffic.

Registry and Discovery Integration#

Having Registry endpoints in the process does not by itself make Repository writes maintain descriptors. Set GENERAL_AASREGISTRYINTEGRATION=true and GENERAL_SUBMODELREGISTRYINTEGRATION=true to enable that synchronization. GENERAL_EXTERNALURL supplies the public base URL used in generated descriptor endpoints. The first-use setup enables both flags explicitly.

The AAS Environment executable always enables Discovery integration internally. Consequently, AAS Descriptor writes maintain the shared Discovery asset-link data. No GENERAL_DISCOVERYINTEGRATION setting is needed for this executable. Repository upload reaches Discovery in the first-use walkthrough through two steps: the enabled AAS Repository-to-Registry synchronization creates or updates the descriptor, and the forced Registry-to-Discovery integration maintains its asset links.

See Registry Integration for synchronization lifecycle details. In particular, do not interpret this composition as HTTP synchronization between separate internal Registry and Repository services.

Dependencies, Persistence, and Security#

The runtime requires PostgreSQL initialized or migrated by a release-compatible BaSyx Configuration Service. PostgreSQL holds Repository content, Registry descriptors, Discovery mappings, and other persistent service state independently of the AAS Environment application container. Read Deployment, Versions, and Persistent State before deploying and its persistent-state guidance before changing volumes or removing the Compose project.

Runtime authorization is optional and disabled in the local walkthrough. Before exposing the service beyond a trusted development machine, follow Runtime Security.

Get Started#

  1. Set up the three-service deployment.

  2. Import, retrieve, discover, and export one environment.

The running service also provides Swagger UI at http://localhost:8090/swagger for the complete composed API contract.