Method: operations.cancel
เริ่มการยกเลิกแบบไม่พร้อมกันในการดำเนินการที่ใช้เวลานาน เซิร์ฟเวอร์จะพยายามยกเลิกการดำเนินการอย่างเต็มที่ แต่ไม่ได้รับประกันว่าจะสำเร็จ หากเซิร์ฟเวอร์ไม่รองรับวิธีนี้ ระบบจะแสดงผลเป็น google.rpc.Code.UNIMPLEMENTED
ลูกค้าสามารถใช้ Operations.GetOperation
หรือวิธีอื่นๆ เพื่อตรวจสอบว่าการยกเลิกสําเร็จหรือไม่ หรือการดำเนินการเสร็จสมบูรณ์แม้จะมีการยกเลิกหรือไม่ เมื่อยกเลิกสำเร็จ ระบบจะไม่ลบการดำเนินการ แต่การดำเนินการจะกลายเป็นการดำเนินการที่มีค่า Operation.error
ที่มี google.rpc.Status.code
เป็น 1
ซึ่งสอดคล้องกับ Code.CANCELLED
คำขอ HTTP
POST https://vault.googleapis.com/v1/{name=operations/**}:cancel
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
name |
string
ชื่อของทรัพยากรการดำเนินการที่จะยกเลิก
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะเป็นออบเจ็กต์ JSON ว่าง
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/ediscovery
ดูข้อมูลเพิ่มเติมได้ที่ OAuth 2.0 Overview
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-02-06 UTC
[null,null,["อัปเดตล่าสุด 2025-02-06 UTC"],[[["Initiates the cancellation process for a long-running operation, although cancellation success is not guaranteed."],["Uses the `POST` method with a specific URL structure including the operation name for cancellation."],["Requires an empty request body and returns an empty response body upon successful cancellation."],["In case of unsupported cancellation by the server, an `UNIMPLEMENTED` error code is returned."],["If cancelled successfully, the operation is not deleted but marked with a `CANCELLED` status code."]]],["This document details the process of initiating asynchronous cancellation for a long-running operation. It uses an HTTP POST request to `vault.googleapis.com/v1/{name=operations/**}:cancel`. The `name` parameter specifies the operation to cancel. The request body must be empty, and a successful response returns an empty JSON object. The server attempts cancellation, and clients can check the status via `Operations.GetOperation`. Successful cancellation results in an `Operation.error` with `Code.CANCELLED`. Authorization requires the `https://www.googleapis.com/auth/ediscovery` OAuth scope.\n"]]