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-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eCancels a long-running operation asynchronously, with the server making a best effort to cancel the operation but success is not guaranteed.\u003c/p\u003e\n"],["\u003cp\u003eUses an HTTP POST request to \u003ccode\u003ehttps://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel\u003c/code\u003e with the operation name as a path parameter and an empty request body.\u003c/p\u003e\n"],["\u003cp\u003eIf cancellation is successful, the response body will be empty and the operation will have an error value with a code of 1, indicating cancellation.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/androidmanagement\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],["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"],null,["# Method: enterprises.devices.operations.cancel\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nStarts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use [Operations.GetOperation](/android/management/reference/rest/v1/enterprises.devices.operations/get#google.longrunning.Operations.GetOperation) or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an [Operation.error](/android/management/reference/rest/v1/enterprises.devices.operations#Operation.FIELDS.error) value with a [google.rpc.Status.code](/android/management/reference/rest/v1/enterprises.devices.operations#Status.FIELDS.code) of `1`, corresponding to `Code.CANCELLED`.\n\n### HTTP request\n\n`POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|--------------------------------------------------------------|\n| `name` | `string` The name of the operation resource to be cancelled. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidmanagement`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]