API 메서드가 완료되는 데 일반적으로 시간이 오래 걸리는 경우 클라이언트에 Operation을 반환하도록 설계할 수 있습니다. 그러면 클라이언트는 이 인터페이스를 통해 작업 리소스를 폴링하여 실제 응답을 비동기식으로 수신하거나, 작업 리소스를 Pub/Sub API 등의 다른 API에 전달하여 응답을 수신할 수 있습니다. 장기 실행 작업을 반환하는 API 서비스는 Operations 인터페이스를 구현하여 개발자에게 일관적인 클라이언트 경험을 제공해야 합니다.
장기 실행 작업에 대한 비동기 취소를 시작합니다. 서버는 작업이 취소되도록 최선을 다하지만 성공한다고 보장되지 않습니다. 서버에서 이 메서드를 지원하지 않으면 google.rpc.Code.UNIMPLEMENTED가 반환됩니다. 클라이언트는 Operations.GetOperation 또는 다른 메서드를 사용하여 취소가 성공했는지 또는 취소에도 불구하고 작업이 완료되었는지 여부를 확인할 수 있습니다. 취소가 성공하면 작업은 삭제되지 않고 대신 Operation.error 값을 갖는 작업이 되며 google.rpc.Status.code가 1로 설정됩니다. 이 값은 Code.CANCELLED에 해당합니다.
지정된 장기 실행 작업이 완료되거나 지정된 최대 제한 시간에 도달할 때까지 기다렸다가 최신 상태를 반환합니다. 작업이 이미 완료된 경우 최신 상태가 즉시 반환됩니다. 지정된 제한시간이 기본 HTTP/RPC 제한시간보다 길면 HTTP/RPC 제한시간이 사용됩니다. 서버에서 이 메서드를 지원하지 않으면 google.rpc.Code.UNIMPLEMENTED가 반환됩니다. 이 메서드는 최상의 방식으로 수행됩니다. 즉시 반환되거나 지정된 제한시간 전에 최신 상태를 반환할 수 있으며 즉시 응답하더라도 작업이 완료됨을 보장하지는 않습니다.
작업과 관련된 서비스별 메타데이터입니다. 일반적으로 진행률 정보 및 생성 시간과 같은 일반 메타데이터가 포함됩니다. 일부 서비스는 이러한 메타데이터를 제공하지 않을 수 있습니다. 장기 실행 작업을 반환하는 메서드는 메타데이터 유형이 있는 경우 이를 문서화해야 합니다.
done
bool
값이 false이면 작업이 아직 진행 중이라는 의미입니다. true이면 작업이 완료된 것이며, error 또는 response를 사용할 수 있습니다.
통합 필드 result는 작업 결과로, error 또는 유효한 response일 수 있습니다. done == false이면 error와 response가 모두 설정되지 않습니다. done == true이면 error 또는 response 중 정확히 하나를 설정할 수 있습니다. 일부 서비스는 결과를 제공하지 않을 수 있습니다. result는 다음 중 하나여야 합니다.
정상적인 성공한 작업 응답입니다. Delete와 같이 원래 메서드가 성공 시 데이터를 반환하지 않는 경우 응답은 google.protobuf.Empty입니다. 원래 메서드가 표준 Get/Create/Update이면 응답은 리소스여야 합니다. 다른 메서드의 경우 응답은 XxxResponse 유형이어야 하며, 여기에서 Xxx는 원래 메서드의 이름입니다. 예를 들어 원래 메서드 이름이 TakeSnapshot()이면 추론된 응답 유형은 TakeSnapshotResponse입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-05-30(UTC)"],[],[],null,["# Package google.longrunning\n\nIndex\n-----\n\n- [Operations](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operations) (interface)\n- [CancelOperationRequest](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.CancelOperationRequest) (message)\n- [DeleteOperationRequest](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.DeleteOperationRequest) (message)\n- [GetOperationRequest](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.GetOperationRequest) (message)\n- [ListOperationsRequest](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.ListOperationsRequest) (message)\n- [ListOperationsResponse](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.ListOperationsResponse) (message)\n- [Operation](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operation) (message)\n- [WaitOperationRequest](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.WaitOperationRequest) (message)\n\nOperations\n----------\n\nManages long-running operations with an API service.\n\nWhen an API method normally takes long time to complete, it can be designed to return [Operation](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operation) to the client, and the client can use this interface to receive the real response asynchronously by polling the operation resource, or pass the operation resource to another API (such as Pub/Sub API) to receive the response. Any API service that returns long-running operations should implement the `Operations` interface so developers can have a consistent client experience.\n\nCancelOperationRequest\n----------------------\n\nThe request message for [Operations.CancelOperation](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operations.CancelOperation).\n\nDeleteOperationRequest\n----------------------\n\nThe request message for [Operations.DeleteOperation](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operations.DeleteOperation).\n\nGetOperationRequest\n-------------------\n\nThe request message for [Operations.GetOperation](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operations.GetOperation).\n\nListOperationsRequest\n---------------------\n\nThe request message for [Operations.ListOperations](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operations.ListOperations).\n\nListOperationsResponse\n----------------------\n\nThe response message for [Operations.ListOperations](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operations.ListOperations).\n\nOperation\n---------\n\nThis resource represents a long-running operation that is the result of a network API call.\n\nWaitOperationRequest\n--------------------\n\nThe request message for [Operations.WaitOperation](/speech-to-text/v2/docs/reference/rpc/google.longrunning#google.longrunning.Operations.WaitOperation)."]]