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 Transcoding استفاده می کند.
پارامترهای مسیر
پارامترها |
---|
name | string نام منبع عملیاتی که باید لغو شود. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ یک شی JSON خالی است.
محدوده مجوز
به محدوده OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/androidmanagement
برای اطلاعات بیشتر، بهOAuth 2.0 Overview .
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-29 بهوقت ساعت هماهنگ جهانی."],[[["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"]]