REST Resource: operations
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
리소스: 작업
이 리소스는 네트워크 API 호출의 결과인 장기 실행 작업을 나타냅니다.
JSON 표현 |
{
"name": string,
"metadata": {
"@type": string,
field1: ...,
...
},
"done": boolean,
// Union field result can be only one of the following:
"error": {
object (Status )
},
"response": {
"@type": string,
field1: ...,
...
}
// End of list of possible types for union field result .
} |
필드 |
name |
string
서버에 할당된 이름으로, 해당 이름을 최초로 반환한 서비스 내에서만 고유합니다. 기본 HTTP 매핑을 사용하는 경우 name 은 operations/{uniqueId} 로 끝나는 리소스 이름이어야 합니다.
|
metadata |
object
작업과 관련된 서비스별 메타데이터입니다. 일반적으로 진행률 정보 및 생성 시간과 같은 일반 메타데이터가 포함됩니다. 일부 서비스는 이러한 메타데이터를 제공하지 않을 수 있습니다. 장기 실행 작업을 반환하는 메소드는 메타데이터 유형이 있는 경우 이를 문서화해야 합니다. 임의 유형의 필드를 포함하는 객체입니다. 추가 필드 "@type" 은 유형을 식별하는 URI를 포함합니다. 예: { "id": 1234, "@type": "types.example.com/standard/id" }
|
done |
boolean
값이 false 이면 작업이 아직 진행 중이라는 의미입니다. true 이면 작업이 완료된 것이며, error 또는 response 를 사용할 수 있습니다.
|
통합 필드 result 는 작업 결과로, error 또는 유효한 response 일 수 있습니다. done == false 이면 error 와 response 가 모두 설정되지 않습니다. done == true 이면 error 또는 response 중 정확히 하나를 설정할 수 있습니다. 일부 서비스는 결과를 제공하지 않을 수 있습니다. result 는 다음 중 하나여야 합니다. |
error |
object (Status )
실패하거나 취소된 작업의 오류 결과입니다.
|
response |
object
정상적인 성공한 작업 응답입니다. Delete 와 같이 원래 메서드가 성공 시 데이터를 반환하지 않는 경우 응답은 google.protobuf.Empty 입니다. 원래 메서드가 표준 Get /Create /Update 이면 응답은 리소스여야 합니다. 다른 메서드의 경우 응답은 XxxResponse 유형이어야 하며, 여기에서 Xxx 는 원래 메서드의 이름입니다. 예를 들어 원래 메서드 이름이 TakeSnapshot() 이면 추론된 응답 유형은 TakeSnapshotResponse 입니다. 임의 유형의 필드를 포함하는 객체입니다. 추가 필드 "@type" 은 유형을 식별하는 URI를 포함합니다. 예: { "id": 1234, "@type": "types.example.com/standard/id" }
|
상태
status
유형은 REST API, RPC API를 비롯하여 다양한 프로그래밍 환경에 적합한 논리적 오류 모델을 정의하며, gRPC에서 사용됩니다. 각 status
메시지에는 오류 코드, 오류 메시지, 오류 세부정보라는 3가지 데이터가 포함됩니다.
API 설계 가이드에서 이 오류 모델과 모델 작업 방법에 대해 자세히 알아볼 수 있습니다.
JSON 표현 |
{
"code": integer,
"message": string,
"details": [
{
"@type": string,
field1: ...,
...
}
]
} |
필드 |
code |
integer
상태 코드로, google.rpc.Code 의 열거형 값이어야 합니다.
|
message |
string
개발자에게 정보를 제공하는 오류 메시지로, 영어로 작성되어야 합니다. 사용자에게 표시되는 모든 오류 메시지는 현지화되어 google.rpc.Status.details 필드에 전송되거나, 클라이언트 측에서 현지화되어야 합니다.
|
details[] |
object
오류 세부정보를 설명하는 메시지 목록입니다. API에서 사용할 일반적인 메시지 유형 집합이 있습니다. 임의 유형의 필드를 포함하는 객체입니다. 추가 필드 "@type" 은 유형을 식별하는 URI를 포함합니다. 예: { "id": 1234, "@type": "types.example.com/standard/id" }
|
메서드 |
|
장기 실행 작업의 최신 상태를 가져옵니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# REST Resource: operations\n\n- [Resource: Operation](#Operation)\n - [JSON representation](#Operation.SCHEMA_REPRESENTATION)\n- [Status](#Status)\n - [JSON representation](#Status.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Operation\n-------------------\n\nThis resource represents a long-running operation that is the result of a network API call.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"metadata\": { \"@type\": string, field1: ..., ... }, \"done\": boolean, // Union field `result` can be only one of the following: \"error\": { object (/workspace/cloud-search/docs/reference/rest/v1/operations#Status) }, \"response\": { \"@type\": string, field1: ..., ... } // End of list of possible types for union field `result`. } ``` |\n\n| Fields ||\n|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{uniqueId}`. |\n| `metadata` | `object` Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. An object containing fields of an arbitrary type. An additional field `\"@type\"` contains a URI identifying the type. Example: `{ \"id\": 1234, \"@type\": \"types.example.com/standard/id\" }`. |\n| `done` | `boolean` If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. |\n| Union field `result`. The operation result, which can be either an `error` or a valid `response`. If `done` == `false`, neither `error` nor `response` is set. If `done` == `true`, exactly one of `error` or `response` can be set. Some services might not provide the result. `result` can be only one of the following: ||\n| `error` | `object (`[Status](/workspace/cloud-search/docs/reference/rest/v1/operations#Status)`)` The error result of the operation in case of failure or cancellation. |\n| `response` | `object` The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. An object containing fields of an arbitrary type. An additional field `\"@type\"` contains a URI identifying the type. Example: `{ \"id\": 1234, \"@type\": \"types.example.com/standard/id\" }`. |\n\nStatus\n------\n\nThe `status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `status` message contains three pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------|\n| ``` { \"code\": integer, \"message\": string, \"details\": [ { \"@type\": string, field1: ..., ... } ] } ``` |\n\n| Fields ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | `integer` The status code, which should be an enum value of `google.rpc.Code`. |\n| `message` | `string` A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details](/workspace/cloud-search/docs/reference/rest/v1/operations#Status.FIELDS.details) field, or localized by the client. |\n| `details[]` | `object` A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field `\"@type\"` contains a URI identifying the type. Example: `{ \"id\": 1234, \"@type\": \"types.example.com/standard/id\" }`. |\n\n| Methods ------- ||\n|--------------------------------------------------------------------------|----------------------------------------------------|\n| ### [get](/workspace/cloud-search/docs/reference/rest/v1/operations/get) | Gets the latest state of a long-running operation. |"]]