Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/notification-hub/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 1 addition & 2 deletions src/notification-hub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
80 changes: 40 additions & 40 deletions src/notification-hub/azext_notification_hub/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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\\\"}}"
"""

Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand All @@ -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'] = """
Expand Down Expand Up @@ -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"
"""

Expand All @@ -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
"""

Expand Down
6 changes: 3 additions & 3 deletions src/notification-hub/azext_notification_hub/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be a breaking change and user would meet errors. Just want to confirm. If the usage is quite low, it's fine to do it.

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.')
Expand Down Expand Up @@ -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.')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.0.67"
}
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.3.1"
}
Loading