Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0e7b97e
Add new Item `CMDSpecsPartialCommandGroup` to support Command Tree dy…
ReaNAiveD Sep 4, 2024
142f9c5
Backend Support
ReaNAiveD Sep 25, 2024
e8fcae2
start hook
ReaNAiveD Sep 25, 2024
2633bb0
UI update
ReaNAiveD Sep 27, 2024
3a44739
Merge branch 'dev' into delete-tree-json
ReaNAiveD Sep 27, 2024
32cf0d1
Fix style
ReaNAiveD Sep 27, 2024
4bab872
Merge branch 'dev' into delete-tree-json
ReaNAiveD Oct 24, 2024
649a221
New api to get simple tree
ReaNAiveD Oct 24, 2024
3b815f4
Add Simple Command Tree
ReaNAiveD Oct 28, 2024
cad2f89
Fix
ReaNAiveD Oct 29, 2024
a57ade2
Batch Get
ReaNAiveD Oct 30, 2024
a18a8ff
Fix dependencies
ReaNAiveD Oct 30, 2024
0ed38fd
remove cross layer call
ReaNAiveD Oct 30, 2024
9c23be8
Backend Fix
ReaNAiveD Oct 30, 2024
7aae85c
Revert dynamic in api
ReaNAiveD Oct 30, 2024
ae0ef92
Fix style
ReaNAiveD Oct 30, 2024
d64c36a
Support aaz model missing detect
ReaNAiveD Oct 30, 2024
5e84be2
Fix error display
ReaNAiveD Oct 30, 2024
bb656db
Modify let to const
ReaNAiveD Oct 30, 2024
c59d9c1
Remove Tree.json Gen & Fix regiest state
ReaNAiveD Oct 31, 2024
ccebb50
Fix slow export model
ReaNAiveD Oct 31, 2024
1d4cf91
Fix Empty Folder in Commands
ReaNAiveD Oct 31, 2024
8a6d06c
Update src/aaz_dev/command/controller/command_tree.py
ReaNAiveD Nov 18, 2024
c27ed08
Use a block by block way to parse the command groups
ReaNAiveD Nov 18, 2024
2135235
Merge branch 'refs/heads/dev' into delete-tree-json
ReaNAiveD Dec 6, 2024
4bdfec1
Drop Command Tree Patching Logic since we drop `tree.json` directly
ReaNAiveD Dec 6, 2024
979a92e
Fix multi-line help extraction error
ReaNAiveD Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/aaz_dev/command/api/specs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from flask import Blueprint, jsonify, request

from utils import exceptions
from utils.plane import PlaneEnum
from command.controller.specs_manager import AAZSpecsManager
Expand All @@ -7,6 +8,17 @@
bp = Blueprint('specs', __name__, url_prefix='/AAZ/Specs')


# modules
@bp.route("/CommandTree/Simple", methods=("GET",))
def simple_command_tree():
manager = AAZSpecsManager()
tree = manager.simple_tree
if not tree:
raise exceptions.ResourceNotFind("Command group not exist")
tree = tree.to_primitive()
return jsonify(tree)


# modules
@bp.route("/CommandTree/Nodes/<names_path:node_names>", methods=("GET",))
def command_tree_node(node_names):
Expand Down Expand Up @@ -38,6 +50,23 @@ def command_tree_leaf(node_names, leaf_name):
return jsonify(result)


@bp.route("/CommandTree/Nodes/Leaves", methods=("POST",))
def command_tree_leaves():
data = request.get_json()
result = []
manager = AAZSpecsManager()

for command_names in data:
if command_names[0] != AAZSpecsManager.COMMAND_TREE_ROOT_NAME:
raise exceptions.ResourceNotFind(f"Command not exist: {' '.join(command_names)}")
command_names = command_names[1:]
leaf = manager.find_command(*command_names)
if not leaf:
raise exceptions.ResourceNotFind(f"Command not exist: {' '.join(command_names)}")
result.append(leaf.to_primitive())
return jsonify(result)


@bp.route("/CommandTree/Nodes/<names_path:node_names>/Leaves/<name:leaf_name>/Versions/<base64:version_name>", methods=("GET",))
def aaz_command_in_version(node_names, leaf_name, version_name):
if node_names[0] != AAZSpecsManager.COMMAND_TREE_ROOT_NAME:
Expand Down
Loading
Loading