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