Skip to content

Commit

Permalink
Update SKU for SignalR CLI extension (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackliu authored and derekbekoe committed May 4, 2018
1 parent 0b338eb commit b017bfe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
"signalr": [
{
"filename": "signalr-0.1.0-py2.py3-none-any.whl",
"sha256Digest": "0cd98580aa10b660602c1b4496c9beef24cf9c8e15df8113b2642c75457772ee",
"sha256Digest": "be38f9e49f1a92d194e7f141d978e10de852f77b63db2ef6c02f838fc3067f9f",
"downloadUrl": "https://azureclisignalr.blob.core.windows.net/cli-extensions/signalr-0.1.0-py2.py3-none-any.whl",
"metadata": {
"azext.minCliCoreVersion": "2.0.32.dev0",
Expand Down
3 changes: 2 additions & 1 deletion src/signalr/azext_signalr/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# --------------------------------------------------------------------------------------------


SIGNALR_SKU = ['Basic_DS2']
SIGNALR_SKU = ['Basic_DS2', 'Free_DS2']
SIGNALR_RESOURCE_TYPE = 'Microsoft.SignalRService/SignalR'
SIGNALR_KEY_TYPE = ['primary', 'secondary']
UNIT_COUNT_MAXIMUM = 10
7 changes: 7 additions & 0 deletions src/signalr/azext_signalr/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@


from azext_signalr.signalr.models import (ResourceSku, SignalRCreateOrUpdateProperties, SignalRCreateParameters)
from ._constants import (
UNIT_COUNT_MAXIMUM
)


def signalr_create(client, signalr_name, resource_group_name, sku, unit_count=1, location=None, tags=None):
if unit_count < 1 or unit_count > UNIT_COUNT_MAXIMUM:
from azure.cli.core.util import CLIError
raise CLIError('Unit count should between 1 and {}'.format(UNIT_COUNT_MAXIMUM))

sku = ResourceSku(name=sku, capacity=unit_count)
properties = SignalRCreateOrUpdateProperties(host_name_prefix=signalr_name)

Expand Down

0 comments on commit b017bfe

Please sign in to comment.