Skip to content

Commit 857068d

Browse files
authored
Merge pull request #102470 from rezasherafat/directmethods_docupdate
Updated direct methods docs clarifying timeouts and error values.
2 parents 6884556 + cd3ef21 commit 857068d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

articles/iot-hub/iot-hub-devguide-direct-methods.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ Direct method invocations on a device are HTTPS calls that are made up of the fo
6868
}
6969
```
7070
71-
Timeout is in seconds. If timeout is not set, it defaults to 30 seconds.
71+
The value provided as `responseTimeoutInSeconds` in the request is the amount of time that IoT Hub service must await for completion of a direct method execution on a device. Set this timeout to be at least as long as the expected execution time of a direct method by a device. If timeout is not provided, it the default value of 30 seconds is used. The minimum and maximum values for `responseTimeoutInSeconds` are 5 and 300 seconds, respectively.
72+
73+
The value provided as `connectTimeoutInSeconds` in the request is the amount of time upon invocation of a direct method that IoT Hub service must await for a disconnected device to come online. The default value is 0, meaning that devices must already be online upon invocation of a direct method. The maximum value for `connectTimeoutInSeconds` is 300 seconds.
74+
7275
7376
#### Example
7477
@@ -93,7 +96,10 @@ curl -X POST \
9396

9497
The back-end app receives a response that is made up of the following items:
9598

96-
* *HTTP status code*, which is used for errors coming from the IoT Hub, including a 404 error for devices not currently connected.
99+
* *HTTP status code*:
100+
* 200 indicates successful execution of direct method;
101+
* 404 indicates that either device ID is invalid, or that the device was not online upon invocation of a direct method and for `connectTimeoutInSeconds` thereafter (use accompanied error message to understand the root cause);
102+
* 504 indicates gateway timeout caused by device not responding to a direct method call within `responseTimeoutInSeconds`.
97103

98104
* *Headers* that contain the ETag, request ID, content type, and content encoding.
99105

0 commit comments

Comments
 (0)