สถานะ
/osc/commands/status
API แสดงสถานะสำหรับคำสั่ง inProgress
ก่อนหน้า status
API มีประโยชน์สำหรับการสำรวจความคืบหน้าของคำสั่งที่ออกก่อนหน้านี้ ตัวอย่างเช่น การพิจารณาว่า camera.takePicture
เสร็จสิ้นแล้วหรือไม่
ชื่อ |
ประเภท |
คำอธิบาย |
id |
สตริง |
รหัสคำสั่งที่ส่งคืนจากการเรียกใช้ก่อนหน้าไปยัง
/osc/commands/execute |
เอาต์พุต
เอาต์พุตนี้เป็นออบเจ็กต์คำสั่งด้วย (ดูเอาต์พุตของ /osc/commands/execute
)
ข้อผิดพลาด
รหัสข้อผิดพลาด |
คำอธิบาย |
missingParameter |
ไม่ได้ระบุ id พารามิเตอร์นี้ต้องมีรหัสคำสั่งที่ส่งคืนจากการเรียก /osc/commands/execute ครั้งก่อน |
invalidParameterName |
ไม่รู้จักพารามิเตอร์อินพุต |
invalidParameterValue |
ระบบรู้จักพารามิเตอร์อินพุต แต่ค่าของพารามิเตอร์ไม่ถูกต้อง ตัวอย่างเช่น ไม่มีค่า id อยู่หรือประเภทไม่ถูกต้อง |
ตัวอย่าง |
คำขอ |
POST /osc/commands/status HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1
{ "id": "90ABCD" } |
การตอบกลับ |
HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff
{ "name": "camera.takePicture", "state": "done", "results": { "fileUri": "ABC.JPG" } } |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-21 UTC
[null,null,["อัปเดตล่าสุด 2024-08-21 UTC"],[[["The `/osc/commands/status` API is used to check the status of previously executed commands, like `camera.takePicture`, that were in progress."],["It requires the `id` of the command, obtained from the `/osc/commands/execute` API, to retrieve the status."],["The API response provides details like command name, state (e.g., \"done\"), and any results, such as a file URI."],["Potential errors include missing or invalid `id` parameters."]]],["The `/osc/commands/status` API retrieves the status of prior `inProgress` commands, using a command ID from `/osc/commands/execute`. Input requires the `id` parameter; output mirrors the command object format of `/osc/commands/execute`. Errors include `missingParameter` (no ID), `invalidParameterName`, or `invalidParameterValue` (incorrect ID type/value). An example shows a POST request with ID \"90ABCD\" and a successful response indicating \"camera.takePicture\" is \"done\" with the file URI.\n"]]