public final class ScheduledJobsClient extends Object
| Constructor and Description |
|---|
ScheduledJobsClient(String connectionString)
Constructor to create instance from connection string
|
ScheduledJobsClient(String hostName,
com.azure.core.credential.AzureSasCredential azureSasCredential)
Create a new ScheduledJobsClient instance.
|
ScheduledJobsClient(String hostName,
com.azure.core.credential.AzureSasCredential azureSasCredential,
ScheduledJobsClientOptions clientOptions)
Create a new ScheduledJobsClient instance.
|
ScheduledJobsClient(String connectionString,
ScheduledJobsClientOptions clientOptions)
Constructor to create instance from connection string
|
ScheduledJobsClient(String hostName,
com.azure.core.credential.TokenCredential credential)
Create a new ScheduledJobsClient instance.
|
ScheduledJobsClient(String hostName,
com.azure.core.credential.TokenCredential credential,
ScheduledJobsClientOptions clientOptions)
Create a new ScheduledJobsClient instance.
|
| Modifier and Type | Method and Description |
|---|---|
ScheduledJob |
cancel(String jobId)
Cancel a current jod on the IoTHub
|
ScheduledJob |
get(String jobId)
Get the current job on the iotHub.
|
JobQueryResponse |
query(ScheduledJobType jobType,
ScheduledJobStatus jobStatus)
Query from your IoT Hub's set of scheduled jobs by job type and job status.
|
JobQueryResponse |
query(ScheduledJobType jobType,
ScheduledJobStatus jobStatus,
QueryPageOptions options)
Query from your IoT Hub's set of scheduled jobs by job type and job status.
|
JobQueryResponse |
query(String query)
Query from your IoT Hub's set of scheduled jobs.
|
JobQueryResponse |
query(String query,
QueryPageOptions options)
Query from your IoT Hub's set of scheduled jobs.
|
ScheduledJob |
scheduleDirectMethod(String jobId,
String queryCondition,
String methodName,
Date startTimeUtc)
Creates a new ScheduledJob to invoke method on one or multiple devices
|
ScheduledJob |
scheduleDirectMethod(String jobId,
String queryCondition,
String methodName,
Date startTimeUtc,
DirectMethodsJobOptions options)
Creates a new ScheduledJob to invoke method on one or multiple devices
|
ScheduledJob |
scheduleUpdateTwin(String jobId,
String queryCondition,
Twin updateTwin,
Date startTimeUtc,
long maxExecutionTimeInSeconds)
Creates a new ScheduledJob to update twin tags and desired properties on one or multiple devices
|
public ScheduledJobsClient(String connectionString)
connectionString - The iot hub connection stringpublic ScheduledJobsClient(String connectionString, ScheduledJobsClientOptions clientOptions)
connectionString - The iot hub connection stringclientOptions - The connection clientOptions to use when connecting to the service.public ScheduledJobsClient(String hostName, com.azure.core.credential.TokenCredential credential)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")credential - The custom TokenCredential that will provide authentication tokens to
this library when they are needed. The provided tokens must be Json Web Tokens.public ScheduledJobsClient(String hostName, com.azure.core.credential.TokenCredential credential, ScheduledJobsClientOptions clientOptions)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")credential - The custom TokenCredential that will provide authentication tokens to
this library when they are needed. The provided tokens must be Json Web Tokens.clientOptions - The connection clientOptions to use when connecting to the service.public ScheduledJobsClient(String hostName, com.azure.core.credential.AzureSasCredential azureSasCredential)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")azureSasCredential - The SAS token provider that will be used for authentication.public ScheduledJobsClient(String hostName, com.azure.core.credential.AzureSasCredential azureSasCredential, ScheduledJobsClientOptions clientOptions)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")azureSasCredential - The SAS token provider that will be used for authentication.clientOptions - The connection clientOptions to use when connecting to the service.public ScheduledJob scheduleUpdateTwin(String jobId, String queryCondition, Twin updateTwin, Date startTimeUtc, long maxExecutionTimeInSeconds) throws IOException, IotHubException
jobId - Unique ScheduledJob Id for this jobqueryCondition - Query condition to evaluate which devices to run the job on. It can be null or emptyupdateTwin - Twin object to use for the updatestartTimeUtc - Date time in Utc to start the jobmaxExecutionTimeInSeconds - Max execution time in seconds, i.e., ttl duration the job can runIOException - if the function cannot create a URL for the jobIotHubException - if the http request failedpublic ScheduledJob scheduleDirectMethod(String jobId, String queryCondition, String methodName, Date startTimeUtc) throws IOException, IotHubException
jobId - Unique ScheduledJob Id for this jobqueryCondition - Query condition to evaluate which devices to run the job on. It can be null or emptymethodName - Method name to be invokedstartTimeUtc - Date time in Utc to start the jobIOException - if the function cannot create a URL for the job, or the IO failed on requestIotHubException - if the http request failedpublic ScheduledJob scheduleDirectMethod(String jobId, String queryCondition, String methodName, Date startTimeUtc, DirectMethodsJobOptions options) throws IOException, IotHubException
jobId - Unique ScheduledJob Id for this jobqueryCondition - Query condition to evaluate which devices to run the job on. It can be null or emptymethodName - Method name to be invokedstartTimeUtc - Date time in Utc to start the joboptions - the optional parameters for this request. May not be null.IOException - if the function cannot create a URL for the job, or the IO failed on requestIotHubException - if the http request failedpublic ScheduledJob get(String jobId) throws IOException, IotHubException
jobId - Unique ScheduledJob Id for this jobIOException - if the function cannot create a URL for the job, or the IO failed on requestIotHubException - if the http request failedpublic ScheduledJob cancel(String jobId) throws IOException, IotHubException
jobId - Unique ScheduledJob Id for this jobIOException - if the function cannot create a URL for the job, or the IO failed on requestIotHubException - if the http request failedpublic JobQueryResponse query(String query) throws IOException, IotHubException
query - The IoT Hub query for selecting which jobs to get.IOException - If IoT Hub cannot be reached due to network level issues.IotHubException - If the request fails for non-network level issues such as an incorrectly formatted query.public JobQueryResponse query(String query, QueryPageOptions options) throws IOException, IotHubException
query - The IoT Hub query for selecting which jobs to get.options - The optional parameters used to decide how the query's results are returned. May not be null.IOException - If IoT Hub cannot be reached due to network level issues.IotHubException - If the request fails for non-network level issues such as an incorrectly formatted query.public JobQueryResponse query(ScheduledJobType jobType, ScheduledJobStatus jobStatus) throws IOException, IotHubException
jobType - The type of the job (methods or twin).jobStatus - The status of the job ("completed", for example)IOException - If IoT Hub cannot be reached due to network level issues.IotHubException - If the request fails for non-network level issues such as throttling.public JobQueryResponse query(ScheduledJobType jobType, ScheduledJobStatus jobStatus, QueryPageOptions options) throws IOException, IotHubException
jobType - The type of the job (methods or twin).jobStatus - The status of the job ("completed", for example)options - The optional parameters used to decide how the query's results are returned. May not be null.IOException - If IoT Hub cannot be reached due to network level issues.IotHubException - If the request fails for non-network level issues such as throttling.Copyright © 2024. All rights reserved.