Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/communication/azext_communication/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.11.0"
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.15.0"
}
62 changes: 32 additions & 30 deletions src/communication/azext_communication/generated/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,116 +12,118 @@
from knack.help_files import helps


helps['communication'] = """
helps['communication service'] = """
type: group
short-summary: Manage service with communication
"""

helps['communication list'] = """
helps['communication service list'] = """
type: command
short-summary: "Handles requests to list all resources in a resource group. And Handles requests to list all \
resources in a subscription."
examples:
- name: List by resource group
text: |-
az communication list --resource-group "MyResourceGroup"
az communication service list --resource-group "MyResourceGroup"
- name: List by subscription
text: |-
az communication list
az communication service list
"""

helps['communication show'] = """
helps['communication service show'] = """
type: command
short-summary: "Get the CommunicationService and its properties."
examples:
- name: Get resource
text: |-
az communication show --name "MyCommunicationResource" --resource-group "MyResourceGroup"
az communication service show --name "MyCommunicationResource" --resource-group "MyResourceGroup"
"""

helps['communication create'] = """
helps['communication service create'] = """
type: command
short-summary: "Create a new CommunicationService or update an existing CommunicationService."
examples:
- name: Create or update resource
text: |-
az communication create --name "MyCommunicationResource" --location "Global" --data-location "United \
States" --resource-group "MyResourceGroup"
az communication service create --name "MyCommunicationResource" --location "Global" --data-location \
"United States" --resource-group "MyResourceGroup"
"""

helps['communication update'] = """
helps['communication service update'] = """
type: command
short-summary: "Operation to update an existing CommunicationService."
examples:
- name: Update resource
text: |-
az communication update --name "MyCommunicationResource" --tags newTag="newVal" --resource-group \
"MyResourceGroup"
az communication service update --name "MyCommunicationResource" --tags newTag="newVal" \
--resource-group "MyResourceGroup"
"""

helps['communication delete'] = """
helps['communication service delete'] = """
type: command
short-summary: "Operation to delete a CommunicationService."
examples:
- name: Delete resource
text: |-
az communication delete --name "MyCommunicationResource" --resource-group "MyResourceGroup"
az communication service delete --name "MyCommunicationResource" --resource-group "MyResourceGroup"
"""

helps['communication link-notification-hub'] = """
helps['communication service link-notification-hub'] = """
type: command
short-summary: "Links an Azure Notification Hub to this communication service."
examples:
- name: Link notification hub
text: |-
az communication link-notification-hub --name "MyCommunicationResource" --connection-string \
az communication service link-notification-hub --name "MyCommunicationResource" --connection-string \
"Endpoint=sb://MyNamespace.servicebus.windows.net/;SharedAccessKey=abcd1234" --resource-id \
"/subscriptions/12345/resourceGroups/MyOtherResourceGroup/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/n\
otificationHubs/MyHub" --resource-group "MyResourceGroup"
"""

helps['communication list-key'] = """
helps['communication service list-key'] = """
type: command
short-summary: "Get the access keys of the CommunicationService resource."
examples:
- name: List keys
text: |-
az communication list-key --name "MyCommunicationResource" --resource-group "MyResourceGroup"
az communication service list-key --name "MyCommunicationResource" --resource-group "MyResourceGroup"
"""

helps['communication regenerate-key'] = """
helps['communication service regenerate-key'] = """
type: command
short-summary: "Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at \
the same time."
examples:
- name: Regenerate key
text: |-
az communication regenerate-key --name "MyCommunicationResource" --key-type "Primary" --resource-group \
"MyResourceGroup"
az communication service regenerate-key --name "MyCommunicationResource" --key-type "Primary" \
--resource-group "MyResourceGroup"
"""

helps['communication wait'] = """
helps['communication service wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the communication is met.
short-summary: Place the CLI in a waiting state until a condition of the communication service is met.
examples:
- name: Pause executing next line of CLI script until the communication is successfully created.
- name: Pause executing next line of CLI script until the communication service is successfully created.
text: |-
az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --created
- name: Pause executing next line of CLI script until the communication is successfully deleted.
az communication service wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" \
--created
- name: Pause executing next line of CLI script until the communication service is successfully deleted.
text: |-
az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --deleted
az communication service wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" \
--deleted
"""

helps['communication'] = """
helps['communication status'] = """
type: group
short-summary: Manage status with communication
"""

helps['communication show-status'] = """
helps['communication status show'] = """
type: command
short-summary: "Gets the current status of an async operation."
examples:
- name: Get OperationStatus
text: |-
az communication show-status --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2"
az communication status show --operation-id "db5f291f-284d-46e9-9152-d5c83f7c14b8" --location "westus2"
"""
20 changes: 10 additions & 10 deletions src/communication/azext_communication/generated/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

def load_arguments(self, _):

with self.argument_context('communication list') as c:
with self.argument_context('communication service list') as c:
c.argument('resource_group_name', resource_group_name_type)

with self.argument_context('communication show') as c:
with self.argument_context('communication service show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')

with self.argument_context('communication create') as c:
with self.argument_context('communication service create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.')
Expand All @@ -39,41 +39,41 @@ def load_arguments(self, _):
c.argument('data_location', type=str, help='The location where the communication service stores its data at '
'rest.')

with self.argument_context('communication update') as c:
with self.argument_context('communication service update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')
c.argument('tags', tags_type)

with self.argument_context('communication delete') as c:
with self.argument_context('communication service delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')

with self.argument_context('communication link-notification-hub') as c:
with self.argument_context('communication service link-notification-hub') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')
c.argument('resource_id', type=str, help='The resource ID of the notification hub')
c.argument('connection_string', type=str, help='Connection string for the notification hub')

with self.argument_context('communication list-key') as c:
with self.argument_context('communication service list-key') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.')

with self.argument_context('communication regenerate-key') as c:
with self.argument_context('communication service regenerate-key') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')
c.argument('key_type', arg_type=get_enum_type(['Primary', 'Secondary']), help='The keyType to regenerate. Must '
'be either \'primary\' or \'secondary\'(case-insensitive).')

with self.argument_context('communication wait') as c:
with self.argument_context('communication service wait') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('name', options_list=['--name', '-n'], type=str, help='The name of the CommunicationService '
'resource.', id_part='name')

with self.argument_context('communication show-status') as c:
with self.argument_context('communication status show') as c:
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('operation_id', type=str, help='The ID of an ongoing async operation')
31 changes: 17 additions & 14 deletions src/communication/azext_communication/generated/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@ def load_command_table(self, _):
operations_tmpl='azext_communication.vendored_sdks.communication.operations._communication_service_operations#C'
'ommunicationServiceOperations.{}',
client_factory=cf_communication_service)
with self.command_group('communication', communication_communication_service,
client_factory=cf_communication_service, is_preview=True) as g:
g.custom_command('list', 'communication_list')
g.custom_show_command('show', 'communication_show')
g.custom_command('create', 'communication_create', supports_no_wait=True)
g.custom_command('update', 'communication_update')
g.custom_command('delete', 'communication_delete', supports_no_wait=True, confirmation=True)
g.custom_command('link-notification-hub', 'communication_link_notification_hub')
g.custom_command('list-key', 'communication_list_key')
g.custom_command('regenerate-key', 'communication_regenerate_key')
g.custom_wait_command('wait', 'communication_show')
with self.command_group('communication service', communication_communication_service,
client_factory=cf_communication_service) as g:
g.custom_command('list', 'communication_service_list')
g.custom_show_command('show', 'communication_service_show')
g.custom_command('create', 'communication_service_create', supports_no_wait=True)
g.custom_command('update', 'communication_service_update')
g.custom_command('delete', 'communication_service_delete', supports_no_wait=True, confirmation=True)
g.custom_command('link-notification-hub', 'communication_service_link_notification_hub')
g.custom_command('list-key', 'communication_service_list_key')
g.custom_command('regenerate-key', 'communication_service_regenerate_key')
g.custom_wait_command('wait', 'communication_service_show')

from azext_communication.generated._client_factory import cf_operation_statuses
communication_operation_statuses = CliCommandType(
operations_tmpl='azext_communication.vendored_sdks.communication.operations._operation_statuses_operations#Oper'
'ationStatusesOperations.{}',
client_factory=cf_operation_statuses)
with self.command_group('communication', communication_operation_statuses, client_factory=cf_operation_statuses,
is_preview=True) as g:
g.custom_command('show-status', 'communication_show_status')
with self.command_group('communication status', communication_operation_statuses,
client_factory=cf_operation_statuses) as g:
g.custom_show_command('show', 'communication_status_show')

with self.command_group('communication', is_preview=True):
pass
92 changes: 50 additions & 42 deletions src/communication/azext_communication/generated/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,83 +12,91 @@
from azure.cli.core.util import sdk_no_wait


def communication_list(client,
resource_group_name=None):
def communication_service_list(client,
resource_group_name=None):
if resource_group_name:
return client.list_by_resource_group(resource_group_name=resource_group_name)
return client.list_by_subscription()


def communication_show(client,
resource_group_name,
name):
def communication_service_show(client,
resource_group_name,
name):
return client.get(resource_group_name=resource_group_name,
communication_service_name=name)


def communication_create(client,
resource_group_name,
name,
location=None,
tags=None,
data_location=None,
no_wait=False):
def communication_service_create(client,
resource_group_name,
name,
location=None,
tags=None,
data_location=None,
no_wait=False):
parameters = {}
parameters['location'] = location
parameters['tags'] = tags
parameters['data_location'] = data_location
return sdk_no_wait(no_wait,
client.begin_create_or_update,
resource_group_name=resource_group_name,
communication_service_name=name,
location=location,
tags=tags,
data_location=data_location)
parameters=parameters)


def communication_update(client,
resource_group_name,
name,
tags=None):
def communication_service_update(client,
resource_group_name,
name,
tags=None):
parameters = {}
parameters['tags'] = tags
return client.update(resource_group_name=resource_group_name,
communication_service_name=name,
tags=tags)
parameters=parameters)


def communication_delete(client,
resource_group_name,
name,
no_wait=False):
def communication_service_delete(client,
resource_group_name,
name,
no_wait=False):
return sdk_no_wait(no_wait,
client.begin_delete,
resource_group_name=resource_group_name,
communication_service_name=name)


def communication_link_notification_hub(client,
resource_group_name,
name,
resource_id=None,
connection_string=None):
def communication_service_link_notification_hub(client,
resource_group_name,
name,
resource_id=None,
connection_string=None):
link_notification_hub_parameters = {}
link_notification_hub_parameters['resource_id'] = resource_id
link_notification_hub_parameters['connection_string'] = connection_string
return client.link_notification_hub(resource_group_name=resource_group_name,
communication_service_name=name,
resource_id=resource_id,
connection_string=connection_string)
link_notification_hub_parameters=link_notification_hub_parameters)


def communication_list_key(client,
resource_group_name,
name):
return client.list_key(resource_group_name=resource_group_name,
communication_service_name=name)
def communication_service_list_key(client,
resource_group_name,
name):
return client.list_keys(resource_group_name=resource_group_name,
communication_service_name=name)


def communication_regenerate_key(client,
resource_group_name,
name,
key_type=None):
def communication_service_regenerate_key(client,
resource_group_name,
name,
key_type=None):
parameters = {}
parameters['key_type'] = key_type
return client.regenerate_key(resource_group_name=resource_group_name,
communication_service_name=name,
key_type=key_type)
parameters=parameters)


def communication_show_status(client,
def communication_status_show(client,
location,
operation_id):
return client.get(location=location,
Expand Down
Loading