لغو ناهمزمان را در یک عملیات طولانی مدت شروع می کند. سرور تمام تلاش خود را برای لغو عملیات انجام می دهد، اما موفقیت تضمین نشده است. اگر سرور از این روش پشتیبانی نمیکند، google.rpc.Code.UNIMPLEMENTED برمیگرداند. مشتریان میتوانند از Operations.GetOperation یا روشهای دیگر برای بررسی اینکه آیا لغو موفقیتآمیز بوده است یا اینکه علیرغم لغو، عملیات تکمیل شده است، استفاده کنند. در صورت لغو موفقیت آمیز، عملیات حذف نمی شود. در عوض، به عملیاتی با مقدار Operation.error با google.rpc.Status.code1 تبدیل می شود که مربوط به Code.CANCELLED است.
درخواست HTTP
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*/operations/*}:cancel
تاریخ آخرین بهروزرسانی 2025-01-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 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"]]