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

Add support for device identity operations #142

Conversation

corollaries
Copy link
Contributor

This PR adds support for getting, creating, updating, and deleting device identities from the IoT Hub and partial implementation for the module identities. I'll add full support for the module identities in a later PR.

Copy link
Contributor

@rylev rylev left a comment

Choose a reason for hiding this comment

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

Looks good. Some nits and some food for thought, but nothing that should prevent us from merging this.

sdk/iothub/src/service/identity.rs Show resolved Hide resolved
sdk/iothub/src/service/identity.rs Outdated Show resolved Hide resolved
/// let iothub = ServiceClient::from_connection_string(connection_string, 3600).expect("Failed to create the ServiceClient!");
/// let device = iothub.get_device_identity("some-device");
/// ```
pub async fn get_device_identity<S>(&self, device_id: S) -> Result<Device, AzureError>
Copy link
Contributor

Choose a reason for hiding this comment

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

These don't really match the pattern of request builders we've been using in other crates. That might be fine, but we probably need to think more deeply about if the iothub crate should follow the same pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd be happy to change it so it's similar to the other crates, no problem at all. I did notice there is a "common" http client within the core crate that was added a while ago. Is this what you mean that should be used instead? Could you link me an example of the ideal way we'd be doing requests?

Copy link
Contributor

@rylev rylev left a comment

Choose a reason for hiding this comment

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

Great stuff!

@rylev rylev merged commit 5aa5e8e into Azure:master Jan 18, 2021
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.

2 participants