Method: enterprises.devices.operations.cancel
เริ่มการยกเลิกแบบไม่พร้อมกันในการดำเนินการที่ใช้เวลานาน เซิร์ฟเวอร์จะพยายามยกเลิกการดำเนินการอย่างเต็มที่ แต่ไม่ได้รับประกันว่าจะสำเร็จ หากเซิร์ฟเวอร์ไม่รองรับวิธีนี้ ระบบจะแสดงผลเป็น google.rpc.Code.UNIMPLEMENTED
ลูกค้าสามารถใช้ Operations.GetOperation
หรือวิธีอื่นๆ เพื่อตรวจสอบว่าการยกเลิกสําเร็จหรือไม่ หรือการดำเนินการเสร็จสมบูรณ์แม้จะมีการยกเลิกหรือไม่ เมื่อยกเลิกสำเร็จ ระบบจะไม่ลบการดำเนินการ แต่การดำเนินการจะกลายเป็นการดำเนินการที่มีค่า Operation.error
ที่มี google.rpc.Status.code
เป็น 1
ซึ่งสอดคล้องกับ Code.CANCELLED
คำขอ HTTP
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
name |
string
ชื่อของทรัพยากรการดำเนินการที่จะยกเลิก
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะเป็นออบเจ็กต์ JSON ว่าง
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/androidmanagement
ดูข้อมูลเพิ่มเติมได้ที่ OAuth 2.0 Overview
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-01-30 UTC
[null,null,["อัปเดตล่าสุด 2025-01-30 UTC"],[[["Cancels a long-running operation asynchronously, with the server making a best effort to cancel the operation but success is not guaranteed."],["Uses an HTTP POST request to `https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel` with the operation name as a path parameter and an empty request body."],["If cancellation is successful, the response body will be empty and the operation will have an error value with a code of 1, indicating cancellation."],["Requires authorization with the `https://www.googleapis.com/auth/androidmanagement` OAuth scope."]]],["This document details the process of initiating asynchronous cancellation for a long-running operation. The core action is sending a `POST` request to a specific URL, defined by a path parameter `name`, indicating the operation to cancel. The request body must be empty. A successful cancellation results in an empty JSON object response, and the operation's error code is set to `1` (`Code.CANCELLED`). The authorization requires the `https://www.googleapis.com/auth/androidmanagement` OAuth scope. The server might not support this method, and cancellation is not guaranteed.\n"]]