Skip to content

Commit d43218e

Browse files
committed
su
1 parent 7b31d0c commit d43218e

16 files changed

Lines changed: 1889 additions & 40 deletions

HISTORY.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Release History
77

88
**General updates**
99

10-
* Updated all ``az iot adr ns`` commands to the ``Microsoft.DeviceRegistry/2026-11-02-preview`` management API.
10+
* Updated all ``az iot adr ns`` commands to the ``Microsoft.DeviceRegistry/2026-11-02-preview`` management API and marked the complete command tree as preview.
1111
* Regenerated the complete synchronous and asynchronous Device Registry SDK from the ``package-preview-2026-11-02`` specification tag. The generated clients expose all 25 operation groups and 118 operations in the source specification.
1212
* Generated a dedicated synchronous and asynchronous Device Update control-plane SDK from the ``package-2026-11-02-preview`` DuDeviceRegistry specification tag without replacing the existing ``az iot du`` SDK.
1313
* Added safer long-running-operation handling: resource mutations poll ``provisioningState`` and POST actions poll the authenticated ``Location`` URL instead of the service's unsupported ``Azure-AsyncOperation`` host.
@@ -29,7 +29,9 @@ Release History
2929
- Added ``az iot adr ns su instance check-name / create / show / list / update / delete / wait`` for ``Microsoft.DeviceUpdate/updateInstances`` resources.
3030
- Update Instance create and update support tags plus complete system- and user-assigned managed identity configuration. List supports resource-group and subscription scopes.
3131
- Namespace updating endpoints remain under ``az iot adr ns link su add / show / list / update / wait``, consistent with the existing Hub and DPS link groups.
32-
- Software Updates data-plane commands and the service-internal ``linkPreflight``, ``linkInitiate``, ``linkNotify``, and ``linkUpdate`` actions are intentionally not exposed.
32+
- Added ``az iot adr ns su update import / list / show / delete``, ``su update file list / show``, local ``su update calculate-hash`` and ``su update init v5``, and ``su device-class list / show / delete`` using the linked namespace's Software Updates data-plane endpoint.
33+
- Added ``az iot adr ns device show`` as the Software Updates workflow alias for ``registry-device show``.
34+
- Device-class update remains unavailable because ``2026-11-02-preview`` exposes no update route or writable friendly-name property. The service-internal ``linkPreflight``, ``linkInitiate``, ``linkNotify``, and ``linkUpdate`` actions remain intentionally hidden.
3335

3436
* **Namespace parity**
3537

azext_iot/_factory.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"iot_service_provisioning_factory",
3535
"adr_service_factory",
3636
"adr_su_service_factory",
37+
"adr_su_data_service_factory",
3738
]
3839

3940

@@ -164,6 +165,17 @@ def adr_su_service_factory(cli_ctx, *_):
164165
)
165166

166167

168+
def adr_su_data_service_factory(cli_ctx, *_):
169+
"""Create the Software Updates data-plane client."""
170+
from azext_iot.sdk.deviceupdate.duregistrydata import DeviceRegistryUpdateClient
171+
172+
return DeviceRegistryUpdateClient(
173+
credential=AZURE_CLI_CREDENTIAL,
174+
user_agent_policy=UserAgentPolicy(user_agent=USER_AGENT),
175+
http_logging_policy=_get_default_logging_policy(),
176+
)
177+
178+
167179
def resource_service_factory(cli_ctx, **_):
168180
from azure.cli.core.commands.client_factory import get_mgmt_service_client
169181
from azure.cli.core.profiles import ResourceType

azext_iot/adr/_help.py

Lines changed: 154 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ def load_adr_help():
547547
short-summary: Manage Software Updates for Device Registry namespaces.
548548
long-summary: |
549549
Manages the Update Instance (Microsoft.DeviceUpdate/updateInstances) that powers
550-
Software Updates. Namespace links remain under 'az iot adr ns link su'.
551-
Software Updates data-plane operations are not part of this command group.
550+
Software Updates and the updates and device classes available through a linked
551+
Device Registry namespace. Namespace links remain under 'az iot adr ns link su'.
552552
"""
553553

554554
helps[
@@ -642,6 +642,158 @@ def load_adr_help():
642642
text: az iot adr ns su instance wait -n myUpdateInstance -g myResourceGroup --custom "properties.provisioningState=='Succeeded'"
643643
"""
644644

645+
helps["iot adr ns device"] = """
646+
type: group
647+
short-summary: View Device Registry device identity information.
648+
"""
649+
650+
helps["iot adr ns device show"] = """
651+
type: command
652+
short-summary: Show a device identity in a Device Registry namespace.
653+
long-summary: |
654+
This Software Updates workflow alias returns the same Registry Device
655+
resource as 'az iot adr ns registry-device show'.
656+
examples:
657+
- name: Show a device identity
658+
text: az iot adr ns device show -n myDevice --ns myNamespace -g myResourceGroup
659+
"""
660+
661+
helps["iot adr ns su update"] = """
662+
type: group
663+
short-summary: Import and manage Software Updates content.
664+
long-summary: |
665+
Uses the data-plane serviceAddress materialized on the namespace's Software
666+
Updates link. The link must finish provisioning before these commands can run.
667+
"""
668+
669+
helps["iot adr ns su update import"] = """
670+
type: command
671+
short-summary: Import an update into Software Updates.
672+
long-summary: |
673+
Imports a v5 manifest from a read-accessible URL. When --size or --hashes is
674+
omitted, the CLI streams the manifest to calculate its size and SHA-256 hash.
675+
examples:
676+
- name: Import a manifest and one payload file
677+
text: |
678+
az iot adr ns su update import --ns myNamespace -g myResourceGroup \\
679+
--url "https://storage.example/manifest.json?<sas>" \\
680+
--file filename=payload.bin url="https://storage.example/payload.bin?<sas>"
681+
"""
682+
683+
helps["iot adr ns su update list"] = """
684+
type: command
685+
short-summary: List updates imported into Software Updates.
686+
examples:
687+
- name: List all imported updates
688+
text: az iot adr ns su update list --ns myNamespace -g myResourceGroup
689+
- name: List deployable updates
690+
text: az iot adr ns su update list --ns myNamespace -g myResourceGroup --filter "isDeployable eq true"
691+
"""
692+
693+
helps["iot adr ns su update show"] = """
694+
type: command
695+
short-summary: Show an imported update.
696+
examples:
697+
- name: Show an update version
698+
text: |
699+
az iot adr ns su update show --ns myNamespace -g myResourceGroup \\
700+
--update-provider Contoso --update-name Thermostat --update-version 1.0
701+
"""
702+
703+
helps["iot adr ns su update delete"] = """
704+
type: command
705+
short-summary: Delete an imported update.
706+
examples:
707+
- name: Delete an update version without prompting
708+
text: |
709+
az iot adr ns su update delete --ns myNamespace -g myResourceGroup \\
710+
--update-provider Contoso --update-name Thermostat --update-version 1.0 --yes
711+
"""
712+
713+
helps["iot adr ns su update calculate-hash"] = """
714+
type: command
715+
short-summary: Calculate update-file hashes locally.
716+
examples:
717+
- name: Calculate a SHA-256 hash
718+
text: az iot adr ns su update calculate-hash --file-path ./payload.bin
719+
"""
720+
721+
helps["iot adr ns su update file"] = """
722+
type: group
723+
short-summary: Inspect files belonging to an imported update.
724+
"""
725+
726+
helps["iot adr ns su update file list"] = """
727+
type: command
728+
short-summary: List file identifiers for an imported update.
729+
examples:
730+
- name: List files
731+
text: |
732+
az iot adr ns su update file list --ns myNamespace -g myResourceGroup \\
733+
--update-provider Contoso --update-name Thermostat --update-version 1.0
734+
"""
735+
736+
helps["iot adr ns su update file show"] = """
737+
type: command
738+
short-summary: Show an imported update file.
739+
examples:
740+
- name: Show a file
741+
text: |
742+
az iot adr ns su update file show --ns myNamespace -g myResourceGroup \\
743+
--update-provider Contoso --update-name Thermostat --update-version 1.0 \\
744+
--update-file-id payload
745+
"""
746+
747+
helps["iot adr ns su update init"] = """
748+
type: group
749+
short-summary: Create Software Updates import manifests locally.
750+
"""
751+
752+
helps["iot adr ns su update init v5"] = """
753+
type: command
754+
short-summary: Create a version 5 import manifest.
755+
examples:
756+
- name: Create a simple manifest
757+
text: |
758+
az iot adr ns su update init v5 --update-provider Contoso \\
759+
--update-name Thermostat --update-version 1.0 \\
760+
--compat manufacturer=Contoso model=T1000 \\
761+
--step handler=microsoft/script:1 --file path=./install.sh
762+
"""
763+
764+
helps["iot adr ns su device-class"] = """
765+
type: group
766+
short-summary: View and delete Software Updates device classes.
767+
"""
768+
769+
helps["iot adr ns su device-class list"] = """
770+
type: command
771+
short-summary: List device classes in a linked Software Updates instance.
772+
examples:
773+
- name: List device classes
774+
text: az iot adr ns su device-class list --ns myNamespace -g myResourceGroup
775+
"""
776+
777+
helps["iot adr ns su device-class show"] = """
778+
type: command
779+
short-summary: Show a Software Updates device class.
780+
examples:
781+
- name: Show a device class
782+
text: |
783+
az iot adr ns su device-class show --ns myNamespace -g myResourceGroup \\
784+
--device-class-id 0123456789abcdef
785+
"""
786+
787+
helps["iot adr ns su device-class delete"] = """
788+
type: command
789+
short-summary: Delete a Software Updates device class.
790+
examples:
791+
- name: Delete a device class without prompting
792+
text: |
793+
az iot adr ns su device-class delete --ns myNamespace -g myResourceGroup \\
794+
--device-class-id 0123456789abcdef --yes
795+
"""
796+
645797
helps[
646798
"iot adr ns link add"
647799
] = """

0 commit comments

Comments
 (0)