-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Iot Central] az iotcentral deprecated #12681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
403f4b6
4a4c31d
36b2bff
6c54206
41ee366
a1ae112
b9a4dd2
84db750
da51031
09d1ad6
c4d97e4
8cd1bd6
8fa8b68
0562501
d33b89f
d3fc96a
51c2ead
6f4e827
a5cd185
82395cb
d588253
6c42022
3443795
56cd739
5d5a3d7
7c99b10
b0ac719
7ed1bb5
0696aa2
4c9c6b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| get_resource_name_completion_list, | ||
| get_enum_type, | ||
| get_three_state_flag) | ||
| from azure.mgmt.iotcentral.models import AppSku | ||
| from azure.mgmt.iothub.models import IotHubSku | ||
| from azure.mgmt.iothubprovisioningservices.models import (IotDpsSku, | ||
| AllocationPolicy, | ||
|
|
@@ -42,6 +43,10 @@ | |
| completer=get_resource_name_completion_list('Microsoft.Devices/ProvisioningServices'), | ||
| help='IoT Provisioning Service name') | ||
|
|
||
| app_name_type = CLIArgumentType( | ||
| completer=get_resource_name_completion_list('Microsoft.IoTCentral/IoTApps'), | ||
| help='IoT Central application name.') | ||
|
|
||
|
|
||
| def load_arguments(self, _): # pylint: disable=too-many-statements | ||
| # Arguments for IoT DPS | ||
|
|
@@ -274,3 +279,19 @@ def load_arguments(self, _): # pylint: disable=too-many-statements | |
| help='Access key for the given IoT Plug and Play repository.') | ||
| c.argument('user_role', options_list=['--role'], arg_type=get_enum_type(UserRole), | ||
| help='User role of the access key for the given IoT Plug and Play repository.') | ||
|
|
||
| with self.argument_context('iot central app') as c: | ||
| c.argument('app_name', app_name_type, options_list=['--name', '-n'], id_part='display_name') | ||
r-delgadillo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| with self.argument_context('iot central app create') as c: | ||
| c.argument('app_name', completer=None) | ||
| c.argument('location', get_location_type(self.cli_ctx), | ||
| help='Location of your IoT Central application. Default is the location of target resource group.') | ||
| c.argument('sku', arg_type=get_enum_type(AppSku), | ||
| help='Pricing tier for IoT Central applications. Default value is ST2.') | ||
| c.argument('subdomain', | ||
| help='Subdomain for the IoT Central URL. Each application must have a unique subdomain.') | ||
| c.argument('template', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there allowed values for template?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, there is. We have an API that allows customers to see the available options.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not want to hardcode these values in the Azure CLI
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this way can we put the API in help message? Because for me (a new user), I totally don't know which value is available for template.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I can see how that can be confusing. We have an item in our backlog to rewrite the documentation for Swagger and Az CLI. I added some details about the issue of not seeing available templates so we can address it when we have the capacity. |
||
| help='IoT Central application template name. Default is a custom application.') | ||
| c.argument('display_name', | ||
| help='Custom display name for the IoT Central application. Default is resource name.') | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| from ._client_factory import iot_hub_service_factory | ||
| from ._client_factory import iot_service_provisioning_factory | ||
| from ._client_factory import iot_pnp_service_factory | ||
| from ._client_factory import iot_central_service_factory | ||
|
|
||
|
|
||
| JOB_DEPRECATION_INFO = 'IoT Extension (azure-cli-iot-ext) Job commands' | ||
|
|
@@ -47,6 +48,10 @@ def load_command_table(self, _): # pylint: disable=too-many-statements | |
|
|
||
| update_custom_util = CliCommandType(operations_tmpl='azure.cli.command_modules.iot.custom#{}') | ||
|
|
||
| iot_central_sdk = CliCommandType( | ||
| operations_tmpl='azure.mgmt.iotcentral.operations#IoTCentaralOperations.{}' | ||
| ) | ||
|
|
||
| # iot dps commands | ||
| with self.command_group('iot dps', client_factory=iot_service_provisioning_factory) as g: | ||
| g.custom_command('list', 'iot_dps_list') | ||
|
|
@@ -172,3 +177,11 @@ def load_command_table(self, _): # pylint: disable=too-many-statements | |
| g.custom_command('create', 'pnp_create_key') | ||
| g.custom_command('delete', 'pnp_delete_key') | ||
| g.custom_command('update', 'pnp_update_key') | ||
|
|
||
| with self.command_group('iot central app', iot_central_sdk, client_factory=iot_central_service_factory) as g: | ||
Juliehzl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| g.custom_command('create', 'iot_central_app_create') | ||
| g.custom_command('list', 'iot_central_app_list') | ||
| g.custom_show_command('show', 'iot_central_app_get') | ||
| g.generic_update_command('update', getter_name='iot_central_app_get', | ||
| setter_name='iot_central_app_update', command_type=update_custom_util) | ||
| g.custom_command('delete', 'iot_central_app_delete') | ||
|
||
Uh oh!
There was an error while loading. Please reload this page.