Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename schema reg create param from --namespace to --registry-namespace #309

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions azext_edge/edge/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,11 +1162,11 @@ def load_iotops_help():
examples:
- name: Create a schema registry called 'myregistry' with minimum inputs.
text: >
az iot ops schema registry create -n myregistry -g myresourcegroup --namespace myschemas
az iot ops schema registry create -n myregistry -g myresourcegroup --registry-namespace myschemas
--sa-resource-id $STORAGE_ACCOUNT_RESOURCE_ID
- name: Create a schema registry called 'myregistry' in region westus2 with additional customization.
text: >
az iot ops schema registry create -n myregistry -g myresourcegroup --namespace myschemas
--sa-resource-id $STORAGE_ACCOUNT_RESOURCE_ID --sa-container mycontainer
az iot ops schema registry create -n myregistry -g myresourcegroup --registry-namespace myschemas
--sa-resource-id $STORAGE_ACCOUNT_RESOURCE_ID --sa-container myschemacontainer
-l westus2 --desc 'Contoso factory X1 schemas' --display-name 'Contoso X1' --tags env=prod
"""
4 changes: 2 additions & 2 deletions azext_edge/edge/commands_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def create_registry(
cmd,
schema_registry_name: str,
resource_group_name: str,
namespace: str,
registry_namespace: str,
storage_account_resource_id: str,
storage_container_name: Optional[str] = "schemas",
location: Optional[str] = None,
Expand All @@ -31,7 +31,7 @@ def create_registry(
name=schema_registry_name,
resource_group_name=resource_group_name,
location=location,
namespace=namespace,
registry_namespace=registry_namespace,
storage_account_resource_id=storage_account_resource_id,
storage_container_name=storage_container_name,
description=description,
Expand Down
4 changes: 2 additions & 2 deletions azext_edge/edge/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,8 @@ def load_iotops_arguments(self, _):
help="Schema registry name.",
)
context.argument(
"namespace",
options_list=["--namespace"],
"registry_namespace",
options_list=["--registry-namespace", "--rn"],
help="Schema registry namespace. Uniquely identifies a schema registry within a tenant.",
)
context.argument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create(
self,
name: str,
resource_group_name: str,
namespace: str,
registry_namespace: str,
storage_account_resource_id: str,
storage_container_name: str,
location: Optional[str] = None,
Expand Down Expand Up @@ -108,7 +108,7 @@ def create(
"type": "SystemAssigned",
},
"properties": {
"namespace": namespace,
"namespace": registry_namespace,
"storageAccountContainerUrl": blob_container_url,
"description": description,
"displayName": display_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_schema_registry_create(
):
registery_name = generate_random_string()
resource_group_name = generate_random_string()
namespace = generate_random_string()
registry_namespace = generate_random_string()
storage_account_name = generate_random_string()
storage_container_name = generate_random_string()

Expand Down Expand Up @@ -269,7 +269,7 @@ def test_schema_registry_create(
"cmd": mocked_cmd,
"schema_registry_name": registery_name,
"resource_group_name": resource_group_name,
"namespace": namespace,
"registry_namespace": registry_namespace,
"storage_account_resource_id": storage_resource_id,
"storage_container_name": storage_container_name,
"location": location,
Expand Down Expand Up @@ -330,7 +330,7 @@ def test_schema_registry_create(
if tags:
assert schema_registry_create_payload["tags"] == tags
assert schema_registry_create_payload["identity"]["type"] == "SystemAssigned"
assert schema_registry_create_payload["properties"]["namespace"] == namespace
assert schema_registry_create_payload["properties"]["namespace"] == registry_namespace
assert schema_registry_create_payload["properties"]["description"] == description
assert schema_registry_create_payload["properties"]["displayName"] == display_name
assert (
Expand Down