diff --git a/src/notification-hub/HISTORY.rst b/src/notification-hub/HISTORY.rst index b99b66222fa..52d5c074528 100644 --- a/src/notification-hub/HISTORY.rst +++ b/src/notification-hub/HISTORY.rst @@ -3,7 +3,12 @@ Release History =============== +1.0.0a1 +++++++ +* Migrate command to AAZ + 0.2.0 +++++++ * Ignore --sku in notification hub as sku can only be set at namespace level * Drop Python 3.5 * Use Experimental tag diff --git a/src/notification-hub/azext_notification_hub/__init__.py b/src/notification-hub/azext_notification_hub/__init__.py index 351b5a6b37e..220fa418f78 100644 --- a/src/notification-hub/azext_notification_hub/__init__.py +++ b/src/notification-hub/azext_notification_hub/__init__.py @@ -16,11 +16,22 @@ def __init__(self, cli_ctx=None): notificationhubs_custom = CliCommandType( operations_tmpl='azext_notification_hub.custom#{}', client_factory=cf_notificationhubs) - super(NotificationHubsCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=notificationhubs_custom) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=notificationhubs_custom) def load_command_table(self, args): from azext_notification_hub.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 diff --git a/src/notification-hub/azext_notification_hub/_client_factory.py b/src/notification-hub/azext_notification_hub/_client_factory.py index e3b79f392c2..6520fe79e62 100644 --- a/src/notification-hub/azext_notification_hub/_client_factory.py +++ b/src/notification-hub/azext_notification_hub/_client_factory.py @@ -10,13 +10,5 @@ def cf_notificationhubs(cli_ctx, *_): return get_mgmt_service_client(cli_ctx, NotificationHubsManagementClient) -def cf_operations(cli_ctx, *_): - return cf_notificationhubs(cli_ctx).operations - - -def cf_namespaces(cli_ctx, *_): - return cf_notificationhubs(cli_ctx).namespaces - - def cf_notification_hubs(cli_ctx, *_): return cf_notificationhubs(cli_ctx).notification_hubs diff --git a/src/notification-hub/azext_notification_hub/_help.py b/src/notification-hub/azext_notification_hub/_help.py index fda3b5dad4c..7d7cedd3c2d 100644 --- a/src/notification-hub/azext_notification_hub/_help.py +++ b/src/notification-hub/azext_notification_hub/_help.py @@ -9,251 +9,6 @@ from knack.help_files import helps # pylint: disable=unused-import -helps['notification-hub namespace'] = """ - type: group - short-summary: Commands to manage notification hub namespace. -""" - -helps['notification-hub namespace'] = """ - type: group - short-summary: Commands to manage notification hub namespace. -""" - -helps['notification-hub namespace create'] = """ - type: command - short-summary: Create a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. - examples: - - name: Create a namespace - text: |- - az notification-hub namespace create --resource-group MyResourceGroup --name \\ - my-namespace --location "South Central US" --sku Standard -""" - -helps['notification-hub namespace update'] = """ - type: command - short-summary: Update a service namespace. The namespace's resource manifest is immutable and cannot be modified. - examples: - - name: Update the namespace - text: |- - az notification-hub namespace update --resource-group MyResourceGroup --name \\ - my-namespace --sku Standard -""" - -helps['notification-hub namespace delete'] = """ - type: command - short-summary: Delete an existing namespace. This operation also removes all associated notification hubs under the namespace. - examples: - - name: Delete the namespace - text: |- - az notification-hub namespace delete --resource-group MyResourceGroup --name \\ - my-namespace -""" - -helps['notification-hub namespace show'] = """ - type: command - short-summary: Return the description for the specified namespace. - examples: - - name: Show namespace info - text: |- - az notification-hub namespace show --resource-group MyResourceGroup --name \\ - my-namespace -""" - -helps['notification-hub namespace list'] = """ - type: command - short-summary: List available namespaces. - examples: - - name: List available namespaces within a resource group - text: |- - az notification-hub namespace list --resource-group MyResourceGroup - - name: List all the available namespaces within the subscription irrespective of the resourceGroups - text: |- - az notification-hub namespace list -""" - -helps['notification-hub namespace check-availability'] = """ - type: command - short-summary: Check the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. - examples: - - name: Check name availability of namespace - text: |- - az notification-hub namespace check-availability --name "my-test-space" -""" - -helps['notification-hub namespace wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the Notification Hub Namesapce is met. - examples: - - name: Pause executing next line of CLI script until the Notification Hub Namesapce is successfully provisioned. - text: az notification-hub namespace wait --resource-group MyResourceGroup --name \\ - my-namespace --created -""" - -helps['notification-hub namespace authorization-rule'] = """ - type: group - short-summary: Commands to manage notification hubs namespace authorization rule. -""" - -helps['notification-hub namespace authorization-rule list-keys'] = """ - type: command - short-summary: List the Primary and Secondary ConnectionStrings to the namespace - examples: - - name: List keys of the namesapce authorization rule - text: |- - az notification-hub namespace authorization-rule list-keys --resource-group MyResourceGroup --namespace-name \\ - my-namespace --name "RootManageSharedAccessKey" -""" - -helps['notification-hub namespace authorization-rule regenerate-keys'] = """ - type: command - short-summary: Regenerate the Primary/Secondary Keys to the Namespace Authorization Rule - examples: - - name: Regenerate keys of the namesapce authorization rule - text: |- - az notification-hub namespace authorization-rule regenerate-keys --resource-group MyResourceGroup --namespace-name \\ - my-namespace --name "RootManageSharedAccessKey" --policy-key "Secondary Key" -""" - -helps['notification-hub namespace authorization-rule show'] = """ - type: command - short-summary: Show an authorization rule for a namespace by name. - examples: - - name: Show namespace authorization rule info - text: |- - az notification-hub namespace authorization-rule show --resource-group MyResourceGroup \\ - --namespace-name my-namespace --name "RootManageSharedAccessKey" -""" - -helps['notification-hub namespace authorization-rule list'] = """ - type: command - short-summary: List the authorization rules for a namespace. - examples: - - name: List authorization rules of the namespace - text: |- - az notification-hub namespace authorization-rule list --resource-group MyResourceGroup \\ - --namespace-name my-namespace -""" - -helps['notification-hub namespace authorization-rule create'] = """ - type: command - short-summary: Create an authorization rule for a namespace - examples: - - name: Create a namespace authorization rule - text: |- - az notification-hub namespace authorization-rule create --resource-group \\ - MyResourceGroup --namespace-name my-namespace --name "sdk-AuthRules-1788" --rights Listen Send -""" - -helps['notification-hub namespace authorization-rule delete'] = """ - type: command - short-summary: Delete a namespace authorization rule - examples: - - name: Delete a namespace authorization rule - text: |- - az notification-hub namespace authorization-rule delete --resource-group MyResourceGroup \\ - --namespace-name my-namespace --name "RootManageSharedAccessKey" -""" - -helps['notification-hub'] = """ - type: group - short-summary: Manage Notification Hubs. -""" - -helps['notification-hub create'] = """ - type: command - short-summary: Create a NotificationHub in a namespace. - examples: - - name: Create a Notification Hub - text: |- - az notification-hub create --resource-group MyResourceGroup --namespace-name my-namespace \\ - --name my-hub --location "South Central US" -""" - -helps['notification-hub update'] = """ - type: command - short-summary: Update a Notification Hub in a namespace. - examples: - - name: Update the Notification Hub - text: |- - az notification-hub update --resource-group MyResourceGroup --namespace-name \\ - my-namespace --name "sdk-notificationHubs-8708" -""" - -helps['notification-hub delete'] = """ - type: command - short-summary: Delete a notification hub associated with a namespace. - examples: - - name: Delete a notification hub - text: |- - az notification-hub delete --resource-group MyResourceGroup --namespace-name my-namespace \\ - --name my-hub -""" - -helps['notification-hub show'] = """ - type: command - short-summary: Show the notification hub information. - examples: - - name: Show the Notification Hub info - text: |- - az notification-hub show --resource-group MyResourceGroup --namespace-name my-namespace \\ - --name my-hub -""" - -helps['notification-hub list'] = """ - type: command - short-summary: List the notification hubs associated with a namespace. - examples: - - name: List the notification hubs - text: |- - az notification-hub list --resource-group MyResourceGroup --namespace-name my-namespace -""" - -helps['notification-hub check-availability'] = """ - type: command - short-summary: Check the availability of the given notificationHub in a namespace. - examples: - - name: Check the availability of the given notificationHub name - text: |- - az notification-hub check-availability --resource-group MyResourceGroup \\ - --namespace-name "locp-newns" --name my-hub -""" - -helps['notification-hub authorization-rule'] = """ - type: group - short-summary: Commands to manage notification hubs authorization rule. -""" - -helps['notification-hub authorization-rule regenerate-keys'] = """ - type: command - short-summary: Regenerate the Primary/Secondary Keys to the NotificationHub Authorization Rule - examples: - - name: Regenerate the Notification Hub authorization rule - text: |- - az notification-hub authorization-rule regenerate-keys --resource-group MyResourceGroup --namespace-name \\ - my-namespace --notification-hub-name my-hub --name \\ - DefaultListenSharedAccessSignature --policy-key "Secondary Key" -""" - -helps['notification-hub credential list'] = """ - type: command - short-summary: List the PNS Credentials associated with a notification hub . - examples: - - name: List the PNS Credentials - text: |- - az notification-hub credential list --resource-group MyResourceGroup --namespace-name \\ - my-namespace --notification-hub-name my-hub -""" - -helps['notification-hub authorization-rule list-keys'] = """ - type: command - short-summary: List the Primary and Secondary ConnectionStrings to the NotificationHub - examples: - - name: List connectionStrings of the authorization rule - text: |- - az notification-hub authorization-rule list-keys --resource-group MyResourceGroup --namespace-name my-namespace \\ - --notification-hub-name my-hub --name "sdk-AuthRules-5800" -""" - helps['notification-hub test-send'] = """ type: command short-summary: test send a push notification @@ -274,122 +29,3 @@ my-namespace --notification-hub-name my-hub --notification-format gcm \\ --payload "{\\\"data\\\":{\\\"message\\\":\\\"test notification\\\"}}" """ - -helps['notification-hub authorization-rule list'] = """ - type: command - short-summary: List the authorization rules for a NotificationHub. - examples: - - name: List authorization rules - text: |- - az notification-hub authorization-rule list --resource-group MyResourceGroup \\ - --namespace-name my-namespace --notification-hub-name my-hub -""" - -helps['notification-hub authorization-rule show'] = """ - type: command - short-summary: Show an authorization rule for a NotificationHub by name. - examples: - - name: Show the authorization rule information - text: |- - az notification-hub authorization-rule show --resource-group MyResourceGroup \\ - --namespace-name my-namespace --notification-hub-name my-hub --name \\ - DefaultListenSharedAccessSignature -""" - -helps['notification-hub authorization-rule create'] = """ - type: command - short-summary: Create an authorization rule for a NotificationHub - examples: - - name: Create an authorization rule - text: |- - az notification-hub authorization-rule create --resource-group MyResourceGroup \\ - --namespace-name my-namespace --notification-hub-name my-hub --name \\ - DefaultListenSharedAccessSignature --rights Listen Send -""" - -helps['notification-hub authorization-rule delete'] = """ - type: command - short-summary: Delete a notificationHub authorization rule - examples: - - name: Delete the authorization rule - text: |- - az notification-hub authorization-rule delete --resource-group MyResourceGroup \\ - --namespace-name my-namespace --notification-hub-name my-hub --name \\ - DefaultListenSharedAccessSignature -""" - -helps['notification-hub credential'] = """ - type: group - short-summary: Commands to manage notification hub credential. -""" -helps['notification-hub credential gcm'] = """ - type: group - short-summary: Commands to manage notification hub credential for Google(GCM/FCM). -""" - -helps['notification-hub credential adm'] = """ - type: group - short-summary: Commands to manage notification hub credential for Amazon(ADM). -""" - -helps['notification-hub credential apns'] = """ - type: group - short-summary: Commands to manage notification hub credential for Apple(APNS). -""" - -helps['notification-hub credential baidu'] = """ - type: group - short-summary: Commands to manage notification hub credential for Baidu(Andrioid China). -""" - -helps['notification-hub credential mpns'] = """ - type: group - short-summary: Commands to manage notification hub credential for Windows Phone(MPNS). -""" - -helps['notification-hub credential wns'] = """ - type: group - short-summary: Commands to manage notification hub credential for Windows(WNS). -""" - -helps['notification-hub credential gcm update'] = """ - type: command - short-summary: Update the Google GCM/FCM API key. - examples: - - name: Update gcm key - text: |- - az notification-hub credential gcm update --resource-group MyResourceGroup \\ - --namespace-name my-namespace --notification-hub-name my-hub --google-api-key \\ - "xxxxxxxxx" -""" - -helps['notification-hub credential adm update'] = """ - type: command - short-summary: Update credential for Amazon(ADM). -""" - -helps['notification-hub credential apns update'] = """ - type: command - short-summary: Update credential for Apple(APNS). - examples: - - name: Update APNS certificate - text: |- - az notification-hub credential apns update --namespace-name my-namespace \\ - --notification-hub-name my-hub --apns-certificate "/path/to/certificate" \\ - --certificate-key "xxxxxx" --resource-group MyResourceGroup -""" - -helps['notification-hub credential baidu update'] = """ - type: command - short-summary: Update credential for Baidu(Andrioid China). -""" - -helps['notification-hub credential mpns update'] = """ - type: command - short-summary: Update credential for Windows Phone(MPNS). -""" - -helps['notification-hub credential wns update'] = """ - type: command - short-summary: Update credential for Windows(WNS). -""" diff --git a/src/notification-hub/azext_notification_hub/_params.py b/src/notification-hub/azext_notification_hub/_params.py index 1c7fc08d735..59dfb477b70 100644 --- a/src/notification-hub/azext_notification_hub/_params.py +++ b/src/notification-hub/azext_notification_hub/_params.py @@ -5,18 +5,10 @@ # pylint: disable=line-too-long # pylint: disable=too-many-lines # pylint: disable=too-many-statements +# pylint: disable=unused-argument -from argcomplete.completers import FilesCompleter from knack.arguments import CLIArgumentType -from azure.cli.core.commands.parameters import ( - tags_type, - get_enum_type, - get_location_type, - file_type -) -from azure.cli.core.commands.validators import get_default_location_from_resource_group - -from ._validators import validate_cert_file +from azure.cli.core.commands.parameters import get_enum_type def load_arguments(self, _): @@ -24,167 +16,13 @@ def load_arguments(self, _): options_list=['--payload'], help='The payload for the message in JSON format. ' ) - - with self.argument_context('notification-hub namespace create') as c: - c.argument('namespace_name', options_list=['--name', '-n'], help='The namespace name.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('sku_name', arg_type=get_enum_type(['Free', 'Basic', 'Standard']), options_list=['--sku'], help='Name of the notification hub sku') - - with self.argument_context('notification-hub namespace update') as c: - c.argument('namespace_name', options_list=['--name', '-n'], help='The namespace name.') - c.argument('tags', tags_type) - c.argument('sku_name', arg_type=get_enum_type(['Free', 'Basic', 'Standard']), options_list=['--sku'], help='Name of the notification hub sku') - - with self.argument_context('notification-hub namespace delete') as c: - c.argument('namespace_name', id_part="name", options_list=['--name', '-n'], help='The namespace name.') - - with self.argument_context('notification-hub namespace show') as c: - c.argument('namespace_name', id_part="name", options_list=['--name', '-n'], help='The namespace name.') - - with self.argument_context('notification-hub namespace list') as c: - pass - - with self.argument_context('notification-hub namespace check-availability') as c: - c.argument('name', options_list=['--name', '-n'], help='The namespace name to check.') - - with self.argument_context('notification-hub namespace wait') as c: - c.argument('namespace_name', options_list=['--name', '-n'], help='The namespace name.') - - with self.argument_context('notification-hub namespace authorization-rule list-keys') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('rule_name', options_list=['--name', '-n'], help='The authorization rule name.') - - with self.argument_context('notification-hub namespace authorization-rule regenerate-keys') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('rule_name', options_list=['--name', '-n'], help='The authorization rule name.') - c.argument('policy_key', arg_type=get_enum_type(['Primary Key', 'Secondary Key']), help='Name of the key that has to be regenerated for the Namespace Authorization Rule.') - - with self.argument_context('notification-hub namespace authorization-rule show') as c: - c.argument('namespace_name', id_part="name", help='The namespace name.') - c.argument('rule_name', id_part="child_name_1", options_list=['--name', '-n'], help='The authorization rule name.') - - with self.argument_context('notification-hub namespace authorization-rule list') as c: - c.argument('namespace_name', help='The namespace name.') - - with self.argument_context('notification-hub namespace authorization-rule create') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('rule_name', options_list=['--name', '-n'], help='The authorization rule name.') - c.argument('rights', nargs='+', help='The rights associated with the rule.') - - with self.argument_context('notification-hub namespace authorization-rule delete') as c: - c.argument('namespace_name', id_part="name", help='The namespace name.') - c.argument('rule_name', id_part="child_name_1", options_list=['--name', '-n'], help='The authorization rule name.') - - with self.argument_context('notification-hub create') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', options_list=['--name', '-n'], help='The notification hub name.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.ignore('sku_name') - c.argument('registration_ttl', help='The RegistrationTtl of the created NotificationHub') - - with self.argument_context('notification-hub update') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', options_list=['--name', '-n'], help='The notification hub name.') - c.argument('tags', tags_type) - c.ignore('sku_name') - - with self.argument_context('notification-hub delete') as c: - c.argument('namespace_name', id_part="name", help='The namespace name.') - c.argument('notification_hub_name', id_part="child_name_1", options_list=['--name', '-n'], help='The notification hub name.') - - with self.argument_context('notification-hub show') as c: - c.argument('namespace_name', id_part="name", help='The namespace name.') - c.argument('notification_hub_name', id_part="child_name_1", options_list=['--name', '-n'], help='The notification hub name.') - - with self.argument_context('notification-hub list') as c: - c.argument('namespace_name', help='The namespace name.') - - with self.argument_context('notification-hub check-availability') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', options_list=['--name', '-n'], help='The notification hub name to check.') - - with self.argument_context('notification-hub authorization-rule regenerate-keys') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('rule_name', options_list=['--name', '-n'], help='The authorization rule name.') - c.argument('policy_key', arg_type=get_enum_type(['Primary Key', 'Secondary Key']), help='Name of the key that has to be regenerated for the Notification Hub Authorization Rule.') - - with self.argument_context('notification-hub credential list') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - - with self.argument_context('notification-hub authorization-rule list-keys') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('rule_name', options_list=['--name', '-n'], help='The authorization rule name.') - with self.argument_context('notification-hub test-send') as c: c.argument('namespace_name', help='The namespace name.') c.argument('notification_hub_name', help='The notification hub name.') - c.argument('notification_format', arg_type=get_enum_type(['apple', 'baidu', 'gcm', 'template', 'windows', 'windowsphone']), help='The format of notification message.') + c.argument('notification_format', + arg_type=get_enum_type(['apple', 'baidu', 'gcm', 'template', 'windows', 'windowsphone']), + help='The format of notification message.') c.argument('message', help='The message body to send. If not None, payload will be ignored') c.argument('title', help='The title of the notification.') c.argument('payload', arg_type=payload_type, id_part=None) c.argument('tag', help='You can send test notifications to a specific set of registrations using this option. Leave this field empty if you like to send push notifications to 10 random registrations on the selected platform.') - - with self.argument_context('notification-hub authorization-rule list') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - - with self.argument_context('notification-hub authorization-rule show') as c: - c.argument('namespace_name', id_part="name", help='The namespace name.') - c.argument('notification_hub_name', id_part="child_name_1", help='The notification hub name.') - c.argument('rule_name', id_part="child_name_2", options_list=['--name', '-n'], help='The authorization rule name.') - - with self.argument_context('notification-hub authorization-rule create') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('rule_name', options_list=['--name', '-n'], help='The authorization rule name.') - c.argument('rights', nargs='+', help='The rights associated with the rule.') - - with self.argument_context('notification-hub authorization-rule delete') as c: - c.argument('namespace_name', id_part="name", help='The namespace name.') - c.argument('notification_hub_name', id_part="child_name_1", help='The notification hub name.') - c.argument('rule_name', id_part="child_name_2", options_list=['--name', '-n'], help='The authorization rule name.') - - with self.argument_context('notification-hub credential gcm update') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('google_api_key', help='Google GCM/FCM API key.') - - with self.argument_context('notification-hub credential adm update') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('client_id', help='The client identifier.') - c.argument('client_secret', help='The credential secret access key.') - - with self.argument_context('notification-hub credential apns update') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('apns_certificate', type=file_type, help='The APNS certificate.', validator=validate_cert_file, completer=FilesCompleter()) - c.argument('certificate_key', help='The certificate key.') - c.argument('endpoint', help='The endpoint of this credential. Example values:"gateway.sandbox.push.apple.com","gateway.push.apple.com"') - c.argument('key_id', help='A 10-character key identifier (kid) key, obtained from your developer account') - c.argument('app_name', help='The name of the application/bundle id.') - c.argument('app_id', help='The issuer (iss) registered claim key, whose value is your 10-character Team ID, obtained from your developer account') - c.argument('token', help='Provider Authentication Token, obtained through your developer account.') - - with self.argument_context('notification-hub credential baidu update') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('api_key', help='Baidu API key.') - c.argument('secret_key', help='Baidu secret key.') - - with self.argument_context('notification-hub credential mpns update') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('mpns_certificate', type=file_type, help='The MPNS certificate.', validator=validate_cert_file, completer=FilesCompleter()) - c.argument('certificate_key', help='The certificate key for this credential.') - - with self.argument_context('notification-hub credential wns update') as c: - c.argument('namespace_name', help='The namespace name.') - c.argument('notification_hub_name', help='The notification hub name.') - c.argument('package_sid', help='The package ID for this credential.') - c.argument('secret_key', help='The secret key.') diff --git a/src/notification-hub/azext_notification_hub/_validators.py b/src/notification-hub/azext_notification_hub/_validators.py index 5e276eb8ab9..4861b430504 100644 --- a/src/notification-hub/azext_notification_hub/_validators.py +++ b/src/notification-hub/azext_notification_hub/_validators.py @@ -4,16 +4,6 @@ # -------------------------------------------------------------------------------------------- -def validate_cert_file(namespace): - """Validate the give cert file existing""" - try: - if namespace.apns_certificate is not None: - with open(namespace.apns_certificate, "rb"): - pass - except EnvironmentError: - raise ValueError("Cannot access certificate file: " + namespace.apns_certificate) - - def validate_notification_message(namespace): """Validate message or payload to send""" from knack.util import CLIError diff --git a/src/notification-hub/azext_notification_hub/aaz/__init__.py b/src/notification-hub/azext_notification_hub/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/__cmd_group.py new file mode 100644 index 00000000000..b4070ec86f5 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "notification-hub", + is_experimental=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage notification hubs. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/__init__.py new file mode 100644 index 00000000000..dc6be547abf --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._check_availability import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_check_availability.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_check_availability.py new file mode 100644 index 00000000000..1de6758e32c --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_check_availability.py @@ -0,0 +1,216 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub check-availability", + is_experimental=True, +) +class CheckAvailability(AAZCommand): + """Checks the availability of the given notification hub in a namespace. + + :example: Check the availability of the given notification hub name + az notification-hub check-availability --resource-group MyResourceGroup --namespace-name "locp-newns" --name my-hub + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/checknotificationhubavailability", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + arg_group="Parameters", + help="Resource name", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsCheckNotificationHubAvailability(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsCheckNotificationHubAvailability(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.is_availiable = AAZBoolType( + serialized_name="isAvailiable", + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _CheckAvailabilityHelper: + """Helper class for CheckAvailability""" + + +__all__ = ["CheckAvailability"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_create.py new file mode 100644 index 00000000000..b77a530841b --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_create.py @@ -0,0 +1,420 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub create", + is_experimental=True, +) +class Create(AAZCommand): + """Create a notification hub in a namespace. + + :example: Create a notification hub + az notification-hub create --resource-group MyResourceGroup --namespace-name my-namespace --name my-hub --location "South Central US" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.registration_ttl = AAZStrArg( + options=["--registration-ttl"], + arg_group="Properties", + help="The RegistrationTtl of the created NotificationHub", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location") + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("name", AAZStrType, ".name") + properties.set_prop("registrationTtl", AAZStrType, ".registration_ttl") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = cls._schema_on_200_201.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200_201.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = cls._schema_on_200_201.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200_201.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = cls._schema_on_200_201.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200_201.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = cls._schema_on_200_201.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200_201.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = cls._schema_on_200_201.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200_201.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = cls._schema_on_200_201.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200_201.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = cls._schema_on_200_201.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200_201.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = cls._schema_on_200_201.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_delete.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_delete.py new file mode 100644 index 00000000000..7c91323179c --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_delete.py @@ -0,0 +1,145 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub delete", + is_experimental=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a notification hub associated with a namespace. + + :example: Delete a notification hub + az notification-hub delete --resource-group MyResourceGroup --namespace-name my-namespace --name my-hub + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The notification hub name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class NotificationHubsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_list.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_list.py new file mode 100644 index 00000000000..081a8c47908 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_list.py @@ -0,0 +1,369 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub list", + is_experimental=True, +) +class List(AAZCommand): + """List the notification hubs associated with a namespace. + + :example: List the notification hubs + az notification-hub list --resource-group MyResourceGroup --namespace-name my-namespace + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs", "2017-04-01"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class NotificationHubsList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = cls._schema_on_200.value.Element.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = cls._schema_on_200.value.Element.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = cls._schema_on_200.value.Element.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.value.Element.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = cls._schema_on_200.value.Element.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = cls._schema_on_200.value.Element.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = cls._schema_on_200.value.Element.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = cls._schema_on_200.value.Element.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_show.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_show.py new file mode 100644 index 00000000000..0d2c13462d1 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_show.py @@ -0,0 +1,366 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub show", + is_experimental=True, +) +class Show(AAZCommand): + """Show the notification hub information. + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The notification hub name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = cls._schema_on_200.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = cls._schema_on_200.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = cls._schema_on_200.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = cls._schema_on_200.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = cls._schema_on_200.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = cls._schema_on_200.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = cls._schema_on_200.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_update.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_update.py new file mode 100644 index 00000000000..19dd9c09d01 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_update.py @@ -0,0 +1,796 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub update", + is_experimental=True, +) +class Update(AAZCommand): + """Update a notification hub in a namespace. + + :example: Update the notification hub + az notification-hub update --resource-group MyResourceGroup --namespace-name my-namespace --name "sdk-notificationHubs-8708" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["-n", "--name", "--notification-hub-name"], + help="The notification hub name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location", + nullable=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.adm_credential = AAZObjectArg( + options=["--adm-credential"], + arg_group="Properties", + help="The AdmCredential of the created NotificationHub", + nullable=True, + ) + _args_schema.apns_credential = AAZObjectArg( + options=["--apns-credential"], + arg_group="Properties", + help="The ApnsCredential of the created NotificationHub", + nullable=True, + ) + _args_schema.baidu_credential = AAZObjectArg( + options=["--baidu-credential"], + arg_group="Properties", + help="The BaiduCredential of the created NotificationHub", + nullable=True, + ) + _args_schema.gcm_credential = AAZObjectArg( + options=["--gcm-credential"], + arg_group="Properties", + help="The GcmCredential of the created NotificationHub", + nullable=True, + ) + _args_schema.mpns_credential = AAZObjectArg( + options=["--mpns-credential"], + arg_group="Properties", + help="The MpnsCredential of the created NotificationHub", + nullable=True, + ) + _args_schema.wns_credential = AAZObjectArg( + options=["--wns-credential"], + arg_group="Properties", + help="The WnsCredential of the created NotificationHub", + nullable=True, + ) + + adm_credential = cls._args_schema.adm_credential + adm_credential.auth_token_url = AAZStrArg( + options=["auth-token-url"], + help="The URL of the authorization token.", + nullable=True, + ) + adm_credential.client_id = AAZStrArg( + options=["client-id"], + help="The client identifier.", + nullable=True, + ) + adm_credential.client_secret = AAZStrArg( + options=["client-secret"], + help="The credential secret access key.", + nullable=True, + ) + + apns_credential = cls._args_schema.apns_credential + apns_credential.apns_certificate = AAZStrArg( + options=["apns-certificate"], + help="The APNS certificate. Specify if using Certificate Authentication Mode.", + nullable=True, + ) + apns_credential.app_id = AAZStrArg( + options=["app-id"], + help="The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from your developer account. Specify if using Token Authentication Mode.", + nullable=True, + ) + apns_credential.app_name = AAZStrArg( + options=["app-name"], + help="The name of the application or BundleId. Specify if using Token Authentication Mode.", + nullable=True, + ) + apns_credential.certificate_key = AAZStrArg( + options=["certificate-key"], + help="The APNS certificate password if it exists.", + nullable=True, + ) + apns_credential.endpoint = AAZStrArg( + options=["endpoint"], + help="The APNS endpoint of this credential. If using Certificate Authentication Mode and Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify 'https://api.push.apple.com:443/3/device'.", + nullable=True, + ) + apns_credential.key_id = AAZStrArg( + options=["key-id"], + help="A 10-character key identifier (kid) key, obtained from your developer account. Specify if using Token Authentication Mode.", + nullable=True, + ) + apns_credential.thumbprint = AAZStrArg( + options=["thumbprint"], + help="The APNS certificate thumbprint. Specify if using Certificate Authentication Mode.", + nullable=True, + ) + apns_credential.token = AAZStrArg( + options=["token"], + help="Provider Authentication Token, obtained through your developer account. Specify if using Token Authentication Mode.", + nullable=True, + ) + + baidu_credential = cls._args_schema.baidu_credential + baidu_credential.baidu_api_key = AAZStrArg( + options=["baidu-api-key"], + help="Baidu Api Key.", + nullable=True, + ) + baidu_credential.baidu_end_point = AAZStrArg( + options=["baidu-end-point"], + help="Baidu Endpoint.", + nullable=True, + ) + baidu_credential.baidu_secret_key = AAZStrArg( + options=["baidu-secret-key"], + help="Baidu Secret Key", + nullable=True, + ) + + gcm_credential = cls._args_schema.gcm_credential + gcm_credential.gcm_endpoint = AAZStrArg( + options=["gcm-endpoint"], + help="The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'", + nullable=True, + ) + gcm_credential.google_api_key = AAZStrArg( + options=["google-api-key"], + help="The Google API key.", + nullable=True, + ) + + mpns_credential = cls._args_schema.mpns_credential + mpns_credential.certificate_key = AAZStrArg( + options=["certificate-key"], + help="The certificate key for this credential.", + nullable=True, + ) + mpns_credential.mpns_certificate = AAZStrArg( + options=["mpns-certificate"], + help="The MPNS certificate.", + nullable=True, + ) + mpns_credential.thumbprint = AAZStrArg( + options=["thumbprint"], + help="The MPNS certificate Thumbprint", + nullable=True, + ) + + wns_credential = cls._args_schema.wns_credential + wns_credential.package_sid = AAZStrArg( + options=["package-sid"], + help="The package ID for this credential.", + nullable=True, + ) + wns_credential.secret_key = AAZStrArg( + options=["secret-key"], + help="The secret key.", + nullable=True, + ) + wns_credential.windows_live_endpoint = AAZStrArg( + options=["windows-live-endpoint"], + help="The Windows Live endpoint.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("location", AAZStrType, ".location") + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("admCredential", AAZObjectType, ".adm_credential") + properties.set_prop("apnsCredential", AAZObjectType, ".apns_credential") + properties.set_prop("baiduCredential", AAZObjectType, ".baidu_credential") + properties.set_prop("gcmCredential", AAZObjectType, ".gcm_credential") + properties.set_prop("mpnsCredential", AAZObjectType, ".mpns_credential") + properties.set_prop("name", AAZStrType, ".notification_hub_name") + properties.set_prop("wnsCredential", AAZObjectType, ".wns_credential") + + adm_credential = _builder.get(".properties.admCredential") + if adm_credential is not None: + adm_credential.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties.admCredential.properties") + if properties is not None: + properties.set_prop("authTokenUrl", AAZStrType, ".auth_token_url") + properties.set_prop("clientId", AAZStrType, ".client_id") + properties.set_prop("clientSecret", AAZStrType, ".client_secret") + + apns_credential = _builder.get(".properties.apnsCredential") + if apns_credential is not None: + apns_credential.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties.apnsCredential.properties") + if properties is not None: + properties.set_prop("apnsCertificate", AAZStrType, ".apns_certificate") + properties.set_prop("appId", AAZStrType, ".app_id") + properties.set_prop("appName", AAZStrType, ".app_name") + properties.set_prop("certificateKey", AAZStrType, ".certificate_key") + properties.set_prop("endpoint", AAZStrType, ".endpoint") + properties.set_prop("keyId", AAZStrType, ".key_id") + properties.set_prop("thumbprint", AAZStrType, ".thumbprint") + properties.set_prop("token", AAZStrType, ".token") + + baidu_credential = _builder.get(".properties.baiduCredential") + if baidu_credential is not None: + baidu_credential.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties.baiduCredential.properties") + if properties is not None: + properties.set_prop("baiduApiKey", AAZStrType, ".baidu_api_key") + properties.set_prop("baiduEndPoint", AAZStrType, ".baidu_end_point") + properties.set_prop("baiduSecretKey", AAZStrType, ".baidu_secret_key") + + gcm_credential = _builder.get(".properties.gcmCredential") + if gcm_credential is not None: + gcm_credential.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties.gcmCredential.properties") + if properties is not None: + properties.set_prop("gcmEndpoint", AAZStrType, ".gcm_endpoint") + properties.set_prop("googleApiKey", AAZStrType, ".google_api_key") + + mpns_credential = _builder.get(".properties.mpnsCredential") + if mpns_credential is not None: + mpns_credential.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties.mpnsCredential.properties") + if properties is not None: + properties.set_prop("certificateKey", AAZStrType, ".certificate_key") + properties.set_prop("mpnsCertificate", AAZStrType, ".mpns_certificate") + properties.set_prop("thumbprint", AAZStrType, ".thumbprint") + + wns_credential = _builder.get(".properties.wnsCredential") + if wns_credential is not None: + wns_credential.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties.wnsCredential.properties") + if properties is not None: + properties.set_prop("packageSid", AAZStrType, ".package_sid") + properties.set_prop("secretKey", AAZStrType, ".secret_key") + properties.set_prop("windowsLiveEndpoint", AAZStrType, ".windows_live_endpoint") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_notification_hub_resource_read = None + + @classmethod + def _build_schema_notification_hub_resource_read(cls, _schema): + if cls._schema_notification_hub_resource_read is not None: + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + return + + cls._schema_notification_hub_resource_read = _schema_notification_hub_resource_read = AAZObjectType() + + notification_hub_resource_read = _schema_notification_hub_resource_read + notification_hub_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.location = AAZStrType() + notification_hub_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + notification_hub_resource_read.sku = AAZObjectType() + notification_hub_resource_read.tags = AAZDictType() + notification_hub_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_notification_hub_resource_read.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = _schema_notification_hub_resource_read.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = _schema_notification_hub_resource_read.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = _schema_notification_hub_resource_read.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = _schema_notification_hub_resource_read.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = _schema_notification_hub_resource_read.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = _schema_notification_hub_resource_read.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = _schema_notification_hub_resource_read.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = _schema_notification_hub_resource_read.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = _schema_notification_hub_resource_read.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = _schema_notification_hub_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_notification_hub_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + + +__all__ = ["Update"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/__cmd_group.py new file mode 100644 index 00000000000..a31a33a4488 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "notification-hub authorization-rule", + is_experimental=True, +) +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hubs authorization rule. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/__init__.py new file mode 100644 index 00000000000..d6e1d6e7896 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._list_keys import * +from ._regenerate_keys import * +from ._show import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_create.py new file mode 100644 index 00000000000..eedff58aac1 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_create.py @@ -0,0 +1,282 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub authorization-rule create", + is_experimental=True, +) +class Create(AAZCommand): + """Create an authorization rule for a notification hub. + + :example: Create an authorization rule + az notification-hub authorization-rule create --resource-group MyResourceGroup --namespace-name my-namespace --notification-hub-name my-hub --name DefaultListenSharedAccessSignature --rights Listen Send + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}/authorizationrules/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Authorization Rule Name.", + required=True, + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.rights = AAZListArg( + options=["--rights"], + arg_group="Properties", + help="The rights associated with the rule.", + ) + + rights = cls._args_schema.rights + rights.Element = AAZStrArg( + enum={"Listen": "Listen", "Manage": "Manage", "Send": "Send"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsCreateOrUpdateAuthorizationRule(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsCreateOrUpdateAuthorizationRule(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("rights", AAZListType, ".rights") + + rights = _builder.get(".properties.rights") + if rights is not None: + rights.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + properties.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + properties.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + properties.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + properties.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + properties.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + properties.revision = AAZIntType( + flags={"read_only": True}, + ) + properties.rights = AAZListType() + properties.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.properties.rights + rights.Element = AAZStrType() + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_delete.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_delete.py new file mode 100644 index 00000000000..33d461c0ab8 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_delete.py @@ -0,0 +1,160 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub authorization-rule delete", + is_experimental=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a notificationHub authorization rule. + + :example: Delete a notificationHub authorization rule + az notification-hub authorization-rule delete --resource-group MyResourceGroup --namespace-name my-namespace --notification-hub-name my-hub --name DefaultListenSharedAccessSignature + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}/authorizationrules/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Authorization Rule Name.", + required=True, + id_part="child_name_2", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["--notification-hub-name"], + help="The notification hub name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsDeleteAuthorizationRule(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class NotificationHubsDeleteAuthorizationRule(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list.py new file mode 100644 index 00000000000..e055ef63141 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list.py @@ -0,0 +1,248 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub authorization-rule list", + is_experimental=True, +) +class List(AAZCommand): + """List the authorization rules for a notification hub. + + :example: List the authorization rules for a notification hub. + az notification-hub authorization-rule list --resource-group MyResourceGroup --namespace-name my-namespace --notification-hub-name my-hub + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}/authorizationrules", "2017-04-01"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsListAuthorizationRules(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class NotificationHubsListAuthorizationRules(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + properties.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + properties.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + properties.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + properties.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + properties.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + properties.revision = AAZIntType( + flags={"read_only": True}, + ) + properties.rights = AAZListType() + properties.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.value.Element.properties.rights + rights.Element = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list_keys.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list_keys.py new file mode 100644 index 00000000000..9ef5b1ae087 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list_keys.py @@ -0,0 +1,200 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub authorization-rule list-keys", + is_experimental=True, +) +class ListKeys(AAZCommand): + """List the primary and secondary connection strings to the notification hub. + + :example: List connection strings of the authorization rule + az notification-hub authorization-rule list-keys --resource-group MyResourceGroup --namespace-name my-namespace --notification-hub-name my-hub --name "sdk-AuthRules-5800" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}/authorizationrules/{}/listkeys", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The connection string of the NotificationHub for the specified authorizationRule.", + required=True, + id_part="child_name_2", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["--notification-hub-name"], + help="The notification hub name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsListKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsListKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.key_name = AAZStrType( + serialized_name="keyName", + ) + _schema_on_200.primary_connection_string = AAZStrType( + serialized_name="primaryConnectionString", + ) + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + ) + _schema_on_200.secondary_connection_string = AAZStrType( + serialized_name="secondaryConnectionString", + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + ) + + return cls._schema_on_200 + + +class _ListKeysHelper: + """Helper class for ListKeys""" + + +__all__ = ["ListKeys"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_regenerate_keys.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_regenerate_keys.py new file mode 100644 index 00000000000..903f4bf2d33 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_regenerate_keys.py @@ -0,0 +1,223 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub authorization-rule regenerate-keys", + is_experimental=True, +) +class RegenerateKeys(AAZCommand): + """Regenerates the primary/secondary keys to the notification hub authorization rule. + + :example: Regenerate the notification hub authorization rule + az notification-hub authorization-rule regenerate-keys --resource-group MyResourceGroup --namespace-name my-namespace --notification-hub-name my-hub --name DefaultListenSharedAccessSignature --policy-key "Secondary Key" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}/authorizationrules/{}/regeneratekeys", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The connection string of the NotificationHub for the specified authorizationRule.", + required=True, + id_part="child_name_2", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["--notification-hub-name"], + help="The notification hub name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.policy_key = AAZStrArg( + options=["--policy-key"], + arg_group="Parameters", + help="Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsRegenerateKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsRegenerateKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("policyKey", AAZStrType, ".policy_key") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.key_name = AAZStrType( + serialized_name="keyName", + ) + _schema_on_200.primary_connection_string = AAZStrType( + serialized_name="primaryConnectionString", + ) + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + ) + _schema_on_200.secondary_connection_string = AAZStrType( + serialized_name="secondaryConnectionString", + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + ) + + return cls._schema_on_200 + + +class _RegenerateKeysHelper: + """Helper class for RegenerateKeys""" + + +__all__ = ["RegenerateKeys"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_show.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_show.py new file mode 100644 index 00000000000..ea740abdfb4 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_show.py @@ -0,0 +1,249 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub authorization-rule show", + is_experimental=True, +) +class Show(AAZCommand): + """Show an authorization rule for a notification hub by name. + + :example: Show the authorization rule information + az notification-hub authorization-rule show --resource-group MyResourceGroup --namespace-name my-namespace --notification-hub-name my-hub --name DefaultListenSharedAccessSignature + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}/authorizationrules/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Authorization Rule Name.", + required=True, + id_part="child_name_2", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name", + required=True, + id_part="name", + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["--notification-hub-name"], + help="The notification hub name.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGetAuthorizationRule(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsGetAuthorizationRule(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + properties.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + properties.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + properties.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + properties.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + properties.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + properties.revision = AAZIntType( + flags={"read_only": True}, + ) + properties.rights = AAZListType() + properties.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.properties.rights + rights.Element = AAZStrType() + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/__cmd_group.py new file mode 100644 index 00000000000..91d2e14c554 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "notification-hub credential", + is_experimental=True, +) +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub credential. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/__init__.py new file mode 100644 index 00000000000..d63ae5a6fc9 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/_list.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/_list.py new file mode 100644 index 00000000000..26924bbacb7 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/_list.py @@ -0,0 +1,320 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub credential list", + is_experimental=True, +) +class List(AAZCommand): + """Lists the PNS credentials associated with a notification hub. + + :example: List the PNS credentials associated with a notification hub . + az notification-hub credential list --resource-group MyResourceGroup --namespace-name my-namespace --notification-hub-name my-hub + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}/pnscredentials", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGetPnsCredentials(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NotificationHubsGetPnsCredentials(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = cls._schema_on_200.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = cls._schema_on_200.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + baidu_credential = cls._schema_on_200.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = cls._schema_on_200.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = cls._schema_on_200.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = cls._schema_on_200.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = cls._schema_on_200.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/__cmd_group.py new file mode 100644 index 00000000000..2e6148873be --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/__cmd_group.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub credential for Amazon(ADM). + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/__init__.py new file mode 100644 index 00000000000..a6df9f5a835 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/_create.py new file mode 100644 index 00000000000..63daa76b261 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/_create.py @@ -0,0 +1,541 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class Create(AAZCommand): + """Update credential for Amazon(ADM). + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01", "properties.admCredential"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["-n", "--name", "--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.client_id = AAZStrArg( + options=["--client-id"], + arg_group="Properties", + help="The client identifier.", + ) + _args_schema.client_secret = AAZStrArg( + options=["--client-secret"], + arg_group="Properties", + help="The credential secret access key.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.pre_instance_create() + self.InstanceCreateByJson(ctx=self.ctx)() + self.post_instance_create(self.ctx.selectors.subresource.required()) + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_create(self): + pass + + @register_callback + def post_instance_create(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.admCredential + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.admCredential = value + return + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceCreateByJson(AAZJsonInstanceCreateOperation): + + def __call__(self, *args, **kwargs): + self.ctx.selectors.subresource.set(self._create_instance()) + + def _create_instance(self): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("clientId", AAZStrType, ".client_id") + properties.set_prop("clientSecret", AAZStrType, ".client_secret") + + return _instance_value + + +class _CreateHelper: + """Helper class for Create""" + + _schema_notification_hub_resource_read = None + + @classmethod + def _build_schema_notification_hub_resource_read(cls, _schema): + if cls._schema_notification_hub_resource_read is not None: + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + return + + cls._schema_notification_hub_resource_read = _schema_notification_hub_resource_read = AAZObjectType() + + notification_hub_resource_read = _schema_notification_hub_resource_read + notification_hub_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.location = AAZStrType() + notification_hub_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + notification_hub_resource_read.sku = AAZObjectType() + notification_hub_resource_read.tags = AAZDictType() + notification_hub_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_notification_hub_resource_read.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = _schema_notification_hub_resource_read.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = _schema_notification_hub_resource_read.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = _schema_notification_hub_resource_read.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = _schema_notification_hub_resource_read.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = _schema_notification_hub_resource_read.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = _schema_notification_hub_resource_read.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = _schema_notification_hub_resource_read.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = _schema_notification_hub_resource_read.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = _schema_notification_hub_resource_read.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = _schema_notification_hub_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_notification_hub_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/__cmd_group.py new file mode 100644 index 00000000000..320513173fd --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/__cmd_group.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub credential for Apple(APNS). + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/__init__.py new file mode 100644 index 00000000000..a6df9f5a835 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/_create.py new file mode 100644 index 00000000000..0e9c541a961 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/_create.py @@ -0,0 +1,575 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class Create(AAZCommand): + """Update credential for Apple(APNS). + + :example: Update APNS certificate + az notification-hub credential apns update --namespace-name my-namespace --notification-hub-name my-hub --apns-certificate "/path/to/certificate" --certificate-key "xxxxxx" --resource-group MyResourceGroup + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01", "properties.apnsCredential"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["-n", "--name", "--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.apns_certificate_org = AAZStrArg( + options=["--apns-certificate-org"], + arg_group="Properties", + help="The APNS certificate. Specify if using Certificate Authentication Mode.", + ) + _args_schema.app_id = AAZStrArg( + options=["--app-id"], + arg_group="Properties", + help="The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from your developer account. Specify if using Token Authentication Mode.", + ) + _args_schema.app_name = AAZStrArg( + options=["--app-name"], + arg_group="Properties", + help="The name of the application or BundleId. Specify if using Token Authentication Mode.", + ) + _args_schema.certificate_key = AAZStrArg( + options=["--certificate-key"], + arg_group="Properties", + help="The APNS certificate password if it exists.", + ) + _args_schema.endpoint = AAZStrArg( + options=["--endpoint"], + arg_group="Properties", + help="The APNS endpoint of this credential. If using Certificate Authentication Mode and Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify 'https://api.push.apple.com:443/3/device'.", + default="gateway.push.apple.com", + ) + _args_schema.key_id = AAZStrArg( + options=["--key-id"], + arg_group="Properties", + help="A 10-character key identifier (kid) key, obtained from your developer account. Specify if using Token Authentication Mode.", + ) + _args_schema.token = AAZStrArg( + options=["--token"], + arg_group="Properties", + help="Provider Authentication Token, obtained through your developer account. Specify if using Token Authentication Mode.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.pre_instance_create() + self.InstanceCreateByJson(ctx=self.ctx)() + self.post_instance_create(self.ctx.selectors.subresource.required()) + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_create(self): + pass + + @register_callback + def post_instance_create(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.apnsCredential + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.apnsCredential = value + return + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceCreateByJson(AAZJsonInstanceCreateOperation): + + def __call__(self, *args, **kwargs): + self.ctx.selectors.subresource.set(self._create_instance()) + + def _create_instance(self): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("apnsCertificate", AAZStrType, ".apns_certificate_org") + properties.set_prop("appId", AAZStrType, ".app_id") + properties.set_prop("appName", AAZStrType, ".app_name") + properties.set_prop("certificateKey", AAZStrType, ".certificate_key") + properties.set_prop("endpoint", AAZStrType, ".endpoint") + properties.set_prop("keyId", AAZStrType, ".key_id") + properties.set_prop("token", AAZStrType, ".token") + + return _instance_value + + +class _CreateHelper: + """Helper class for Create""" + + _schema_notification_hub_resource_read = None + + @classmethod + def _build_schema_notification_hub_resource_read(cls, _schema): + if cls._schema_notification_hub_resource_read is not None: + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + return + + cls._schema_notification_hub_resource_read = _schema_notification_hub_resource_read = AAZObjectType() + + notification_hub_resource_read = _schema_notification_hub_resource_read + notification_hub_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.location = AAZStrType() + notification_hub_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + notification_hub_resource_read.sku = AAZObjectType() + notification_hub_resource_read.tags = AAZDictType() + notification_hub_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_notification_hub_resource_read.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = _schema_notification_hub_resource_read.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = _schema_notification_hub_resource_read.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = _schema_notification_hub_resource_read.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = _schema_notification_hub_resource_read.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = _schema_notification_hub_resource_read.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = _schema_notification_hub_resource_read.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = _schema_notification_hub_resource_read.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = _schema_notification_hub_resource_read.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = _schema_notification_hub_resource_read.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = _schema_notification_hub_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_notification_hub_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/__cmd_group.py new file mode 100644 index 00000000000..fa68b2ab4f3 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/__cmd_group.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub credential for Baidu(Andrioid China). + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/__init__.py new file mode 100644 index 00000000000..a6df9f5a835 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/_create.py new file mode 100644 index 00000000000..3567a75375b --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/_create.py @@ -0,0 +1,541 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class Create(AAZCommand): + """Update credential for Baidu(Andrioid China). + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01", "properties.baiduCredential"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["-n", "--name", "--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.baidu_api_key = AAZStrArg( + options=["--baidu-api-key"], + arg_group="Properties", + help="Baidu Api Key.", + ) + _args_schema.baidu_secret_key = AAZStrArg( + options=["--baidu-secret-key"], + arg_group="Properties", + help="Baidu Secret Key", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.pre_instance_create() + self.InstanceCreateByJson(ctx=self.ctx)() + self.post_instance_create(self.ctx.selectors.subresource.required()) + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_create(self): + pass + + @register_callback + def post_instance_create(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.baiduCredential + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.baiduCredential = value + return + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceCreateByJson(AAZJsonInstanceCreateOperation): + + def __call__(self, *args, **kwargs): + self.ctx.selectors.subresource.set(self._create_instance()) + + def _create_instance(self): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("baiduApiKey", AAZStrType, ".baidu_api_key") + properties.set_prop("baiduSecretKey", AAZStrType, ".baidu_secret_key") + + return _instance_value + + +class _CreateHelper: + """Helper class for Create""" + + _schema_notification_hub_resource_read = None + + @classmethod + def _build_schema_notification_hub_resource_read(cls, _schema): + if cls._schema_notification_hub_resource_read is not None: + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + return + + cls._schema_notification_hub_resource_read = _schema_notification_hub_resource_read = AAZObjectType() + + notification_hub_resource_read = _schema_notification_hub_resource_read + notification_hub_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.location = AAZStrType() + notification_hub_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + notification_hub_resource_read.sku = AAZObjectType() + notification_hub_resource_read.tags = AAZDictType() + notification_hub_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_notification_hub_resource_read.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = _schema_notification_hub_resource_read.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = _schema_notification_hub_resource_read.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = _schema_notification_hub_resource_read.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = _schema_notification_hub_resource_read.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = _schema_notification_hub_resource_read.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = _schema_notification_hub_resource_read.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = _schema_notification_hub_resource_read.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = _schema_notification_hub_resource_read.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = _schema_notification_hub_resource_read.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = _schema_notification_hub_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_notification_hub_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/__cmd_group.py new file mode 100644 index 00000000000..41d8e00ac11 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/__cmd_group.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub credential for Google(GCM/FCM). + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/__init__.py new file mode 100644 index 00000000000..a6df9f5a835 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/_create.py new file mode 100644 index 00000000000..8863b54be1b --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/_create.py @@ -0,0 +1,538 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class Create(AAZCommand): + """Update the Google GCM/FCM API key. + + :example: Update Android push API key + az notification-hub credential gcm update --resource-group groupName --namespace-name spaceName --notification-hub-name hubName --google-api-key keyValue + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01", "properties.gcmCredential"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["-n", "--name", "--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.google_api_key = AAZStrArg( + options=["--google-api-key"], + arg_group="Properties", + help="The Google API key.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.pre_instance_create() + self.InstanceCreateByJson(ctx=self.ctx)() + self.post_instance_create(self.ctx.selectors.subresource.required()) + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_create(self): + pass + + @register_callback + def post_instance_create(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.gcmCredential + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.gcmCredential = value + return + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceCreateByJson(AAZJsonInstanceCreateOperation): + + def __call__(self, *args, **kwargs): + self.ctx.selectors.subresource.set(self._create_instance()) + + def _create_instance(self): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("googleApiKey", AAZStrType, ".google_api_key") + + return _instance_value + + +class _CreateHelper: + """Helper class for Create""" + + _schema_notification_hub_resource_read = None + + @classmethod + def _build_schema_notification_hub_resource_read(cls, _schema): + if cls._schema_notification_hub_resource_read is not None: + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + return + + cls._schema_notification_hub_resource_read = _schema_notification_hub_resource_read = AAZObjectType() + + notification_hub_resource_read = _schema_notification_hub_resource_read + notification_hub_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.location = AAZStrType() + notification_hub_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + notification_hub_resource_read.sku = AAZObjectType() + notification_hub_resource_read.tags = AAZDictType() + notification_hub_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_notification_hub_resource_read.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = _schema_notification_hub_resource_read.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = _schema_notification_hub_resource_read.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = _schema_notification_hub_resource_read.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = _schema_notification_hub_resource_read.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = _schema_notification_hub_resource_read.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = _schema_notification_hub_resource_read.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = _schema_notification_hub_resource_read.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = _schema_notification_hub_resource_read.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = _schema_notification_hub_resource_read.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = _schema_notification_hub_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_notification_hub_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/__cmd_group.py new file mode 100644 index 00000000000..83569c4d57f --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/__cmd_group.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub credential for Windows Phone(MPNS). + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/__init__.py new file mode 100644 index 00000000000..a6df9f5a835 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/_create.py new file mode 100644 index 00000000000..ade63d9aaf6 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/_create.py @@ -0,0 +1,541 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class Create(AAZCommand): + """Update credential for Windows Phone(MPNS). + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01", "properties.mpnsCredential"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["-n", "--name", "--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.certificate_key = AAZStrArg( + options=["--certificate-key"], + arg_group="Properties", + help="The certificate key for this credential.", + ) + _args_schema.mpns_certificate_org = AAZStrArg( + options=["--mpns-certificate-org"], + arg_group="Properties", + help="The MPNS certificate.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.pre_instance_create() + self.InstanceCreateByJson(ctx=self.ctx)() + self.post_instance_create(self.ctx.selectors.subresource.required()) + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_create(self): + pass + + @register_callback + def post_instance_create(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.mpnsCredential + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.mpnsCredential = value + return + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceCreateByJson(AAZJsonInstanceCreateOperation): + + def __call__(self, *args, **kwargs): + self.ctx.selectors.subresource.set(self._create_instance()) + + def _create_instance(self): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("certificateKey", AAZStrType, ".certificate_key") + properties.set_prop("mpnsCertificate", AAZStrType, ".mpns_certificate_org") + + return _instance_value + + +class _CreateHelper: + """Helper class for Create""" + + _schema_notification_hub_resource_read = None + + @classmethod + def _build_schema_notification_hub_resource_read(cls, _schema): + if cls._schema_notification_hub_resource_read is not None: + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + return + + cls._schema_notification_hub_resource_read = _schema_notification_hub_resource_read = AAZObjectType() + + notification_hub_resource_read = _schema_notification_hub_resource_read + notification_hub_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.location = AAZStrType() + notification_hub_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + notification_hub_resource_read.sku = AAZObjectType() + notification_hub_resource_read.tags = AAZDictType() + notification_hub_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_notification_hub_resource_read.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = _schema_notification_hub_resource_read.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = _schema_notification_hub_resource_read.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = _schema_notification_hub_resource_read.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = _schema_notification_hub_resource_read.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = _schema_notification_hub_resource_read.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = _schema_notification_hub_resource_read.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = _schema_notification_hub_resource_read.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = _schema_notification_hub_resource_read.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = _schema_notification_hub_resource_read.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = _schema_notification_hub_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_notification_hub_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/__cmd_group.py new file mode 100644 index 00000000000..5037cd17f20 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/__cmd_group.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub credential for Windows(WNS). + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/__init__.py new file mode 100644 index 00000000000..a6df9f5a835 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/_create.py new file mode 100644 index 00000000000..c117a7dbe13 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/_create.py @@ -0,0 +1,541 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +class Create(AAZCommand): + """Update credential for Windows(WNS). + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/notificationhubs/{}", "2017-04-01", "properties.wnsCredential"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self.SubresourceSelector(ctx=self.ctx, name="subresource") + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.notification_hub_name = AAZStrArg( + options=["-n", "--name", "--notification-hub-name"], + help="The notification hub name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.package_sid = AAZStrArg( + options=["--package-sid"], + arg_group="Properties", + help="The package ID for this credential.", + ) + _args_schema.secret_key = AAZStrArg( + options=["--secret-key"], + arg_group="Properties", + help="The secret key.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NotificationHubsGet(ctx=self.ctx)() + self.pre_instance_create() + self.InstanceCreateByJson(ctx=self.ctx)() + self.post_instance_create(self.ctx.selectors.subresource.required()) + self.NotificationHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_create(self): + pass + + @register_callback + def post_instance_create(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) + return result + + class SubresourceSelector(AAZJsonSelector): + + def _get(self): + result = self.ctx.vars.instance + return result.properties.wnsCredential + + def _set(self, value): + result = self.ctx.vars.instance + result.properties.wnsCredential = value + return + + class NotificationHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NotificationHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "notificationHubName", self.ctx.args.notification_hub_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _CreateHelper._build_schema_notification_hub_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceCreateByJson(AAZJsonInstanceCreateOperation): + + def __call__(self, *args, **kwargs): + self.ctx.selectors.subresource.set(self._create_instance()) + + def _create_instance(self): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("packageSid", AAZStrType, ".package_sid") + properties.set_prop("secretKey", AAZStrType, ".secret_key") + + return _instance_value + + +class _CreateHelper: + """Helper class for Create""" + + _schema_notification_hub_resource_read = None + + @classmethod + def _build_schema_notification_hub_resource_read(cls, _schema): + if cls._schema_notification_hub_resource_read is not None: + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + return + + cls._schema_notification_hub_resource_read = _schema_notification_hub_resource_read = AAZObjectType() + + notification_hub_resource_read = _schema_notification_hub_resource_read + notification_hub_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.location = AAZStrType() + notification_hub_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + notification_hub_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + notification_hub_resource_read.sku = AAZObjectType() + notification_hub_resource_read.tags = AAZDictType() + notification_hub_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_notification_hub_resource_read.properties + properties.adm_credential = AAZObjectType( + serialized_name="admCredential", + ) + properties.apns_credential = AAZObjectType( + serialized_name="apnsCredential", + ) + properties.authorization_rules = AAZListType( + serialized_name="authorizationRules", + ) + properties.baidu_credential = AAZObjectType( + serialized_name="baiduCredential", + ) + properties.gcm_credential = AAZObjectType( + serialized_name="gcmCredential", + ) + properties.mpns_credential = AAZObjectType( + serialized_name="mpnsCredential", + ) + properties.name = AAZStrType() + properties.registration_ttl = AAZStrType( + serialized_name="registrationTtl", + ) + properties.wns_credential = AAZObjectType( + serialized_name="wnsCredential", + ) + + adm_credential = _schema_notification_hub_resource_read.properties.adm_credential + adm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.adm_credential.properties + properties.auth_token_url = AAZStrType( + serialized_name="authTokenUrl", + ) + properties.client_id = AAZStrType( + serialized_name="clientId", + ) + properties.client_secret = AAZStrType( + serialized_name="clientSecret", + ) + + apns_credential = _schema_notification_hub_resource_read.properties.apns_credential + apns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.apns_credential.properties + properties.apns_certificate = AAZStrType( + serialized_name="apnsCertificate", + ) + properties.app_id = AAZStrType( + serialized_name="appId", + ) + properties.app_name = AAZStrType( + serialized_name="appName", + ) + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.endpoint = AAZStrType() + properties.key_id = AAZStrType( + serialized_name="keyId", + ) + properties.thumbprint = AAZStrType() + properties.token = AAZStrType() + + authorization_rules = _schema_notification_hub_resource_read.properties.authorization_rules + authorization_rules.Element = AAZObjectType() + + _element = _schema_notification_hub_resource_read.properties.authorization_rules.Element + _element.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + _element.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + _element.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + _element.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + _element.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + _element.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _element.revision = AAZIntType( + flags={"read_only": True}, + ) + _element.rights = AAZListType() + _element.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = _schema_notification_hub_resource_read.properties.authorization_rules.Element.rights + rights.Element = AAZStrType() + + baidu_credential = _schema_notification_hub_resource_read.properties.baidu_credential + baidu_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.baidu_credential.properties + properties.baidu_api_key = AAZStrType( + serialized_name="baiduApiKey", + ) + properties.baidu_end_point = AAZStrType( + serialized_name="baiduEndPoint", + ) + properties.baidu_secret_key = AAZStrType( + serialized_name="baiduSecretKey", + ) + + gcm_credential = _schema_notification_hub_resource_read.properties.gcm_credential + gcm_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.gcm_credential.properties + properties.gcm_endpoint = AAZStrType( + serialized_name="gcmEndpoint", + ) + properties.google_api_key = AAZStrType( + serialized_name="googleApiKey", + ) + + mpns_credential = _schema_notification_hub_resource_read.properties.mpns_credential + mpns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.mpns_credential.properties + properties.certificate_key = AAZStrType( + serialized_name="certificateKey", + ) + properties.mpns_certificate = AAZStrType( + serialized_name="mpnsCertificate", + ) + properties.thumbprint = AAZStrType() + + wns_credential = _schema_notification_hub_resource_read.properties.wns_credential + wns_credential.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + + properties = _schema_notification_hub_resource_read.properties.wns_credential.properties + properties.package_sid = AAZStrType( + serialized_name="packageSid", + ) + properties.secret_key = AAZStrType( + serialized_name="secretKey", + ) + properties.windows_live_endpoint = AAZStrType( + serialized_name="windowsLiveEndpoint", + ) + + sku = _schema_notification_hub_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_notification_hub_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_notification_hub_resource_read.id + _schema.location = cls._schema_notification_hub_resource_read.location + _schema.name = cls._schema_notification_hub_resource_read.name + _schema.properties = cls._schema_notification_hub_resource_read.properties + _schema.sku = cls._schema_notification_hub_resource_read.sku + _schema.tags = cls._schema_notification_hub_resource_read.tags + _schema.type = cls._schema_notification_hub_resource_read.type + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/__cmd_group.py new file mode 100644 index 00000000000..aa98a9f5baf --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "notification-hub namespace", + is_experimental=True, +) +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hub namespace. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/__init__.py new file mode 100644 index 00000000000..91fe3c40f58 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/__init__.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._check_availability import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_check_availability.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_check_availability.py new file mode 100644 index 00000000000..2ca087be822 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_check_availability.py @@ -0,0 +1,197 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace check-availability", + is_experimental=True, +) +class CheckAvailability(AAZCommand): + """Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name. + + :example: Check name availability of namespace + az notification-hub namespace check-availability --name "my-test-space" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.notificationhubs/checknamespaceavailability", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + arg_group="Parameters", + help="Resource name", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesCheckAvailability(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesCheckAvailability(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.is_availiable = AAZBoolType( + serialized_name="isAvailiable", + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _CheckAvailabilityHelper: + """Helper class for CheckAvailability""" + + +__all__ = ["CheckAvailability"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_create.py new file mode 100644 index 00000000000..2dab0bb59ee --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_create.py @@ -0,0 +1,287 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace create", + is_experimental=True, +) +class Create(AAZCommand): + """Create a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + + :example: Create a namespace + az notification-hub namespace create --resource-group MyResourceGroup --name my-namespace --location "South Central US" --sku Standard + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The namespace name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + # define Arg Group "Sku" + + _args_schema = cls._args_schema + _args_schema.sku = AAZStrArg( + options=["--sku"], + arg_group="Sku", + help="Name of the notification hub sku", + enum={"Basic": "Basic", "Free": "Free", "Standard": "Standard"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("sku", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("name", AAZStrType, ".name") + + sku = _builder.get(".sku") + if sku is not None: + sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.created_at = AAZStrType( + serialized_name="createdAt", + ) + properties.critical = AAZBoolType() + properties.data_center = AAZStrType( + serialized_name="dataCenter", + ) + properties.enabled = AAZBoolType() + properties.metric_id = AAZStrType( + serialized_name="metricId", + flags={"read_only": True}, + ) + properties.name = AAZStrType() + properties.namespace_type = AAZStrType( + serialized_name="namespaceType", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + ) + properties.region = AAZStrType() + properties.scale_unit = AAZStrType( + serialized_name="scaleUnit", + ) + properties.service_bus_endpoint = AAZStrType( + serialized_name="serviceBusEndpoint", + ) + properties.status = AAZStrType() + properties.subscription_id = AAZStrType( + serialized_name="subscriptionId", + ) + properties.updated_at = AAZStrType( + serialized_name="updatedAt", + ) + + sku = cls._schema_on_200_201.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_delete.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_delete.py new file mode 100644 index 00000000000..241d37d53e2 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_delete.py @@ -0,0 +1,164 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace delete", + is_experimental=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an existing namespace. This operation also removes all associated notificationHubs under the namespace. + + :example: Delete the namespace + az notification-hub namespace delete --resource-group MyResourceGroup --name my-namespace + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}", "2017-04-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.NamespacesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class NamespacesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_list.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_list.py new file mode 100644 index 00000000000..6e40fa5ac64 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_list.py @@ -0,0 +1,382 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace list", + is_experimental=True, +) +class List(AAZCommand): + """List available namespaces. + + :example: List available namespaces within a resource group + az notification-hub namespace list --resource-group MyResourceGroup + + :example: List all the available namespaces within the subscription irrespective of the resource groups + az notification-hub namespace list + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.notificationhubs/namespaces", "2017-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces", "2017-04-01"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + if condition_0: + self.NamespacesList(ctx=self.ctx)() + if condition_1: + self.NamespacesListAll(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class NamespacesList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.created_at = AAZStrType( + serialized_name="createdAt", + ) + properties.critical = AAZBoolType() + properties.data_center = AAZStrType( + serialized_name="dataCenter", + ) + properties.enabled = AAZBoolType() + properties.metric_id = AAZStrType( + serialized_name="metricId", + flags={"read_only": True}, + ) + properties.name = AAZStrType() + properties.namespace_type = AAZStrType( + serialized_name="namespaceType", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + ) + properties.region = AAZStrType() + properties.scale_unit = AAZStrType( + serialized_name="scaleUnit", + ) + properties.service_bus_endpoint = AAZStrType( + serialized_name="serviceBusEndpoint", + ) + properties.status = AAZStrType() + properties.subscription_id = AAZStrType( + serialized_name="subscriptionId", + ) + properties.updated_at = AAZStrType( + serialized_name="updatedAt", + ) + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class NamespacesListAll(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.created_at = AAZStrType( + serialized_name="createdAt", + ) + properties.critical = AAZBoolType() + properties.data_center = AAZStrType( + serialized_name="dataCenter", + ) + properties.enabled = AAZBoolType() + properties.metric_id = AAZStrType( + serialized_name="metricId", + flags={"read_only": True}, + ) + properties.name = AAZStrType() + properties.namespace_type = AAZStrType( + serialized_name="namespaceType", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + ) + properties.region = AAZStrType() + properties.scale_unit = AAZStrType( + serialized_name="scaleUnit", + ) + properties.service_bus_endpoint = AAZStrType( + serialized_name="serviceBusEndpoint", + ) + properties.status = AAZStrType() + properties.subscription_id = AAZStrType( + serialized_name="subscriptionId", + ) + properties.updated_at = AAZStrType( + serialized_name="updatedAt", + ) + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_show.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_show.py new file mode 100644 index 00000000000..cba1b0dc058 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_show.py @@ -0,0 +1,227 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace show", + is_experimental=True, +) +class Show(AAZCommand): + """Return the description for the specified namespace. + + :example: Show namespace info + az notification-hub namespace show --resource-group MyResourceGroup --name my-namespace + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.created_at = AAZStrType( + serialized_name="createdAt", + ) + properties.critical = AAZBoolType() + properties.data_center = AAZStrType( + serialized_name="dataCenter", + ) + properties.enabled = AAZBoolType() + properties.metric_id = AAZStrType( + serialized_name="metricId", + flags={"read_only": True}, + ) + properties.name = AAZStrType() + properties.namespace_type = AAZStrType( + serialized_name="namespaceType", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + ) + properties.region = AAZStrType() + properties.scale_unit = AAZStrType( + serialized_name="scaleUnit", + ) + properties.service_bus_endpoint = AAZStrType( + serialized_name="serviceBusEndpoint", + ) + properties.status = AAZStrType() + properties.subscription_id = AAZStrType( + serialized_name="subscriptionId", + ) + properties.updated_at = AAZStrType( + serialized_name="updatedAt", + ) + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_update.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_update.py new file mode 100644 index 00000000000..ba18d36e988 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_update.py @@ -0,0 +1,434 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace update", + is_experimental=True, +) +class Update(AAZCommand): + """Update a service namespace. The namespace's resource manifest is immutable and cannot be modified. + + :example: Update the namespace + az notification-hub namespace update --resource-group MyResourceGroup --name my-namespace --sku Standard + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}", "2017-04-01"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + # define Arg Group "Sku" + + _args_schema = cls._args_schema + _args_schema.sku = AAZStrArg( + options=["--sku"], + arg_group="Sku", + help="Name of the notification hub sku", + enum={"Basic": "Basic", "Free": "Free", "Standard": "Standard"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.NamespacesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_namespace_resource_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NamespacesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_namespace_resource_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("sku", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("name", AAZStrType, ".name") + + sku = _builder.get(".sku") + if sku is not None: + sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_namespace_resource_read = None + + @classmethod + def _build_schema_namespace_resource_read(cls, _schema): + if cls._schema_namespace_resource_read is not None: + _schema.id = cls._schema_namespace_resource_read.id + _schema.location = cls._schema_namespace_resource_read.location + _schema.name = cls._schema_namespace_resource_read.name + _schema.properties = cls._schema_namespace_resource_read.properties + _schema.sku = cls._schema_namespace_resource_read.sku + _schema.tags = cls._schema_namespace_resource_read.tags + _schema.type = cls._schema_namespace_resource_read.type + return + + cls._schema_namespace_resource_read = _schema_namespace_resource_read = AAZObjectType() + + namespace_resource_read = _schema_namespace_resource_read + namespace_resource_read.id = AAZStrType( + flags={"read_only": True}, + ) + namespace_resource_read.location = AAZStrType() + namespace_resource_read.name = AAZStrType( + flags={"read_only": True}, + ) + namespace_resource_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + namespace_resource_read.sku = AAZObjectType() + namespace_resource_read.tags = AAZDictType() + namespace_resource_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_namespace_resource_read.properties + properties.created_at = AAZStrType( + serialized_name="createdAt", + ) + properties.critical = AAZBoolType() + properties.data_center = AAZStrType( + serialized_name="dataCenter", + ) + properties.enabled = AAZBoolType() + properties.metric_id = AAZStrType( + serialized_name="metricId", + flags={"read_only": True}, + ) + properties.name = AAZStrType() + properties.namespace_type = AAZStrType( + serialized_name="namespaceType", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + ) + properties.region = AAZStrType() + properties.scale_unit = AAZStrType( + serialized_name="scaleUnit", + ) + properties.service_bus_endpoint = AAZStrType( + serialized_name="serviceBusEndpoint", + ) + properties.status = AAZStrType() + properties.subscription_id = AAZStrType( + serialized_name="subscriptionId", + ) + properties.updated_at = AAZStrType( + serialized_name="updatedAt", + ) + + sku = _schema_namespace_resource_read.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = _schema_namespace_resource_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_namespace_resource_read.id + _schema.location = cls._schema_namespace_resource_read.location + _schema.name = cls._schema_namespace_resource_read.name + _schema.properties = cls._schema_namespace_resource_read.properties + _schema.sku = cls._schema_namespace_resource_read.sku + _schema.tags = cls._schema_namespace_resource_read.tags + _schema.type = cls._schema_namespace_resource_read.type + + +__all__ = ["Update"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_wait.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_wait.py new file mode 100644 index 00000000000..eb0edaff3f4 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_wait.py @@ -0,0 +1,222 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class NamespacesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.created_at = AAZStrType( + serialized_name="createdAt", + ) + properties.critical = AAZBoolType() + properties.data_center = AAZStrType( + serialized_name="dataCenter", + ) + properties.enabled = AAZBoolType() + properties.metric_id = AAZStrType( + serialized_name="metricId", + flags={"read_only": True}, + ) + properties.name = AAZStrType() + properties.namespace_type = AAZStrType( + serialized_name="namespaceType", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + ) + properties.region = AAZStrType() + properties.scale_unit = AAZStrType( + serialized_name="scaleUnit", + ) + properties.service_bus_endpoint = AAZStrType( + serialized_name="serviceBusEndpoint", + ) + properties.status = AAZStrType() + properties.subscription_id = AAZStrType( + serialized_name="subscriptionId", + ) + properties.updated_at = AAZStrType( + serialized_name="updatedAt", + ) + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/__cmd_group.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/__cmd_group.py new file mode 100644 index 00000000000..75fbdfab5de --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "notification-hub namespace authorization-rule", + is_experimental=True, +) +class __CMDGroup(AAZCommandGroup): + """Commands to manage notification hubs namespace authorization rule. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/__init__.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/__init__.py new file mode 100644 index 00000000000..d6e1d6e7896 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._list_keys import * +from ._regenerate_keys import * +from ._show import * diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_create.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_create.py new file mode 100644 index 00000000000..57f19f151f8 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_create.py @@ -0,0 +1,273 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace authorization-rule create", + is_experimental=True, +) +class Create(AAZCommand): + """Create an authorization rule for a namespace. + + :example: Create a namespace authorization rule + az notification-hub namespace authorization-rule create --resource-group MyResourceGroup --namespace-name my-namespace --name "sdk-AuthRules-1788" --rights Listen Send + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/authorizationrules/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Authorization Rule Name.", + required=True, + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.rights = AAZListArg( + options=["--rights"], + arg_group="Properties", + help="The rights associated with the rule.", + ) + + rights = cls._args_schema.rights + rights.Element = AAZStrArg( + enum={"Listen": "Listen", "Manage": "Manage", "Send": "Send"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesCreateOrUpdateAuthorizationRule(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesCreateOrUpdateAuthorizationRule(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("rights", AAZListType, ".rights") + + rights = _builder.get(".properties.rights") + if rights is not None: + rights.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + properties.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + properties.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + properties.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + properties.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + properties.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + properties.revision = AAZIntType( + flags={"read_only": True}, + ) + properties.rights = AAZListType() + properties.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.properties.rights + rights.Element = AAZStrType() + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_delete.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_delete.py new file mode 100644 index 00000000000..8807048970d --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_delete.py @@ -0,0 +1,150 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace authorization-rule delete", + is_experimental=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a namespace authorization rule. + + :example: Delete a namespace authorization rule + az notification-hub namespace authorization-rule delete --resource-group MyResourceGroup --namespace-name my-namespace --name "RootManageSharedAccessKey" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/authorizationrules/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Authorization Rule Name.", + required=True, + id_part="child_name_1", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesDeleteAuthorizationRule(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class NamespacesDeleteAuthorizationRule(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list.py new file mode 100644 index 00000000000..1e2dc20f3fa --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list.py @@ -0,0 +1,239 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace authorization-rule list", + is_experimental=True, +) +class List(AAZCommand): + """List the authorization rules for a namespace. + + :example: List authorization rules of the namespace + az notification-hub namespace authorization-rule list --resource-group MyResourceGroup --namespace-name my-namespace + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/authorizationrules", "2017-04-01"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesListAuthorizationRules(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class NamespacesListAuthorizationRules(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + properties.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + properties.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + properties.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + properties.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + properties.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + properties.revision = AAZIntType( + flags={"read_only": True}, + ) + properties.rights = AAZListType() + properties.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.value.Element.properties.rights + rights.Element = AAZStrType() + + sku = cls._schema_on_200.value.Element.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list_keys.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list_keys.py new file mode 100644 index 00000000000..f87a4b325ed --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list_keys.py @@ -0,0 +1,190 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace authorization-rule list-keys", + is_experimental=True, +) +class ListKeys(AAZCommand): + """List the primary and secondary connection strings to the namespace. + + :example: List keys of the namesapce authorization rule + az notification-hub namespace authorization-rule list-keys --resource-group MyResourceGroup --namespace-name my-namespace --name "RootManageSharedAccessKey" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/authorizationrules/{}/listkeys", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The connection string of the namespace for the specified authorizationRule.", + required=True, + id_part="child_name_1", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesListKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesListKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.key_name = AAZStrType( + serialized_name="keyName", + ) + _schema_on_200.primary_connection_string = AAZStrType( + serialized_name="primaryConnectionString", + ) + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + ) + _schema_on_200.secondary_connection_string = AAZStrType( + serialized_name="secondaryConnectionString", + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + ) + + return cls._schema_on_200 + + +class _ListKeysHelper: + """Helper class for ListKeys""" + + +__all__ = ["ListKeys"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_regenerate_keys.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_regenerate_keys.py new file mode 100644 index 00000000000..535a812b492 --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_regenerate_keys.py @@ -0,0 +1,213 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace authorization-rule regenerate-keys", + is_experimental=True, +) +class RegenerateKeys(AAZCommand): + """Regenerate the primary/secondary keys to the namespace authorization rule. + + :example: Regenerate keys of the namesapce authorization rule + az notification-hub namespace authorization-rule regenerate-keys --resource-group MyResourceGroup --namespace-name my-namespace --name "RootManageSharedAccessKey" --policy-key "Secondary Key" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/authorizationrules/{}/regeneratekeys", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The connection string of the namespace for the specified authorizationRule.", + required=True, + id_part="child_name_1", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.policy_key = AAZStrArg( + options=["--policy-key"], + arg_group="Parameters", + help="Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesRegenerateKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesRegenerateKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("policyKey", AAZStrType, ".policy_key") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.key_name = AAZStrType( + serialized_name="keyName", + ) + _schema_on_200.primary_connection_string = AAZStrType( + serialized_name="primaryConnectionString", + ) + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + ) + _schema_on_200.secondary_connection_string = AAZStrType( + serialized_name="secondaryConnectionString", + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + ) + + return cls._schema_on_200 + + +class _RegenerateKeysHelper: + """Helper class for RegenerateKeys""" + + +__all__ = ["RegenerateKeys"] diff --git a/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_show.py b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_show.py new file mode 100644 index 00000000000..7861ce5d0aa --- /dev/null +++ b/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_show.py @@ -0,0 +1,239 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "notification-hub namespace authorization-rule show", + is_experimental=True, +) +class Show(AAZCommand): + """Get an authorization rule for a namespace by name. + + :example: Show namespace authorization rule info + az notification-hub namespace authorization-rule show --resource-group MyResourceGroup --namespace-name my-namespace --name "RootManageSharedAccessKey" + """ + + _aaz_info = { + "version": "2017-04-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.notificationhubs/namespaces/{}/authorizationrules/{}", "2017-04-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Authorization Rule Name.", + required=True, + id_part="child_name_1", + ) + _args_schema.namespace_name = AAZStrArg( + options=["--namespace-name"], + help="The namespace name", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesGetAuthorizationRule(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesGetAuthorizationRule(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "authorizationRuleName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2017-04-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.claim_type = AAZStrType( + serialized_name="claimType", + flags={"read_only": True}, + ) + properties.claim_value = AAZStrType( + serialized_name="claimValue", + flags={"read_only": True}, + ) + properties.created_time = AAZStrType( + serialized_name="createdTime", + flags={"read_only": True}, + ) + properties.key_name = AAZStrType( + serialized_name="keyName", + flags={"read_only": True}, + ) + properties.modified_time = AAZStrType( + serialized_name="modifiedTime", + flags={"read_only": True}, + ) + properties.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + properties.revision = AAZIntType( + flags={"read_only": True}, + ) + properties.rights = AAZListType() + properties.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + rights = cls._schema_on_200.properties.rights + rights.Element = AAZStrType() + + sku = cls._schema_on_200.sku + sku.capacity = AAZIntType() + sku.family = AAZStrType() + sku.name = AAZStrType( + flags={"required": True}, + ) + sku.size = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/notification-hub/azext_notification_hub/azext_metadata.json b/src/notification-hub/azext_notification_hub/azext_metadata.json index 5bed66c74e7..f6f49495c1b 100644 --- a/src/notification-hub/azext_notification_hub/azext_metadata.json +++ b/src/notification-hub/azext_notification_hub/azext_metadata.json @@ -1,3 +1,3 @@ { - "azext.minCliCoreVersion": "2.3.1" -} + "azext.minCliCoreVersion": "2.49.0" +} \ No newline at end of file diff --git a/src/notification-hub/azext_notification_hub/commands.py b/src/notification-hub/azext_notification_hub/commands.py index cf26b5814b5..7a2d87bddf0 100644 --- a/src/notification-hub/azext_notification_hub/commands.py +++ b/src/notification-hub/azext_notification_hub/commands.py @@ -7,59 +7,42 @@ # pylint: disable=too-many-lines # pylint: disable=too-many-statements # pylint: disable=too-many-locals -from azure.cli.core.commands import CliCommandType -from ._validators import validate_notification_message def load_command_table(self, _): - - from ._client_factory import cf_namespaces - notificationhubs_namespaces = CliCommandType( - operations_tmpl='azext_notification_hub.vendored_sdks.notificationhubs.operations.namespaces_operations#NamespacesOperations.{}', - client_factory=cf_namespaces) - with self.command_group('notification-hub namespace', notificationhubs_namespaces, client_factory=cf_namespaces) as g: - g.custom_command('create', 'create_notificationhubs_namespace') - g.custom_command('update', 'update_notificationhubs_namespace') - g.custom_command('delete', 'delete_notificationhubs_namespace', supports_no_wait=True, confirmation='Are you sure to delete this namespace and all its hubs?') - g.custom_show_command('show', 'get_notificationhubs_namespace') - g.custom_command('list', 'list_notificationhubs_namespace') - g.custom_command('check-availability', 'check_availability_notificationhubs_namespace') - g.wait_command('wait') - - with self.command_group('notification-hub namespace authorization-rule', notificationhubs_namespaces, client_factory=cf_namespaces) as g: - g.custom_show_command('show', 'get_authorization_rule_notificationhubs_namespace') - g.custom_command('list', 'list_authorization_rules_notificationhubs_namespace') - g.custom_command('create', 'create_or_update_authorization_rule_notificationhubs_namespace') - g.custom_command('delete', 'delete_authorization_rule_notificationhubs_namespace', confirmation=True) - g.custom_command('list-keys', 'list_keys_notificationhubs_namespace') - g.custom_command('regenerate-keys', 'regenerate_keys_notificationhubs_namespace') + with self.command_group('notification-hub'): + from azext_notification_hub.custom import NotificationHubCreate, NotificationHubUpdate + self.command_table['notification-hub create'] = NotificationHubCreate(loader=self) + self.command_table['notification-hub update'] = NotificationHubUpdate(loader=self) + + with self.command_group('notification-hub authorization-rule'): + from azext_notification_hub.custom import RuleRegenerateKeys + self.command_table['notification-hub authorization-rule regenerate-keys'] = RuleRegenerateKeys(loader=self) + + with self.command_group('notification-hub namespace'): + from azext_notification_hub.custom import NamespaceCreate + self.command_table['notification-hub namespace create'] = NamespaceCreate(loader=self) + + with self.command_group('notification-hub namespace authorization-rule'): + from azext_notification_hub.custom import NamespaceRuleCreate, NamespaceRuleRegenerateKeys + self.command_table['notification-hub namespace authorization-rule create'] = NamespaceRuleCreate(loader=self) + self.command_table['notification-hub namespace authorization-rule regenerate-keys'] = NamespaceRuleRegenerateKeys(loader=self) + + with self.command_group('notification-hub credential'): + from azext_notification_hub.custom import BaiduUpdate, ApnsUpdate, MpnsUpdate, AdmUpdate, WnsUpdate, GcmUpdate + self.command_table['notification-hub credential gcm update'] = GcmUpdate(loader=self) + self.command_table['notification-hub credential adm update'] = AdmUpdate(loader=self) + self.command_table['notification-hub credential apns update'] = ApnsUpdate(loader=self) + self.command_table['notification-hub credential wns update'] = WnsUpdate(loader=self) + self.command_table['notification-hub credential mpns update'] = MpnsUpdate(loader=self) + self.command_table['notification-hub credential baidu update'] = BaiduUpdate(loader=self) from ._client_factory import cf_notification_hubs + from ._validators import validate_notification_message + from azure.cli.core.commands import CliCommandType notificationhubs_notification_hubs = CliCommandType( operations_tmpl='azext_notification_hub.vendored_sdks.notificationhubs.operations.notification_hubs_operations#NotificationHubsOperations.{}', client_factory=cf_notification_hubs) - with self.command_group('notification-hub', notificationhubs_notification_hubs, client_factory=cf_notification_hubs, is_experimental=True) as g: - g.custom_command('create', 'create_notificationhubs_hub') - g.custom_command('update', 'update_notificationhubs_hub') - g.custom_command('delete', 'delete_notificationhubs_hub', confirmation=True) - g.custom_show_command('show', 'get_notificationhubs_hub') - g.custom_command('list', 'list_notificationhubs_hub') - g.custom_command('check-availability', 'check_notification_hub_availability_notificationhubs_hub') + with self.command_group('notification-hub', notificationhubs_notification_hubs, client_factory=cf_notification_hubs, + is_experimental=True) as g: g.custom_command('test-send', 'debug_send_notificationhubs_hub', validator=validate_notification_message) - - with self.command_group('notification-hub authorization-rule', notificationhubs_notification_hubs, client_factory=cf_notification_hubs) as g: - g.custom_command('list', 'list_authorization_rules_notificationhubs_hub') - g.custom_show_command('show', 'get_authorization_rule_notificationhubs_hub') - g.custom_command('create', 'create_or_update_authorization_rule_notificationhubs_hub') - g.custom_command('delete', 'delete_authorization_rule_notificationhubs_hub') - g.custom_command('list-keys', 'list_keys_notificationhubs_hub') - g.custom_command('regenerate-keys', 'regenerate_keys_notificationhubs_hub') - - with self.command_group('notification-hub credential', notificationhubs_notification_hubs, client_factory=cf_notification_hubs) as g: - g.custom_command('list', 'get_pns_credentials_notificationhubs_hub') - g.custom_command('gcm update', 'update_gcm_credential') - g.custom_command('apns update', 'update_apns_credential') - g.custom_command('wns update', 'update_wns_credential') - g.custom_command('mpns update', 'update_mpns_credential') - g.custom_command('adm update', 'update_adm_credential') - g.custom_command('baidu update', 'update_baidu_credential') diff --git a/src/notification-hub/azext_notification_hub/custom.py b/src/notification-hub/azext_notification_hub/custom.py index e21beca0370..eebb5308910 100644 --- a/src/notification-hub/azext_notification_hub/custom.py +++ b/src/notification-hub/azext_notification_hub/custom.py @@ -7,205 +7,208 @@ # pylint: disable=too-many-lines # pylint: disable=too-many-locals # pylint: disable=unused-argument - -from azure.cli.core.util import sdk_no_wait - - -DEFAULT_APNS_ENDPOINT = "gateway.push.apple.com" - - -def create_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - sku_name, - location=None, - tags=None): - from knack.util import CLIError - check_result = client.check_availability(parameters={"name": namespace_name}) - if check_result and not check_result.is_availiable: # misspell inherited from swagger - raise CLIError("A Notification Hub Namespace with the name: {} already exists.".format(namespace_name)) - body = {} - body['location'] = location # str - body['tags'] = tags # dictionary - body.setdefault('sku', {})['name'] = sku_name # str - return client.create_or_update(resource_group_name=resource_group_name, - namespace_name=namespace_name, - parameters=body) - - -def update_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - tags=None, - sku_name=None): - body = client.get(resource_group_name=resource_group_name, namespace_name=namespace_name).as_dict() - if tags is not None: - body['tags'] = tags # dictionary - if sku_name is not None: - body.setdefault('sku', {})['name'] = sku_name # str - return client.create_or_update(resource_group_name=resource_group_name, namespace_name=namespace_name, parameters=body) - - -def delete_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - no_wait=False): - return sdk_no_wait(no_wait, client.delete, resource_group_name=resource_group_name, namespace_name=namespace_name) - - -def get_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name): - return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name) - - -def list_notificationhubs_namespace(cmd, client, - resource_group_name=None): - if resource_group_name: - return client.list(resource_group_name=resource_group_name) - return client.list_all() - - -def check_availability_notificationhubs_namespace(cmd, client, name): - body = {"name": name} - return client.check_availability(parameters=body) - - -def list_keys_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - rule_name): - return client.list_keys(resource_group_name=resource_group_name, namespace_name=namespace_name, authorization_rule_name=rule_name) - - -def regenerate_keys_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - rule_name, - policy_key): - return client.regenerate_keys(resource_group_name=resource_group_name, namespace_name=namespace_name, authorization_rule_name=rule_name, policy_key=policy_key) - - -def get_authorization_rule_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - rule_name): - return client.get_authorization_rule(resource_group_name=resource_group_name, namespace_name=namespace_name, authorization_rule_name=rule_name) - - -def list_authorization_rules_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name): - return client.list_authorization_rules(resource_group_name=resource_group_name, namespace_name=namespace_name) - - -def create_or_update_authorization_rule_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - rule_name, - rights): - body = {} - body['rights'] = rights - return client.create_or_update_authorization_rule(resource_group_name=resource_group_name, namespace_name=namespace_name, authorization_rule_name=rule_name, properties=body) - - -def delete_authorization_rule_notificationhubs_namespace(cmd, client, - resource_group_name, - namespace_name, - rule_name): - return client.delete_authorization_rule(resource_group_name=resource_group_name, namespace_name=namespace_name, authorization_rule_name=rule_name) - - -def create_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - location, - tags=None, - registration_ttl=None): - from knack.util import CLIError - check_result = client.check_notification_hub_availability(resource_group_name=resource_group_name, - namespace_name=namespace_name, - parameters={"name": notification_hub_name}) - if check_result and not check_result.is_availiable: # misspell inherited from swagger - raise CLIError("A Notification Hub with the name: {} already exists in {}.".format(notification_hub_name, namespace_name)) - - body = {} - body['location'] = location # str - body['tags'] = tags # dictionary - - # sku is actually a property of namespace, current service ignores it. The swagger added it as required in notification hub(a bug?). - # Here we fetch the sku from the namespace. - from ._client_factory import cf_namespaces - namespace_client = cf_namespaces(cmd.cli_ctx) - namespace = namespace_client.get(resource_group_name=resource_group_name, namespace_name=namespace_name) - body.setdefault('sku', {})['name'] = namespace.sku.name - - body['registration_ttl'] = registration_ttl # str - return client.create_or_update(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) - - -def update_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - tags=None): - body = client.get(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name).as_dict() - if tags is not None: - body['tags'] = tags # dictionary - return client.create_or_update(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) - - -def delete_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name): - return client.delete(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name) - - -def get_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name): - return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name) - - -def list_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name): - return client.list(resource_group_name=resource_group_name, namespace_name=namespace_name) - - -def check_notification_hub_availability_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name): - body = {"name": notification_hub_name} - return client.check_notification_hub_availability(resource_group_name=resource_group_name, namespace_name=namespace_name, parameters=body) - - -def regenerate_keys_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - rule_name, - policy_key): - return client.regenerate_keys(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, authorization_rule_name=rule_name, policy_key=policy_key) - - -def get_pns_credentials_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name): - return client.get_pns_credentials(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name) - - -def list_keys_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - rule_name): - return client.list_keys(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, authorization_rule_name=rule_name) +# pylint: disable=protected-access, consider-using-f-string + +from azure.cli.core.aaz import has_value, register_command +from azext_notification_hub.aaz.latest.notification_hub import Create as _CreateNotificationHub +from azext_notification_hub.aaz.latest.notification_hub import Update as _UpdateNotificationHub +from azext_notification_hub.aaz.latest.notification_hub.credential.apns import Create as _ApnsUpdate +from azext_notification_hub.aaz.latest.notification_hub.credential.mpns import Create as _MpnsUpdate +from azext_notification_hub.aaz.latest.notification_hub.credential.baidu import Create as _BaiduUpdate +from azext_notification_hub.aaz.latest.notification_hub.credential.adm import Create as _AdmUpdate +from azext_notification_hub.aaz.latest.notification_hub.credential.wns import Create as _WnsUpdate +from azext_notification_hub.aaz.latest.notification_hub.credential.gcm import Create as _GcmUpdate +from azext_notification_hub.aaz.latest.notification_hub.authorization_rule import RegenerateKeys as _RegenerateKeys +from azext_notification_hub.aaz.latest.notification_hub.namespace import Create as _NamespaceCreate +from azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule import Create as _NamespaceRuleCreate +from azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule import RegenerateKeys as _NamespaceRuleRegenerateKeys + + +class NotificationHubCreate(_CreateNotificationHub): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.location._required = True + return args_schema + + +class NotificationHubUpdate(_UpdateNotificationHub): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.adm_credential._registered = False + args_schema.apns_credential._registered = False + args_schema.baidu_credential._registered = False + args_schema.gcm_credential._registered = False + args_schema.mpns_credential._registered = False + args_schema.wns_credential._registered = False + return args_schema + + +@register_command( + "notification-hub credential apns update", + is_experimental=True, +) +class ApnsUpdate(_ApnsUpdate): + """Update credential for Apple(APNS). + + :example: Update APNS certificate + az notification-hub credential apns update --namespace-name my-namespace --notification-hub-name my-hub --apns-certificate "/path/to/certificate" --certificate-key "xxxxxx" --resource-group MyResourceGroup + """ + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZFileArg, AAZFileArgBase64EncodeFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.apns_certificate = AAZFileArg( + options=['--apns-certificate'], + help='The APNS certificate.', + fmt=AAZFileArgBase64EncodeFormat() + ) + args_schema.apns_certificate_org._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + if has_value(args.apns_certificate): + args.apns_certificate_org = args.apns_certificate + + +@register_command( + "notification-hub credential adm update", + is_experimental=True, +) +class AdmUpdate(_AdmUpdate): + """Update credential for Amazon(ADM). + """ + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.client_id._required = True + args_schema.client_secret._required = True + return args_schema + + +@register_command( + "notification-hub credential wns update", + is_experimental=True, +) +class WnsUpdate(_WnsUpdate): + """Update credential for Windows(WNS). + """ + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.package_sid._required = True + args_schema.secret_key._required = True + return args_schema + + +@register_command( + "notification-hub credential gcm update", + is_experimental=True, +) +class GcmUpdate(_GcmUpdate): + """Update the Google GCM/FCM API key. + + :example: Update Android push API key + az notification-hub credential gcm update --resource-group groupName --namespace-name spaceName --notification-hub-name hubName --google-api-key keyValue + """ + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.google_api_key._required = True + return args_schema + + +@register_command( + "notification-hub credential mpns update", + is_experimental=True, +) +class MpnsUpdate(_MpnsUpdate): + """Update credential for Windows Phone(MPNS). + """ + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZFileArg, AAZFileArgBase64EncodeFormat + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.mpns_certificate = AAZFileArg( + options=['--mpns-certificate'], + help='The MPNS certificate.', + fmt=AAZFileArgBase64EncodeFormat(), + required=True + ) + args_schema.certificate_key._required = True + args_schema.mpns_certificate_org._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.mpns_certificate_org = args.mpns_certificate + + +@register_command( + "notification-hub credential baidu update", + is_experimental=True, +) +class BaiduUpdate(_BaiduUpdate): + """Update credential for Baidu(Andrioid China). + """ + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.api_key = AAZStrArg( + options=['--api-key'], + help='Baidu API key.', + required=True + ) + args_schema.secret_key = AAZStrArg( + options=['--secret-key'], + help='Baidu secret key.', + required=True + ) + return args_schema + + def pre_operations(self): + args = self.ctx.args + args.baidu_api_key = args.api_key + args.baidu_secret_key = args.secret_key + + +class RuleRegenerateKeys(_RegenerateKeys): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZArgEnum + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.policy_key._required = True + args_schema.policy_key.enum = AAZArgEnum({'Primary Key': 'Primary Key', 'Secondary Key': 'Secondary Key'}) + return args_schema + + +class NamespaceCreate(_NamespaceCreate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.sku._required = True + return args_schema + + +class NamespaceRuleCreate(_NamespaceRuleCreate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.rights._required = True + return args_schema + + +class NamespaceRuleRegenerateKeys(_NamespaceRuleRegenerateKeys): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZArgEnum + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.policy_key._required = True + args_schema.policy_key.enum = AAZArgEnum({'Primary Key': 'Primary Key', 'Secondary Key': 'Secondary Key'}) + return args_schema def debug_send_notificationhubs_hub(cmd, client, @@ -247,133 +250,3 @@ def debug_send_notificationhubs_hub(cmd, client, custom_headers['servicebusnotification-tags'] = tag return client.debug_send(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=parameters, custom_headers=custom_headers) - - -def list_authorization_rules_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name): - return client.list_authorization_rules(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name) - - -def get_authorization_rule_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - rule_name): - return client.get_authorization_rule(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, authorization_rule_name=rule_name) - - -def create_or_update_authorization_rule_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - rule_name, - rights): - body = {} - body['rights'] = rights - return client.create_or_update_authorization_rule(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, authorization_rule_name=rule_name, properties=body) - - -def delete_authorization_rule_notificationhubs_hub(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - rule_name): - return client.delete_authorization_rule(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, authorization_rule_name=rule_name) - - -def update_gcm_credential(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - google_api_key): - body = {} - body.setdefault('gcm_credential', {})['google_api_key'] = google_api_key - return client.patch(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) - - -def update_adm_credential(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - client_id, - client_secret): - body = {} - body.setdefault('adm_credential', {})['client_id'] = client_id - body.setdefault('adm_credential', {})['client_secret'] = client_secret - return client.patch(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) - - -def update_apns_credential(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - apns_certificate=None, - certificate_key=None, - endpoint=DEFAULT_APNS_ENDPOINT, - key_id=None, - app_name=None, - app_id=None, - token=None): - import base64 - body = {} - if apns_certificate is not None: - with open(apns_certificate, "rb") as f: - data_bytes = f.read() - cert_data = base64.b64encode(data_bytes).decode('utf-8') - body.setdefault('apns_credential', {})['apns_certificate'] = cert_data - if certificate_key is not None: - body.setdefault('apns_credential', {})['certificate_key'] = certificate_key - if endpoint is not None: - body.setdefault('apns_credential', {})['endpoint'] = endpoint - if key_id is not None: - body.setdefault('apns_credential', {})['key_id'] = key_id - if app_name is not None: - body.setdefault('apns_credential', {})['app_name'] = app_name - if app_id is not None: - body.setdefault('apns_credential', {})['app_id'] = app_id - if token is not None: - body.setdefault('apns_credential', {})['token'] = token - return client.patch(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) - - -def update_baidu_credential(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - api_key, - secret_key): - body = {} - body.setdefault('baidu_credential', {})['baidu_api_key'] = api_key - body.setdefault('baidu_credential', {})['baidu_secret_key'] = secret_key - return client.patch(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) - - -def update_mpns_credential(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - mpns_certificate, - certificate_key): - import base64 - body = {} - if mpns_certificate is not None: - with open(mpns_certificate, "rb") as f: - data_bytes = f.read() - cert_data = base64.b64encode(data_bytes).decode('utf-8') - body.setdefault('mpns_credential', {})['mpns_certificate'] = cert_data - body.setdefault('mpns_credential', {})['certificate_key'] = certificate_key - return client.patch(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) - - -def update_wns_credential(cmd, client, - resource_group_name, - namespace_name, - notification_hub_name, - package_sid, - secret_key): - body = {} - body.setdefault('wns_credential', {})['package_sid'] = package_sid - body.setdefault('wns_credential', {})['secret_key'] = secret_key - return client.patch(resource_group_name=resource_group_name, namespace_name=namespace_name, notification_hub_name=notification_hub_name, parameters=body) diff --git a/src/notification-hub/azext_notification_hub/tests/latest/recordings/test_notificationhubs.yaml b/src/notification-hub/azext_notification_hub/tests/latest/recordings/test_notificationhubs.yaml index 877cd7c7085..3754f85f4eb 100644 --- a/src/notification-hub/azext_notification_hub/tests/latest/recordings/test_notificationhubs.yaml +++ b/src/notification-hub/azext_notification_hub/tests/latest/recordings/test_notificationhubs.yaml @@ -13,137 +13,48 @@ interactions: Content-Length: - '25' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NotificationHubs/checkNamespaceAvailability?api-version=2017-04-01 response: body: - string: '{"isAvailiable":true,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NotificationHubs/checkNamespaceAvailability","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces/checkNamespaceAvailability","location":null,"tags":null,"properties":true}' + string: '{"isAvailiable":true,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NotificationHubs/CheckNamespaceAvailability","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces/checkNamespaceAvailability"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '287' + - '241' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:16:55 GMT + - Mon, 24 Jul 2023 10:11:44 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - d8b24457-2051-4428-8091-4b96cf077210 transfer-encoding: - chunked vary: - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' status: code: 200 message: OK - request: body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - notification-hub namespace check-availability - Connection: - - keep-alive - ParameterSetName: - - --name - User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-06-01 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia","name":"eastasia","displayName":"East - Asia","longitude":"114.188","latitude":"22.267"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia","name":"southeastasia","displayName":"Southeast - Asia","longitude":"103.833","latitude":"1.283"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus","name":"centralus","displayName":"Central - US","longitude":"-93.6208","latitude":"41.5908"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus","name":"eastus","displayName":"East - US","longitude":"-79.8164","latitude":"37.3719"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2","name":"eastus2","displayName":"East - US 2","longitude":"-78.3889","latitude":"36.6681"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus","name":"westus","displayName":"West - US","longitude":"-122.417","latitude":"37.783"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus","name":"northcentralus","displayName":"North - Central US","longitude":"-87.6278","latitude":"41.8819"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus","name":"southcentralus","displayName":"South - Central US","longitude":"-98.5","latitude":"29.4167"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope","name":"northeurope","displayName":"North - Europe","longitude":"-6.2597","latitude":"53.3478"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope","name":"westeurope","displayName":"West - Europe","longitude":"4.9","latitude":"52.3667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest","name":"japanwest","displayName":"Japan - West","longitude":"135.5022","latitude":"34.6939"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast","name":"japaneast","displayName":"Japan - East","longitude":"139.77","latitude":"35.68"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth","name":"brazilsouth","displayName":"Brazil - South","longitude":"-46.633","latitude":"-23.55"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast","name":"australiaeast","displayName":"Australia - East","longitude":"151.2094","latitude":"-33.86"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast","name":"australiasoutheast","displayName":"Australia - Southeast","longitude":"144.9631","latitude":"-37.8136"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia","name":"southindia","displayName":"South - India","longitude":"80.1636","latitude":"12.9822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia","name":"centralindia","displayName":"Central - India","longitude":"73.9197","latitude":"18.5822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia","name":"westindia","displayName":"West - India","longitude":"72.868","latitude":"19.088"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral","name":"canadacentral","displayName":"Canada - Central","longitude":"-79.383","latitude":"43.653"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast","name":"canadaeast","displayName":"Canada - East","longitude":"-71.217","latitude":"46.817"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth","name":"uksouth","displayName":"UK - South","longitude":"-0.799","latitude":"50.941"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest","name":"ukwest","displayName":"UK - West","longitude":"-3.084","latitude":"53.427"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus","name":"westcentralus","displayName":"West - Central US","longitude":"-110.234","latitude":"40.890"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2","name":"westus2","displayName":"West - US 2","longitude":"-119.852","latitude":"47.233"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral","name":"koreacentral","displayName":"Korea - Central","longitude":"126.9780","latitude":"37.5665"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth","name":"koreasouth","displayName":"Korea - South","longitude":"129.0756","latitude":"35.1796"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral","name":"francecentral","displayName":"France - Central","longitude":"2.3730","latitude":"46.3772"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth","name":"francesouth","displayName":"France - South","longitude":"2.1972","latitude":"43.8345"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral","name":"australiacentral","displayName":"Australia - Central","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2","name":"australiacentral2","displayName":"Australia - Central 2","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral","name":"uaecentral","displayName":"UAE - Central","longitude":"54.366669","latitude":"24.466667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth","name":"uaenorth","displayName":"UAE - North","longitude":"55.316666","latitude":"25.266666"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth","name":"southafricanorth","displayName":"South - Africa North","longitude":"28.218370","latitude":"-25.731340"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest","name":"southafricawest","displayName":"South - Africa West","longitude":"18.843266","latitude":"-34.075691"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth","name":"switzerlandnorth","displayName":"Switzerland - North","longitude":"8.564572","latitude":"47.451542"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest","name":"switzerlandwest","displayName":"Switzerland - West","longitude":"6.143158","latitude":"46.204391"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth","name":"germanynorth","displayName":"Germany - North","longitude":"8.806422","latitude":"53.073635"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral","name":"germanywestcentral","displayName":"Germany - West Central","longitude":"8.682127","latitude":"50.110924"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest","name":"norwaywest","displayName":"Norway - West","longitude":"5.733107","latitude":"58.969975"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast","name":"norwayeast","displayName":"Norway - East","longitude":"10.752245","latitude":"59.913868"}]}' - headers: - cache-control: - - no-cache - content-length: - - '7129' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 01 Apr 2020 14:16:56 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"name": "my-test-space"}' headers: Accept: - application/json @@ -153,55 +64,474 @@ interactions: - notification-hub namespace create Connection: - keep-alive - Content-Length: - - '25' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --resource-group --name --location --sku User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NotificationHubs/checkNamespaceAvailability?api-version=2017-04-01 + - AZURECLI/2.50.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 response: body: - string: '{"isAvailiable":true,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NotificationHubs/checkNamespaceAvailability","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces/checkNamespaceAvailability","location":null,"tags":null,"properties":true}' + string: "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"\ + ,\"name\":\"eastus\",\"displayName\":\"East US\",\"regionalDisplayName\":\"\ + (US) East US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\"\ + :\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\"\ + :\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\"\ + ,\"name\":\"eastus2\",\"displayName\":\"East US 2\",\"regionalDisplayName\"\ + :\"(US) East US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\"\ + :\"36.6681\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\"\ + :\"centralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"\ + ,\"name\":\"southcentralus\",\"displayName\":\"South Central US\",\"regionalDisplayName\"\ + :\"(US) South Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\"\ + :\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"\ + northcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\"\ + ,\"name\":\"westus2\",\"displayName\":\"West US 2\",\"regionalDisplayName\"\ + :\"(US) West US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-119.852\",\"latitude\"\ + :\"47.233\",\"physicalLocation\":\"Washington\",\"pairedRegion\":[{\"name\"\ + :\"westcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus3\"\ + ,\"name\":\"westus3\",\"displayName\":\"West US 3\",\"regionalDisplayName\"\ + :\"(US) West US 3\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-112.074036\",\"\ + latitude\":\"33.448376\",\"physicalLocation\":\"Phoenix\",\"pairedRegion\"\ + :[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\"\ + ,\"name\":\"australiaeast\",\"displayName\":\"Australia East\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Australia East\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"151.2094\",\"latitude\":\"-33.86\",\"physicalLocation\":\"New\ + \ South Wales\",\"pairedRegion\":[{\"name\":\"australiasoutheast\",\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\"\ + ,\"name\":\"southeastasia\",\"displayName\":\"Southeast Asia\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Southeast Asia\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"103.833\",\"latitude\":\"1.283\",\"physicalLocation\":\"Singapore\"\ + ,\"pairedRegion\":[{\"name\":\"eastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\"\ + ,\"name\":\"northeurope\",\"displayName\":\"North Europe\",\"regionalDisplayName\"\ + :\"(Europe) North Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-6.2597\",\"\ + latitude\":\"53.3478\",\"physicalLocation\":\"Ireland\",\"pairedRegion\":[{\"\ + name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedencentral\"\ + ,\"name\":\"swedencentral\",\"displayName\":\"Sweden Central\",\"regionalDisplayName\"\ + :\"(Europe) Sweden Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"17.14127\",\"latitude\":\"60.67488\",\"physicalLocation\":\"G\xE4vle\"\ + ,\"pairedRegion\":[{\"name\":\"swedensouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedensouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\"\ + ,\"name\":\"uksouth\",\"displayName\":\"UK South\",\"regionalDisplayName\"\ + :\"(Europe) UK South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-0.799\",\"\ + latitude\":\"50.941\",\"physicalLocation\":\"London\",\"pairedRegion\":[{\"\ + name\":\"ukwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"\ + ,\"name\":\"westeurope\",\"displayName\":\"West Europe\",\"regionalDisplayName\"\ + :\"(Europe) West Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"4.9\",\"latitude\"\ + :\"52.3667\",\"physicalLocation\":\"Netherlands\",\"pairedRegion\":[{\"name\"\ + :\"northeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\"\ + ,\"name\":\"centralus\",\"displayName\":\"Central US\",\"regionalDisplayName\"\ + :\"(US) Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\"\ + :\"41.5908\",\"physicalLocation\":\"Iowa\",\"pairedRegion\":[{\"name\":\"\ + eastus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\"\ + ,\"name\":\"southafricanorth\",\"displayName\":\"South Africa North\",\"regionalDisplayName\"\ + :\"(Africa) South Africa North\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Africa\",\"longitude\"\ + :\"28.21837\",\"latitude\":\"-25.73134\",\"physicalLocation\":\"Johannesburg\"\ + ,\"pairedRegion\":[{\"name\":\"southafricawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\"\ + ,\"name\":\"centralindia\",\"displayName\":\"Central India\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Central India\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"73.9197\",\"latitude\":\"18.5822\",\"physicalLocation\":\"Pune\"\ + ,\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\"\ + ,\"name\":\"eastasia\",\"displayName\":\"East Asia\",\"regionalDisplayName\"\ + :\"(Asia Pacific) East Asia\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"114.188\",\"latitude\":\"22.267\",\"physicalLocation\":\"Hong Kong\",\"\ + pairedRegion\":[{\"name\":\"southeastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\"\ + ,\"name\":\"japaneast\",\"displayName\":\"Japan East\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Japan East\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"139.77\",\"latitude\":\"35.68\",\"physicalLocation\":\"Tokyo, Saitama\"\ + ,\"pairedRegion\":[{\"name\":\"japanwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\"\ + ,\"name\":\"koreacentral\",\"displayName\":\"Korea Central\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Korea Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"126.978\",\"latitude\":\"37.5665\",\"physicalLocation\":\"Seoul\"\ + ,\"pairedRegion\":[{\"name\":\"koreasouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\"\ + ,\"name\":\"canadacentral\",\"displayName\":\"Canada Central\",\"regionalDisplayName\"\ + :\"(Canada) Canada Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Canada\",\"longitude\"\ + :\"-79.383\",\"latitude\":\"43.653\",\"physicalLocation\":\"Toronto\",\"pairedRegion\"\ + :[{\"name\":\"canadaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\"\ + ,\"name\":\"francecentral\",\"displayName\":\"France Central\",\"regionalDisplayName\"\ + :\"(Europe) France Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"2.373\",\"latitude\":\"46.3772\",\"physicalLocation\":\"Paris\",\"pairedRegion\"\ + :[{\"name\":\"francesouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\"\ + ,\"name\":\"germanywestcentral\",\"displayName\":\"Germany West Central\"\ + ,\"regionalDisplayName\":\"(Europe) Germany West Central\",\"metadata\":{\"\ + regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\"\ + :\"Europe\",\"longitude\":\"8.682127\",\"latitude\":\"50.110924\",\"physicalLocation\"\ + :\"Frankfurt\",\"pairedRegion\":[{\"name\":\"germanynorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\"\ + ,\"name\":\"norwayeast\",\"displayName\":\"Norway East\",\"regionalDisplayName\"\ + :\"(Europe) Norway East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"10.752245\"\ + ,\"latitude\":\"59.913868\",\"physicalLocation\":\"Norway\",\"pairedRegion\"\ + :[{\"name\":\"norwaywest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/polandcentral\"\ + ,\"name\":\"polandcentral\",\"displayName\":\"Poland Central\",\"regionalDisplayName\"\ + :\"(Europe) Poland Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"21.01666\",\"latitude\":\"52.23334\",\"physicalLocation\":\"Warsaw\",\"\ + pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\"\ + ,\"name\":\"switzerlandnorth\",\"displayName\":\"Switzerland North\",\"regionalDisplayName\"\ + :\"(Europe) Switzerland North\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"8.564572\",\"latitude\":\"47.451542\",\"physicalLocation\":\"Zurich\",\"\ + pairedRegion\":[{\"name\":\"switzerlandwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\"\ + ,\"name\":\"uaenorth\",\"displayName\":\"UAE North\",\"regionalDisplayName\"\ + :\"(Middle East) UAE North\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle East\",\"longitude\"\ + :\"55.316666\",\"latitude\":\"25.266666\",\"physicalLocation\":\"Dubai\",\"\ + pairedRegion\":[{\"name\":\"uaecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\"\ + ,\"name\":\"brazilsouth\",\"displayName\":\"Brazil South\",\"regionalDisplayName\"\ + :\"(South America) Brazil South\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"South America\",\"\ + longitude\":\"-46.633\",\"latitude\":\"-23.55\",\"physicalLocation\":\"Sao\ + \ Paulo State\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"\ + ,\"name\":\"centraluseuap\",\"displayName\":\"Central US EUAP\",\"regionalDisplayName\"\ + :\"(US) Central US EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\"\ + :\"41.5908\",\"physicalLocation\":\"\",\"pairedRegion\":[{\"name\":\"eastus2euap\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/qatarcentral\"\ + ,\"name\":\"qatarcentral\",\"displayName\":\"Qatar Central\",\"regionalDisplayName\"\ + :\"(Middle East) Qatar Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle East\",\"\ + longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\"\ + :\"Doha\",\"pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\"\ + ,\"name\":\"centralusstage\",\"displayName\":\"Central US (Stage)\",\"regionalDisplayName\"\ + :\"(US) Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstage\"\ + ,\"name\":\"eastusstage\",\"displayName\":\"East US (Stage)\",\"regionalDisplayName\"\ + :\"(US) East US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2stage\"\ + ,\"name\":\"eastus2stage\",\"displayName\":\"East US 2 (Stage)\",\"regionalDisplayName\"\ + :\"(US) East US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralusstage\"\ + ,\"name\":\"northcentralusstage\",\"displayName\":\"North Central US (Stage)\"\ + ,\"regionalDisplayName\":\"(US) North Central US (Stage)\",\"metadata\":{\"\ + regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"\ + US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstage\"\ + ,\"name\":\"southcentralusstage\",\"displayName\":\"South Central US (Stage)\"\ + ,\"regionalDisplayName\":\"(US) South Central US (Stage)\",\"metadata\":{\"\ + regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"\ + US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westusstage\"\ + ,\"name\":\"westusstage\",\"displayName\":\"West US (Stage)\",\"regionalDisplayName\"\ + :\"(US) West US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2stage\"\ + ,\"name\":\"westus2stage\",\"displayName\":\"West US 2 (Stage)\",\"regionalDisplayName\"\ + :\"(US) West US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asia\"\ + ,\"name\":\"asia\",\"displayName\":\"Asia\",\"regionalDisplayName\":\"Asia\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asiapacific\"\ + ,\"name\":\"asiapacific\",\"displayName\":\"Asia Pacific\",\"regionalDisplayName\"\ + :\"Asia Pacific\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australia\"\ + ,\"name\":\"australia\",\"displayName\":\"Australia\",\"regionalDisplayName\"\ + :\"Australia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazil\"\ + ,\"name\":\"brazil\",\"displayName\":\"Brazil\",\"regionalDisplayName\":\"\ + Brazil\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canada\"\ + ,\"name\":\"canada\",\"displayName\":\"Canada\",\"regionalDisplayName\":\"\ + Canada\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/europe\"\ + ,\"name\":\"europe\",\"displayName\":\"Europe\",\"regionalDisplayName\":\"\ + Europe\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/france\"\ + ,\"name\":\"france\",\"displayName\":\"France\",\"regionalDisplayName\":\"\ + France\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germany\"\ + ,\"name\":\"germany\",\"displayName\":\"Germany\",\"regionalDisplayName\"\ + :\"Germany\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"\ + Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/global\"\ + ,\"name\":\"global\",\"displayName\":\"Global\",\"regionalDisplayName\":\"\ + Global\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/india\"\ + ,\"name\":\"india\",\"displayName\":\"India\",\"regionalDisplayName\":\"India\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japan\"\ + ,\"name\":\"japan\",\"displayName\":\"Japan\",\"regionalDisplayName\":\"Japan\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/korea\"\ + ,\"name\":\"korea\",\"displayName\":\"Korea\",\"regionalDisplayName\":\"Korea\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/mexicocentral\"\ + ,\"name\":\"mexicocentral\",\"displayName\":\"Mexico Central\",\"regionalDisplayName\"\ + :\"Mexico Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norway\"\ + ,\"name\":\"norway\",\"displayName\":\"Norway\",\"regionalDisplayName\":\"\ + Norway\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/singapore\"\ + ,\"name\":\"singapore\",\"displayName\":\"Singapore\",\"regionalDisplayName\"\ + :\"Singapore\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafrica\"\ + ,\"name\":\"southafrica\",\"displayName\":\"South Africa\",\"regionalDisplayName\"\ + :\"South Africa\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerland\"\ + ,\"name\":\"switzerland\",\"displayName\":\"Switzerland\",\"regionalDisplayName\"\ + :\"Switzerland\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/taiwannorth\"\ + ,\"name\":\"taiwannorth\",\"displayName\":\"Taiwan North\",\"regionalDisplayName\"\ + :\"Taiwan North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/taiwannorthwest\"\ + ,\"name\":\"taiwannorthwest\",\"displayName\":\"Taiwan Northwest\",\"regionalDisplayName\"\ + :\"Taiwan Northwest\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uae\"\ + ,\"name\":\"uae\",\"displayName\":\"United Arab Emirates\",\"regionalDisplayName\"\ + :\"United Arab Emirates\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uk\"\ + ,\"name\":\"uk\",\"displayName\":\"United Kingdom\",\"regionalDisplayName\"\ + :\"United Kingdom\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstates\"\ + ,\"name\":\"unitedstates\",\"displayName\":\"United States\",\"regionalDisplayName\"\ + :\"United States\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstateseuap\"\ + ,\"name\":\"unitedstateseuap\",\"displayName\":\"United States EUAP\",\"regionalDisplayName\"\ + :\"United States EUAP\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasiastage\"\ + ,\"name\":\"eastasiastage\",\"displayName\":\"East Asia (Stage)\",\"regionalDisplayName\"\ + :\"(Asia Pacific) East Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\"}},{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\"\ + ,\"name\":\"southeastasiastage\",\"displayName\":\"Southeast Asia (Stage)\"\ + ,\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\"\ + :{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\"\ + :\"Asia Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilus\"\ + ,\"name\":\"brazilus\",\"displayName\":\"Brazil US\",\"regionalDisplayName\"\ + :\"(South America) Brazil US\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"South America\",\"longitude\"\ + :\"0\",\"latitude\":\"0\",\"physicalLocation\":\"\",\"pairedRegion\":[{\"\ + name\":\"brazilsoutheast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsoutheast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\"\ + ,\"name\":\"eastusstg\",\"displayName\":\"East US STG\",\"regionalDisplayName\"\ + :\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\"\ + :\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\"\ + :\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\"\ + ,\"name\":\"northcentralus\",\"displayName\":\"North Central US\",\"regionalDisplayName\"\ + :\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\"\ + :\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\"\ + :\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\"\ + ,\"name\":\"westus\",\"displayName\":\"West US\",\"regionalDisplayName\":\"\ + (US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\"\ + :\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\"\ + :\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\"\ + ,\"name\":\"jioindiawest\",\"displayName\":\"Jio India West\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"70.05773\",\"latitude\":\"22.470701\",\"physicalLocation\":\"Jamnagar\"\ + ,\"pairedRegion\":[{\"name\":\"jioindiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/italynorth\"\ + ,\"name\":\"italynorth\",\"displayName\":\"Italy North\",\"regionalDisplayName\"\ + :\"(Europe) Italy North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"9.18109\",\"latitude\"\ + :\"45.46888\",\"physicalLocation\":\"Milan\",\"pairedRegion\":[]}},{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\"\ + ,\"name\":\"eastus2euap\",\"displayName\":\"East US 2 EUAP\",\"regionalDisplayName\"\ + :\"(US) East US 2 EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\"\ + :\"36.6681\",\"physicalLocation\":\"\",\"pairedRegion\":[{\"name\":\"centraluseuap\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"\ + ,\"name\":\"southcentralusstg\",\"displayName\":\"South Central US STG\",\"\ + regionalDisplayName\":\"(US) South Central US STG\",\"metadata\":{\"regionType\"\ + :\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\"\ + :\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\"\ + :[{\"name\":\"eastusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\"\ + ,\"name\":\"westcentralus\",\"displayName\":\"West Central US\",\"regionalDisplayName\"\ + :\"(US) West Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-110.234\",\"latitude\"\ + :\"40.89\",\"physicalLocation\":\"Wyoming\",\"pairedRegion\":[{\"name\":\"\ + westus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\"\ + ,\"name\":\"southafricawest\",\"displayName\":\"South Africa West\",\"regionalDisplayName\"\ + :\"(Africa) South Africa West\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Africa\",\"longitude\"\ + :\"18.843266\",\"latitude\":\"-34.075691\",\"physicalLocation\":\"Cape Town\"\ + ,\"pairedRegion\":[{\"name\":\"southafricanorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\"\ + ,\"name\":\"australiacentral\",\"displayName\":\"Australia Central\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Australia Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\"\ + ,\"pairedRegion\":[{\"name\":\"australiacentral2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\"\ + ,\"name\":\"australiacentral2\",\"displayName\":\"Australia Central 2\",\"\ + regionalDisplayName\":\"(Asia Pacific) Australia Central 2\",\"metadata\"\ + :{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\"\ + :\"Asia Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"\ + physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\"\ + ,\"name\":\"australiasoutheast\",\"displayName\":\"Australia Southeast\",\"\ + regionalDisplayName\":\"(Asia Pacific) Australia Southeast\",\"metadata\"\ + :{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\"\ + :\"Asia Pacific\",\"longitude\":\"144.9631\",\"latitude\":\"-37.8136\",\"\ + physicalLocation\":\"Victoria\",\"pairedRegion\":[{\"name\":\"australiaeast\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\"\ + ,\"name\":\"japanwest\",\"displayName\":\"Japan West\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Japan West\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"135.5022\",\"latitude\":\"34.6939\",\"physicalLocation\":\"Osaka\",\"pairedRegion\"\ + :[{\"name\":\"japaneast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\"\ + ,\"name\":\"jioindiacentral\",\"displayName\":\"Jio India Central\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Jio India Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"79.08886\",\"latitude\":\"21.146633\",\"physicalLocation\":\"Nagpur\",\"\ + pairedRegion\":[{\"name\":\"jioindiawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\"\ + ,\"name\":\"koreasouth\",\"displayName\":\"Korea South\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Korea South\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"129.0756\",\"latitude\":\"35.1796\",\"physicalLocation\":\"Busan\",\"pairedRegion\"\ + :[{\"name\":\"koreacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/malaysiasouth\"\ + ,\"name\":\"malaysiasouth\",\"displayName\":\"Malaysia South\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Malaysia South\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"101.7123\",\"latitude\":\"3.1569\",\"physicalLocation\":\"Kuala Lumpur\"\ + ,\"pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"\ + ,\"name\":\"southindia\",\"displayName\":\"South India\",\"regionalDisplayName\"\ + :\"(Asia Pacific) South India\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"80.1636\",\"latitude\":\"12.9822\",\"physicalLocation\":\"Chennai\",\"\ + pairedRegion\":[{\"name\":\"centralindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia\"\ + ,\"name\":\"westindia\",\"displayName\":\"West India\",\"regionalDisplayName\"\ + :\"(Asia Pacific) West India\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"72.868\",\"latitude\":\"19.088\",\"physicalLocation\":\"Mumbai\",\"pairedRegion\"\ + :[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\"\ + ,\"name\":\"canadaeast\",\"displayName\":\"Canada East\",\"regionalDisplayName\"\ + :\"(Canada) Canada East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Canada\",\"longitude\":\"-71.217\",\"latitude\"\ + :\"46.817\",\"physicalLocation\":\"Quebec\",\"pairedRegion\":[{\"name\":\"\ + canadacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\"\ + ,\"name\":\"francesouth\",\"displayName\":\"France South\",\"regionalDisplayName\"\ + :\"(Europe) France South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.1972\",\"latitude\"\ + :\"43.8345\",\"physicalLocation\":\"Marseille\",\"pairedRegion\":[{\"name\"\ + :\"francecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\"\ + ,\"name\":\"germanynorth\",\"displayName\":\"Germany North\",\"regionalDisplayName\"\ + :\"(Europe) Germany North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.806422\",\"latitude\"\ + :\"53.073635\",\"physicalLocation\":\"Berlin\",\"pairedRegion\":[{\"name\"\ + :\"germanywestcentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\"\ + ,\"name\":\"norwaywest\",\"displayName\":\"Norway West\",\"regionalDisplayName\"\ + :\"(Europe) Norway West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"5.733107\",\"latitude\"\ + :\"58.969975\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\"\ + :\"norwayeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedensouth\"\ + ,\"name\":\"swedensouth\",\"displayName\":\"Sweden South\",\"regionalDisplayName\"\ + :\"(Europe) Sweden South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"13.0007\",\"latitude\"\ + :\"55.6059\",\"physicalLocation\":\"Malmo\",\"pairedRegion\":[{\"name\":\"\ + swedencentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedencentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\"\ + ,\"name\":\"switzerlandwest\",\"displayName\":\"Switzerland West\",\"regionalDisplayName\"\ + :\"(Europe) Switzerland West\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"\ + 6.143158\",\"latitude\":\"46.204391\",\"physicalLocation\":\"Geneva\",\"pairedRegion\"\ + :[{\"name\":\"switzerlandnorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\"\ + ,\"name\":\"ukwest\",\"displayName\":\"UK West\",\"regionalDisplayName\":\"\ + (Europe) UK West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"-3.084\",\"latitude\"\ + :\"53.427\",\"physicalLocation\":\"Cardiff\",\"pairedRegion\":[{\"name\":\"\ + uksouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\"\ + ,\"name\":\"uaecentral\",\"displayName\":\"UAE Central\",\"regionalDisplayName\"\ + :\"(Middle East) UAE Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Middle East\",\"longitude\"\ + :\"54.366669\",\"latitude\":\"24.466667\",\"physicalLocation\":\"Abu Dhabi\"\ + ,\"pairedRegion\":[{\"name\":\"uaenorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsoutheast\"\ + ,\"name\":\"brazilsoutheast\",\"displayName\":\"Brazil Southeast\",\"regionalDisplayName\"\ + :\"(South America) Brazil Southeast\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"South America\",\"longitude\"\ + :\"-43.2075\",\"latitude\":\"-22.90278\",\"physicalLocation\":\"Rio\",\"pairedRegion\"\ + :[{\"name\":\"brazilsouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/israelcentral\"\ + ,\"name\":\"israelcentral\",\"displayName\":\"Israel Central\",\"regionalDisplayName\"\ + :\"(Middle East) Israel Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Middle East\",\"longitude\"\ + :\"33.4506633\",\"latitude\":\"31.2655698\",\"physicalLocation\":\"Israel\"\ + ,\"pairedRegion\":[]}}]}" headers: cache-control: - no-cache content-length: - - '287' + - '33459' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:16:58 GMT + - Mon, 24 Jul 2023 10:11:46 GMT expires: - '-1' pragma: - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked vary: - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' status: code: 200 message: OK - request: - body: '{"location": "southcentralus", "sku": {"name": "Free"}}' + body: '{"location": "southcentralus", "properties": {"name": "my-test-space"}, + "sku": {"name": "Free"}}' headers: Accept: - application/json @@ -212,106 +542,50 @@ interactions: Connection: - keep-alive Content-Length: - - '55' + - '96' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - --resource-group --name --location --sku User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South - Central US","kind":"NotificationHub","sku":{"name":"Free"},"tags":{},"properties":{"provisioningState":"Unknown","metricId":null,"enabled":false,"namespaceType":"NotificationHub"}}' + string: '{"properties":{"provisioningState":"Unknown","enabled":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/operations/Q3JlYXRlTmFtZXNwYWNlLTBiMWY2NDcxLTFiZjAtNGRkYS1hZWMzLWNiOTI3MmYwOTU5MC1teS10ZXN0LXNwYWNlO25ocHJvZHNuMTAwMS0yLWZhYnJpYw==?api-version=2017-04-01 cache-control: - no-cache content-length: - - '481' + - '300' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:17:09 GMT + - Mon, 24 Jul 2023 10:12:06 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space?api-version=2017-04-01 pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + trackingid: + - c0c47c49-9529-41fd-be60-36469483d464 x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - notification-hub namespace wait - Connection: - - keep-alive - ParameterSetName: - - --resource-group --name --created - User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space?api-version=2017-04-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South - Central US","kind":"NotificationHub","sku":{"name":"Free"},"tags":{},"properties":{"provisioningState":"Activating","metricId":null,"status":"Created","createdAt":"2020-04-01T14:17:07.507Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-04-01T14:17:07.507Z","namespaceType":"NotificationHub"}}' - headers: - cache-control: - - no-cache - content-length: - - '670' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 01 Apr 2020 14:17:14 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK + code: 201 + message: Created - request: body: null headers: @@ -326,36 +600,34 @@ interactions: ParameterSetName: - --resource-group --name --created User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South - Central US","kind":"NotificationHub","sku":{"name":"Free"},"tags":{},"properties":{"provisioningState":"Succeeded","metricId":null,"status":"Active","createdAt":"2020-04-01T14:17:07.507Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-04-01T14:17:31.16Z","namespaceType":"NotificationHub"}}' + string: '{"sku":{"name":"Free"},"properties":{"provisioningState":"Succeeded","status":"Active","createdAt":"2023-07-24T07:56:25.0170000Z","updatedAt":"2023-07-24T10:12:04.5200000Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South + Central US","tags":{}}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '667' + - '557' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:17:49 GMT + - Mon, 24 Jul 2023 10:12:08 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 465c225b-f039-4017-8ab3-54b4bf6ad97f transfer-encoding: - chunked vary: @@ -379,182 +651,37 @@ interactions: Content-Length: - '23' Content-Type: - - application/json; charset=utf-8 - ParameterSetName: - - --resource-group --namespace-name --name - User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/checkNotificationHubAvailability?api-version=2017-04-01 - response: - body: - string: '{"isAvailiable":true,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/checkNotificationHubAvailability","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/checkNotificationHubAvailability","location":null,"tags":null,"properties":true}' - headers: - cache-control: - - no-cache - content-length: - - '430' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 01 Apr 2020 14:17:53 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - notification-hub check-availability - Connection: - - keep-alive ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-06-01 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia","name":"eastasia","displayName":"East - Asia","longitude":"114.188","latitude":"22.267"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia","name":"southeastasia","displayName":"Southeast - Asia","longitude":"103.833","latitude":"1.283"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus","name":"centralus","displayName":"Central - US","longitude":"-93.6208","latitude":"41.5908"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus","name":"eastus","displayName":"East - US","longitude":"-79.8164","latitude":"37.3719"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2","name":"eastus2","displayName":"East - US 2","longitude":"-78.3889","latitude":"36.6681"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus","name":"westus","displayName":"West - US","longitude":"-122.417","latitude":"37.783"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus","name":"northcentralus","displayName":"North - Central US","longitude":"-87.6278","latitude":"41.8819"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus","name":"southcentralus","displayName":"South - Central US","longitude":"-98.5","latitude":"29.4167"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope","name":"northeurope","displayName":"North - Europe","longitude":"-6.2597","latitude":"53.3478"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope","name":"westeurope","displayName":"West - Europe","longitude":"4.9","latitude":"52.3667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest","name":"japanwest","displayName":"Japan - West","longitude":"135.5022","latitude":"34.6939"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast","name":"japaneast","displayName":"Japan - East","longitude":"139.77","latitude":"35.68"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth","name":"brazilsouth","displayName":"Brazil - South","longitude":"-46.633","latitude":"-23.55"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast","name":"australiaeast","displayName":"Australia - East","longitude":"151.2094","latitude":"-33.86"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast","name":"australiasoutheast","displayName":"Australia - Southeast","longitude":"144.9631","latitude":"-37.8136"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia","name":"southindia","displayName":"South - India","longitude":"80.1636","latitude":"12.9822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia","name":"centralindia","displayName":"Central - India","longitude":"73.9197","latitude":"18.5822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia","name":"westindia","displayName":"West - India","longitude":"72.868","latitude":"19.088"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral","name":"canadacentral","displayName":"Canada - Central","longitude":"-79.383","latitude":"43.653"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast","name":"canadaeast","displayName":"Canada - East","longitude":"-71.217","latitude":"46.817"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth","name":"uksouth","displayName":"UK - South","longitude":"-0.799","latitude":"50.941"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest","name":"ukwest","displayName":"UK - West","longitude":"-3.084","latitude":"53.427"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus","name":"westcentralus","displayName":"West - Central US","longitude":"-110.234","latitude":"40.890"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2","name":"westus2","displayName":"West - US 2","longitude":"-119.852","latitude":"47.233"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral","name":"koreacentral","displayName":"Korea - Central","longitude":"126.9780","latitude":"37.5665"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth","name":"koreasouth","displayName":"Korea - South","longitude":"129.0756","latitude":"35.1796"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral","name":"francecentral","displayName":"France - Central","longitude":"2.3730","latitude":"46.3772"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth","name":"francesouth","displayName":"France - South","longitude":"2.1972","latitude":"43.8345"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral","name":"australiacentral","displayName":"Australia - Central","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2","name":"australiacentral2","displayName":"Australia - Central 2","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral","name":"uaecentral","displayName":"UAE - Central","longitude":"54.366669","latitude":"24.466667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth","name":"uaenorth","displayName":"UAE - North","longitude":"55.316666","latitude":"25.266666"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth","name":"southafricanorth","displayName":"South - Africa North","longitude":"28.218370","latitude":"-25.731340"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest","name":"southafricawest","displayName":"South - Africa West","longitude":"18.843266","latitude":"-34.075691"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth","name":"switzerlandnorth","displayName":"Switzerland - North","longitude":"8.564572","latitude":"47.451542"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest","name":"switzerlandwest","displayName":"Switzerland - West","longitude":"6.143158","latitude":"46.204391"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth","name":"germanynorth","displayName":"Germany - North","longitude":"8.806422","latitude":"53.073635"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral","name":"germanywestcentral","displayName":"Germany - West Central","longitude":"8.682127","latitude":"50.110924"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest","name":"norwaywest","displayName":"Norway - West","longitude":"5.733107","latitude":"58.969975"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast","name":"norwayeast","displayName":"Norway - East","longitude":"10.752245","latitude":"59.913868"}]}' - headers: - cache-control: - - no-cache - content-length: - - '7129' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 01 Apr 2020 14:17:54 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"name": "my-test-hub"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - notification-hub create - Connection: - - keep-alive - Content-Length: - - '23' - Content-Type: - - application/json; charset=utf-8 - ParameterSetName: - - --resource-group --namespace-name --name --location - User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/checkNotificationHubAvailability?api-version=2017-04-01 response: body: - string: '{"isAvailiable":true,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/checkNotificationHubAvailability","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/checkNotificationHubAvailability","location":null,"tags":null,"properties":true}' + string: '{"isAvailiable":true,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/checkNotificationHubAvailability","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/checkNotificationHubAvailability"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '430' + - '340' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:17:57 GMT + - Mon, 24 Jul 2023 10:12:10 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - cf5bff33-43ca-416d-b8ad-3b5a0d15c9b5 transfer-encoding: - chunked vary: @@ -562,7 +689,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -580,38 +707,461 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name --location User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South - Central US","kind":"NotificationHub","sku":{"name":"Free"},"tags":{},"properties":{"provisioningState":"Succeeded","metricId":null,"status":"Active","createdAt":"2020-04-01T14:17:07.507Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-04-01T14:17:31.16Z","namespaceType":"NotificationHub"}}' + string: "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"\ + ,\"name\":\"eastus\",\"displayName\":\"East US\",\"regionalDisplayName\":\"\ + (US) East US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\"\ + :\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\"\ + :\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\"\ + ,\"name\":\"eastus2\",\"displayName\":\"East US 2\",\"regionalDisplayName\"\ + :\"(US) East US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\"\ + :\"36.6681\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\"\ + :\"centralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"\ + ,\"name\":\"southcentralus\",\"displayName\":\"South Central US\",\"regionalDisplayName\"\ + :\"(US) South Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\"\ + :\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"\ + northcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\"\ + ,\"name\":\"westus2\",\"displayName\":\"West US 2\",\"regionalDisplayName\"\ + :\"(US) West US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-119.852\",\"latitude\"\ + :\"47.233\",\"physicalLocation\":\"Washington\",\"pairedRegion\":[{\"name\"\ + :\"westcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus3\"\ + ,\"name\":\"westus3\",\"displayName\":\"West US 3\",\"regionalDisplayName\"\ + :\"(US) West US 3\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-112.074036\",\"\ + latitude\":\"33.448376\",\"physicalLocation\":\"Phoenix\",\"pairedRegion\"\ + :[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\"\ + ,\"name\":\"australiaeast\",\"displayName\":\"Australia East\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Australia East\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"151.2094\",\"latitude\":\"-33.86\",\"physicalLocation\":\"New\ + \ South Wales\",\"pairedRegion\":[{\"name\":\"australiasoutheast\",\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\"\ + ,\"name\":\"southeastasia\",\"displayName\":\"Southeast Asia\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Southeast Asia\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"103.833\",\"latitude\":\"1.283\",\"physicalLocation\":\"Singapore\"\ + ,\"pairedRegion\":[{\"name\":\"eastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\"\ + ,\"name\":\"northeurope\",\"displayName\":\"North Europe\",\"regionalDisplayName\"\ + :\"(Europe) North Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-6.2597\",\"\ + latitude\":\"53.3478\",\"physicalLocation\":\"Ireland\",\"pairedRegion\":[{\"\ + name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedencentral\"\ + ,\"name\":\"swedencentral\",\"displayName\":\"Sweden Central\",\"regionalDisplayName\"\ + :\"(Europe) Sweden Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"17.14127\",\"latitude\":\"60.67488\",\"physicalLocation\":\"G\xE4vle\"\ + ,\"pairedRegion\":[{\"name\":\"swedensouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedensouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\"\ + ,\"name\":\"uksouth\",\"displayName\":\"UK South\",\"regionalDisplayName\"\ + :\"(Europe) UK South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-0.799\",\"\ + latitude\":\"50.941\",\"physicalLocation\":\"London\",\"pairedRegion\":[{\"\ + name\":\"ukwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"\ + ,\"name\":\"westeurope\",\"displayName\":\"West Europe\",\"regionalDisplayName\"\ + :\"(Europe) West Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"4.9\",\"latitude\"\ + :\"52.3667\",\"physicalLocation\":\"Netherlands\",\"pairedRegion\":[{\"name\"\ + :\"northeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\"\ + ,\"name\":\"centralus\",\"displayName\":\"Central US\",\"regionalDisplayName\"\ + :\"(US) Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\"\ + :\"41.5908\",\"physicalLocation\":\"Iowa\",\"pairedRegion\":[{\"name\":\"\ + eastus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\"\ + ,\"name\":\"southafricanorth\",\"displayName\":\"South Africa North\",\"regionalDisplayName\"\ + :\"(Africa) South Africa North\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Africa\",\"longitude\"\ + :\"28.21837\",\"latitude\":\"-25.73134\",\"physicalLocation\":\"Johannesburg\"\ + ,\"pairedRegion\":[{\"name\":\"southafricawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\"\ + ,\"name\":\"centralindia\",\"displayName\":\"Central India\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Central India\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"73.9197\",\"latitude\":\"18.5822\",\"physicalLocation\":\"Pune\"\ + ,\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\"\ + ,\"name\":\"eastasia\",\"displayName\":\"East Asia\",\"regionalDisplayName\"\ + :\"(Asia Pacific) East Asia\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"114.188\",\"latitude\":\"22.267\",\"physicalLocation\":\"Hong Kong\",\"\ + pairedRegion\":[{\"name\":\"southeastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\"\ + ,\"name\":\"japaneast\",\"displayName\":\"Japan East\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Japan East\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"139.77\",\"latitude\":\"35.68\",\"physicalLocation\":\"Tokyo, Saitama\"\ + ,\"pairedRegion\":[{\"name\":\"japanwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\"\ + ,\"name\":\"koreacentral\",\"displayName\":\"Korea Central\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Korea Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia Pacific\",\"\ + longitude\":\"126.978\",\"latitude\":\"37.5665\",\"physicalLocation\":\"Seoul\"\ + ,\"pairedRegion\":[{\"name\":\"koreasouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\"\ + ,\"name\":\"canadacentral\",\"displayName\":\"Canada Central\",\"regionalDisplayName\"\ + :\"(Canada) Canada Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Canada\",\"longitude\"\ + :\"-79.383\",\"latitude\":\"43.653\",\"physicalLocation\":\"Toronto\",\"pairedRegion\"\ + :[{\"name\":\"canadaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\"\ + ,\"name\":\"francecentral\",\"displayName\":\"France Central\",\"regionalDisplayName\"\ + :\"(Europe) France Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"2.373\",\"latitude\":\"46.3772\",\"physicalLocation\":\"Paris\",\"pairedRegion\"\ + :[{\"name\":\"francesouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\"\ + ,\"name\":\"germanywestcentral\",\"displayName\":\"Germany West Central\"\ + ,\"regionalDisplayName\":\"(Europe) Germany West Central\",\"metadata\":{\"\ + regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\"\ + :\"Europe\",\"longitude\":\"8.682127\",\"latitude\":\"50.110924\",\"physicalLocation\"\ + :\"Frankfurt\",\"pairedRegion\":[{\"name\":\"germanynorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\"\ + ,\"name\":\"norwayeast\",\"displayName\":\"Norway East\",\"regionalDisplayName\"\ + :\"(Europe) Norway East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"10.752245\"\ + ,\"latitude\":\"59.913868\",\"physicalLocation\":\"Norway\",\"pairedRegion\"\ + :[{\"name\":\"norwaywest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/polandcentral\"\ + ,\"name\":\"polandcentral\",\"displayName\":\"Poland Central\",\"regionalDisplayName\"\ + :\"(Europe) Poland Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"21.01666\",\"latitude\":\"52.23334\",\"physicalLocation\":\"Warsaw\",\"\ + pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\"\ + ,\"name\":\"switzerlandnorth\",\"displayName\":\"Switzerland North\",\"regionalDisplayName\"\ + :\"(Europe) Switzerland North\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\"\ + :\"8.564572\",\"latitude\":\"47.451542\",\"physicalLocation\":\"Zurich\",\"\ + pairedRegion\":[{\"name\":\"switzerlandwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\"\ + ,\"name\":\"uaenorth\",\"displayName\":\"UAE North\",\"regionalDisplayName\"\ + :\"(Middle East) UAE North\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle East\",\"longitude\"\ + :\"55.316666\",\"latitude\":\"25.266666\",\"physicalLocation\":\"Dubai\",\"\ + pairedRegion\":[{\"name\":\"uaecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\"\ + ,\"name\":\"brazilsouth\",\"displayName\":\"Brazil South\",\"regionalDisplayName\"\ + :\"(South America) Brazil South\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"South America\",\"\ + longitude\":\"-46.633\",\"latitude\":\"-23.55\",\"physicalLocation\":\"Sao\ + \ Paulo State\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"\ + ,\"name\":\"centraluseuap\",\"displayName\":\"Central US EUAP\",\"regionalDisplayName\"\ + :\"(US) Central US EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\"\ + :\"41.5908\",\"physicalLocation\":\"\",\"pairedRegion\":[{\"name\":\"eastus2euap\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/qatarcentral\"\ + ,\"name\":\"qatarcentral\",\"displayName\":\"Qatar Central\",\"regionalDisplayName\"\ + :\"(Middle East) Qatar Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle East\",\"\ + longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\"\ + :\"Doha\",\"pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\"\ + ,\"name\":\"centralusstage\",\"displayName\":\"Central US (Stage)\",\"regionalDisplayName\"\ + :\"(US) Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstage\"\ + ,\"name\":\"eastusstage\",\"displayName\":\"East US (Stage)\",\"regionalDisplayName\"\ + :\"(US) East US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2stage\"\ + ,\"name\":\"eastus2stage\",\"displayName\":\"East US 2 (Stage)\",\"regionalDisplayName\"\ + :\"(US) East US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralusstage\"\ + ,\"name\":\"northcentralusstage\",\"displayName\":\"North Central US (Stage)\"\ + ,\"regionalDisplayName\":\"(US) North Central US (Stage)\",\"metadata\":{\"\ + regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"\ + US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstage\"\ + ,\"name\":\"southcentralusstage\",\"displayName\":\"South Central US (Stage)\"\ + ,\"regionalDisplayName\":\"(US) South Central US (Stage)\",\"metadata\":{\"\ + regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"\ + US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westusstage\"\ + ,\"name\":\"westusstage\",\"displayName\":\"West US (Stage)\",\"regionalDisplayName\"\ + :\"(US) West US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2stage\"\ + ,\"name\":\"westus2stage\",\"displayName\":\"West US 2 (Stage)\",\"regionalDisplayName\"\ + :\"(US) West US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asia\"\ + ,\"name\":\"asia\",\"displayName\":\"Asia\",\"regionalDisplayName\":\"Asia\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asiapacific\"\ + ,\"name\":\"asiapacific\",\"displayName\":\"Asia Pacific\",\"regionalDisplayName\"\ + :\"Asia Pacific\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australia\"\ + ,\"name\":\"australia\",\"displayName\":\"Australia\",\"regionalDisplayName\"\ + :\"Australia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazil\"\ + ,\"name\":\"brazil\",\"displayName\":\"Brazil\",\"regionalDisplayName\":\"\ + Brazil\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canada\"\ + ,\"name\":\"canada\",\"displayName\":\"Canada\",\"regionalDisplayName\":\"\ + Canada\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/europe\"\ + ,\"name\":\"europe\",\"displayName\":\"Europe\",\"regionalDisplayName\":\"\ + Europe\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/france\"\ + ,\"name\":\"france\",\"displayName\":\"France\",\"regionalDisplayName\":\"\ + France\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germany\"\ + ,\"name\":\"germany\",\"displayName\":\"Germany\",\"regionalDisplayName\"\ + :\"Germany\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"\ + Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/global\"\ + ,\"name\":\"global\",\"displayName\":\"Global\",\"regionalDisplayName\":\"\ + Global\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/india\"\ + ,\"name\":\"india\",\"displayName\":\"India\",\"regionalDisplayName\":\"India\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japan\"\ + ,\"name\":\"japan\",\"displayName\":\"Japan\",\"regionalDisplayName\":\"Japan\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/korea\"\ + ,\"name\":\"korea\",\"displayName\":\"Korea\",\"regionalDisplayName\":\"Korea\"\ + ,\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"\ + id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/mexicocentral\"\ + ,\"name\":\"mexicocentral\",\"displayName\":\"Mexico Central\",\"regionalDisplayName\"\ + :\"Mexico Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norway\"\ + ,\"name\":\"norway\",\"displayName\":\"Norway\",\"regionalDisplayName\":\"\ + Norway\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"\ + }},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/singapore\"\ + ,\"name\":\"singapore\",\"displayName\":\"Singapore\",\"regionalDisplayName\"\ + :\"Singapore\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafrica\"\ + ,\"name\":\"southafrica\",\"displayName\":\"South Africa\",\"regionalDisplayName\"\ + :\"South Africa\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerland\"\ + ,\"name\":\"switzerland\",\"displayName\":\"Switzerland\",\"regionalDisplayName\"\ + :\"Switzerland\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/taiwannorth\"\ + ,\"name\":\"taiwannorth\",\"displayName\":\"Taiwan North\",\"regionalDisplayName\"\ + :\"Taiwan North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/taiwannorthwest\"\ + ,\"name\":\"taiwannorthwest\",\"displayName\":\"Taiwan Northwest\",\"regionalDisplayName\"\ + :\"Taiwan Northwest\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uae\"\ + ,\"name\":\"uae\",\"displayName\":\"United Arab Emirates\",\"regionalDisplayName\"\ + :\"United Arab Emirates\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uk\"\ + ,\"name\":\"uk\",\"displayName\":\"United Kingdom\",\"regionalDisplayName\"\ + :\"United Kingdom\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstates\"\ + ,\"name\":\"unitedstates\",\"displayName\":\"United States\",\"regionalDisplayName\"\ + :\"United States\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstateseuap\"\ + ,\"name\":\"unitedstateseuap\",\"displayName\":\"United States EUAP\",\"regionalDisplayName\"\ + :\"United States EUAP\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\"\ + :\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasiastage\"\ + ,\"name\":\"eastasiastage\",\"displayName\":\"East Asia (Stage)\",\"regionalDisplayName\"\ + :\"(Asia Pacific) East Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\"}},{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\"\ + ,\"name\":\"southeastasiastage\",\"displayName\":\"Southeast Asia (Stage)\"\ + ,\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\"\ + :{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\"\ + :\"Asia Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilus\"\ + ,\"name\":\"brazilus\",\"displayName\":\"Brazil US\",\"regionalDisplayName\"\ + :\"(South America) Brazil US\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"South America\",\"longitude\"\ + :\"0\",\"latitude\":\"0\",\"physicalLocation\":\"\",\"pairedRegion\":[{\"\ + name\":\"brazilsoutheast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsoutheast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\"\ + ,\"name\":\"eastusstg\",\"displayName\":\"East US STG\",\"regionalDisplayName\"\ + :\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\"\ + :\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\"\ + :\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\"\ + ,\"name\":\"northcentralus\",\"displayName\":\"North Central US\",\"regionalDisplayName\"\ + :\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\"\ + :\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\"\ + :\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\"\ + ,\"name\":\"westus\",\"displayName\":\"West US\",\"regionalDisplayName\":\"\ + (US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\"\ + :\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\"\ + :\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\"\ + ,\"name\":\"jioindiawest\",\"displayName\":\"Jio India West\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"70.05773\",\"latitude\":\"22.470701\",\"physicalLocation\":\"Jamnagar\"\ + ,\"pairedRegion\":[{\"name\":\"jioindiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/italynorth\"\ + ,\"name\":\"italynorth\",\"displayName\":\"Italy North\",\"regionalDisplayName\"\ + :\"(Europe) Italy North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"9.18109\",\"latitude\"\ + :\"45.46888\",\"physicalLocation\":\"Milan\",\"pairedRegion\":[]}},{\"id\"\ + :\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\"\ + ,\"name\":\"eastus2euap\",\"displayName\":\"East US 2 EUAP\",\"regionalDisplayName\"\ + :\"(US) East US 2 EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\"\ + :\"36.6681\",\"physicalLocation\":\"\",\"pairedRegion\":[{\"name\":\"centraluseuap\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"\ + ,\"name\":\"southcentralusstg\",\"displayName\":\"South Central US STG\",\"\ + regionalDisplayName\":\"(US) South Central US STG\",\"metadata\":{\"regionType\"\ + :\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\"\ + :\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\"\ + :[{\"name\":\"eastusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\"\ + ,\"name\":\"westcentralus\",\"displayName\":\"West Central US\",\"regionalDisplayName\"\ + :\"(US) West Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-110.234\",\"latitude\"\ + :\"40.89\",\"physicalLocation\":\"Wyoming\",\"pairedRegion\":[{\"name\":\"\ + westus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\"\ + ,\"name\":\"southafricawest\",\"displayName\":\"South Africa West\",\"regionalDisplayName\"\ + :\"(Africa) South Africa West\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Africa\",\"longitude\"\ + :\"18.843266\",\"latitude\":\"-34.075691\",\"physicalLocation\":\"Cape Town\"\ + ,\"pairedRegion\":[{\"name\":\"southafricanorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\"\ + ,\"name\":\"australiacentral\",\"displayName\":\"Australia Central\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Australia Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\"\ + ,\"pairedRegion\":[{\"name\":\"australiacentral2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\"\ + ,\"name\":\"australiacentral2\",\"displayName\":\"Australia Central 2\",\"\ + regionalDisplayName\":\"(Asia Pacific) Australia Central 2\",\"metadata\"\ + :{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\"\ + :\"Asia Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"\ + physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\"\ + ,\"name\":\"australiasoutheast\",\"displayName\":\"Australia Southeast\",\"\ + regionalDisplayName\":\"(Asia Pacific) Australia Southeast\",\"metadata\"\ + :{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\"\ + :\"Asia Pacific\",\"longitude\":\"144.9631\",\"latitude\":\"-37.8136\",\"\ + physicalLocation\":\"Victoria\",\"pairedRegion\":[{\"name\":\"australiaeast\"\ + ,\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\"\ + ,\"name\":\"japanwest\",\"displayName\":\"Japan West\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Japan West\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"135.5022\",\"latitude\":\"34.6939\",\"physicalLocation\":\"Osaka\",\"pairedRegion\"\ + :[{\"name\":\"japaneast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\"\ + ,\"name\":\"jioindiacentral\",\"displayName\":\"Jio India Central\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Jio India Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"79.08886\",\"latitude\":\"21.146633\",\"physicalLocation\":\"Nagpur\",\"\ + pairedRegion\":[{\"name\":\"jioindiawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\"\ + ,\"name\":\"koreasouth\",\"displayName\":\"Korea South\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Korea South\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"129.0756\",\"latitude\":\"35.1796\",\"physicalLocation\":\"Busan\",\"pairedRegion\"\ + :[{\"name\":\"koreacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/malaysiasouth\"\ + ,\"name\":\"malaysiasouth\",\"displayName\":\"Malaysia South\",\"regionalDisplayName\"\ + :\"(Asia Pacific) Malaysia South\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"101.7123\",\"latitude\":\"3.1569\",\"physicalLocation\":\"Kuala Lumpur\"\ + ,\"pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"\ + ,\"name\":\"southindia\",\"displayName\":\"South India\",\"regionalDisplayName\"\ + :\"(Asia Pacific) South India\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"80.1636\",\"latitude\":\"12.9822\",\"physicalLocation\":\"Chennai\",\"\ + pairedRegion\":[{\"name\":\"centralindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia\"\ + ,\"name\":\"westindia\",\"displayName\":\"West India\",\"regionalDisplayName\"\ + :\"(Asia Pacific) West India\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\",\"longitude\"\ + :\"72.868\",\"latitude\":\"19.088\",\"physicalLocation\":\"Mumbai\",\"pairedRegion\"\ + :[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\"\ + ,\"name\":\"canadaeast\",\"displayName\":\"Canada East\",\"regionalDisplayName\"\ + :\"(Canada) Canada East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Canada\",\"longitude\":\"-71.217\",\"latitude\"\ + :\"46.817\",\"physicalLocation\":\"Quebec\",\"pairedRegion\":[{\"name\":\"\ + canadacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\"\ + ,\"name\":\"francesouth\",\"displayName\":\"France South\",\"regionalDisplayName\"\ + :\"(Europe) France South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.1972\",\"latitude\"\ + :\"43.8345\",\"physicalLocation\":\"Marseille\",\"pairedRegion\":[{\"name\"\ + :\"francecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\"\ + ,\"name\":\"germanynorth\",\"displayName\":\"Germany North\",\"regionalDisplayName\"\ + :\"(Europe) Germany North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.806422\",\"latitude\"\ + :\"53.073635\",\"physicalLocation\":\"Berlin\",\"pairedRegion\":[{\"name\"\ + :\"germanywestcentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\"\ + ,\"name\":\"norwaywest\",\"displayName\":\"Norway West\",\"regionalDisplayName\"\ + :\"(Europe) Norway West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"5.733107\",\"latitude\"\ + :\"58.969975\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\"\ + :\"norwayeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedensouth\"\ + ,\"name\":\"swedensouth\",\"displayName\":\"Sweden South\",\"regionalDisplayName\"\ + :\"(Europe) Sweden South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"13.0007\",\"latitude\"\ + :\"55.6059\",\"physicalLocation\":\"Malmo\",\"pairedRegion\":[{\"name\":\"\ + swedencentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedencentral\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\"\ + ,\"name\":\"switzerlandwest\",\"displayName\":\"Switzerland West\",\"regionalDisplayName\"\ + :\"(Europe) Switzerland West\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"\ + 6.143158\",\"latitude\":\"46.204391\",\"physicalLocation\":\"Geneva\",\"pairedRegion\"\ + :[{\"name\":\"switzerlandnorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\"\ + ,\"name\":\"ukwest\",\"displayName\":\"UK West\",\"regionalDisplayName\":\"\ + (Europe) UK West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\"\ + :\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"-3.084\",\"latitude\"\ + :\"53.427\",\"physicalLocation\":\"Cardiff\",\"pairedRegion\":[{\"name\":\"\ + uksouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\"\ + ,\"name\":\"uaecentral\",\"displayName\":\"UAE Central\",\"regionalDisplayName\"\ + :\"(Middle East) UAE Central\",\"metadata\":{\"regionType\":\"Physical\",\"\ + regionCategory\":\"Other\",\"geographyGroup\":\"Middle East\",\"longitude\"\ + :\"54.366669\",\"latitude\":\"24.466667\",\"physicalLocation\":\"Abu Dhabi\"\ + ,\"pairedRegion\":[{\"name\":\"uaenorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsoutheast\"\ + ,\"name\":\"brazilsoutheast\",\"displayName\":\"Brazil Southeast\",\"regionalDisplayName\"\ + :\"(South America) Brazil Southeast\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"South America\",\"longitude\"\ + :\"-43.2075\",\"latitude\":\"-22.90278\",\"physicalLocation\":\"Rio\",\"pairedRegion\"\ + :[{\"name\":\"brazilsouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\"\ + }]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/israelcentral\"\ + ,\"name\":\"israelcentral\",\"displayName\":\"Israel Central\",\"regionalDisplayName\"\ + :\"(Middle East) Israel Central\",\"metadata\":{\"regionType\":\"Physical\"\ + ,\"regionCategory\":\"Other\",\"geographyGroup\":\"Middle East\",\"longitude\"\ + :\"33.4506633\",\"latitude\":\"31.2655698\",\"physicalLocation\":\"Israel\"\ + ,\"pairedRegion\":[]}}]}" headers: cache-control: - no-cache content-length: - - '667' + - '33459' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:17:59 GMT + - Mon, 24 Jul 2023 10:12:12 GMT expires: - '-1' pragma: - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked vary: - Accept-Encoding x-content-type-options: @@ -620,7 +1170,7 @@ interactions: code: 200 message: OK - request: - body: '{"location": "southcentralus", "sku": {"name": "Free"}}' + body: '{"location": "southcentralus", "properties": {"name": "my-test-hub"}}' headers: Accept: - application/json @@ -631,46 +1181,44 @@ interactions: Connection: - keep-alive Content-Length: - - '55' + - '69' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - --resource-group --namespace-name --name --location User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs","location":"South - Central US","tags":null,"properties":{"registrationTtl":"10675199.02:48:05.4775807"}}' + string: '{"properties":{"registrationTtl":"10675199.02:48:05.4775807","dailyMaxActiveDevices":0},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs","location":"South + Central US"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '430' + - '400' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:08 GMT + - Mon, 24 Jul 2023 10:12:20 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 1265d6ad-5b38-49d1-8010-2e2f6dd129f2 x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 201 message: Created @@ -688,39 +1236,38 @@ interactions: Content-Length: - '46' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - --resource-group --namespace-name --name --rights User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule","name":"my-space-rule","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":null,"tags":null,"properties":{"rights":["Listen","Send"]}}' + string: '{"properties":{"rights":["Listen","Send"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule","name":"my-space-rule","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":"South + Central US"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '405' + - '363' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:11 GMT + - Mon, 24 Jul 2023 10:12:23 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - a076bf9b-8fdb-49b3-9779-f8fd7a4ecfbf transfer-encoding: - chunked vary: @@ -728,7 +1275,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -746,35 +1293,34 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule","name":"my-space-rule","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":null,"tags":null,"properties":{"rights":["Listen","Send"]}}' + string: '{"properties":{"rights":["Listen","Send"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule","name":"my-space-rule","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":"South + Central US"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '405' + - '363' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:14 GMT + - Mon, 24 Jul 2023 10:12:24 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 66a0e446-e0de-45da-8df4-059ce554ad25 transfer-encoding: - chunked vary: @@ -798,35 +1344,35 @@ interactions: ParameterSetName: - --resource-group --namespace-name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules?api-version=2017-04-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/RootManageSharedAccessKey","name":"RootManageSharedAccessKey","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":null,"tags":null,"properties":{"rights":["Listen","Manage","Send"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule","name":"my-space-rule","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":null,"tags":null,"properties":{"rights":["Listen","Send"]}}],"nextLink":null}' + string: '{"value":[{"properties":{"rights":["Manage","Listen","Send"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/RootManageSharedAccessKey","name":"RootManageSharedAccessKey","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":"South + Central US"},{"properties":{"rights":["Listen","Send"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule","name":"my-space-rule","type":"Microsoft.NotificationHubs/Namespaces/AuthorizationRules","location":"South + Central US"}]}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '872' + - '772' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:17 GMT + - Mon, 24 Jul 2023 10:12:27 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 3410a501-2ae1-461f-94df-78d1461797e0 transfer-encoding: - chunked vary: @@ -852,16 +1398,15 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/AuthorizationRules/my-space-rule/listKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-space-rule;SharedAccessKey=zpPpUHBblEeOJ1qHWUcInapxF6ZJS0n5wbUeY1RsKg8=","secondaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-space-rule;SharedAccessKey=nbJ4hhmMHElZFhFesKsiVsIeMSCsATnmLflQmZ5nV70=","primaryKey":"zpPpUHBblEeOJ1qHWUcInapxF6ZJS0n5wbUeY1RsKg8=","secondaryKey":"nbJ4hhmMHElZFhFesKsiVsIeMSCsATnmLflQmZ5nV70=","keyName":"my-space-rule"}' + string: '{"primaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-space-rule;SharedAccessKey=Xjc93e7VNk3+24KwBcngnRNnH8gLT51DXMViwu3N5T8=","secondaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-space-rule;SharedAccessKey=Cp0pDrlq2bBWs+6CasWUsW2eA2vm896QwbQj6xBvqOY=","primaryKey":"Xjc93e7VNk3+24KwBcngnRNnH8gLT51DXMViwu3N5T8=","secondaryKey":"Cp0pDrlq2bBWs+6CasWUsW2eA2vm896QwbQj6xBvqOY=","keyName":"my-space-rule"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: @@ -869,18 +1414,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:19 GMT + - Mon, 24 Jul 2023 10:12:30 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 8367e2a9-892c-4d5c-9b4b-3dfc41796fb1 transfer-encoding: - chunked vary: @@ -888,7 +1432,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 200 message: OK @@ -906,39 +1450,38 @@ interactions: Content-Length: - '38' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - --resource-group --namespace-name --notification-hub-name --name --rights User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key","name":"my-hub-listen-key","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":null,"tags":null,"properties":{"rights":["Listen"]}}' + string: '{"properties":{"rights":["Listen"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key","name":"my-hub-listen-key","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":"South + Central US"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '452' + - '410' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:22 GMT + - Mon, 24 Jul 2023 10:12:31 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 13cabdaf-7adb-494d-bd0f-9531255234d1 transfer-encoding: - chunked vary: @@ -964,35 +1507,34 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key","name":"my-hub-listen-key","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":null,"tags":null,"properties":{"rights":["Listen"]}}' + string: '{"properties":{"rights":["Listen"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key","name":"my-hub-listen-key","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":"South + Central US"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '452' + - '410' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:34 GMT + - Mon, 24 Jul 2023 10:12:33 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 2c53af73-c14b-4cd0-b9f3-415dd800c734 transfer-encoding: - chunked vary: @@ -1016,35 +1558,36 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules?api-version=2017-04-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/DefaultListenSharedAccessSignature","name":"DefaultListenSharedAccessSignature","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":null,"tags":null,"properties":{"rights":["Listen"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/DefaultFullSharedAccessSignature","name":"DefaultFullSharedAccessSignature","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":null,"tags":null,"properties":{"rights":["Listen","Manage","Send"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key","name":"my-hub-listen-key","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":null,"tags":null,"properties":{"rights":["Listen"]}}],"nextLink":null}' + string: '{"value":[{"properties":{"rights":["Listen"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub/AuthorizationRules/DefaultListenSharedAccessSignature","name":"DefaultListenSharedAccessSignature","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":"South + Central US"},{"properties":{"rights":["Manage","Listen","Send"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub/AuthorizationRules/DefaultFullSharedAccessSignature","name":"DefaultFullSharedAccessSignature","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":"South + Central US"},{"properties":{"rights":["Listen"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key","name":"my-hub-listen-key","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules","location":"South + Central US"}]}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '1466' + - '1324' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:37 GMT + - Mon, 24 Jul 2023 10:12:35 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - ef0ead01-6fd6-433a-adb1-4c117710bf7a transfer-encoding: - chunked vary: @@ -1070,16 +1613,15 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/AuthorizationRules/my-hub-listen-key/listKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-hub-listen-key;SharedAccessKey=cRI/qRnfXTMxdfkEEnydEW+54r/I05ZASdcWZK1EmCo=","secondaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-hub-listen-key;SharedAccessKey=E69PJR96yawTqdIgWrcrKagkujOlf9mrguHbS6PgW/I=","primaryKey":"cRI/qRnfXTMxdfkEEnydEW+54r/I05ZASdcWZK1EmCo=","secondaryKey":"E69PJR96yawTqdIgWrcrKagkujOlf9mrguHbS6PgW/I=","keyName":"my-hub-listen-key"}' + string: '{"primaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-hub-listen-key;SharedAccessKey=E93/nouMmJBDSqRxJVkcrkpLnP2TqQoM32qUFr+WoFk=","secondaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-hub-listen-key;SharedAccessKey=VCPw/f2eb3ds44LCCT38zDuOAkieBpI6uYS7E3KcjZU=","primaryKey":"E93/nouMmJBDSqRxJVkcrkpLnP2TqQoM32qUFr+WoFk=","secondaryKey":"VCPw/f2eb3ds44LCCT38zDuOAkieBpI6uYS7E3KcjZU=","keyName":"my-hub-listen-key"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: @@ -1087,77 +1629,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:38 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"gcmCredential": {"properties": {"googleApiKey": "XXXXX"}}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - notification-hub credential gcm update - Connection: - - keep-alive - Content-Length: - - '223' - Content-Type: - - application/json; charset=utf-8 - ParameterSetName: - - --resource-group --namespace-name --notification-hub-name --google-api-key - User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub?api-version=2017-04-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs","location":"South - Central US","tags":null,"properties":{"registrationTtl":"10675199.02:48:05.4775807","authorizationRules":[{"keyName":"DefaultListenSharedAccessSignature","primaryKey":"1036t3Lsv+Pt+yEMMjX99NUittJ1JeOmQBcppHkmSSU=","secondaryKey":"I28Hi1oQi9PNyLR7BXiNAuHn54bwFIMR2SG7zLcdHz8=","claimType":"SharedAccessKey","claimValue":"None","rights":["Listen"],"createdTime":"2020-04-01T14:18:07.2541923Z","modifiedTime":"2020-04-01T14:18:07.2541923Z"},{"keyName":"DefaultFullSharedAccessSignature","primaryKey":"PFOlf2U7KJWGuunmGHI9jpMuQ96v+fCVdYLOUYNGbKo=","secondaryKey":"O6xEksyW0eCMd3WRo0q5Cjm2hTZqqzA8uCd4JIKwe5A=","claimType":"SharedAccessKey","claimValue":"None","rights":["Listen","Manage","Send"],"createdTime":"2020-04-01T14:18:07.2541923Z","modifiedTime":"2020-04-01T14:18:07.2541923Z"},{"keyName":"my-hub-listen-key","primaryKey":"cRI/qRnfXTMxdfkEEnydEW+54r/I05ZASdcWZK1EmCo=","secondaryKey":"E69PJR96yawTqdIgWrcrKagkujOlf9mrguHbS6PgW/I=","claimType":"SharedAccessKey","claimValue":"None","rights":["Listen"],"createdTime":"2020-04-01T14:18:23.1101762Z","modifiedTime":"2020-04-01T14:18:23.1101762Z"}],"gcmCredential":{"properties":{"googleApiKey":"XXXXX"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '1649' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 01 Apr 2020 14:18:41 GMT + - Mon, 24 Jul 2023 10:12:36 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 7ed1751d-de43-45ea-9c18-1c54db51eb5a transfer-encoding: - chunked vary: @@ -1165,63 +1647,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - notification-hub credential list - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --resource-group --namespace-name --notification-hub-name - User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/pnsCredentials?api-version=2017-04-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub/pnsCredentials","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs/pnsCredentials","location":null,"tags":null,"properties":{"gcmCredential":{"properties":{"googleApiKey":"XXXXX"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '603' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 01 Apr 2020 14:18:44 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' status: code: 200 message: OK @@ -1239,36 +1665,34 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs","location":"South - Central US","tags":null,"properties":{"registrationTtl":"10675199.02:48:05.4775807","authorizationRules":[]}}' + string: '{"properties":{"registrationTtl":"10675199.02:48:05.4775807","authorizationRules":[],"dailyMaxActiveDevices":0},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs","location":"South + Central US"}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '454' + - '424' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:48 GMT + - Mon, 24 Jul 2023 10:12:39 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 0571f45e-33b6-4b06-a069-2a3947373295 transfer-encoding: - chunked vary: @@ -1292,36 +1716,34 @@ interactions: ParameterSetName: - --resource-group --namespace-name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs?api-version=2017-04-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs","location":"South - Central US","tags":null,"properties":{"registrationTtl":"10675199.02:48:05.4775807","authorizationRules":[]}}],"nextLink":null}' + string: '{"value":[{"properties":{"registrationTtl":"10675199.02:48:05.4775807","authorizationRules":[],"dailyMaxActiveDevices":0},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/NotificationHubs/my-test-hub","name":"my-test-hub","type":"Microsoft.NotificationHubs/namespaces/notificationHubs","location":"South + Central US"}]}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '482' + - '436' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:50 GMT + - Mon, 24 Jul 2023 10:12:40 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 7f10aff5-3daa-499d-977f-dacb89b9e884 transfer-encoding: - chunked vary: @@ -1345,36 +1767,34 @@ interactions: ParameterSetName: - --resource-group --name User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South - Central US","kind":"NotificationHub","sku":{"name":"Free"},"tags":{},"properties":{"provisioningState":"Succeeded","metricId":null,"status":"Active","createdAt":"2020-04-01T14:17:07.507Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-04-01T14:17:31.16Z","namespaceType":"NotificationHub"}}' + string: '{"sku":{"name":"Free"},"properties":{"provisioningState":"Succeeded","status":"Active","createdAt":"2023-07-24T07:56:25.0170000Z","updatedAt":"2023-07-24T10:12:23.1570000Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South + Central US","tags":{}}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '667' + - '557' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:51 GMT + - Mon, 24 Jul 2023 10:12:42 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 1ea8d921-7906-4fe0-a7c2-d4c0c21d8dc6 transfer-encoding: - chunked vary: @@ -1398,36 +1818,34 @@ interactions: ParameterSetName: - --resource-group User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces?api-version=2017-04-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South - Central US","kind":"NotificationHub","sku":{"name":"Free"},"tags":{},"properties":{"provisioningState":"Succeeded","metricId":null,"status":"Active","createdAt":"2020-04-01T14:17:07.507Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-04-01T14:17:31.16Z","namespaceType":"NotificationHub"}}],"nextLink":null}' + string: '{"value":[{"sku":{"name":"Free"},"properties":{"provisioningState":"Succeeded","status":"Active","createdAt":"2023-07-24T07:56:25.0170000Z","updatedAt":"2023-07-24T10:12:23.1570000Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space","name":"my-test-space","type":"Microsoft.NotificationHubs/namespaces","location":"South + Central US","tags":{}}]}' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - - '695' + - '569' content-type: - application/json; charset=utf-8 date: - - Wed, 01 Apr 2020 14:18:53 GMT + - Mon, 24 Jul 2023 10:12:45 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 27d2c396-55ac-4ce9-abe5-23b7187797d8 transfer-encoding: - chunked vary: @@ -1441,7 +1859,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -1453,33 +1871,31 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name -y User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space/notificationHubs/my-test-hub?api-version=2017-04-01 response: body: string: '' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache content-length: - '0' date: - - Wed, 01 Apr 2020 14:18:59 GMT + - Mon, 24 Jul 2023 10:12:54 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 16c892eb-a1d1-42fa-bc2e-0c39a8cecf8a x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: @@ -1491,7 +1907,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -1503,90 +1919,34 @@ interactions: ParameterSetName: - --resource-group --name -y User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - accept-language: - - en-US + - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_notificationhubs000001/providers/Microsoft.NotificationHubs/namespaces/my-test-space?api-version=2017-04-01 response: body: string: '' headers: + api-supported-versions: + - 2014-09-01, 2016-03-01, 2017-04-01, 2020-01-01-preview, 2023-01-01-preview cache-control: - no-cache - content-length: - - '0' date: - - Wed, 01 Apr 2020 14:19:02 GMT + - Mon, 24 Jul 2023 10:13:02 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NotificationHubs/operationresults/my-test-space?api-version=2017-04-01 pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + trackingid: + - 02f48f68-5d1f-479a-bbce-27afcdd69c65 x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - '14999' status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - notification-hub namespace delete - Connection: - - keep-alive - ParameterSetName: - - --resource-group --name -y - User-Agent: - - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 (MSI) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.NotificationHubs/operationresults/my-test-space?api-version=2017-04-01 - response: - body: - string: '{"id":"subscriptions/0b1f64711bf04ddaaec3cb9272f09590/operationsStatus/my-test-space","name":"my-test-space","status":"Completed"}' - headers: - cache-control: - - no-cache - content-length: - - '130' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 01 Apr 2020 14:19:33 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK + code: 204 + message: No Content version: 1 diff --git a/src/notification-hub/azext_notification_hub/tests/latest/test_notificationhubs_scenario.py b/src/notification-hub/azext_notification_hub/tests/latest/test_notificationhubs_scenario.py index 40c3b8311af..fe03588729e 100644 --- a/src/notification-hub/azext_notification_hub/tests/latest/test_notificationhubs_scenario.py +++ b/src/notification-hub/azext_notification_hub/tests/latest/test_notificationhubs_scenario.py @@ -16,6 +16,7 @@ class NotificationHubsScenarioTest(ScenarioTest): + @AllowLargeResponse(9999) @ResourceGroupPreparer(name_prefix='cli_test_notificationhubs') def test_notificationhubs(self, resource_group): @@ -106,18 +107,19 @@ def test_notificationhubs(self, resource_group): '--name "my-hub-listen-key"', checks=[JMESPathCheckExists('primaryConnectionString')]) - self.cmd('az notification-hub credential gcm update ' - '--resource-group {rg} ' - '--namespace-name {namespace-name} ' - '--notification-hub-name {notification-hub-name} ' - '--google-api-key "XXXXX"', - checks=[]) + # Invalid Firebase credentials. + # self.cmd('az notification-hub credential gcm update ' + # '--resource-group {rg} ' + # '--namespace-name {namespace-name} ' + # '--notification-hub-name {notification-hub-name} ' + # '--google-api-key "XXXXX"', + # checks=[]) - self.cmd('az notification-hub credential list ' - '--resource-group {rg} ' - '--namespace-name {namespace-name} ' - '--notification-hub-name {notification-hub-name}', - checks=[JMESPathCheckExists('gcmCredential.googleApiKey')]) + # self.cmd('az notification-hub credential list ' + # '--resource-group {rg} ' + # '--namespace-name {namespace-name} ' + # '--notification-hub-name {notification-hub-name}', + # checks=[JMESPathCheckExists('gcmCredential.googleApiKey')]) # This test needs to use an Android App to receive notification: # https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-android-push-notification-google-fcm-get-started diff --git a/src/notification-hub/setup.py b/src/notification-hub/setup.py index b1ec563fe96..730c071f27d 100644 --- a/src/notification-hub/setup.py +++ b/src/notification-hub/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.2.0' +VERSION = '1.0.0a1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers