Method: enterprises.devices.operations.cancel
Bắt đầu huỷ không đồng bộ trên một thao tác chạy trong thời gian dài. Máy chủ sẽ cố gắng hết sức để huỷ thao tác, nhưng không đảm bảo sẽ huỷ thành công. Nếu không hỗ trợ phương thức này, máy chủ sẽ trả về google.rpc.Code.UNIMPLEMENTED
. Ứng dụng có thể sử dụng Operations.GetOperation
hoặc các phương thức khác để kiểm tra xem thao tác huỷ có thành công hay không hoặc liệu thao tác có hoàn tất mặc dù đã huỷ hay không. Khi huỷ thành công, thao tác sẽ không bị xoá; thay vào đó, thao tác đó sẽ trở thành một thao tác có giá trị Operation.error
với google.rpc.Status.code
là 1
, tương ứng với Code.CANCELLED
.
Yêu cầu HTTP
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
name |
string
Tên của tài nguyên thao tác cần huỷ.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ là một đối tượng JSON trống.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/androidmanagement
Để biết thêm thông tin, hãy xem OAuth 2.0 Overview.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-01-30 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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"]]