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
6 changes: 3 additions & 3 deletions src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def default_api_version(self):
ResourceType.MGMT_MONITOR: None,
ResourceType.MGMT_MSI: '2023-01-31',
ResourceType.MGMT_APPSERVICE: '2024-11-01',
ResourceType.MGMT_IOTHUB: '2023-06-30-preview',
ResourceType.MGMT_IOTDPS: '2021-10-15',
ResourceType.MGMT_IOTCENTRAL: '2021-11-01-preview',
ResourceType.MGMT_IOTHUB: None,
ResourceType.MGMT_IOTDPS: None,
ResourceType.MGMT_IOTCENTRAL: None,
ResourceType.MGMT_ARO: '2023-11-22',
ResourceType.MGMT_DATABOXEDGE: '2021-02-01-preview',
ResourceType.MGMT_CUSTOMLOCATION: '2021-03-15-preview',
Expand Down
3 changes: 1 addition & 2 deletions src/azure-cli/azure/cli/command_modules/iot/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ def load_command_table(self, _): # pylint: disable=too-many-statements
transform=EndpointUpdateResultTransform(self.cli_ctx))

# iot hub message enrichment commands
with self.command_group('iot hub message-enrichment', client_factory=iot_hub_service_factory,
min_api="2019-07-01-preview") as g:
with self.command_group('iot hub message-enrichment', client_factory=iot_hub_service_factory) as g:
g.custom_command('create', 'iot_message_enrichment_create')
g.custom_command('list', 'iot_message_enrichment_list')
g.custom_command('delete', 'iot_message_enrichment_delete')
Expand Down
13 changes: 4 additions & 9 deletions src/azure-cli/azure/cli/command_modules/iot/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
)
from azure.cli.core.commands import LongRunningOperation
from azure.cli.core.util import sdk_no_wait
from azure.cli.core.profiles._shared import AZURE_API_PROFILES, ResourceType

from azure.mgmt.iothub.models import (IotHubSku,
AccessRights,
Expand Down Expand Up @@ -433,10 +432,8 @@ def iot_hub_certificate_create(client, hub_name, certificate_name, certificate_p
raise CLIError("Error uploading certificate '{0}'.".format(certificate_path))
cert_properties = CertificateProperties(certificate=certificate, is_verified=is_verified)

if AZURE_API_PROFILES["latest"][ResourceType.MGMT_IOTHUB] in client.profile.label:
cert_description = CertificateDescription(properties=cert_properties)
return client.certificates.create_or_update(resource_group_name, hub_name, certificate_name, cert_description)
return client.certificates.create_or_update(resource_group_name, hub_name, certificate_name, cert_properties)
cert_description = CertificateDescription(properties=cert_properties)
return client.certificates.create_or_update(resource_group_name, hub_name, certificate_name, cert_description)


def iot_hub_certificate_update(client, hub_name, certificate_name, certificate_path, etag, resource_group_name=None, is_verified=None):
Expand All @@ -449,10 +446,8 @@ def iot_hub_certificate_update(client, hub_name, certificate_name, certificate_p
raise CLIError("Error uploading certificate '{0}'.".format(certificate_path))
cert_properties = CertificateProperties(certificate=certificate, is_verified=is_verified)

if AZURE_API_PROFILES["latest"][ResourceType.MGMT_IOTHUB] in client.profile.label:
cert_description = CertificateDescription(properties=cert_properties)
return client.certificates.create_or_update(resource_group_name, hub_name, certificate_name, cert_description, etag)
return client.certificates.create_or_update(resource_group_name, hub_name, certificate_name, cert_properties, etag)
cert_description = CertificateDescription(properties=cert_properties)
return client.certificates.create_or_update(resource_group_name, hub_name, certificate_name, cert_description, etag)
raise CLIError("Certificate '{0}' does not exist. Use 'iot hub certificate create' to create a new certificate."
.format(certificate_name))

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ def test_iot_hub(self, resource_group, resource_group_location, storage_account)
self.check('routes[0].properties.endpointNames[0]', endpoint_name)])

# Test 'az iot hub route update'
routing_sources = [source.value for source in RoutingSource if source != RoutingSource.Invalid]
skipped_sources = (RoutingSource.Invalid, RoutingSource.Mqtt_Broker_Messages)
routing_sources = [source.value for source in RoutingSource if source not in skipped_sources]
for new_source_type in routing_sources:
self.cmd('iot hub route update --hub-name {0} -g {1} -n {2} -s {3}'.format(hub, rg, route_name, new_source_type),
checks=[self.check('length([*])', 1),
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ azure-mgmt-extendedlocation==1.0.0b2
azure-mgmt-hdinsight==9.0.0b3
azure-mgmt-imagebuilder==1.3.0
azure-mgmt-iotcentral==10.0.0b1
azure-mgmt-iothub==3.0.0
azure-mgmt-iothub==5.0.0b1
azure-mgmt-iothubprovisioningservices==1.1.0
azure-mgmt-keyvault==12.0.0
azure-mgmt-loganalytics==13.0.0b4
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ azure-mgmt-extendedlocation==1.0.0b2
azure-mgmt-hdinsight==9.0.0b3
azure-mgmt-imagebuilder==1.3.0
azure-mgmt-iotcentral==10.0.0b1
azure-mgmt-iothub==3.0.0
azure-mgmt-iothub==5.0.0b1
azure-mgmt-iothubprovisioningservices==1.1.0
azure-mgmt-keyvault==12.0.0
azure-mgmt-loganalytics==13.0.0b4
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ azure-mgmt-extendedlocation==1.0.0b2
azure-mgmt-hdinsight==9.0.0b3
azure-mgmt-imagebuilder==1.3.0
azure-mgmt-iotcentral==10.0.0b1
azure-mgmt-iothub==3.0.0
azure-mgmt-iothub==5.0.0b1
azure-mgmt-iothubprovisioningservices==1.1.0
azure-mgmt-keyvault==12.0.0
azure-mgmt-loganalytics==13.0.0b4
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
'azure-mgmt-hdinsight==9.0.0b3',
'azure-mgmt-imagebuilder~=1.3.0',
'azure-mgmt-iotcentral~=10.0.0b1',
'azure-mgmt-iothub==3.0.0',
'azure-mgmt-iothub==5.0.0b1',
'azure-mgmt-iothubprovisioningservices==1.1.0',
'azure-mgmt-keyvault==12.0.0',
'azure-mgmt-loganalytics==13.0.0b4',
Expand Down
Loading