Skip to content
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

Updated Python sample for IoT Central 1.0.0b1 #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bretmulvey
Copy link

Updated the Python SDK sample to work with latest IoT Central management SDK. Included the same functionality as the previous sample, and added examples of new functionality including

  • enabling system-assigned identity
  • regional instead of geographic scope
  • S1 SKU unavailable

Updated the Python SDK sample to work with last IoT Central management SDK. Included the same functionality as the previous sample, and added examples of new functionality including

- enabling system-assigned identity
- regional instead of geographic scope
- S1 SKU unavailable
poller = iotc.apps.begin_create_or_update(resourceGroup, appName, app)
result = poller.result()
print("It worked but it shouldn't have!")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add raise Exception here?

Copy link
Author

@bretmulvey bretmulvey Nov 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inside a try who's except is the success condition and prints "OK", so raising here would print "OK".

Copy link
Collaborator

@poanchen poanchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

poller = iotc.apps.begin_create_or_update(resourceGroup, appNameS1, app)
result = poller.result()
print("It worked but it shouldn't have!")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here add raise Exception

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception here means success (we expect exception) so raising exception here would print "OK".

@gansvv
Copy link
Contributor

gansvv commented Nov 10, 2021

Please also update the requirements.txt with latest deps. And the readme if needed.

@bretmulvey
Copy link
Author

Please also update the requirements.txt with latest deps. And the readme if needed.

Will do. This is pending a version number update on the mgmt package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants