orchestration (new orchestration generator)
What it is
Creates a new orchestration scaffold by copying a bundled template directory into a target path, parameterized with an orchestration name.
Public API
new_orchestration(orchestration_name: str, orchestration_path: str = ".", extra_values: dict = {})- Normalizes
orchestration_nameto PascalCase. - Resolves
orchestration_path("."becomes current working directory). - Ensures the destination directory exists.
- Copies orchestration templates into the destination using
Copier, injecting template values.
- Normalizes
- CLI command:
new orchestration ORCHESTRATION_NAME [ORCHESTRATION_PATH]- Implemented by
_new_orchestration(...)and callsnew_orchestration(...).
- Implemented by
Configuration/Dependencies
- Depends on:
clickfor CLI wiring.naas_abi_clipackage location to resolve the template folder:<naas_abi_cli package>/cli/new/templates/orchestration
Copier(naas_abi_cli.cli.utils.Copier.Copier) to perform template copying.to_pascal_case(.utils) to normalize names.
- Template values passed to
Copier.copy(...):orchestration_name_pascal: PascalCase version of the provided name.- Any additional keys from
extra_valuesare merged in.
Usage
As a CLI command
naas-abi-cli new orchestration MyOrchestration ./out
As a Python function
from naas_abi_cli.cli.new.orchestration import new_orchestration
new_orchestration("my orchestration", "./out", extra_values={"foo": "bar"})
Caveats
extra_valueshas a mutable default ({}); passing your own dict is recommended when adding values.- If
orchestration_pathis".", it usesos.getcwd()as the destination.