Skip to content

Commit 2cb3d51

Browse files
schaudhari6254888Your Name
andauthored
{Eventhub} API-Version for az eventhubs eventhub az eventhubs namespace cmdlets updated to 2024-05-01-preview (#29957)
* [Eventhub]:New feature update * updates * updates * updates * updates * updates * updates * updateds * updateds * test recording * test recording * updates recording * updates recording cluster * updates * updates help & params.py * update & linter fix * updates again linter' * updates again linter' * Update _help.py * Update _help.py * updateS * recording --------- Co-authored-by: Your Name <[email protected]>
1 parent 6925bbd commit 2cb3d51

File tree

64 files changed

+8818
-13082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+8818
-13082
lines changed

src/azure-cli/azure/cli/command_modules/eventhubs/_help.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,29 @@
668668
az eventhubs namespace identity remove --namespace-name mynamespace -g MyResourceGroup --system-assigned --user-assigned /subscriptions/{subscriptionId}}/resourceGroups/{resourcegroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MSIName
669669
"""
670670

671+
helps['eventhubs namespace replica'] = """
672+
type: group
673+
short-summary: Manage eventhubs namespace replicas.
674+
"""
675+
676+
helps['eventhubs namespace replica add'] = """
677+
type: command
678+
short-summary: Add one or more Replica properties to a namespace.
679+
examples:
680+
- name: Add one or more Replica properties to a namespace.
681+
text: |
682+
az eventhubs namespace replica add --namespace-name mynamespace -g MyResourceGroup --geo-data-replication-config role-type=Secondary location-name=mylocation cluster-arm-id=/subscriptions/{mysubcriptionid}/resourceGroups/{myResourcegroup}/providers/Microsoft.EventHub/clusters/{clustername}
683+
"""
684+
685+
helps['eventhubs namespace replica remove'] = """
686+
type: command
687+
short-summary: Remove one or more Replica properties to a namespace.
688+
examples:
689+
- name: Remove one or more Replica properties to a namespace.
690+
text: |
691+
az eventhubs namespace replica remove --namespace-name mynamespace -g MyResourceGroup --geo-data-replication-config role-type=Secondary location-name=mylocation cluster-arm-id=/subscriptions/{mysubcriptionid}/resourceGroups/{myResourcegroup}/providers/Microsoft.EventHub/clusters/{clustername}
692+
"""
693+
671694
helps['eventhubs namespace schema-registry'] = """
672695
type: group
673696
short-summary: Manages eventhubs namespace schema registry.

src/azure-cli/azure/cli/command_modules/eventhubs/_params.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def load_arguments_eh(self, _):
1717
from knack.arguments import CLIArgumentType
1818
from azure.cli.core.profiles import ResourceType
1919
(SkuName, TlsVersion) = self.get_models('SkuName', 'TlsVersion', resource_type=ResourceType.MGMT_EVENTHUB)
20-
from azure.cli.command_modules.eventhubs.action import AlertAddEncryption, ConstructPolicy, AlertAddIpRule, AlertAddVirtualNetwork, ConstructPolicyName
20+
from azure.cli.command_modules.eventhubs.action import AlertAddEncryption, ConstructPolicy, AlertAddIpRule, AlertAddVirtualNetwork, ConstructPolicyName, AlertAddlocation
2121

2222
namespace_name_arg_type = CLIArgumentType(options_list=['--namespace-name'], help='Name of Namespace', id_part='name')
2323

@@ -47,6 +47,7 @@ def load_arguments_eh(self, _):
4747
help='Enable System Assigned Identity')
4848
c.argument('mi_user_assigned', arg_group='Managed Identity', nargs='+', help='List of User Assigned Identity ids.')
4949
c.argument('encryption_config', action=AlertAddEncryption, nargs='+', help='List of KeyVaultProperties objects.')
50+
c.argument('geo_data_replication_config', action=AlertAddlocation, options_list=['--geo-data-replication-config', '--replica-config'], nargs='+', help='A list of regions where replicas of the namespace are maintained Object')
5051
c.argument('minimum_tls_version', arg_type=get_enum_type(TlsVersion), options_list=['--minimum-tls-version', '--min-tls'], help='The minimum TLS version for the cluster to support, e.g. 1.2')
5152
c.argument('require_infrastructure_encryption', options_list=['--infra-encryption'],
5253
arg_type=get_three_state_flag(),
@@ -55,6 +56,7 @@ def load_arguments_eh(self, _):
5556
arg_type=get_enum_type(['Enabled', 'Disabled']),
5657
help='This determines if traffic is allowed over public network. By default it is enabled. If value is SecuredByPerimeter then Inbound and Outbound communication is controlled by the network security perimeter and profile\' access rules.')
5758
c.argument('alternate_name', help='Alternate name specified when alias and namespace names are same.')
59+
c.argument('max_replication_lag_duration_in_seconds', type=int, options_list=['--max-replication-lag-duration-in-seconds', '--max-lag'], help='The maximum acceptable lag for data replication operations from the primary replica to a quorum of secondary replicas')
5860

5961
with self.argument_context('eventhubs namespace create', min_api='2021-06-01-preview') as c:
6062
c.argument('cluster_arm_id', options_list=['--cluster-arm-id'], help='Cluster ARM ID of the Namespace')
@@ -77,10 +79,13 @@ def load_arguments_eh(self, _):
7779
c.argument('archive_name_format', arg_group='Capture-Destination', help='Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order')
7880
c.argument('retention_time_in_hours', type=int, arg_group='Retention-Description', options_list=['--retention-time-in-hours', '--retention-time'], help="Number of hours to retain the events for this Event Hub. This value is only used when cleanupPolicy is Delete. If cleanupPolicy is Compaction the returned value of this property is Long.MaxValue")
7981
c.argument('tombstone_retention_time_in_hours', type=int, arg_group='Retention-Description', options_list=['--tombstone-retention-time-in-hours', '--tombstone-time'], help="Number of hours to retain the tombstone markers of a compacted Event Hub. This value is only used when cleanupPolicy is Compaction. Consumer must complete reading the tombstone marker within this specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key described by the tombstone marker within the compacted Event Hub")
80-
c.argument('cleanup_policy', arg_group='Retention-Description', arg_type=get_enum_type(['Delete', 'Compact']), help="Enumerates the possible values for cleanup policy")
82+
c.argument('cleanup_policy', arg_group='Retention-Description', arg_type=get_enum_type(['Delete', 'Compact', 'DeleteOrCompact']), help="Enumerates the possible values for cleanup policy")
8183
c.argument('mi_system_assigned', arg_group='Capture-Destination', arg_type=get_three_state_flag(),
8284
help='Enable System Assigned Identity')
8385
c.argument('mi_user_assigned', arg_group='Capture-Destination', help='List of User Assigned Identity ids.')
86+
c.argument('user_metadata', help="Gets and Sets Metadata of User.")
87+
c.argument('timestamp_type', arg_type=get_enum_type(['Create', 'LogAppend']), help='Denotes the type of timestamp the message will hold.')
88+
c.argument('min_compaction_lag_in_mins', type=int, arg_group='Retention-Description', options_list=['--min-lag', '--min-compaction-lag-in-mins'], help="The minimum time a message will remain ineligible for compaction in the log. This value is used when cleanupPolicy is Compact or DeleteOrCompact.")
8489
with self.argument_context('eventhubs eventhub list') as c:
8590
c.argument('namespace_name', options_list=['--namespace-name'], id_part=None, help='Name of Namespace')
8691

@@ -152,6 +157,14 @@ def load_arguments_eh(self, _):
152157
c.argument('require_infrastructure_encryption', options_list=['--infra-encryption'],
153158
arg_type=get_three_state_flag(),
154159
help='A boolean value that indicates whether Infrastructure Encryption (Double Encryption) is enabled/disabled')
160+
# Location
161+
with self.argument_context('eventhubs namespace replica', resource_type=ResourceType.MGMT_EVENTHUB) as c:
162+
c.argument('namespace_name', options_list=['--namespace-name'], id_part=None, help='Name of the Namespace')
163+
164+
for scope in ['eventhubs namespace replica add', 'eventhubs namespace replica remove']:
165+
with self.argument_context(scope, resource_type=ResourceType.MGMT_EVENTHUB) as c:
166+
c.argument('geo_data_replication_config', action=AlertAddlocation, nargs='+',
167+
help='A list of regions where replicas of the namespace are maintained Object')
155168

156169
# Application Group
157170
with self.argument_context('eventhubs namespace application-group') as c:

src/azure-cli/azure/cli/command_modules/eventhubs/aaz/latest/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
#
55
# Code generated by aaz-dev-tools
66
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+

src/azure-cli/azure/cli/command_modules/eventhubs/aaz/latest/eventhubs/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ class __CMDGroup(AAZCommandGroup):
2020
pass
2121

2222

23-
__all__ = ["__CMDGroup"]
23+
__all__ = ["__CMDGroup"]

src/azure-cli/azure/cli/command_modules/eventhubs/aaz/latest/eventhubs/cluster/_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,4 +388,4 @@ class _ListHelper:
388388
"""Helper class for List"""
389389

390390

391-
__all__ = ["List"]
391+
__all__ = ["List"]

src/azure-cli/azure/cli/command_modules/eventhubs/aaz/latest/eventhubs/cluster/_show.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,4 @@ class _ShowHelper:
233233
"""Helper class for Show"""
234234

235235

236-
__all__ = ["Show"]
236+
__all__ = ["Show"]

src/azure-cli/azure/cli/command_modules/eventhubs/aaz/latest/eventhubs/cluster/_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,4 +476,4 @@ def _build_schema_cluster_read(cls, _schema):
476476
_schema.type = cls._schema_cluster_read.type
477477

478478

479-
__all__ = ["Update"]
479+
__all__ = ["Update"]

src/azure-cli/azure/cli/command_modules/eventhubs/aaz/latest/eventhubs/cluster/_wait.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,4 @@ class _WaitHelper:
232232
"""Helper class for Wait"""
233233

234234

235-
__all__ = ["Wait"]
235+
__all__ = ["Wait"]

src/azure-cli/azure/cli/command_modules/eventhubs/aaz/latest/eventhubs/eventhub/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ class __CMDGroup(AAZCommandGroup):
2020
pass
2121

2222

23-
__all__ = ["__CMDGroup"]
23+
__all__ = ["__CMDGroup"]

0 commit comments

Comments
 (0)