Skip to content

Commit a194d78

Browse files
committed
expand API comments
1 parent dee6aed commit a194d78

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

gateway-api/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,10 @@ pub trait GatewayApi {
263263
///
264264
/// This endpoint is only valid for the `host-boot-flash` component.
265265
///
266-
/// Computing the hash takes several seconds; callers can poll for results
267-
/// using `sp_component_hash_firmware_get()`.
266+
/// Computing the hash takes several seconds; callers should poll for results
267+
/// using `sp_component_hash_firmware_get()`. In general they should call
268+
/// `sp_component_hash_firmware_get()` first anyway, as the hashes are
269+
/// cached in the SP and may already be ready.
268270
#[endpoint {
269271
method = POST,
270272
path = "/sp/{type}/{slot}/component/{component}/hash/{firmware_slot}",
@@ -278,8 +280,11 @@ pub trait GatewayApi {
278280
///
279281
/// This endpoint is only valid for the `host-boot-flash` component.
280282
///
281-
/// Computing the hash takes several seconds; callers can start hashing
282-
/// using `sp_component_hash_firmware_start()`.
283+
/// Computing the hash takes several seconds; this endpoint returns the
284+
/// current status. If the status is `HashNotStarted`, callers should start
285+
/// hashing using `sp_component_hash_firmware_start()`. If the status is
286+
/// `HashInProgress`, callers should wait a bit then call this endpoint
287+
/// again.
283288
#[endpoint {
284289
method = GET,
285290
path = "/sp/{type}/{slot}/component/{component}/hash/{firmware_slot}",

0 commit comments

Comments
 (0)