SDK and ScheduledJobs (JobResponse) - Different results from devices.jobs query #3075
Replies: 1 comment 3 replies
-
Your understanding is correct here. The different sets of results you get from the different service client APIs is a result of the service client calling different IoT Hub service APIs.
Because these are different service requests, IoT hub has slightly different implementations on what it returns. I agree that the service returning different data from these seemingly identical requests is confusing, but it isn't something the SDK can control unfortunately.
We appreciate the feedback! We decided on the name "ScheduledJobs" to make clear that the client does not handle all types of jobs. Import/export jobs in particular are wildly different, so we wanted to make these distinct. Does that help contextualize the name choice at all? |
Beta Was this translation helpful? Give feedback.
-
It's not clear to me (and it doesn't seem documented anywhere) how using the
JobsClient
in the SDK (IotHubServiceClient.ScheduledJobs
in V2 of the SDK) is supposed to be different or identical to using the REST API or the SDK Query API.For instance, if I run
IotHubServiceClient.ScheduledJobs.CreateQueryAsync()
I get a set of results that's different from the interactive query in IoT Hub (SELECT * FROM devices.jobs
) with no filter criteria. When I useIotHubServiceClient.Query.CreateAsync()
the results are identical to the interactive query. It's not at all clear where theQueryResponse<ScheduledJob>
(formerlyJobResponse
) is coming from. My understanding is the SDK is just a pass-thru to the REST API and that they should be referring to the same data:https://learn.microsoft.com/en-us/rest/api/iothub/service/jobs/query-scheduled-jobs
I am currently using the V2 preview version of the SDK:
https://github.com/Azure/azure-iot-sdk-csharp/blob/previews/v2/SDK%20v2%20migration%20guide.md
As a side note as feedback for the V2 preview SDK, it's weird that the new client is called
ScheduledJobs
and not justJobs
to be consistent.Beta Was this translation helpful? Give feedback.
All reactions