|
1 | 1 | --- |
2 | 2 | name: asset-registry-endpoints |
3 | 3 | description: >- |
4 | | - Call asset service endpoints (schema, validate, methodology, examples) for any |
5 | | - registered asset type using the asset registry descriptor and the content-cli |
6 | | - api command. Also covers exporting/importing/creating packages via config |
7 | | - commands. Use when the user asks for a schema, wants to validate an asset, |
8 | | - needs methodology/best-practices, wants example configurations for an asset |
9 | | - type, or needs to export/import/list/create packages. |
| 4 | + Discover asset types, fetch schemas, examples, and methodology via |
| 5 | + content-cli asset-registry commands. Also covers exporting/importing/creating |
| 6 | + packages via config commands. Use when the user asks for a schema, wants to |
| 7 | + validate an asset, needs methodology/best-practices, wants example |
| 8 | + configurations for an asset type, or needs to export/import/list/create |
| 9 | + packages. |
10 | 10 | --- |
11 | 11 |
|
12 | 12 | # Asset Registry Endpoint Caller |
13 | 13 |
|
14 | | -Call any endpoint defined in an asset registry descriptor by combining the |
15 | | -service `basePath` with the endpoint path, then hitting it via `content-cli api request`. |
| 14 | +Use `content-cli asset-registry` commands to discover asset types and fetch |
| 15 | +schemas, examples, and methodology for any registered asset type. |
16 | 16 |
|
17 | 17 | ## Prerequisites |
18 | 18 |
|
@@ -122,7 +122,7 @@ nothing above or around it. If the schema defines a `metadata` field inside |
122 | 122 | `configuration`, that is the asset's own metadata, not a platform concept. |
123 | 123 |
|
124 | 124 | Everything outside `configuration` is configuration-management metadata managed |
125 | | -by Pacman. |
| 125 | +by the platform. |
126 | 126 |
|
127 | 127 | ```json |
128 | 128 | { |
@@ -170,127 +170,122 @@ Field reference: |
170 | 170 | | `variables` | Package variables (e.g. DATA_MODEL bindings) | |
171 | 171 | | `dependencies` | Package-level dependencies | |
172 | 172 |
|
173 | | -## Step 1 — Get the asset descriptor |
| 173 | +## Step 1 — Discover asset types |
174 | 174 |
|
175 | | -```bash |
176 | | -$CLI asset-registry get --assetType <ASSET_TYPE> -p <profile> |
177 | | -``` |
178 | | - |
179 | | -This returns a descriptor like: |
180 | | - |
181 | | -```json |
182 | | -{ |
183 | | - "assetType": "BOARD_V2", |
184 | | - "displayName": "View", |
185 | | - "service": { "basePath": "/blueprint/api" }, |
186 | | - "endpoints": { |
187 | | - "schema": "/validation/schema/BOARD_V2", |
188 | | - "validate": "/validate/BOARD_V2", |
189 | | - "methodology": "/methodology/BOARD_V2", |
190 | | - "examples": "/examples/BOARD_V2" |
191 | | - } |
192 | | -} |
193 | | -``` |
194 | | - |
195 | | -If you don't know which asset types exist, list them first: |
| 175 | +List all registered asset types: |
196 | 176 |
|
197 | 177 | ```bash |
198 | 178 | $CLI asset-registry list -p <profile> |
199 | 179 | ``` |
200 | 180 |
|
201 | | -## Step 2 — Build the full path |
202 | | - |
203 | | -Concatenate `service.basePath` + `endpoints.<endpoint>`: |
| 181 | +Get the full descriptor for a specific type (includes schema version, service |
| 182 | +info, and endpoint availability): |
204 | 183 |
|
205 | | -| Want | Formula | Example | |
206 | | -|------|---------|---------| |
207 | | -| Schema | `basePath + endpoints.schema` | `/blueprint/api/validation/schema/BOARD_V2` | |
208 | | -| Validate | `basePath + endpoints.validate` | `/blueprint/api/validate/BOARD_V2` | |
209 | | -| Methodology | `basePath + endpoints.methodology` | `/blueprint/api/methodology/BOARD_V2` | |
210 | | -| Examples | `basePath + endpoints.examples` | `/blueprint/api/examples/BOARD_V2` | |
211 | | - |
212 | | -`methodology` and `examples` are optional — check if they exist in the |
213 | | -descriptor before calling. |
214 | | - |
215 | | -**Not all endpoints may be available** for every asset type. Some services may |
216 | | -not have deployed validate, methodology, or examples endpoints yet. If you get |
217 | | -a 404, the endpoint is not implemented for that asset type — do not retry. |
| 184 | +```bash |
| 185 | +$CLI asset-registry get --assetType <ASSET_TYPE> -p <profile> |
| 186 | +``` |
218 | 187 |
|
219 | | -## Step 3 — Call the endpoint |
| 188 | +## Step 2 — Fetch schema, examples, or methodology |
220 | 189 |
|
221 | | -> **Note on `api request`**: This command is **beta** and exists as a testing |
222 | | -> mechanism. It hits Celonis APIs using the configured profile's auth — it is |
223 | | -> not a general-purpose HTTP client. Do not use outside of testing. |
| 190 | +Use these commands to get asset authoring resources directly. Each proxies |
| 191 | +through the platform to the owning asset service — no manual path construction |
| 192 | +needed. |
224 | 193 |
|
225 | 194 | ### Schema (GET) |
226 | 195 |
|
227 | 196 | Returns the full JSON Schema for the asset type's `configuration` object. |
228 | 197 |
|
229 | 198 | ```bash |
230 | | -$CLI api request --path "<basePath><endpoints.schema>" -p <profile> |
| 199 | +$CLI asset-registry schema --assetType <ASSET_TYPE> -p <profile> |
231 | 200 | ``` |
232 | 201 |
|
233 | | -### Validate (POST) |
| 202 | +Save to file: |
234 | 203 |
|
235 | 204 | ```bash |
236 | | -$CLI api request --path "<basePath><endpoints.validate>" --method POST \ |
237 | | - --body '{"assetType":"<TYPE>","packageKey":"<PKG>","nodes":[{"key":"<KEY>","configuration":{...}}]}' \ |
238 | | - -p <profile> |
| 205 | +$CLI asset-registry schema --assetType <ASSET_TYPE> --json -p <profile> |
239 | 206 | ``` |
240 | 207 |
|
241 | | -### Methodology (GET) |
| 208 | +### Examples (GET) |
| 209 | + |
| 210 | +Returns example configurations for the asset type. Not all asset types provide |
| 211 | +examples — a 404 means the endpoint is not available. |
242 | 212 |
|
243 | 213 | ```bash |
244 | | -$CLI api request --path "<basePath><endpoints.methodology>" -p <profile> |
| 214 | +$CLI asset-registry examples --assetType <ASSET_TYPE> -p <profile> |
245 | 215 | ``` |
246 | 216 |
|
247 | | -### Examples (GET) |
| 217 | +### Methodology (GET) |
| 218 | + |
| 219 | +Returns best-practices and methodology guidance. Not all asset types provide |
| 220 | +methodology — a 404 means the endpoint is not available. |
248 | 221 |
|
249 | 222 | ```bash |
250 | | -$CLI api request --path "<basePath><endpoints.examples>" -p <profile> |
| 223 | +$CLI asset-registry methodology --assetType <ASSET_TYPE> -p <profile> |
251 | 224 | ``` |
252 | 225 |
|
253 | | -### Save response to file |
| 226 | +### Validate (POST — via config import) |
| 227 | + |
| 228 | +Use `config import --validate` to validate assets against their schema before |
| 229 | +importing: |
254 | 230 |
|
255 | 231 | ```bash |
256 | | -$CLI api request --path "<path>" --json -p <profile> |
| 232 | +$CLI config import -d <export_dir> --validate --overwrite -p <profile> |
257 | 233 | ``` |
258 | 234 |
|
259 | | -## Troubleshooting: 403 on asset endpoints |
| 235 | +**Important**: If validation returns errors, do **not** proceed with the import. |
| 236 | +Instead, fix the schema violations in the node JSON and re-run the command. If |
| 237 | +you cannot resolve the errors automatically, present the validation results to |
| 238 | +the user and ask whether they want to continue importing with invalid |
| 239 | +configuration or stop to fix it manually. |
| 240 | + |
| 241 | +## Troubleshooting |
260 | 242 |
|
261 | | -If an asset service endpoint returns **403**, the endpoint is likely **not on |
262 | | -the OAuth scope allowlist** for the token. The asset registry (Pacman) APIs may |
263 | | -work, but downstream asset service APIs (e.g. `/blueprint/api/...`, |
264 | | -`/llm-agent/api/...`) need their own allowlisting. |
| 243 | +**404 on examples / methodology** — Not all asset services have deployed these |
| 244 | +endpoints. The schema endpoint is required for all registered types; the others |
| 245 | +are optional. |
265 | 246 |
|
266 | | -**Tip for asset teams**: if your endpoints return 403 via Content CLI or public |
267 | | -APIs, request that they be added to the OAuth `studio` scope allowlist. |
| 247 | +**500 on proxy endpoints** — The platform proxies requests to the owning asset |
| 248 | +service. A 500 typically means the downstream service is unavailable or returned |
| 249 | +an unexpected response. |
| 250 | + |
| 251 | +**Errors on import (400)** — Ensure `spaceId` is set on every node and |
| 252 | +`schemaVersion` matches the descriptor's `assetSchema.version`. |
268 | 253 |
|
269 | 254 | ## Full worked example |
270 | 255 |
|
271 | 256 | ```bash |
272 | | -# 1. Get descriptor |
273 | | -$CLI asset-registry get --assetType BOARD_V2 --json |
| 257 | +# 1. Discover available asset types |
| 258 | +$CLI asset-registry list -p <profile> |
274 | 259 |
|
275 | | -# 2. Fetch schema (beta command — testing only) |
276 | | -$CLI api request --path "/blueprint/api/validation/schema/BOARD_V2" --json |
| 260 | +# 2. Get the descriptor (includes schema version) |
| 261 | +$CLI asset-registry get --assetType BOARD_V2 --json -p <profile> |
277 | 262 |
|
278 | | -# 3. Export the target package |
279 | | -$CLI config export --packageKeys <package-key> --unzip |
| 263 | +# 3. Fetch the schema |
| 264 | +$CLI asset-registry schema --assetType BOARD_V2 --json -p <profile> |
280 | 265 |
|
281 | | -# 4. Create a new node JSON in the export's nodes/ directory |
282 | | -# — configuration root must conform to the schema from step 2 |
| 266 | +# 4. (Optional) Fetch examples for reference |
| 267 | +$CLI asset-registry examples --assetType BOARD_V2 --json -p <profile> |
| 268 | + |
| 269 | +# 5. Export the target package |
| 270 | +$CLI config export --packageKeys <package-key> --unzip -p <profile> |
| 271 | + |
| 272 | +# 6. Create a new node JSON in the export's nodes/ directory |
| 273 | +# — configuration root must conform to the schema from step 3 |
283 | 274 | # — set spaceId to the package's space (ask the user) |
284 | 275 |
|
285 | | -# 5. Validate and import (--overwrite for existing package, omit for new) |
286 | | -$CLI config import -d <export_dir> --validate --overwrite |
| 276 | +# 7. Validate and import (--overwrite for existing package, omit for new) |
| 277 | +$CLI config import -d <export_dir> --validate --overwrite -p <profile> |
287 | 278 | ``` |
288 | 279 |
|
289 | 280 | ## Quick reference |
290 | 281 |
|
291 | | -| Endpoint | Method | Required | Notes | |
292 | | -|----------|--------|----------|-------| |
293 | | -| schema | GET | Yes | Returns full JSON Schema | |
294 | | -| validate | POST | Yes | May not be deployed for all types yet | |
295 | | -| methodology | GET | No | May not be deployed for all types yet | |
296 | | -| examples | GET | No | May not be deployed for all types yet | |
| 282 | +| Command | Description | |
| 283 | +|---------|-------------| |
| 284 | +| `asset-registry list` | List all registered asset types | |
| 285 | +| `asset-registry get --assetType X` | Get the full descriptor for an asset type | |
| 286 | +| `asset-registry schema --assetType X` | Get the JSON Schema for the asset's configuration | |
| 287 | +| `asset-registry examples --assetType X` | Get example configurations (if available) | |
| 288 | +| `asset-registry methodology --assetType X` | Get methodology / best-practices (if available) | |
| 289 | +| `config list` | List packages | |
| 290 | +| `config export --packageKeys X --unzip` | Export packages | |
| 291 | +| `config import -d <dir> --validate --overwrite` | Validate and import packages | |
0 commit comments