[Compute] Create new extension module interconnect with new command interface interconnect-block - #10163
[Compute] Create new extension module interconnect with new command interface interconnect-block#10163william051200 wants to merge 12 commits into
interconnect with new command interface interconnect-block#10163Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Adds a new Azure CLI extension module interconnect implementing CRUD commands for the new Compute resource type Interconnect Block (az interconnect-block create/delete/list/show/update), including generated AAZ command implementations and an initial scenario test to validate end-to-end behavior.
Changes:
- Introduces the new
interconnectextension packaging (setup files, README/HISTORY, extension loader, command table). - Adds AAZ-generated command implementations for
Microsoft.Compute/interconnectBlocks(api-version2026-03-01). - Adds a scenario test covering create/show/list/update/delete flows for
interconnect-block.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/service_name.json | Adds service ownership mapping entry for the new extension/command group. |
| src/interconnect/setup.py | New extension packaging metadata and setuptools entrypoint. |
| src/interconnect/setup.cfg | Placeholder setup.cfg (matches existing generated extensions’ pattern). |
| src/interconnect/README.md | User-facing usage examples for az interconnect-block. |
| src/interconnect/HISTORY.rst | Initial release history entry. |
| src/interconnect/azext_interconnect/init.py | Extension command loader wiring (AAZ + custom command table). |
| src/interconnect/azext_interconnect/_help.py | Help registration stub. |
| src/interconnect/azext_interconnect/_params.py | Arguments registration stub. |
| src/interconnect/azext_interconnect/commands.py | Registers interconnect-block commands in the command table. |
| src/interconnect/azext_interconnect/custom.py | Custom module stub (logger). |
| src/interconnect/azext_interconnect/interconnect_block_custom.py | Custom command classes for interconnect-block wrapping AAZ implementations. |
| src/interconnect/azext_interconnect/azext_metadata.json | Extension metadata (preview flag, min CLI core version). |
| src/interconnect/azext_interconnect/aaz/init.py | AAZ package init stub. |
| src/interconnect/azext_interconnect/aaz/latest/init.py | AAZ latest-version package init stub. |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/init.py | Defines the AAZ interconnect command group package. |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/__cmd_group.py | AAZ command group definition for interconnect. |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/block/init.py | Exposes block subcommands (create/delete/list/show/update). |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/block/__cmd_group.py | AAZ command group definition for interconnect block. |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/block/_create.py | Generated create implementation for interconnect blocks. |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/block/_delete.py | Generated delete implementation for interconnect blocks. |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/block/_list.py | Generated list implementation (subscription + RG scopes). |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/block/_show.py | Generated show implementation (supports $expand=instanceView). |
| src/interconnect/azext_interconnect/aaz/latest/interconnect/block/_update.py | Generated update implementation (generic update + instance update). |
| src/interconnect/azext_interconnect/tests/init.py | Test package init stub. |
| src/interconnect/azext_interconnect/tests/latest/init.py | Latest tests package init stub. |
| src/interconnect/azext_interconnect/tests/latest/test_interconnect.py | Scenario test validating interconnect-block CRUD operations. |
| "Command": "az interconnect", | ||
| "AzureServiceName": "Interconnect", |
| az interconnect-block create --name training-icb-001 --resource-group ai-training-rg \ | ||
| --location eastus --zone 1 --sku-name Standard_ND128isr_GB300_v6 --sku-capacity 36 \ | ||
| --interconnect-group-id \ |
| def load_command_table(self, args): | ||
| from azext_interconnect.commands import load_command_table | ||
| from azure.cli.core.aaz import load_aaz_command_table | ||
| try: | ||
| from . import aaz | ||
| except ImportError: | ||
| aaz = None | ||
| if aaz: | ||
| load_aaz_command_table( | ||
| loader=self, | ||
| aaz_pkg_name=aaz.__name__, | ||
| args=args | ||
| ) | ||
| load_command_table(self, args) | ||
| return self.command_table |
| _args_schema.interconnect_group_id = AAZStrArg( | ||
| options=["--group-id", "--interconnect-group-id"], | ||
| arg_group="InterconnectGroup", | ||
| help="The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...", | ||
| ) |
| _args_schema.sku_capacity = AAZIntArg( | ||
| options=["--sku-capacity"], | ||
| arg_group="Sku", | ||
| help="Specifies the number of virtual machines in the scale set.", | ||
| ) |
| _args_schema.sku_name = AAZStrArg( | ||
| options=["--sku-name"], | ||
| arg_group="Sku", | ||
| help="The sku name.", | ||
| ) |
| _args_schema = cls._args_schema | ||
| _args_schema.placement_exclude_zones = AAZListArg( | ||
| options=["--exclude-zones", "--placement-exclude-zones"], | ||
| arg_group="Placement", | ||
| help="This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection.", | ||
| nullable=True, | ||
| ) | ||
| _args_schema.placement_include_zones = AAZListArg( | ||
| options=["--include-zones", "--placement-include-zones"], | ||
| arg_group="Placement", | ||
| help="This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection.", | ||
| nullable=True, | ||
| ) | ||
| _args_schema.zone_placement_policy = AAZStrArg( | ||
| options=["--placement-policy", "--zone-placement-policy"], | ||
| arg_group="Placement", | ||
| help="Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation.", | ||
| nullable=True, | ||
| enum={"Any": "Any", "Auto": "Auto"}, | ||
| ) |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Compute |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Automated sensitive-information remediation ran on this pull request.
If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment. ✅ Keep the redaction · ❌ Dispute the redaction GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices. Posted by agent-assist (autonomous bug-fix pipeline). |
Feature request: Azure/azure-cli#33707
aaz: Azure/aaz#1053
New extension module:
interconnectNew command:
az interconnect-block create/delete/list/show/updateThis checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.