|
| 1 | +# Bruno API Testing Setup – DataEngine (.NET Backend) |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This directory contains the Bruno collection and instructions to test the **AAS.TwinEngine.DataEngine** .NET API using Bruno. The collection includes pre-configured requests and environments to exercise the DataEngine API and its plugin-based data sources. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 📚 Contents |
| 10 | + |
| 11 | +[[_TOC_]] |
| 12 | + |
| 13 | + |
| 14 | +## 🔍 Quick Summary |
| 15 | + |
| 16 | +| Item | Description | |
| 17 | +|--------------------------|-----------------------------------------------------| |
| 18 | +| **API** | `AAS.TwinEngine.DataEngine` (.NET) | |
| 19 | +| **Testing Tool** | [Bruno](https://www.usebruno.com/downloads) | |
| 20 | +| **Default API URL** | `https://localhost:5059` | |
| 21 | +| **SDK Required** | .NET 8 (recommended) | |
| 22 | +| **Run docker compose file** | Run `docker-compose-up` form AasTwin.DataEngine | |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Prerequisites |
| 27 | + |
| 28 | +1. **Install Bruno** |
| 29 | + |
| 30 | + * Download: [https://www.usebruno.com/downloads](https://www.usebruno.com/downloads) |
| 31 | + * Platforms: Windows, macOS, Linux |
| 32 | + |
| 33 | +2. **Install .NET SDK** |
| 34 | + |
| 35 | + * Recommended: **.NET 8** (install from Microsoft docs) |
| 36 | + |
| 37 | +3. **Install docker** |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Running the services |
| 42 | + |
| 43 | + |
| 44 | +### 1. Run docker compose file |
| 45 | + |
| 46 | +Before starting , run twinengine environmnet with multi-plugin. |
| 47 | +[click here for getting starated with docker-compose](../README.md) |
| 48 | + |
| 49 | +### 2. Start the DataEngine .NET API |
| 50 | + |
| 51 | +Run the API: |
| 52 | + |
| 53 | +```bash |
| 54 | +cd source\AAS.TwinEngine.DataEngine |
| 55 | +dotnet run |
| 56 | +``` |
| 57 | + |
| 58 | +By default the API listens at `https://localhost:5059` unless overridden by environment settings or `launchSettings.json`. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## Bruno Collection — Quick Start |
| 63 | + |
| 64 | +1. Open Bruno |
| 65 | +2. `Collection -> Open Collection` and choose the Bruno collection folder (`apiCollection`) from the AasTwin.DataEngine repository |
| 66 | +3. From the top-right environment dropdown select an environment: `local` or `dev` (use `local` for local testing) |
| 67 | +4. Expand folders to find requests, select a request and click **Send** |
| 68 | +5. Inspect the request/response in the right panel |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## Bruno environment & collection variables |
| 73 | + |
| 74 | +The collection includes a set of environment/collection variables you can edit to point the requests at your local or dev instance. |
| 75 | +**Enter these variables in plain text — the collection’s Pre-request script will automatically change value to Base64-encode.** |
| 76 | + |
| 77 | +| Variable name | Purpose | Example value | |
| 78 | +| ------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | |
| 79 | +| `DataEngineBaseUrl` | Base URL for DataEngine API | `https://localhost:5059` | |
| 80 | +| `aasIdentifier` | Base64-encoded AAS identifier | `https://mm-software.com/ids/aas/000-001`(this will be convered to base64 by script in bruno) | |
| 81 | +| `submodelIdentifierContact` | Base64-encoded submodel identifier for ContactInformation | `https://mm-software.com/submodels/000-001/ContactInformation`((this will be convered to base64 by script in bruno)) | |
| 82 | +| `submodelIdentifierNameplate` | Base64-encoded submodel identifier for Nameplate | `https://mm-software.com/submodels/000-001/Nameplate`(this will be convered to base64 by script in bruno) | |
| 83 | +| `submodelIdentifierReliability` | Base64-encoded submodel identifier for Reliability| `https://mm-software.com/submodels/000-001/Reliability`(this will be convered to base64 by script in bruno) | |
| 84 | + |
| 85 | +Default values are set as shown. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Default api-test configuration |
| 90 | + |
| 91 | +* The default configuration includes four shell descriptors with these IDs: |
| 92 | + |
| 93 | + * `https://mm-software.com/ids/aas/000-001` |
| 94 | + * `https://mm-software.com/ids/aas/000-002` |
| 95 | + * `https://mm-software.com/ids/aas/000-003` |
| 96 | + * `https://mm-software.com/ids/aas/000-004` |
| 97 | + |
| 98 | +* Default submodel templates (under `/infrastructure/config-files/aas`): |
| 99 | + |
| 100 | + * `ContactInformation` |
| 101 | + * `Nameplate` |
| 102 | + * `Reliability` |
| 103 | + |
| 104 | +* Default shell template used by all four shells: |
| 105 | + |
| 106 | +```json |
| 107 | +{ |
| 108 | + "id": "https://mm-software.com/aas/aasTemplate", |
| 109 | + "assetInformation": { |
| 110 | + "assetKind": "Instance" |
| 111 | + }, |
| 112 | + "submodels": [ |
| 113 | + { |
| 114 | + "type": "ModelReference", |
| 115 | + "keys": [ |
| 116 | + { "type": "Submodel", "value": "Nameplate" } |
| 117 | + ] |
| 118 | + }, |
| 119 | + { |
| 120 | + "type": "ModelReference", |
| 121 | + "keys": [ |
| 122 | + { "type": "Submodel", "value": "ContactInformation" } |
| 123 | + ] |
| 124 | + }, |
| 125 | + { |
| 126 | + "type": "ModelReference", |
| 127 | + "keys": [ |
| 128 | + { "type": "Submodel", "value": "Reliability" } |
| 129 | + ] |
| 130 | + } |
| 131 | + ], |
| 132 | + "modelType": "AssetAdministrationShell" |
| 133 | +} |
| 134 | +``` |
| 135 | + |
| 136 | +By default, DataEngine requests the dev Template Repository, Submodel Registry, and AAS Registry (Azure-backed in the `dev` environment). |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## Useful requests & folders |
| 141 | + |
| 142 | +* **Aas Registry** — endpoints to get all ShellDescriptors and ShellDescriptor by id |
| 143 | +* **Aas Repository** — endpoints to get Shell by id, SubmodelRef by id, Asset Information by id |
| 144 | +* **Submodel Registry** — endpoints to get SubmodelDescriptor by id |
| 145 | +* **Submodel Repository** — endpoints to get submodel, submodelElement, and serialization |
| 146 | + |
| 147 | +(Each Bruno request contains example payloads.) |
| 148 | + |
| 149 | +--- |
| 150 | + |
| 151 | +## Troubleshooting |
| 152 | + |
| 153 | +#### ❌ Bruno shows `SSL/TLS handshake failed` |
| 154 | + |
| 155 | +- Run `dotnet dev-certs https --trust` |
| 156 | +- Ensure plugin and API endpoints match port and schema (`https://`) |
| 157 | + |
| 158 | + |
| 159 | +--- |
0 commit comments