Skip to content

[HORIZONDB] Add private endpoint CLI commands#10043

Open
petarperin-mdcs wants to merge 3 commits into
Azure:mainfrom
petarperin-mdcs:dev/petarperin/hdb-pe-cli-ext
Open

[HORIZONDB] Add private endpoint CLI commands#10043
petarperin-mdcs wants to merge 3 commits into
Azure:mainfrom
petarperin-mdcs:dev/petarperin/hdb-pe-cli-ext

Conversation

@petarperin-mdcs

@petarperin-mdcs petarperin-mdcs commented Jun 25, 2026

Copy link
Copy Markdown
Member

Related command

az horizondb private-endpoint-connection
az horizondb private-link-resource

Summary

  • Add HorizonDB-specific private endpoint connection commands: list, show, approve, reject, and delete.
  • Add HorizonDB-specific private link resource commands: list and show.
  • Update the vendored HorizonDB SDK private endpoint connection update/delete route shape to match the cluster-scoped backend contract.
  • Add help, README, history/version updates, and targeted command/validator tests.
  • Add a replayable scenario test and recording for the HorizonDB private endpoint command surface.

Validation

  • python -m unittest discover -s src\horizondb\azext_horizondb\tests\latest -p test_horizondb_private_endpoint_commands.py
  • azdev test test_horizondb_private_endpoint_command_scenario --discover
  • python -m compileall -q src\horizondb\azext_horizondb
  • azdev style horizondb
  • azdev linter horizondb --min-severity medium
  • git diff --check
  • python scripts\ci\test_index.py -q

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (azdev required; see .azure-pipelines/templates/azdev_setup.yml for the install command until azdev==0.2.11b1 is on PyPI)
  • My extension version conforms to the Extension version schema

For new extensions:

Add HorizonDB-specific private link resource and private endpoint connection commands to the preview extension. Update the vendored SDK PEC update/delete route shape to match the cluster-scoped backend contract and add targeted coverage for route generation and ID validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 25, 2026 13:02
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 25, 2026

Copy link
Copy Markdown
❌Azure CLI Extensions Breaking Change Test
❌cosmosdb-preview
rule cmd_name rule_message suggest_message
1007 - ParaRemove cosmosdb create cmd cosmosdb create removed parameter disable_local_auth please add back parameter disable_local_auth for cmd cosmosdb create
1012 - SubgroupRemove cosmosdb keys sub group cosmosdb keys removed please confirm sub group cosmosdb keys removed
1007 - ParaRemove cosmosdb restore cmd cosmosdb restore removed parameter disable_local_auth please add back parameter disable_local_auth for cmd cosmosdb restore
1012 - SubgroupRemove cosmosdb softdeleted-account sub group cosmosdb softdeleted-account removed please confirm sub group cosmosdb softdeleted-account removed
1012 - SubgroupRemove cosmosdb sql softdeleted-container sub group cosmosdb sql softdeleted-container removed please confirm sub group cosmosdb sql softdeleted-container removed
1012 - SubgroupRemove cosmosdb sql softdeleted-database sub group cosmosdb sql softdeleted-database removed please confirm sub group cosmosdb sql softdeleted-database removed
1007 - ParaRemove cosmosdb update cmd cosmosdb update removed parameter soft_delete_configuration please add back parameter soft_delete_configuration for cmd cosmosdb update
⚠️ 1010 - ParaPropUpdate cosmosdb create cmd cosmosdb create update parameter continuous_tier: updated property choices from ['Continuous30Days', 'Continuous35Days', 'Continuous7Days'] to ['Continuous30Days', 'Continuous7Days']
⚠️ 1010 - ParaPropUpdate cosmosdb update cmd cosmosdb update update parameter continuous_tier: updated property choices from ['Continuous30Days', 'Continuous35Days', 'Continuous7Days'] to ['Continuous30Days', 'Continuous7Days']
⚠️horizondb
rule cmd_name rule_message suggest_message
⚠️ 1015 - SubgroupPropUpdate horizondb sub group horizondb updated property sub_groups from {} to {'horizondb private-endpoint-connection': {'name': 'horizondb private-endpoint-connection', 'commands': {'horizondb private-endpoint-connection list': {'name': 'horizondb private-endpoint-connection list', 'is_aaz': False, 'parameters': [{'name': 'resource_group_name', 'options': ['--resource-group', '-g'], 'required': True, 'id_part': 'resource_group', 'has_completer': True}, {'name': 'cluster_name', 'options': ['--cluster-name', '-c'], 'required': True}]}, 'horizondb private-endpoint-connection show': {'name': 'horizondb private-endpoint-connection show', 'is_aaz': False, 'parameters': [{'name': 'connection_id', 'options': ['--id']}, {'name': 'resource_group_name', 'options': ['--resource-group', '-g'], 'id_part': 'resource_group', 'has_completer': True}, {'name': 'cluster_name', 'options': ['--cluster-name', '-c']}, {'name': 'private_endpoint_connection_name', 'options': ['--name', '-n']}]}, 'horizondb private-endpoint-connection delete': {'name': 'horizondb private-endpoint-connection delete', 'is_aaz': False, 'parameters': [{'name': '_change_reference', 'options': ['--change-reference']}, {'name': '_acquire_policy_token', 'options': ['--acquire-policy-token']}, {'name': 'connection_id', 'options': ['--id']}, {'name': 'resource_group_name', 'options': ['--resource-group', '-g'], 'id_part': 'resource_group', 'has_completer': True}, {'name': 'cluster_name', 'options': ['--cluster-name', '-c']}, {'name': 'private_endpoint_connection_name', 'options': ['--name', '-n']}]}, 'horizondb private-endpoint-connection approve': {'name': 'horizondb private-endpoint-connection approve', 'is_aaz': False, 'parameters': [{'name': '_change_reference', 'options': ['--change-reference']}, {'name': '_acquire_policy_token', 'options': ['--acquire-policy-token']}, {'name': 'connection_id', 'options': ['--id']}, {'name': 'resource_group_name', 'options': ['--resource-group', '-g'], 'id_part': 'resource_group', 'has_completer': True}, {'name': 'cluster_name', 'options': ['--cluster-name', '-c']}, {'name': 'private_endpoint_connection_name', 'options': ['--name', '-n']}, {'name': 'description', 'options': ['--description', '-d'], 'required': True}]}, 'horizondb private-endpoint-connection reject': {'name': 'horizondb private-endpoint-connection reject', 'is_aaz': False, 'parameters': [{'name': '_change_reference', 'options': ['--change-reference']}, {'name': '_acquire_policy_token', 'options': ['--acquire-policy-token']}, {'name': 'connection_id', 'options': ['--id']}, {'name': 'resource_group_name', 'options': ['--resource-group', '-g'], 'id_part': 'resource_group', 'has_completer': True}, {'name': 'cluster_name', 'options': ['--cluster-name', '-c']}, {'name': 'private_endpoint_connection_name', 'options': ['--name', '-n']}, {'name': 'description', 'options': ['--description', '-d'], 'required': True}]}}, 'sub_groups': {}}, 'horizondb private-link-resource': {'name': 'horizondb private-link-resource', 'commands': {'horizondb private-link-resource list': {'name': 'horizondb private-link-resource list', 'is_aaz': False, 'parameters': [{'name': 'resource_group_name', 'options': ['--resource-group', '-g'], 'required': True, 'id_part': 'resource_group', 'has_completer': True}, {'name': 'cluster_name', 'options': ['--cluster-name', '-c'], 'required': True}]}, 'horizondb private-link-resource show': {'name': 'horizondb private-link-resource show', 'is_aaz': False, 'parameters': [{'name': 'resource_group_name', 'options': ['--resource-group', '-g'], 'required': True, 'id_part': 'resource_group', 'has_completer': True}, {'name': 'cluster_name', 'options': ['--cluster-name', '-c'], 'required': True}, {'name': 'group_name', 'options': ['--group-name'], 'required': True}]}}, 'sub_groups': {}}}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Azure HorizonDB CLI support for managing private endpoint connections and private link resources, including wiring new command groups into the extension, updating the vendored SDK request shapes to the cluster-scoped backend contract, and adding targeted validation/tests.

Changes:

  • Add az horizondb private-endpoint-connection commands (list/show/approve/reject/delete) and az horizondb private-link-resource commands (list/show).
  • Update vendored SDK private endpoint connection update/delete to use cluster-scoped routes (and update = PUT).
  • Add --id parsing/validation for private endpoint connection resource IDs plus targeted unit tests; bump extension version and update docs/help/history.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/horizondb/setup.py Bump extension version to 1.0.0b4.
src/horizondb/README.md Document new private endpoint/private link command groups.
src/horizondb/HISTORY.rst Add 1.0.0b4 release notes for the new commands.
src/horizondb/azext_horizondb/vendored_sdks/operations/_operations.py Update private endpoint connection update/delete request builders + operation signatures to include cluster_name and use cluster-scoped routes (PUT for update).
src/horizondb/azext_horizondb/vendored_sdks/aio/operations/_operations.py Propagate cluster_name into async private endpoint connection update/delete operation flows.
src/horizondb/azext_horizondb/utils/validators.py Add validator to parse/validate --id for cluster-scoped private endpoint connection IDs and populate RG/cluster/connection name.
src/horizondb/azext_horizondb/tests/latest/test_horizondb_private_endpoint_commands.py Add unit tests for ID parsing, request shape changes, and CLI argument required-ness.
src/horizondb/azext_horizondb/commands/private_endpoint_commands.py Add approve/reject helpers and a private link resource get wrapper.
src/horizondb/azext_horizondb/cluster_commands.py Register new command groups and bind SDK/custom handlers + validators.
src/horizondb/azext_horizondb/_params.py Add parameters for private endpoint connection (--connection-name, --id, --description) and private link resource (--group-name).
src/horizondb/azext_horizondb/_help.py Add help entries and examples for the new command groups/commands.
src/horizondb/azext_horizondb/_client_factory.py Add client factories for private endpoint connections and private link resources operation groups.

Comment on lines +26 to +51
from azext_horizondb._client_factory import cf_horizondb_private_endpoint_connections
from azext_horizondb.vendored_sdks.models import (
OptionalPropertiesUpdateableProperties,
PrivateEndpointConnectionUpdate,
PrivateLinkServiceConnectionState,
)

private_endpoint_connections_client = cf_horizondb_private_endpoint_connections(cmd.cli_ctx, None)
private_endpoint_connections_client.get(
resource_group_name=resource_group_name,
cluster_name=cluster_name,
private_endpoint_connection_name=private_endpoint_connection_name)

new_status = 'Approved' if is_approved else 'Rejected'
state = PrivateLinkServiceConnectionState(
status=new_status,
description=description)
update = PrivateEndpointConnectionUpdate(
properties=OptionalPropertiesUpdateableProperties(
private_link_service_connection_state=state))

return client.begin_update(
resource_group_name=resource_group_name,
cluster_name=cluster_name,
private_endpoint_connection_name=private_endpoint_connection_name,
properties=update)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7dc0907 by removing the extra GET before approve/reject; the command now relies on begin_update to surface service validation/errors.

@yonzhan yonzhan requested a review from jsntcy June 25, 2026 22:37
@yonzhan

yonzhan commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

HORIZONDB

Remove the redundant private endpoint connection GET before approve/reject and add HorizonDB wait/list-command linter fixes. Extend targeted tests for command metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nasc17 nasc17 requested review from mattboentoro and nehrao1 June 29, 2026 01:37
'Required if --id is not specified.')
private_endpoint_connection_id_arg_type = CLIArgumentType(
options_list=['--id'],
help='The resource ID of the private endpoint connection associated with the HorizonDB cluster.')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'If specified --cluster-name/-c and --name/-n, this should be omitted.'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7071881 by updating the --id help to reference --cluster-name/-c and --name/-n.

scopes=['horizondb']))
cluster_name_no_id_arg_type = CLIArgumentType(
metavar='NAME',
options_list=['--name', '-n'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be '--cluster-name'

cluster_name_resource_arg_type = CLIArgumentType(
metavar='NAME',
options_list=['--cluster-name', '-c'],
id_part='name',
help="Name of the cluster.",
local_context_attribute=LocalContextAttribute(
name='cluster_name',
actions=[LocalContextAction.SET, LocalContextAction.GET],
scopes=['horizondb']))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7071881 by changing the child command cluster argument to --cluster-name/-c.

Comment thread src/horizondb/azext_horizondb/_help.py Outdated
"""


helps['horizondb wait'] = """

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this command added?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary addition by AI, will remove

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7071881 by removing the added wait command. The pre-existing update --no-wait linter finding is now handled with a linter exclusion.

Comment thread src/horizondb/azext_horizondb/_help.py Outdated
short-summary: List private endpoint connections for a HorizonDB cluster.
examples:
- name: List private endpoint connections for a HorizonDB cluster.
text: az horizondb private-endpoint-connection list --resource-group exampleresourcegroup --name examplecluster

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--cluster-name

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7071881 by updating the help example to use --cluster-name.

Comment thread src/horizondb/azext_horizondb/_help.py Outdated
short-summary: Show details of a HorizonDB private endpoint connection.
examples:
- name: Show a private endpoint connection by cluster and connection name.
text: az horizondb private-endpoint-connection show --resource-group exampleresourcegroup --name examplecluster --connection-name exampleconnection

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--cluster-name examplecluster --name exampleconnection

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7071881 by updating examples to use --cluster-name for the cluster and --name for the private endpoint connection.

options_list=['--parameter-group'],
help='The resource ID of the parameter group.')
private_endpoint_connection_name_arg_type = CLIArgumentType(
options_list=['--connection-name'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'--name'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7071881 by changing the private endpoint connection name argument to --name/-n.


class HorizonDBPrivateEndpointCommandTests(unittest.TestCase):

def test_private_endpoint_connection_id_commands_do_not_require_resource_group_at_parse_time(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration test should follow similarly to how we have for Flexible Server. Please update and include recordings. For authoring support check: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_tests.md

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7071881 by adding a replayable ScenarioTest and recording for private-link-resource list/show and private-endpoint-connection list/show/approve/reject/delete.

async def _update_initial(
self,
resource_group_name: str,
cluster_name: str,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For awareness, bug has been reported to SDK team for this: Azure/azure-sdk-for-python#47688

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep as-is if functional.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Kept the vendored SDK route fix in this PR since it is required for these commands to call the cluster-scoped HorizonDB backend route.

@yonzhan yonzhan requested a review from Pan-Qi June 29, 2026 02:09
Update child command arguments to use --cluster-name and --name, remove the added wait command, add a linter exclusion for the pre-existing update --no-wait behavior, and add a recorded scenario test for the HorizonDB private endpoint command surface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nasc17

nasc17 commented Jun 30, 2026

Copy link
Copy Markdown
Member

@Pan-Qi Please review and merge this PR. Thank you

@Pan-Qi

Pan-Qi commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@Pan-Qi Pan-Qi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the failed CI tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants