Skip to content

[HORIZONDB] az horizondb firewall-rule create/update/delete/show/list: Introduced firewall-rule commands for HorizonDB#9866

Open
mattboentoro wants to merge 1 commit into
Azure:mainfrom
mattboentoro:mattboentoro/horizon-firewall
Open

[HORIZONDB] az horizondb firewall-rule create/update/delete/show/list: Introduced firewall-rule commands for HorizonDB#9866
mattboentoro wants to merge 1 commit into
Azure:mainfrom
mattboentoro:mattboentoro/horizon-firewall

Conversation

@mattboentoro
Copy link
Copy Markdown
Member


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

  • az horizondb firewall-rule create
  • az horizondb firewall-rule update
  • az horizondb firewall-rule delete
  • az horizondb firewall-rule show
  • az horizondb firewall-rule list

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? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

…t`: Introduced firewall-rule commands for HorizonDB
Copilot AI review requested due to automatic review settings May 13, 2026 18:39
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @mattboentoro,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 13, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

Hi @mattboentoro

Release Suggestions

Module: horizondb

  • Please log updates into to src/horizondb/HISTORY.rst
  • Update VERSION to 1.0.0b2 in src/horizondb/setup.py

Notes

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new az horizondb firewall-rule command group (create/update/delete/show/list) to the HorizonDB CLI extension, wiring a new SDK client factory for firewall rules and registering the corresponding command handlers, parameters, and help entries.

Changes:

  • New commands/firewall_commands.py implementing create/update (read-modify-write via GET + begin_create_or_update), delete (with confirmation), and list handlers.
  • New client factory cf_horizondb_firewall_rules and command-table registration under horizondb firewall-rule.
  • Argument definitions and help text for the new command group.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/horizondb/azext_horizondb/commands/firewall_commands.py New custom command handlers for firewall rule CRUD operations.
src/horizondb/azext_horizondb/cluster_commands.py Registers the new horizondb firewall-rule command group with SDK and custom command types.
src/horizondb/azext_horizondb/_params.py Adds CLI argument types and contexts for firewall-rule commands.
src/horizondb/azext_horizondb/_help.py Adds help/examples for the new firewall-rule commands.
src/horizondb/azext_horizondb/_client_factory.py Adds cf_horizondb_firewall_rules factory returning the firewall rules operations group.

Note: setup.py (VERSION) and HISTORY.rst were not updated in this PR even though the extension is gaining new public commands; please bump the version and add a changelog entry per the PR template.

resource=resource)


def horizondb_firewall_rule_delete(cmd, client, resource_group_name, cluster_name,
Comment on lines +14 to +87
def horizondb_firewall_rule_create(client, resource_group_name, cluster_name,
firewall_rule_name, start_ip_address, end_ip_address,
pool_name='default',
rule_description=None, no_wait=False):
from azext_horizondb.vendored_sdks.models import HorizonDbFirewallRule, HorizonDbFirewallRuleProperties

properties = HorizonDbFirewallRuleProperties(
start_ip_address=start_ip_address,
end_ip_address=end_ip_address,
description=rule_description,
)

resource = HorizonDbFirewallRule(
properties=properties,
)

return sdk_no_wait(no_wait, client.begin_create_or_update,
resource_group_name=resource_group_name,
cluster_name=cluster_name,
pool_name=pool_name,
firewall_rule_name=firewall_rule_name,
resource=resource)


def horizondb_firewall_rule_update(client, resource_group_name, cluster_name,
firewall_rule_name, pool_name='default',
start_ip_address=None, end_ip_address=None,
rule_description=None, no_wait=False):
from azext_horizondb.vendored_sdks.models import HorizonDbFirewallRule, HorizonDbFirewallRuleProperties

existing = client.get(
resource_group_name=resource_group_name,
cluster_name=cluster_name,
pool_name=pool_name,
firewall_rule_name=firewall_rule_name)

props = existing.properties
properties = HorizonDbFirewallRuleProperties(
start_ip_address=start_ip_address if start_ip_address is not None else props.start_ip_address,
end_ip_address=end_ip_address if end_ip_address is not None else props.end_ip_address,
description=rule_description if rule_description is not None else props.description,
)

resource = HorizonDbFirewallRule(
properties=properties,
)

return sdk_no_wait(no_wait, client.begin_create_or_update,
resource_group_name=resource_group_name,
cluster_name=cluster_name,
pool_name=pool_name,
firewall_rule_name=firewall_rule_name,
resource=resource)


def horizondb_firewall_rule_delete(cmd, client, resource_group_name, cluster_name,
firewall_rule_name, pool_name='default',
no_wait=False, yes=False):
if not yes:
user_confirmation(
"Are you sure you want to delete the firewall rule '{0}' for cluster '{1}' in resource group '{2}'".format(
firewall_rule_name, cluster_name, resource_group_name), yes=yes)
return sdk_no_wait(no_wait, client.begin_delete,
resource_group_name=resource_group_name,
cluster_name=cluster_name,
pool_name=pool_name,
firewall_rule_name=firewall_rule_name)


def horizondb_firewall_rule_list(client, resource_group_name, cluster_name, pool_name='default'):
return client.list(
resource_group_name=resource_group_name,
cluster_name=cluster_name,
pool_name=pool_name)
Comment on lines +111 to +112
c.argument('start_ip_address', arg_type=start_ip_address_arg_type)
c.argument('end_ip_address', arg_type=end_ip_address_arg_type)
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.

4 participants