Hello community, here is the log from the commit of package azure-cli-iot for openSUSE:Factory checked in at 2018-10-15 10:48:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azure-cli-iot (Old) and /work/SRC/openSUSE:Factory/.azure-cli-iot.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azure-cli-iot" Mon Oct 15 10:48:12 2018 rev:4 rq:641234 version:0.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/azure-cli-iot/azure-cli-iot.changes 2018-05-13 16:02:36.587706413 +0200 +++ /work/SRC/openSUSE:Factory/.azure-cli-iot.new/azure-cli-iot.changes 2018-10-15 10:48:15.387081469 +0200 @@ -1,0 +2,9 @@ +Mon Sep 17 11:44:17 UTC 2018 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- New upstream release + + Version 0.3.1 + + For detailed information about changes see the + HISTORY.txt file provided with this package +- Update Requires from setup.py + +------------------------------------------------------------------- Old: ---- azure-cli-iot-0.1.19.tar.gz New: ---- azure-cli-iot-0.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azure-cli-iot.spec ++++++ --- /var/tmp/diff_new_pack.t6tuh1/_old 2018-10-15 10:48:15.911080910 +0200 +++ /var/tmp/diff_new_pack.t6tuh1/_new 2018-10-15 10:48:15.915080906 +0200 @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: azure-cli-iot -Version: 0.1.19 +Version: 0.3.1 Release: 0 Summary: Microsoft Azure CLI 'iot' Command Module License: MIT @@ -34,8 +34,8 @@ Requires: azure-cli-command-modules-nspkg Requires: azure-cli-core Requires: azure-cli-nspkg -Requires: python3-azure-mgmt-iothub >= 0.4.0 -Requires: python3-azure-mgmt-iothubprovisioningservices >= 0.1.0 +Requires: python3-azure-mgmt-iothub >= 0.5.0 +Requires: python3-azure-mgmt-iothubprovisioningservices >= 0.2.0 Requires: python3-azure-nspkg Requires: python3-pyOpenSSL Conflicts: azure-cli < 2.0.0 ++++++ azure-cli-iot-0.1.19.tar.gz -> azure-cli-iot-0.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/HISTORY.rst new/azure-cli-iot-0.3.1/HISTORY.rst --- old/azure-cli-iot-0.1.19/HISTORY.rst 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/HISTORY.rst 2018-08-23 01:07:57.000000000 +0200 @@ -3,6 +3,37 @@ Release History =============== +0.3.1 ++++++ +* Increment DPS mgmt SDK requirement +* Fix internal breaking changes for SDK usage patterns +* Apply work around (back rev API) for assocating a linked-hub due to swagger/sdk mismatch with API. +* Update tests and DPS recording + +0.3.0 ++++++ +* BREAKING CHANGE: Removed deprecated commands which have moved to the iot extension +* Updated elements to not assume azure-devices.net domain + +0.2.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. + +0.1.22 +++++++ +* Minor fixes. + +0.1.21 +++++++ + +* Adds support for creating Basic Tier IoT Hubs. +* Updates to Azure SDK 0.5.0 + +0.1.20 +++++++ + +* Minor fixes to compat with msrest 0.4.28 + 0.1.19 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/PKG-INFO new/azure-cli-iot-0.3.1/PKG-INFO --- old/azure-cli-iot-0.1.19/PKG-INFO 2018-04-06 19:33:52.000000000 +0200 +++ new/azure-cli-iot-0.3.1/PKG-INFO 2018-08-23 01:09:41.000000000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: azure-cli-iot -Version: 0.1.19 +Version: 0.3.1 Summary: Microsoft Azure Command-Line Tools IoT Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: azpy...@microsoft.com License: MIT -Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'iot' Command Module ======================================== @@ -21,6 +20,37 @@ Release History =============== + 0.3.1 + +++++ + * Increment DPS mgmt SDK requirement + * Fix internal breaking changes for SDK usage patterns + * Apply work around (back rev API) for assocating a linked-hub due to swagger/sdk mismatch with API. + * Update tests and DPS recording + + 0.3.0 + +++++ + * BREAKING CHANGE: Removed deprecated commands which have moved to the iot extension + * Updated elements to not assume azure-devices.net domain + + 0.2.0 + +++++ + * BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. + + 0.1.22 + ++++++ + * Minor fixes. + + 0.1.21 + ++++++ + + * Adds support for creating Basic Tier IoT Hubs. + * Updates to Azure SDK 0.5.0 + + 0.1.20 + ++++++ + + * Minor fixes to compat with msrest 0.4.28 + 0.1.19 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/_completers.py new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/_completers.py --- old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/_completers.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/_completers.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from azure.cli.core.decorators import Completer - -from ._client_factory import iot_hub_service_factory -from .custom import iot_device_list - - -@Completer -def get_device_id_completion_list(cmd, prefix, namespace): # pylint: disable=unused-argument - client = iot_hub_service_factory(cmd.cli_ctx) - return [d.device_id for d in iot_device_list(client, namespace.hub_name, top=100)] if namespace.hub_name else [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/_help.py new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/_help.py --- old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/_help.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/_help.py 2018-08-23 01:07:57.000000000 +0200 @@ -1,3 +1,4 @@ +# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -10,20 +11,15 @@ helps['iot'] = """ type: group - short-summary: (PREVIEW) Manage Internet of Things (IoT) assets. + short-summary: Manage Internet of Things (IoT) assets. long-summary: Comprehensive IoT data-plane functionality is available in the Azure IoT CLI Extension. For more info and install guide go to https://github.com/Azure/azure-iot-cli-extension """ -helps['iot device'] = """ - type: group - short-summary: (PREVIEW) Manage devices in your Azure IoT hub. -""" - helps['iot hub'] = """ type: group - short-summary: (PREVIEW) Manage Azure IoT hubs. + short-summary: Manage Azure IoT hubs. """ helps['iot dps'] = """ type: group @@ -425,7 +421,7 @@ helps['iot hub consumer-group'] = """ type: group - short-summary: (PREVIEW) Manage the event hub consumer groups of an IoT hub. + short-summary: Manage the event hub consumer groups of an IoT hub. """ helps['iot hub consumer-group create'] = """ @@ -457,7 +453,7 @@ helps['iot hub policy'] = """ type: group - short-summary: (PREVIEW) Manage shared access policies of an IoT hub. + short-summary: Manage shared access policies of an IoT hub. """ helps['iot hub policy list'] = """ @@ -491,7 +487,7 @@ helps['iot hub job'] = """ type: group - short-summary: (PREVIEW) Manage jobs in an IoT hub. + short-summary: Manage jobs in an IoT hub. """ helps['iot hub job list'] = """ @@ -518,136 +514,3 @@ type: command short-summary: Get the statistics for an IoT hub. """ - -helps['iot device create'] = """ - type: command - short-summary: Register a device for an IoT hub. - long-summary: This command is deprecating. Use 'az iot hub device-identity create' via the IoT Extension instead. - examples: - - name: Create a device authenticating with symmetric key. - text: > - az iot device create --hub-name MyIotHub --device-id MyDevice - - name: Create a device authenticating with an existing X.509 certificate. - text: > - az iot device create --hub-name MyIotHub --device-id MyDevice --x509 --primary-thumbprint X.509_certificate_thumbprint - - name: Create a device authenticating with a self-signed X.509 certificate, which is put into to the current directory. - text: > - az iot device create --hub-name MyIotHub --device-id MyDevice --x509 - - name: Create a device authenticating with a self-signed X.509 certificate that is valid for 100 days. - text: > - az iot device create --hub-name MyIotHub --device-id MyDevice --x509 --valid-days 100 - - name: Create a device authenticating with a self-signed X.509 certificate, and write the certificate to /path/to/output. - text: > - az iot device create --hub-name MyIotHub --device-id MyDevice --x509 --output-dir /path/to/output -""" - -helps['iot device show'] = """ - type: command - short-summary: Get the details for a device in an IoT hub. - long-summary: This command is deprecating. Use 'az iot hub device-identity show' via the IoT Extension instead. -""" - -helps['iot device update'] = """ - type: command - short-summary: Update the metadata of a device in an IoT hub. - long-summary: This command is deprecating. Use 'az iot hub device-identity update' via the IoT Extension instead. - examples: - - name: Disable a device. - text: > - az iot device update --hub-name MyIotHub --device-id MyDevice --set status=disabled -""" - -helps['iot device list'] = """ - type: command - short-summary: List devices in an IoT hub. - long-summary: This command is deprecating. Use 'az iot hub device-identity list' via the IoT Extension instead. -""" - -helps['iot device delete'] = """ - type: command - short-summary: Delete a device from an IoT hub. - long-summary: This command is deprecating. Use 'az iot hub device-identity delete' via the IoT Extension instead. -""" - -helps['iot device show-connection-string'] = """ - type: command - short-summary: Show the connection strings for devices in an IoT hub. - long-summary: This command is deprecating. - Use 'az iot hub device-identity show-connection-string' via the IoT Extension instead. - examples: - - name: Show the connection string of a device in an IoT Hub using the primary key. - text: > - az iot device show-connection-string --hub-name MyIotHub --device-id MyDevice - - name: Show the connection string of a device in an IoT Hub using the secondary key. - text: > - az iot device show-connection-string --hub-name MyIotHub --device-id MyDevice --key secondary - - name: Show the connection strings of the default devices in an IoT Hub using primary key. - text: > - az iot device show-connection-string --hub-name MyIotHub - - name: Show the connection strings of the top 100 devices in an IoT Hub using primary key. - text: > - az iot device show-connection-string --hub-name MyIotHub --top 100 -""" - -helps['iot device message'] = """ - type: group - short-summary: (PREVIEW) Manage IoT device messaging. -""" - -helps['iot device message send'] = """ - type: command - short-summary: Send a device-to-cloud message. - long-summary: This command is deprecating. Use 'az iot device send-d2c-message' via the IoT Extension instead. - examples: - - name: Send a device-to-cloud message to an IoT hub with a default message. - text: > - az iot device message send --hub-name MyIotHub --device-id MyDevice - - name: Send a device-to-cloud message to an IoT hub with a custom message. - text: > - az iot device message send --hub-name MyIotHub --device-id MyDevice --data "Custom Message" -""" - -helps['iot device message receive'] = """ - type: command - short-summary: Receive a cloud-to-device message. - long-summary: This command is deprecating. Use 'az iot device c2d-message receive' via the IoT Extension instead. - examples: - - name: Receive a cloud-to-device message from an IoT hub with a default timeout. - text: > - az iot device message receive --hub-name MyIotHub --device-id MyDevice - - name: Receive a cloud-to-device message from an IoT Hub with a timeout of 300 seconds. - text: > - az iot device message receive --hub-name MyIotHub --device-id MyDevice --lock-timeout 300 -""" - -helps['iot device message complete'] = """ - type: command - short-summary: Complete a cloud-to-device message. - long-summary: This command is deprecating. Use 'az iot device c2d-message complete' via the IoT Extension instead. -""" - -helps['iot device message reject'] = """ - type: command - short-summary: Reject a cloud-to-device message. - long-summary: This command is deprecating. Use 'az iot device c2d-message reject' via the IoT Extension instead. -""" - -helps['iot device message abandon'] = """ - type: command - short-summary: Abandon a cloud-to-device message. - long-summary: This command is deprecating. Use 'az iot device c2d-message abandon' via the IoT Extension instead. -""" - -helps['iot device export'] = """ - type: command - short-summary: Export all the device identities in the IoT hub identity registry to an Azure Storage blob container. - long-summary: This command is deprecating. Use 'az iot hub device-identity export' via the IoT Extension instead. - For more information, see https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities -""" - -helps['iot device import'] = """ - type: command - short-summary: Import, update, or delete device identities in the IoT hub identity registry from a blob. - long-summary: This command is deprecating. Use 'az iot hub device-identity import' via the IoT Extension instead. - For more information, see https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities -""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/_params.py new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/_params.py --- old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/_params.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/_params.py 2018-08-23 01:07:57.000000000 +0200 @@ -11,14 +11,13 @@ get_resource_name_completion_list, get_enum_type, get_three_state_flag) -from azure.mgmt.iothub.models.iot_hub_client_enums import IotHubSku -from azure.mgmt.iothubprovisioningservices.models.iot_dps_client_enums import (IotDpsSku, - AllocationPolicy, - AccessRightsDescription) +from azure.mgmt.iothub.models import IotHubSku +from azure.mgmt.iothubprovisioningservices.models import (IotDpsSku, + AllocationPolicy, + AccessRightsDescription) from .custom import KeyType, SimpleAccessRights from ._validators import validate_policy_permissions -from ._completers import get_device_id_completion_list hub_name_type = CLIArgumentType( @@ -95,10 +94,6 @@ c.argument('etag', options_list=['--etag', '-e'], help='Entity Tag (etag) of the object.') # Arguments for IoT Hub - with self.argument_context('iot') as c: - c.argument('device_id', options_list=['--device-id', '-d'], help='Device Id.', - completer=get_device_id_completion_list) - with self.argument_context('iot hub') as c: c.argument('hub_name', hub_name_type, options_list=['--name', '-n'], id_part='name') c.argument('etag', options_list=['--etag', '-e'], help='Entity Tag (etag) of the object.') @@ -107,9 +102,6 @@ with self.argument_context('iot hub {}'.format(subgroup)) as c: c.argument('hub_name', options_list=['--hub-name']) - with self.argument_context('iot device') as c: - c.argument('hub_name', hub_name_type) - with self.argument_context('iot hub certificate') as c: c.argument('certificate_path', options_list=['--path', '-p'], type=file_type, completer=FilesCompleter([".cer", ".pem"]), help='The path to the file containing the certificate.') @@ -140,66 +132,9 @@ 'Note that only one free IoT hub instance is allowed in each ' 'subscription. Exception will be thrown if free instances exceed one.') c.argument('unit', help='Units in your IoT Hub.', type=int) - c.argument('partition_count', help='The number of partitions for device-to-cloud messages.', type=int) + c.argument('partition_count', + help='The number of partitions of the backing Event Hub for device-to-cloud messages.', type=int) with self.argument_context('iot hub show-connection-string') as c: c.argument('policy_name', help='Shared access policy to use.') c.argument('key_type', arg_type=get_enum_type(KeyType), options_list=['--key'], help='The key to use.') - - with self.argument_context('iot device create') as c: - c.argument('device_id', completer=None) - - with self.argument_context('iot device create', arg_group='X.509 Certificate') as c: - c.argument('x509', action='store_true', help='Use X.509 certificate for device authentication.') - c.argument('primary_thumbprint', help='Primary X.509 certificate thumbprint to authenticate device.') - c.argument('secondary_thumbprint', help='Secondary X.509 certificate thumbprint to authenticate device.') - c.argument('valid_days', type=int, help='Number of days the generated self-signed X.509 certificate should be ' - 'valid for. Default validity is 365 days.') - c.argument('output_dir', help='Output directory for generated self-signed X.509 certificate. ' - 'Default is current working directory.') - - with self.argument_context('iot device list') as c: - c.argument('top', help='Maximum number of device identities to return.', type=int) - - with self.argument_context('iot device delete') as c: - c.argument('etag', help='ETag of the target device. It is used for the purpose of optimistic ' - 'concurrency. Delete operation will be performed only if the specified ' - 'ETag matches the value maintained by the server, indicating that the ' - 'device identity has not been modified since it was retrieved. Default ' - 'value is set to wildcard character (*) to force an unconditional ' - 'delete.') - - with self.argument_context('iot device show-connection-string') as c: - c.argument('top', type=int, help='Maximum number of connection strings to return.') - c.argument('key_type', arg_type=get_enum_type(KeyType), options_list=['--key'], help='The key to use.') - - with self.argument_context('iot device message') as c: - c.argument('lock_token', help='Message lock token.') - - with self.argument_context('iot device message send', arg_group='Messaging') as c: - c.argument('data', help='Device-to-cloud message body.') - c.argument('message_id', help='Device-to-cloud message Id.') - c.argument('correlation_id', help='Device-to-cloud message correlation Id.') - c.argument('user_id', help='Device-to-cloud message user Id.') - - with self.argument_context('iot device message receive') as c: - c.argument('lock_timeout', type=int, - help='In case a message returned to this call, this specifies the amount of ' - 'time in seconds, the message will be invisible to other receive calls.') - - with self.argument_context('iot device export') as c: - c.argument('blob_container_uri', - help='Blob Shared Access Signature URI with write access to a blob container.' - 'This is used to output the status of the job and the results.') - c.argument('include_keys', action='store_true', - help='If set, keys are exported normally. Otherwise, keys are set to null in ' - 'export output.') - - with self.argument_context('iot device import') as c: - c.argument('input_blob_container_uri', - help='Blob Shared Access Signature URI with read access to a blob container.' - 'This blob contains the operations to be performed on the identity ' - 'registry ') - c.argument('output_blob_container_uri', - help='Blob Shared Access Signature URI with write access to a blob container.' - 'This is used to output the status of the job and the results.') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/commands.py new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/commands.py --- old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/commands.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/commands.py 2018-08-23 01:07:57.000000000 +0200 @@ -35,7 +35,7 @@ # iot dps commands with self.command_group('iot dps', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_list') - g.custom_command('show', 'iot_dps_get') + g.custom_show_command('show', 'iot_dps_get') g.custom_command('create', 'iot_dps_create') g.custom_command('delete', 'iot_dps_delete') g.generic_update_command('update', getter_name='iot_dps_get', setter_name='iot_dps_update', @@ -44,7 +44,7 @@ # iot dps access-policy commands with self.command_group('iot dps access-policy', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_access_policy_list') - g.custom_command('show', 'iot_dps_access_policy_get') + g.custom_show_command('show', 'iot_dps_access_policy_get') g.custom_command('create', 'iot_dps_access_policy_create', supports_no_wait=True) g.custom_command('update', 'iot_dps_access_policy_update', supports_no_wait=True) g.custom_command('delete', 'iot_dps_access_policy_delete', supports_no_wait=True) @@ -52,7 +52,7 @@ # iot dps linked-hub commands with self.command_group('iot dps linked-hub', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_linked_hub_list') - g.custom_command('show', 'iot_dps_linked_hub_get') + g.custom_show_command('show', 'iot_dps_linked_hub_get') g.custom_command('create', 'iot_dps_linked_hub_create', supports_no_wait=True) g.custom_command('update', 'iot_dps_linked_hub_update', supports_no_wait=True) g.custom_command('delete', 'iot_dps_linked_hub_delete', supports_no_wait=True) @@ -60,7 +60,7 @@ # iot dps certificate commands with self.command_group('iot dps certificate', client_factory=iot_service_provisioning_factory) as g: g.custom_command('list', 'iot_dps_certificate_list') - g.custom_command('show', 'iot_dps_certificate_get') + g.custom_show_command('show', 'iot_dps_certificate_get') g.custom_command('create', 'iot_dps_certificate_create') g.custom_command('delete', 'iot_dps_certificate_delete') g.custom_command('generate-verification-code', 'iot_dps_certificate_gen_code') @@ -70,7 +70,7 @@ # iot hub certificate commands with self.command_group('iot hub certificate', client_factory=iot_hub_service_factory) as g: g.custom_command('list', 'iot_hub_certificate_list') - g.custom_command('show', 'iot_hub_certificate_get') + g.custom_show_command('show', 'iot_hub_certificate_get') g.custom_command('create', 'iot_hub_certificate_create') g.custom_command('delete', 'iot_hub_certificate_delete') g.custom_command('generate-verification-code', 'iot_hub_certificate_gen_code') @@ -82,51 +82,30 @@ g.custom_command('create', 'iot_hub_create') g.custom_command('list', 'iot_hub_list') g.custom_command('show-connection-string', 'iot_hub_show_connection_string') - g.custom_command('show', 'iot_hub_get') + g.custom_show_command('show', 'iot_hub_get') g.generic_update_command('update', getter_name='iot_hub_get', setter_name='iot_hub_update', command_type=update_custom_util) g.custom_command('delete', 'iot_hub_delete', transform=HubDeleteResultTransform(self.cli_ctx)) g.custom_command('list-skus', 'iot_hub_sku_list') - g.custom_command('consumer-group create', 'iot_hub_consumer_group_create') - g.custom_command('consumer-group list', 'iot_hub_consumer_group_list') - g.custom_command('consumer-group show', 'iot_hub_consumer_group_get') - g.custom_command('consumer-group delete', 'iot_hub_consumer_group_delete') - g.custom_command('policy list', 'iot_hub_policy_list') - g.custom_command('policy show', 'iot_hub_policy_get') - g.custom_command('policy create', 'iot_hub_policy_create', transform=PolicyUpdateResultTransform(self.cli_ctx)) - g.custom_command('policy delete', 'iot_hub_policy_delete', transform=PolicyUpdateResultTransform(self.cli_ctx)) - g.custom_command('job list', 'iot_hub_job_list') - g.custom_command('job show', 'iot_hub_job_get') - g.custom_command('job cancel', 'iot_hub_job_cancel') g.custom_command('show-quota-metrics', 'iot_hub_get_quota_metrics') g.custom_command('show-stats', 'iot_hub_get_stats') - # iot device commands - with self.command_group('iot device', client_factory=iot_hub_service_factory) as g: - g.custom_command('create', 'iot_device_create', - deprecate_info='az iot hub device-identity create (via IoT Extension)') - g.custom_command('list', 'iot_device_list', - deprecate_info='az iot hub device-identity list (via IoT Extension)') - g.custom_command('show-connection-string', 'iot_device_show_connection_string', - deprecate_info='az iot hub device-identity show-connection-string (via IoT Extension)') - g.custom_command('show', 'iot_device_get', - deprecate_info='az iot hub device-identity show (via IoT Extension)') - g.generic_update_command('update', getter_name='iot_device_get', setter_name='iot_device_update', - command_type=update_custom_util, - deprecate_info='az iot hub device-identity update (via IoT Extension)') - g.custom_command('delete', 'iot_device_delete', - deprecate_info='az iot hub device-identity delete (via IoT Extension)') - g.custom_command('message send', 'iot_device_send_message', - deprecate_info='az iot device send-d2c-message (via IoT Extension)') - g.custom_command('message receive', 'iot_device_receive_message', - deprecate_info='az iot device c2d-message receive (via IoT Extension)') - g.custom_command('message complete', 'iot_device_complete_message', - deprecate_info='az iot device c2d-message complete (via IoT Extension)') - g.custom_command('message reject', 'iot_device_reject_message', - deprecate_info='az iot device c2d-message reject (via IoT Extension)') - g.custom_command('message abandon', 'iot_device_abandon_message', - deprecate_info='az iot device c2d-message abandon (via IoT Extension)') - g.custom_command('export', 'iot_device_export', - deprecate_info='az iot hub device-identity export (via IoT Extension)') - g.custom_command('import', 'iot_device_import', - deprecate_info='az iot hub device-identity import (via IoT Extension)') + # iot hub consumer group commands + with self.command_group('iot hub consumer-group', client_factory=iot_hub_service_factory) as g: + g.custom_command('create', 'iot_hub_consumer_group_create') + g.custom_command('list', 'iot_hub_consumer_group_list') + g.custom_command('show', 'iot_hub_consumer_group_get') + g.custom_command('delete', 'iot_hub_consumer_group_delete') + + # iot hub policy commands + with self.command_group('iot hub policy', client_factory=iot_hub_service_factory) as g: + g.custom_command('list', 'iot_hub_policy_list') + g.custom_command('show', 'iot_hub_policy_get') + g.custom_command('create', 'iot_hub_policy_create', transform=PolicyUpdateResultTransform(self.cli_ctx)) + g.custom_command('delete', 'iot_hub_policy_delete', transform=PolicyUpdateResultTransform(self.cli_ctx)) + + # iot hub job commands + with self.command_group('iot hub job', client_factory=iot_hub_service_factory) as g: + g.custom_command('list', 'iot_hub_job_list') + g.custom_command('show', 'iot_hub_job_get') + g.custom_command('cancel', 'iot_hub_job_cancel') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/custom.py new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/custom.py --- old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/custom.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/custom.py 2018-08-23 01:07:57.000000000 +0200 @@ -5,7 +5,6 @@ # pylint: disable=no-self-use,no-member,line-too-long,too-few-public-methods from __future__ import print_function -from os.path import exists from enum import Enum from knack.util import CLIError from azure.cli.core.commands import LongRunningOperation @@ -26,14 +25,10 @@ SharedAccessSignatureAuthorizationRuleAccessRightsDescription) from azure.cli.command_modules.iot.mgmt_iot_hub_device.lib.iot_hub_device_client import IotHubDeviceClient -from azure.cli.command_modules.iot.mgmt_iot_hub_device.lib.models.authentication import Authentication -from azure.cli.command_modules.iot.mgmt_iot_hub_device.lib.models.device_description import DeviceDescription -from azure.cli.command_modules.iot.mgmt_iot_hub_device.lib.models.x509_thumbprint import X509Thumbprint from azure.cli.command_modules.iot.sas_token_auth import SasTokenAuthentication -from azure.cli.core.util import sdk_no_wait from ._client_factory import resource_service_factory -from ._utils import create_self_signed_certificate, open_certificate +from ._utils import open_certificate # CUSTOM TYPE @@ -73,7 +68,9 @@ _check_dps_name_availability(client.iot_dps_resource, dps_name) location = _ensure_location(cli_ctx, resource_group_name, location) dps_property = IotDpsPropertiesDescription() - dps_description = ProvisioningServiceDescription(location, dps_property, IotDpsSkuInfo(sku, unit)) + dps_description = ProvisioningServiceDescription(location=location, + properties=dps_property, + sku=IotDpsSkuInfo(name=sku, capacity=unit)) return client.iot_dps_resource.create_or_update(resource_group_name, dps_name, dps_description) @@ -104,11 +101,13 @@ access_policy_rights = _convert_rights_to_access_rights(rights) dps_access_policies.append(SharedAccessSignatureAuthorizationRuleAccessRightsDescription( - access_policy_name, access_policy_rights, primary_key, secondary_key)) + key_name=access_policy_name, rights=access_policy_rights, primary_key=primary_key, secondary_key=secondary_key)) dps = iot_dps_get(client, dps_name, resource_group_name) - dps_property = IotDpsPropertiesDescription(None, None, dps.properties.iot_hubs, dps.properties.allocation_policy, dps_access_policies) - dps_description = ProvisioningServiceDescription(dps.location, dps_property, dps.sku) + dps_property = IotDpsPropertiesDescription(iot_hubs=dps.properties.iot_hubs, + allocation_policy=dps.properties.allocation_policy, + authorization_policies=dps_access_policies) + dps_description = ProvisioningServiceDescription(location=dps.location, properties=dps_property, sku=dps.sku) if no_wait: return client.iot_dps_resource.create_or_update(resource_group_name, dps_name, dps_description) @@ -133,8 +132,10 @@ policy.rights = _convert_rights_to_access_rights(rights) dps = iot_dps_get(client, dps_name, resource_group_name) - dps_property = IotDpsPropertiesDescription(None, None, dps.properties.iot_hubs, dps.properties.allocation_policy, dps_access_policies) - dps_description = ProvisioningServiceDescription(dps.location, dps_property, dps.sku) + dps_property = IotDpsPropertiesDescription(iot_hubs=dps.properties.iot_hubs, + allocation_policy=dps.properties.allocation_policy, + authorization_policies=dps_access_policies) + dps_description = ProvisioningServiceDescription(location=dps.location, properties=dps_property, sku=dps.sku) if no_wait: return client.iot_dps_resource.create_or_update(resource_group_name, dps_name, dps_description) @@ -150,8 +151,10 @@ updated_policies = [p for p in dps_access_policies if p.key_name.lower() != access_policy_name.lower()] dps = iot_dps_get(client, dps_name, resource_group_name) - dps_property = IotDpsPropertiesDescription(None, None, dps.properties.iot_hubs, dps.properties.allocation_policy, updated_policies) - dps_description = ProvisioningServiceDescription(dps.location, dps_property, dps.sku) + dps_property = IotDpsPropertiesDescription(iot_hubs=dps.properties.iot_hubs, + allocation_policy=dps.properties.allocation_policy, + authorization_policies=updated_policies) + dps_description = ProvisioningServiceDescription(location=dps.location, properties=dps_property, sku=dps.sku) if no_wait: return client.iot_dps_resource.create_or_update(resource_group_name, dps_name, dps_description) @@ -176,11 +179,21 @@ def iot_dps_linked_hub_create(cmd, client, dps_name, resource_group_name, connection_string, location, apply_allocation_policy=None, allocation_weight=None, no_wait=False): dps_linked_hubs = [] dps_linked_hubs.extend(iot_dps_linked_hub_list(client, dps_name, resource_group_name)) - dps_linked_hubs.append(IotHubDefinitionDescription(connection_string, location, apply_allocation_policy, allocation_weight)) + + # Hack due to DPS Swagger/SDK issue + # In the newer API version the name parameter is required + # however in the SDK name is read-only/assigned to None + client.api_version = '2017-11-15' + dps_linked_hubs.append(IotHubDefinitionDescription(connection_string=connection_string, + location=location, + apply_allocation_policy=apply_allocation_policy, + allocation_weight=allocation_weight)) dps = iot_dps_get(client, dps_name, resource_group_name) - dps_property = IotDpsPropertiesDescription(None, None, dps_linked_hubs, dps.properties.allocation_policy, dps.properties.authorization_policies) - dps_description = ProvisioningServiceDescription(dps.location, dps_property, dps.sku) + dps_property = IotDpsPropertiesDescription(iot_hubs=dps_linked_hubs, + allocation_policy=dps.properties.allocation_policy, + authorization_policies=dps.properties.authorization_policies) + dps_description = ProvisioningServiceDescription(location=dps.location, properties=dps_property, sku=dps.sku) if no_wait: return client.iot_dps_resource.create_or_update(resource_group_name, dps_name, dps_description) @@ -202,8 +215,10 @@ hub.allocation_weight = allocation_weight dps = iot_dps_get(client, dps_name, resource_group_name) - dps_property = IotDpsPropertiesDescription(None, None, dps_linked_hubs, dps.properties.allocation_policy, dps.properties.authorization_policies) - dps_description = ProvisioningServiceDescription(dps.location, dps_property, dps.sku) + dps_property = IotDpsPropertiesDescription(iot_hubs=dps_linked_hubs, + allocation_policy=dps.properties.allocation_policy, + authorization_policies=dps.properties.authorization_policies) + dps_description = ProvisioningServiceDescription(location=dps.location, properties=dps_property, sku=dps.sku) if no_wait: return client.iot_dps_resource.create_or_update(resource_group_name, dps_name, dps_description) @@ -219,8 +234,10 @@ updated_hub = [p for p in dps_linked_hubs if p.name.lower() != linked_hub.lower()] dps = iot_dps_get(client, dps_name, resource_group_name) - dps_property = IotDpsPropertiesDescription(None, None, updated_hub, dps.properties.allocation_policy, dps.properties.authorization_policies) - dps_description = ProvisioningServiceDescription(dps.location, dps_property, dps.sku) + dps_property = IotDpsPropertiesDescription(iot_hubs=updated_hub, + allocation_policy=dps.properties.allocation_policy, + authorization_policies=dps.properties.authorization_policies) + dps_description = ProvisioningServiceDescription(location=dps.location, properties=dps_property, sku=dps.sku) if no_wait: return client.iot_dps_resource.create_or_update(resource_group_name, dps_name, dps_description) @@ -230,7 +247,7 @@ # DPS certificate methods def iot_dps_certificate_list(client, dps_name, resource_group_name): - return client.dps_certificates.list(resource_group_name, dps_name) + return client.dps_certificate.list(resource_group_name, dps_name) def iot_dps_certificate_get(client, dps_name, resource_group_name, certificate_name): @@ -238,7 +255,7 @@ def iot_dps_certificate_create(client, dps_name, resource_group_name, certificate_name, certificate_path): - cert_list = client.dps_certificates.list(resource_group_name, dps_name) + cert_list = client.dps_certificate.list(resource_group_name, dps_name) for cert in cert_list.value: if cert.name == certificate_name: raise CLIError("Certificate '{0}' already exists. Use 'iot dps certificate update'" @@ -250,7 +267,7 @@ def iot_dps_certificate_update(client, dps_name, resource_group_name, certificate_name, certificate_path, etag): - cert_list = client.dps_certificates.list(resource_group_name, dps_name) + cert_list = client.dps_certificate.list(resource_group_name, dps_name) for cert in cert_list.value: if cert.name == certificate_name: certificate = open_certificate(certificate_path) @@ -340,10 +357,11 @@ sku = IotHubSkuInfo(name=sku, capacity=unit) event_hub_dic = {} - event_hub_dic['events'] = EventHubProperties(1, partition_count) - properties = IotHubProperties(None, None, event_hub_dic) - hub_description = IotHubDescription(location, client.iot_hub_resource.config.subscription_id, resource_group_name, - sku, None, None, properties) + event_hub_dic['events'] = EventHubProperties(retention_time_in_days=1, partition_count=partition_count) + properties = IotHubProperties(event_hub_endpoints=event_hub_dic) + hub_description = IotHubDescription(location=location, + sku=sku, + properties=properties) return client.iot_hub_resource.create_or_update(resource_group_name, hub_name, hub_description) @@ -376,7 +394,7 @@ # pylint: disable=inconsistent-return-statements -def iot_hub_show_connection_string(client, hub_name=None, resource_group_name=None, policy_name='iothubowner', +def iot_hub_show_connection_string(client, hub_name, resource_group_name=None, policy_name='iothubowner', key_type=KeyType.primary.value): if hub_name is None: hubs = iot_hub_list(client, resource_group_name) @@ -384,7 +402,7 @@ raise CLIError("No IoT Hub found.") def conn_str_getter(h): - return _get_single_hub_connection_string(client, h.name, h.resourcegroup, policy_name, key_type) + return _get_single_hub_connection_string(client, h.name, h.additional_properties['resourcegroup'], policy_name, key_type) return [{'name': h.name, 'connectionString': conn_str_getter(h)} for h in hubs] else: resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name) @@ -394,9 +412,12 @@ def _get_single_hub_connection_string(client, hub_name, resource_group_name, policy_name, key_type): access_policy = iot_hub_policy_get(client, hub_name, policy_name, resource_group_name) - conn_str_template = 'HostName={}.azure-devices.net;SharedAccessKeyName={};SharedAccessKey={}' + # Intermediate fix to support domains beyond azure-devices.net + hub = _get_iot_hub_by_name(client, hub_name) + hostname = hub.properties.host_name + conn_str_template = 'HostName={};SharedAccessKeyName={};SharedAccessKey={}' key = access_policy.secondary_key if key_type == KeyType.secondary else access_policy.primary_key - return conn_str_template.format(hub_name, policy_name, key) + return conn_str_template.format(hostname, policy_name, key) def iot_hub_sku_list(client, hub_name, resource_group_name=None): @@ -438,23 +459,23 @@ rights = _convert_perms_to_access_rights(permissions) hub = iot_hub_get(client, hub_name, resource_group_name) policies = [] - policies.extend(iot_hub_policy_list(client, hub_name, hub.resourcegroup)) + policies.extend(iot_hub_policy_list(client, hub_name, hub.additional_properties['resourcegroup'])) if _is_policy_existed(policies, policy_name): raise CLIError("Policy {0} already existed.".format(policy_name)) - policies.append(SharedAccessSignatureAuthorizationRule(policy_name, rights)) + policies.append(SharedAccessSignatureAuthorizationRule(key_name=policy_name, rights=rights)) hub.properties.authorization_policies = policies - return client.iot_hub_resource.create_or_update(hub.resourcegroup, hub_name, hub, {'IF-MATCH': hub.etag}) + return client.iot_hub_resource.create_or_update(hub.additional_properties['resourcegroup'], hub_name, hub, {'IF-MATCH': hub.etag}) def iot_hub_policy_delete(client, hub_name, policy_name, resource_group_name=None): import copy hub = iot_hub_get(client, hub_name, resource_group_name) - policies = iot_hub_policy_list(client, hub_name, hub.resourcegroup) + policies = iot_hub_policy_list(client, hub_name, hub.additional_properties['resourcegroup']) if not _is_policy_existed(copy.deepcopy(policies), policy_name): raise CLIError("Policy {0} not found.".format(policy_name)) updated_policies = [p for p in policies if p.key_name.lower() != policy_name.lower()] hub.properties.authorization_policies = updated_policies - return client.iot_hub_resource.create_or_update(hub.resourcegroup, hub_name, hub, {'IF-MATCH': hub.etag}) + return client.iot_hub_resource.create_or_update(hub.additional_properties['resourcegroup'], hub_name, hub, {'IF-MATCH': hub.etag}) def _is_policy_existed(policies, policy_name): @@ -487,148 +508,11 @@ return client.iot_hub_resource.get_stats(resource_group_name, hub_name) -def iot_device_create(client, hub_name, device_id, resource_group_name=None, x509=False, primary_thumbprint=None, - secondary_thumbprint=None, valid_days=None, output_dir=None): - _validate_x509_parameters(x509, primary_thumbprint, secondary_thumbprint, valid_days, output_dir) - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - device = DeviceDescription(device_id=device_id) - - if x509 is True: - device.authentication = _construct_x509_auth(device_id, primary_thumbprint, secondary_thumbprint, valid_days, output_dir) - - return device_client.create_or_update(device_id, device, if_match=None) - - -def _validate_x509_parameters(x509, primary_thumbprint, secondary_thumbprint, valid_days, output_dir): - if x509 is True: - if any([primary_thumbprint, secondary_thumbprint]) and any([valid_days, output_dir]): - raise CLIError("Certificate thumbprint parameters are used for existing certificates.\n" - "Certificate valid days and output directory are used to generate self-signed certificate.\n" - "They must not be used together.") - if output_dir is not None and not exists(output_dir): - raise CLIError("Directory not exist: {0}".format(output_dir)) - else: - if any([primary_thumbprint, secondary_thumbprint, valid_days, output_dir]): - raise CLIError("X.509 certificate parameters must be used with --x509 flag.") - - -def _construct_x509_auth(device_id, primary_thumbprint, secondary_thumbprint, valid_days, output_dir): - if any([primary_thumbprint, secondary_thumbprint]): - return Authentication(x509_thumbprint=X509Thumbprint(primary_thumbprint, secondary_thumbprint)) - valid_days = valid_days if valid_days is not None else 365 - output_dir = output_dir if output_dir is not None else '.' - cert_info = create_self_signed_certificate(device_id, valid_days, output_dir) - return Authentication(x509_thumbprint=X509Thumbprint(cert_info['thumbprint'])) - - -def iot_device_get(client, hub_name, device_id, resource_group_name=None): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - return device_client.get(device_id) - - -def iot_device_update(client, hub_name, device_id, parameters, resource_group_name=None): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - return device_client.create_or_update(device_id, parameters) - - -def iot_device_list(client, hub_name, resource_group_name=None, top=20): - device_client = _get_device_client(client, resource_group_name, hub_name, '') - return device_client.list(top) - - -def iot_device_delete(client, hub_name, device_id, resource_group_name=None, etag='*'): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - return device_client.delete(device_id, etag) - - -# pylint: disable=inconsistent-return-statements -def iot_device_show_connection_string(client, hub_name, device_id=None, resource_group_name=None, top=20, - key_type=KeyType.primary.value): - resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name) - if device_id is None: - devices = iot_device_list(client, hub_name, resource_group_name, top) - if devices is None: - raise CLIError("No devices found in IoT Hub {}.".format(hub_name)) - - def conn_str_getter(d): - return _get_single_device_connection_string(client, hub_name, d.device_id, resource_group_name, key_type) - return [{'deviceId': d.device_id, 'connectionString': conn_str_getter(d)} for d in devices] - else: - conn_str = _get_single_device_connection_string(client, hub_name, device_id, resource_group_name, key_type) - return {'connectionString': conn_str} - - -def iot_device_send_message(client, hub_name, device_id, resource_group_name=None, data='Ping from Azure CLI', - message_id=None, correlation_id=None, user_id=None): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - return device_client.send_message(device_id, data, message_id, correlation_id, user_id) - - -# pylint: disable=inconsistent-return-statements -def iot_device_receive_message(client, hub_name, device_id, resource_group_name=None, lock_timeout=60): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - result = sdk_no_wait(True, device_client.receive_message, device_id, lock_timeout) - if result is not None and result.response.status_code == 200: - return { - 'ack': result.headers['iothub-ack'], - 'correlationId': result.headers['iothub-correlationid'], - 'data': result.response.content, - 'deliveryCount': result.headers['iothub-deliverycount'], - 'enqueuedTime': result.headers['iothub-enqueuedtime'], - 'expiry': result.headers['iothub-expiry'], - 'lockToken': result.headers['ETag'].strip('"'), - 'messageId': result.headers['iothub-messageid'], - 'sequenceNumber': result.headers['iothub-sequencenumber'], - 'to': result.headers['iothub-to'], - 'userId': result.headers['iothub-userid'] - } - - -def iot_device_complete_message(client, hub_name, device_id, lock_token, resource_group_name=None): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - return device_client.complete_or_reject_message(device_id, lock_token) - - -def iot_device_reject_message(client, hub_name, device_id, lock_token, resource_group_name=None): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - return device_client.complete_or_reject_message(device_id, lock_token, '') - - -def iot_device_abandon_message(client, hub_name, device_id, lock_token, resource_group_name=None): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - return device_client.abandon_message(device_id, lock_token) - - -def iot_device_export(client, hub_name, blob_container_uri, include_keys=False, resource_group_name=None): - resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name) - return client.iot_hub_resource.export_devices(resource_group_name, hub_name, blob_container_uri, not include_keys) - - -def iot_device_import(client, hub_name, input_blob_container_uri, output_blob_container_uri, resource_group_name=None): - resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name) - return client.iot_hub_resource.import_devices(resource_group_name, hub_name, input_blob_container_uri, output_blob_container_uri) - - -def _get_single_device_connection_string(client, hub_name, device_id, resource_group_name, key_type): - device_client = _get_device_client(client, resource_group_name, hub_name, device_id) - device = device_client.get(device_id) - if device is None: - raise CLIError("Device {} not found.".format(device_id)) - - conn_str_template = "HostName={0}.azure-devices.net;DeviceId={1};{2}={3}" - keys = device.authentication.symmetric_key - if any([keys.primary_key, keys.secondary_key]): - key = keys.secondary_key if key_type == KeyType.secondary else keys.primary_key - if key is None: - raise CLIError("{0} key not found.".format(key_type)) - return conn_str_template.format(hub_name, device_id, 'SharedAccessKey', key) - else: - return conn_str_template.format(hub_name, device_id, 'x509', 'true') - - def _get_device_client(client, resource_group_name, hub_name, device_id): resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name) - base_url = '{0}.azure-devices.net'.format(hub_name) + # Intermediate fix to support domains beyond azure-devices.net + hub = _get_iot_hub_by_name(client, hub_name) + base_url = hub.properties.host_name uri = '{0}/devices/{1}'.format(base_url, device_id) access_policy = iot_hub_policy_get(client, hub_name, 'iothubowner', resource_group_name) creds = SasTokenAuthentication(uri, access_policy.key_name, access_policy.primary_key) @@ -655,7 +539,7 @@ def _ensure_resource_group_name(client, resource_group_name, hub_name): if resource_group_name is None: - return _get_iot_hub_by_name(client, hub_name).resourcegroup + return _get_iot_hub_by_name(client, hub_name).additional_properties['resourcegroup'] return resource_group_name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/sas_token_auth.py new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/sas_token_auth.py --- old/azure-cli-iot-0.1.19/azure/cli/command_modules/iot/sas_token_auth.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure/cli/command_modules/iot/sas_token_auth.py 2018-08-23 01:07:57.000000000 +0200 @@ -34,12 +34,12 @@ else: self.expiry = expiry - def signed_session(self): + def signed_session(self, session=None): """Create requests session with SAS auth headers. :rtype: requests.Session. """ - session = super(SasTokenAuthentication, self).signed_session() + session = session or super(SasTokenAuthentication, self).signed_session() session.headers['Authorization'] = self.generate_sas_token() return session diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure_cli_iot.egg-info/PKG-INFO new/azure-cli-iot-0.3.1/azure_cli_iot.egg-info/PKG-INFO --- old/azure-cli-iot-0.1.19/azure_cli_iot.egg-info/PKG-INFO 2018-04-06 19:33:52.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure_cli_iot.egg-info/PKG-INFO 2018-08-23 01:09:41.000000000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: azure-cli-iot -Version: 0.1.19 +Version: 0.3.1 Summary: Microsoft Azure Command-Line Tools IoT Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: azpy...@microsoft.com License: MIT -Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'iot' Command Module ======================================== @@ -21,6 +20,37 @@ Release History =============== + 0.3.1 + +++++ + * Increment DPS mgmt SDK requirement + * Fix internal breaking changes for SDK usage patterns + * Apply work around (back rev API) for assocating a linked-hub due to swagger/sdk mismatch with API. + * Update tests and DPS recording + + 0.3.0 + +++++ + * BREAKING CHANGE: Removed deprecated commands which have moved to the iot extension + * Updated elements to not assume azure-devices.net domain + + 0.2.0 + +++++ + * BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. + + 0.1.22 + ++++++ + * Minor fixes. + + 0.1.21 + ++++++ + + * Adds support for creating Basic Tier IoT Hubs. + * Updates to Azure SDK 0.5.0 + + 0.1.20 + ++++++ + + * Minor fixes to compat with msrest 0.4.28 + 0.1.19 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure_cli_iot.egg-info/SOURCES.txt new/azure-cli-iot-0.3.1/azure_cli_iot.egg-info/SOURCES.txt --- old/azure-cli-iot-0.1.19/azure_cli_iot.egg-info/SOURCES.txt 2018-04-06 19:33:52.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure_cli_iot.egg-info/SOURCES.txt 2018-08-23 01:09:41.000000000 +0200 @@ -8,7 +8,6 @@ azure/cli/command_modules/__init__.py azure/cli/command_modules/iot/__init__.py azure/cli/command_modules/iot/_client_factory.py -azure/cli/command_modules/iot/_completers.py azure/cli/command_modules/iot/_constants.py azure/cli/command_modules/iot/_help.py azure/cli/command_modules/iot/_params.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/azure_cli_iot.egg-info/requires.txt new/azure-cli-iot-0.3.1/azure_cli_iot.egg-info/requires.txt --- old/azure-cli-iot-0.1.19/azure_cli_iot.egg-info/requires.txt 2018-04-06 19:33:52.000000000 +0200 +++ new/azure-cli-iot-0.3.1/azure_cli_iot.egg-info/requires.txt 2018-08-23 01:09:41.000000000 +0200 @@ -1,4 +1,4 @@ -azure-mgmt-iothub==0.4.0 -azure-mgmt-iothubprovisioningservices==0.1.0 +azure-mgmt-iothub==0.5.0 +azure-mgmt-iothubprovisioningservices==0.2.0 pyOpenSSL azure-cli-core diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-iot-0.1.19/setup.py new/azure-cli-iot-0.3.1/setup.py --- old/azure-cli-iot-0.1.19/setup.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-iot-0.3.1/setup.py 2018-08-23 01:07:57.000000000 +0200 @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.19" +VERSION = "0.3.1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ @@ -32,8 +32,8 @@ ] DEPENDENCIES = [ - 'azure-mgmt-iothub==0.4.0', - 'azure-mgmt-iothubprovisioningservices==0.1.0', + 'azure-mgmt-iothub==0.5.0', + 'azure-mgmt-iothubprovisioningservices==0.2.0', 'pyOpenSSL', 'azure-cli-core', ]