diff --git a/src/notification-hub/HISTORY.rst b/src/notification-hub/HISTORY.rst index 1c139576ba0..b99b66222fa 100644 --- a/src/notification-hub/HISTORY.rst +++ b/src/notification-hub/HISTORY.rst @@ -3,6 +3,11 @@ Release History =============== +0.2.0 +* Ignore --sku in notification hub as sku can only be set at namespace level +* Drop Python 3.5 +* Use Experimental tag + 0.1.0 ++++++ * Initial release. diff --git a/src/notification-hub/README.md b/src/notification-hub/README.md index 7aed4b13f6f..fb6761627b1 100644 --- a/src/notification-hub/README.md +++ b/src/notification-hub/README.md @@ -28,8 +28,7 @@ az notification-hub create \ --resource-group groupName \ --namespace-name spaceName \ --name hubName \ - --location "South Central US" \ - --name "Basic" + --location "South Central US" ``` ##### Create a Notification Hub authorization rule diff --git a/src/notification-hub/azext_notification_hub/_help.py b/src/notification-hub/azext_notification_hub/_help.py index 70813f3d883..fda3b5dad4c 100644 --- a/src/notification-hub/azext_notification_hub/_help.py +++ b/src/notification-hub/azext_notification_hub/_help.py @@ -26,7 +26,7 @@ - name: Create a namespace text: |- az notification-hub namespace create --resource-group MyResourceGroup --name \\ - "nh-sdk-ns" --location "South Central US" --sku "Standard" + my-namespace --location "South Central US" --sku Standard """ helps['notification-hub namespace update'] = """ @@ -36,7 +36,7 @@ - name: Update the namespace text: |- az notification-hub namespace update --resource-group MyResourceGroup --name \\ - "nh-sdk-ns" --sku "Standard" + my-namespace --sku Standard """ helps['notification-hub namespace delete'] = """ @@ -46,7 +46,7 @@ - name: Delete the namespace text: |- az notification-hub namespace delete --resource-group MyResourceGroup --name \\ - "nh-sdk-ns" + my-namespace """ helps['notification-hub namespace show'] = """ @@ -56,14 +56,14 @@ - name: Show namespace info text: |- az notification-hub namespace show --resource-group MyResourceGroup --name \\ - "nh-sdk-ns" + my-namespace """ helps['notification-hub namespace list'] = """ type: command short-summary: List available namespaces. examples: - - name: List available namespaces within a resourceGroup + - 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 @@ -86,7 +86,7 @@ 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 \\ - "nh-sdk-ns" --created + my-namespace --created """ helps['notification-hub namespace authorization-rule'] = """ @@ -101,7 +101,7 @@ - name: List keys of the namesapce authorization rule text: |- az notification-hub namespace authorization-rule list-keys --resource-group MyResourceGroup --namespace-name \\ - "nh-sdk-ns" --name "RootManageSharedAccessKey" + my-namespace --name "RootManageSharedAccessKey" """ helps['notification-hub namespace authorization-rule regenerate-keys'] = """ @@ -111,7 +111,7 @@ - name: Regenerate keys of the namesapce authorization rule text: |- az notification-hub namespace authorization-rule regenerate-keys --resource-group MyResourceGroup --namespace-name \\ - "nh-sdk-ns" --name "RootManageSharedAccessKey" --policy-key "Secondary Key" + my-namespace --name "RootManageSharedAccessKey" --policy-key "Secondary Key" """ helps['notification-hub namespace authorization-rule show'] = """ @@ -121,7 +121,7 @@ - name: Show namespace authorization rule info text: |- az notification-hub namespace authorization-rule show --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" --name "RootManageSharedAccessKey" + --namespace-name my-namespace --name "RootManageSharedAccessKey" """ helps['notification-hub namespace authorization-rule list'] = """ @@ -131,7 +131,7 @@ - name: List authorization rules of the namespace text: |- az notification-hub namespace authorization-rule list --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" + --namespace-name my-namespace """ helps['notification-hub namespace authorization-rule create'] = """ @@ -141,7 +141,7 @@ - name: Create a namespace authorization rule text: |- az notification-hub namespace authorization-rule create --resource-group \\ - MyResourceGroup --namespace-name "nh-sdk-ns" --name "sdk-AuthRules-1788" --rights "Listen" + MyResourceGroup --namespace-name my-namespace --name "sdk-AuthRules-1788" --rights Listen Send """ helps['notification-hub namespace authorization-rule delete'] = """ @@ -151,7 +151,7 @@ - name: Delete a namespace authorization rule text: |- az notification-hub namespace authorization-rule delete --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" --name "RootManageSharedAccessKey" + --namespace-name my-namespace --name "RootManageSharedAccessKey" """ helps['notification-hub'] = """ @@ -165,8 +165,8 @@ examples: - name: Create a Notification Hub text: |- - az notification-hub create --resource-group MyResourceGroup --namespace-name "nh-sdk-ns" \\ - --name "nh-sdk-hub" --location "South Central US" --sku "Free" + az notification-hub create --resource-group MyResourceGroup --namespace-name my-namespace \\ + --name my-hub --location "South Central US" """ helps['notification-hub update'] = """ @@ -175,8 +175,8 @@ examples: - name: Update the Notification Hub text: |- - az notification-hub update --resource-group "sdkresourceGroup" --namespace-name \\ - "nh-sdk-ns" --name "sdk-notificationHubs-8708" + az notification-hub update --resource-group MyResourceGroup --namespace-name \\ + my-namespace --name "sdk-notificationHubs-8708" """ helps['notification-hub delete'] = """ @@ -185,8 +185,8 @@ examples: - name: Delete a notification hub text: |- - az notification-hub delete --resource-group MyResourceGroup --namespace-name "nh-sdk-ns" \\ - --name "nh-sdk-hub" + az notification-hub delete --resource-group MyResourceGroup --namespace-name my-namespace \\ + --name my-hub """ helps['notification-hub show'] = """ @@ -195,8 +195,8 @@ examples: - name: Show the Notification Hub info text: |- - az notification-hub show --resource-group MyResourceGroup --namespace-name "nh-sdk-ns" \\ - --name "nh-sdk-hub" + az notification-hub show --resource-group MyResourceGroup --namespace-name my-namespace \\ + --name my-hub """ helps['notification-hub list'] = """ @@ -205,7 +205,7 @@ examples: - name: List the notification hubs text: |- - az notification-hub list --resource-group MyResourceGroup --namespace-name "nh-sdk-ns" + az notification-hub list --resource-group MyResourceGroup --namespace-name my-namespace """ helps['notification-hub check-availability'] = """ @@ -215,7 +215,7 @@ - name: Check the availability of the given notificationHub name text: |- az notification-hub check-availability --resource-group MyResourceGroup \\ - --namespace-name "locp-newns" --name "nh-sdk-hub" + --namespace-name "locp-newns" --name my-hub """ helps['notification-hub authorization-rule'] = """ @@ -230,8 +230,8 @@ - name: Regenerate the Notification Hub authorization rule text: |- az notification-hub authorization-rule regenerate-keys --resource-group MyResourceGroup --namespace-name \\ - "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --name \\ - "DefaultListenSharedAccessSignature" --policy-key "Secondary Key" + my-namespace --notification-hub-name my-hub --name \\ + DefaultListenSharedAccessSignature --policy-key "Secondary Key" """ helps['notification-hub credential list'] = """ @@ -241,7 +241,7 @@ - name: List the PNS Credentials text: |- az notification-hub credential list --resource-group MyResourceGroup --namespace-name \\ - "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" + my-namespace --notification-hub-name my-hub """ helps['notification-hub authorization-rule list-keys'] = """ @@ -250,8 +250,8 @@ examples: - name: List connectionStrings of the authorization rule text: |- - az notification-hub authorization-rule list-keys --resource-group MyResourceGroup --namespace-name "nh-sdk-ns" \\ - --notification-hub-name "nh-sdk-hub" --name "sdk-AuthRules-5800" + 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'] = """ @@ -261,17 +261,17 @@ - name: test send notification with message body text: |- az notification-hub test-send --resource-group MyResourceGroup --namespace-name \\ - "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --notification-format gcm \\ + my-namespace --notification-hub-name my-hub --notification-format gcm \\ --message "test notification" - name: test send notification from file text: |- az notification-hub test-send --resource-group MyResourceGroup --namespace-name \\ - "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --notification-format gcm \\ + my-namespace --notification-hub-name my-hub --notification-format gcm \\ --payload @path/to/file - name: test send notification with json string text: |- az notification-hub test-send --resource-group MyResourceGroup --namespace-name \\ - "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --notification-format gcm \\ + my-namespace --notification-hub-name my-hub --notification-format gcm \\ --payload "{\\\"data\\\":{\\\"message\\\":\\\"test notification\\\"}}" """ @@ -282,7 +282,7 @@ - name: List authorization rules text: |- az notification-hub authorization-rule list --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" + --namespace-name my-namespace --notification-hub-name my-hub """ helps['notification-hub authorization-rule show'] = """ @@ -292,8 +292,8 @@ - name: Show the authorization rule information text: |- az notification-hub authorization-rule show --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --name \\ - "DefaultListenSharedAccessSignature" + --namespace-name my-namespace --notification-hub-name my-hub --name \\ + DefaultListenSharedAccessSignature """ helps['notification-hub authorization-rule create'] = """ @@ -303,8 +303,8 @@ - name: Create an authorization rule text: |- az notification-hub authorization-rule create --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --name \\ - "DefaultListenSharedAccessSignature" --rights "Listen" + --namespace-name my-namespace --notification-hub-name my-hub --name \\ + DefaultListenSharedAccessSignature --rights Listen Send """ helps['notification-hub authorization-rule delete'] = """ @@ -314,8 +314,8 @@ - name: Delete the authorization rule text: |- az notification-hub authorization-rule delete --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --name \\ - "DefaultListenSharedAccessSignature" + --namespace-name my-namespace --notification-hub-name my-hub --name \\ + DefaultListenSharedAccessSignature """ helps['notification-hub credential'] = """ @@ -359,7 +359,7 @@ - name: Update gcm key text: |- az notification-hub credential gcm update --resource-group MyResourceGroup \\ - --namespace-name "nh-sdk-ns" --notification-hub-name "nh-sdk-hub" --google-api-key \\ + --namespace-name my-namespace --notification-hub-name my-hub --google-api-key \\ "xxxxxxxxx" """ @@ -374,8 +374,8 @@ examples: - name: Update APNS certificate text: |- - az notification-hub credential apns update --namespace-name "nh-sdk-ns" \\ - --notification-hub-name "nh-sdk-hub" --apns-certificate "/path/to/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 """ diff --git a/src/notification-hub/azext_notification_hub/_params.py b/src/notification-hub/azext_notification_hub/_params.py index eb94641e2cf..1c7fc08d735 100644 --- a/src/notification-hub/azext_notification_hub/_params.py +++ b/src/notification-hub/azext_notification_hub/_params.py @@ -81,14 +81,14 @@ def load_arguments(self, _): 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.argument('sku_name', arg_type=get_enum_type(['Free', 'Basic', 'Standard']), help='Name of the notification hub sku') + 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.argument('sku_name', arg_type=get_enum_type(['Free', 'Basic', 'Standard']), help='Name of the notification hub sku') + c.ignore('sku_name') with self.argument_context('notification-hub delete') as c: c.argument('namespace_name', id_part="name", help='The namespace name.') @@ -142,7 +142,7 @@ def load_arguments(self, _): 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. Separated by comma.') + 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.') diff --git a/src/notification-hub/azext_notification_hub/azext_metadata.json b/src/notification-hub/azext_notification_hub/azext_metadata.json index 55c81bf3328..27e30487444 100644 --- a/src/notification-hub/azext_notification_hub/azext_metadata.json +++ b/src/notification-hub/azext_notification_hub/azext_metadata.json @@ -1,4 +1,4 @@ { - "azext.isPreview": true, - "azext.minCliCoreVersion": "2.0.67" -} \ No newline at end of file + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} diff --git a/src/notification-hub/azext_notification_hub/commands.py b/src/notification-hub/azext_notification_hub/commands.py index 4b459665008..cf26b5814b5 100644 --- a/src/notification-hub/azext_notification_hub/commands.py +++ b/src/notification-hub/azext_notification_hub/commands.py @@ -17,7 +17,7 @@ def load_command_table(self, _): 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, is_preview=True) as g: + 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?') @@ -25,18 +25,20 @@ def load_command_table(self, _): g.custom_command('list', 'list_notificationhubs_namespace') g.custom_command('check-availability', 'check_availability_notificationhubs_namespace') g.wait_command('wait') - g.custom_show_command('authorization-rule show', 'get_authorization_rule_notificationhubs_namespace') - g.custom_command('authorization-rule list', 'list_authorization_rules_notificationhubs_namespace') - g.custom_command('authorization-rule create', 'create_or_update_authorization_rule_notificationhubs_namespace') - g.custom_command('authorization-rule delete', 'delete_authorization_rule_notificationhubs_namespace', confirmation=True) - g.custom_command('authorization-rule list-keys', 'list_keys_notificationhubs_namespace') - g.custom_command('authorization-rule regenerate-keys', 'regenerate_keys_notificationhubs_namespace') + + 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') from ._client_factory import cf_notification_hubs 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_preview=True) as g: + 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) @@ -44,12 +46,14 @@ def load_command_table(self, _): g.custom_command('list', 'list_notificationhubs_hub') g.custom_command('check-availability', 'check_notification_hub_availability_notificationhubs_hub') g.custom_command('test-send', 'debug_send_notificationhubs_hub', validator=validate_notification_message) - g.custom_command('authorization-rule list', 'list_authorization_rules_notificationhubs_hub') - g.custom_show_command('authorization-rule show', 'get_authorization_rule_notificationhubs_hub') - g.custom_command('authorization-rule create', 'create_or_update_authorization_rule_notificationhubs_hub') - g.custom_command('authorization-rule delete', 'delete_authorization_rule_notificationhubs_hub') - g.custom_command('authorization-rule list-keys', 'list_keys_notificationhubs_hub') - g.custom_command('authorization-rule regenerate-keys', 'regenerate_keys_notificationhubs_hub') + + 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') diff --git a/src/notification-hub/azext_notification_hub/custom.py b/src/notification-hub/azext_notification_hub/custom.py index 7d8ecf59464..e21beca0370 100644 --- a/src/notification-hub/azext_notification_hub/custom.py +++ b/src/notification-hub/azext_notification_hub/custom.py @@ -20,6 +20,10 @@ def create_notificationhubs_namespace(cmd, client, 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 @@ -57,7 +61,7 @@ def get_notificationhubs_namespace(cmd, client, def list_notificationhubs_namespace(cmd, client, resource_group_name=None): - if resource_group_name is not None: + if resource_group_name: return client.list(resource_group_name=resource_group_name) return client.list_all() @@ -116,14 +120,27 @@ def create_notificationhubs_hub(cmd, client, resource_group_name, namespace_name, notification_hub_name, - sku_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 - body.setdefault('sku', {})['name'] = sku_name # str + + # 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) @@ -132,13 +149,10 @@ def update_notificationhubs_hub(cmd, client, resource_group_name, namespace_name, notification_hub_name, - tags=None, - sku_name=None): + 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 - 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, 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 3309c2c6225..877cd7c7085 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 @@ -17,8 +17,8 @@ interactions: ParameterSetName: - --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -34,7 +34,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:28:36 GMT + - Wed, 01 Apr 2020 14:16:55 GMT expires: - '-1' pragma: @@ -53,7 +53,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -71,12 +71,12 @@ interactions: ParameterSetName: - --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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=2016-06-01 + 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 @@ -128,7 +128,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:28:36 GMT + - Wed, 01 Apr 2020 14:16:56 GMT expires: - '-1' pragma: @@ -142,6 +142,64 @@ interactions: status: code: 200 message: OK +- request: + body: '{"name": "my-test-space"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - 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 + 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}' + headers: + cache-control: + - no-cache + content-length: + - '287' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Apr 2020 14:16:58 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"}}' headers: @@ -160,8 +218,8 @@ interactions: ParameterSetName: - --resource-group --name --location --sku User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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: PUT @@ -178,7 +236,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:28:45 GMT + - Wed, 01 Apr 2020 14:17:09 GMT expires: - '-1' pragma: @@ -215,8 +273,8 @@ interactions: ParameterSetName: - --resource-group --name --created User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -224,7 +282,7 @@ interactions: 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-01-20T09:28:43.857Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-01-20T09:28:43.857Z","namespaceType":"NotificationHub"}}' + 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 @@ -233,7 +291,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:28:47 GMT + - Wed, 01 Apr 2020 14:17:14 GMT expires: - '-1' pragma: @@ -268,8 +326,8 @@ interactions: ParameterSetName: - --resource-group --name --created User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -277,16 +335,16 @@ interactions: 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-01-20T09:28:43.857Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-01-20T09:29:09.507Z","namespaceType":"NotificationHub"}}' + 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"}}' headers: cache-control: - no-cache content-length: - - '668' + - '667' content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:19 GMT + - Wed, 01 Apr 2020 14:17:49 GMT expires: - '-1' pragma: @@ -325,8 +383,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -342,7 +400,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:22 GMT + - Wed, 01 Apr 2020 14:17:53 GMT expires: - '-1' pragma: @@ -361,7 +419,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 200 message: OK @@ -379,12 +437,12 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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=2016-06-01 + 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 @@ -436,13 +494,124 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:23 GMT + - 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 + 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:57 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: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - notification-hub create + Connection: + - keep-alive + 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 + 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"}}' + headers: + cache-control: + - no-cache + content-length: + - '667' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Apr 2020 14:17:59 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: @@ -466,10 +635,10 @@ interactions: Content-Type: - application/json; charset=utf-8 ParameterSetName: - - --resource-group --namespace-name --name --location --sku + - --resource-group --namespace-name --name --location User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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: PUT @@ -486,7 +655,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:32 GMT + - Wed, 01 Apr 2020 14:18:08 GMT expires: - '-1' pragma: @@ -523,8 +692,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name --rights User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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: PUT @@ -540,7 +709,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:35 GMT + - Wed, 01 Apr 2020 14:18:11 GMT expires: - '-1' pragma: @@ -559,7 +728,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -577,8 +746,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -594,7 +763,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:36 GMT + - Wed, 01 Apr 2020 14:18:14 GMT expires: - '-1' pragma: @@ -629,8 +798,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -646,7 +815,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:39 GMT + - Wed, 01 Apr 2020 14:18:17 GMT expires: - '-1' pragma: @@ -683,15 +852,15 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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/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=Sf6KfAR8KHjgeqWUuivX514Zrs77lS38Dv1/UVPyW5c=","secondaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-space-rule;SharedAccessKey=YLIMQj2nht7cuLb0aLtbgYgl+4mXVbTkspCFNpbD3EU=","primaryKey":"Sf6KfAR8KHjgeqWUuivX514Zrs77lS38Dv1/UVPyW5c=","secondaryKey":"YLIMQj2nht7cuLb0aLtbgYgl+4mXVbTkspCFNpbD3EU=","keyName":"my-space-rule"}' + 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"}' headers: cache-control: - no-cache @@ -700,7 +869,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:41 GMT + - Wed, 01 Apr 2020 14:18:19 GMT expires: - '-1' pragma: @@ -719,7 +888,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -741,8 +910,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name --name --rights User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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: PUT @@ -758,7 +927,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:43 GMT + - Wed, 01 Apr 2020 14:18:22 GMT expires: - '-1' pragma: @@ -777,7 +946,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -795,8 +964,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -812,7 +981,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:45 GMT + - Wed, 01 Apr 2020 14:18:34 GMT expires: - '-1' pragma: @@ -847,8 +1016,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -864,7 +1033,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:46 GMT + - Wed, 01 Apr 2020 14:18:37 GMT expires: - '-1' pragma: @@ -901,15 +1070,15 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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/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=l+qEVCZy2u1oA+AeikT8yOuvtAa8cpQ/ZmZI5AyN9zs=","secondaryConnectionString":"Endpoint=sb://my-test-space.servicebus.windows.net/;SharedAccessKeyName=my-hub-listen-key;SharedAccessKey=dDmUgdnP4nL00rKueAh2Pm98+AYN1SlBUcVbiabI/yI=","primaryKey":"l+qEVCZy2u1oA+AeikT8yOuvtAa8cpQ/ZmZI5AyN9zs=","secondaryKey":"dDmUgdnP4nL00rKueAh2Pm98+AYN1SlBUcVbiabI/yI=","keyName":"my-hub-listen-key"}' + 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"}' headers: cache-control: - no-cache @@ -918,7 +1087,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:48 GMT + - Wed, 01 Apr 2020 14:18:38 GMT expires: - '-1' pragma: @@ -937,67 +1106,12 @@ interactions: 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 credential gcm update - Connection: - - keep-alive - ParameterSetName: - - --resource-group --namespace-name --notification-hub-name --google-api-key - User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 - 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/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":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '454' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 20 Jan 2020 09:29:49 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 + - '1197' status: code: 200 message: OK - request: - body: '{"location": "South Central US", "properties": {"name": "my-test-hub", - "registrationTtl": "10675199.02:48:05.4775807", "authorizationRules": [], "gcmCredential": - {"properties": {"googleApiKey": "XXXXX"}}}}' + body: '{"properties": {"gcmCredential": {"properties": {"googleApiKey": "XXXXX"}}}}' headers: Accept: - application/json @@ -1008,14 +1122,14 @@ interactions: Connection: - keep-alive Content-Length: - - '352' + - '223' Content-Type: - application/json; charset=utf-8 ParameterSetName: - --resource-group --namespace-name --notification-hub-name --google-api-key User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -1023,16 +1137,16 @@ interactions: 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":[],"gcmCredential":{"properties":{"googleApiKey":"XXXXX"}}}}' + 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: - - '657' + - '1649' content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:51 GMT + - Wed, 01 Apr 2020 14:18:41 GMT expires: - '-1' pragma: @@ -1051,7 +1165,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 200 message: OK @@ -1071,8 +1185,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --notification-hub-name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -1088,7 +1202,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:53 GMT + - Wed, 01 Apr 2020 14:18:44 GMT expires: - '-1' pragma: @@ -1107,7 +1221,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 200 message: OK @@ -1125,8 +1239,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -1143,7 +1257,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:54 GMT + - Wed, 01 Apr 2020 14:18:48 GMT expires: - '-1' pragma: @@ -1178,8 +1292,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -1196,7 +1310,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:55 GMT + - Wed, 01 Apr 2020 14:18:50 GMT expires: - '-1' pragma: @@ -1231,8 +1345,8 @@ interactions: ParameterSetName: - --resource-group --name User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -1240,16 +1354,16 @@ interactions: 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-01-20T09:28:43.857Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-01-20T09:29:09.507Z","namespaceType":"NotificationHub"}}' + 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"}}' headers: cache-control: - no-cache content-length: - - '668' + - '667' content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:57 GMT + - Wed, 01 Apr 2020 14:18:51 GMT expires: - '-1' pragma: @@ -1284,8 +1398,8 @@ interactions: ParameterSetName: - --resource-group User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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 @@ -1293,16 +1407,16 @@ interactions: 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-01-20T09:28:43.857Z","serviceBusEndpoint":"https://my-test-space.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2020-01-20T09:29:09.507Z","namespaceType":"NotificationHub"}}],"nextLink":null}' + 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}' headers: cache-control: - no-cache content-length: - - '696' + - '695' content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:29:58 GMT + - Wed, 01 Apr 2020 14:18:53 GMT expires: - '-1' pragma: @@ -1339,8 +1453,8 @@ interactions: ParameterSetName: - --resource-group --namespace-name --name -y User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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: DELETE @@ -1354,7 +1468,7 @@ interactions: content-length: - '0' date: - - Mon, 20 Jan 2020 09:30:04 GMT + - Wed, 01 Apr 2020 14:18:59 GMT expires: - '-1' pragma: @@ -1389,8 +1503,8 @@ interactions: ParameterSetName: - --resource-group --name -y User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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: DELETE @@ -1404,7 +1518,7 @@ interactions: content-length: - '0' date: - - Mon, 20 Jan 2020 09:30:08 GMT + - Wed, 01 Apr 2020 14:19:02 GMT expires: - '-1' location: @@ -1421,7 +1535,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 202 message: Accepted @@ -1439,8 +1553,8 @@ interactions: ParameterSetName: - --resource-group --name -y User-Agent: - - python/3.7.3 (Darwin-19.0.0-x86_64-i386-64bit) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-notificationhubs/2.1.0 Azure-SDK-For-Python AZURECLI/2.0.80 + - 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: @@ -1454,7 +1568,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 20 Jan 2020 09:30:39 GMT + - Wed, 01 Apr 2020 14:19:33 GMT expires: - '-1' pragma: 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 ecff1c5ffe5..a8b24df547d 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 @@ -51,8 +51,7 @@ def test_notificationhubs(self, resource_group): '--resource-group {rg} ' '--namespace-name {namespace-name} ' '--name {notification-hub-name} ' - '--location "South Central US" ' - '--sku "Free"', + '--location "South Central US"', checks=[JMESPathCheck('name', self.kwargs.get('notification-hub-name', ''))]) self.cmd('az notification-hub namespace authorization-rule create ' diff --git a/src/notification-hub/setup.cfg b/src/notification-hub/setup.cfg index 3c6e79cf31d..e69de29bb2d 100644 --- a/src/notification-hub/setup.cfg +++ b/src/notification-hub/setup.cfg @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/src/notification-hub/setup.py b/src/notification-hub/setup.py index 555ecddf7b7..e6b7c55e5f4 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.1.0' +VERSION = '0.2.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -25,10 +25,7 @@ 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8',