Skip to content

Commit 4d9815e

Browse files
committed
feat(network): OSC-parity set aliases for Neutron resources
Lot 1a of the Neutron audit (2026-04-28). OSC consistently uses ``set`` as the verb for in-place mutation; orca uses ``update`` (matching the Neutron API endpoint name). Both are valid — expose ``set`` as a literal Click-level alias on the same callback so users coming from ``openstack ...`` find their muscle memory works out of the box. Aliases added (no logic duplication — same Command object registered under a second name): orca network set ≡ orca network update orca network port set ≡ orca network port update orca network subnet set ≡ orca network subnet update orca network router set ≡ orca network router update orca network rbac set ≡ orca network rbac update orca security-group set ≡ orca security-group update Six gaps closed from the OSC delta. ruff/mypy clean, pytest 2676 passed (no new test added — the alias is a literal re-export, the underlying ``update`` already has full coverage). Lots 1b–11 follow (qos rule show/set, subnet-pool/trunk unset, address group/scope, FIP port-forwarding, metering, segment ranges, flavor + flavor-profile, L3 conntrack helper, router NDP proxy, local IP, IP availability, agent binding).
1 parent 4c70500 commit 4d9815e

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

orca_cli/commands/network.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ def network_update(ctx: click.Context, network_id: str, name: str | None, admin_
158158
console.print(f"[green]Network {network_id} updated.[/green]")
159159

160160

161+
# OSC-parity alias: ``openstack network set`` ≡ orca ``network update``.
162+
network.add_command(network_update, name="set")
163+
164+
161165
@network.command("delete")
162166
@click.argument("network_id", callback=validate_id, shell_complete=complete_networks)
163167
@click.option("--yes", "-y", is_flag=True, help="Skip confirmation.")
@@ -349,6 +353,10 @@ def port_update(ctx: click.Context, port_id: str, name: str | None, admin_state:
349353
console.print(f"[green]Port {port_id} updated.[/green]")
350354

351355

356+
# OSC-parity alias: ``openstack port set`` ≡ orca ``network port update``.
357+
network_port.add_command(port_update, name="set")
358+
359+
352360
@network_port.command("delete")
353361
@click.argument("port_id", callback=validate_id)
354362
@click.option("--yes", "-y", is_flag=True, help="Skip confirmation.")
@@ -443,6 +451,10 @@ def router_update(ctx: click.Context, router_id: str, name: str | None, external
443451
console.print(f"[green]Router {router_id} updated.[/green]")
444452

445453

454+
# OSC-parity alias: ``openstack router set`` ≡ orca ``network router update``.
455+
network_router.add_command(router_update, name="set")
456+
457+
446458
@network_router.command("delete")
447459
@click.argument("router_id", callback=validate_id)
448460
@click.option("--yes", "-y", is_flag=True, help="Skip confirmation.")
@@ -811,6 +823,10 @@ def network_subnet_update(ctx: click.Context, subnet_id: str, name: str | None,
811823
console.print(f"[green]Subnet {subnet_id} updated.[/green]")
812824

813825

826+
# OSC-parity alias: ``openstack subnet set`` ≡ orca ``network subnet update``.
827+
network_subnet.add_command(network_subnet_update, name="set")
828+
829+
814830
# ══════════════════════════════════════════════════════════════════════════
815831
# network agent-*
816832
# ══════════════════════════════════════════════════════════════════════════
@@ -1021,6 +1037,10 @@ def network_rbac_update(ctx: click.Context, rbac_id: str, target_project: str) -
10211037
console.print(f"[green]RBAC policy {rbac_id} updated.[/green]")
10221038

10231039

1040+
# OSC-parity alias: ``openstack network rbac set`` ≡ orca's ``rbac update``.
1041+
network_rbac.add_command(network_rbac_update, name="set")
1042+
1043+
10241044
# ══════════════════════════════════════════════════════════════════════════
10251045
# port unset
10261046
# ══════════════════════════════════════════════════════════════════════════

orca_cli/commands/security_group.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ def sg_update(ctx: click.Context, group_id: str, name: str | None, description:
109109
console.print(f"[green]Security group {group_id} updated.[/green]")
110110

111111

112+
# OSC-parity alias: ``openstack security group set`` ≡ orca ``security-group update``.
113+
security_group.add_command(sg_update, name="set")
114+
115+
112116
@security_group.command("delete")
113117
@click.argument("group_id", callback=validate_id)
114118
@click.option("--yes", "-y", is_flag=True, help="Skip confirmation.")

0 commit comments

Comments
 (0)