Method: indexing.datasources.items.poll
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
색인 생성 대기열에서 예약되지 않은 항목을 폴링하고 가장 높은 우선순위 ItemStatus
에서 가장 오래된 타임스탬프가 있는 항목부터 시작하여 세트를 예약됨으로 표시합니다. 우선순위 순서는 다음과 같습니다.
ERROR
MODIFIED
NEW_ITEM
ACCEPTED
항목을 예약하면 다른 스레드에서 폴링하여 중복 세트를 만들 수 없습니다.
예약된 항목을 처리한 후 클라이언트는 index,
를 호출하거나 REQUEUE.
유형으로 push
를 호출하여 항목을 예약되지 않은 상태로 되돌려야 합니다.
업데이트 또는 푸시 메서드가 호출되지 않더라도 4시간 후에 항목이 자동으로 사용 가능해집니다 (예약 해제됨).
이 API를 실행하려면 관리자 또는 서비스 계정이 필요합니다. 사용되는 서비스 계정은 해당 데이터 소스에 허용 목록에 추가된 계정입니다.
HTTP 요청
POST https://cloudsearch.googleapis.com/v1/indexing/{name=datasources/*}/items:poll
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
name |
string
항목을 폴링할 데이터 소스의 이름입니다. 형식: datasources/{sourceId}
|
요청 본문
요청 본문에는 다음과 같은 구조의 데이터가 포함됩니다.
JSON 표현 |
{
"connectorName": string,
"statusCodes": [
enum (ItemStatus.Code )
],
"limit": integer,
"queue": string,
"debugOptions": {
object (DebugOptions )
}
} |
필드 |
connectorName |
string
이 호출을 실행하는 커넥터의 이름입니다. 형식: datasources/{sourceId}/connectors/{id}
|
statusCodes[] |
enum (ItemStatus.Code )
폴링되는 항목을 이러한 상태의 항목으로 제한합니다.
|
limit |
integer
반환할 최대 항목 수입니다. 최대값은 100이고 기본값은 20입니다.
|
queue |
string
항목을 가져올 대기열 이름입니다. 지정하지 않으면 items.poll이 'default' 대기열에서 가져옵니다. 최대 길이는 100자입니다.
|
debugOptions |
object (DebugOptions )
일반적인 디버그 옵션
|
응답 본문
성공한 경우 응답 본문은 다음과 같은 구조의 데이터를 포함합니다.
JSON 표현 |
{
"items": [
{
object (Item )
}
]
} |
필드 |
items[] |
object (Item )
커넥터가 처리할 수 있는 대기열의 항목 세트입니다. 이러한 항목에는 다음과 같은 필드 하위 집합이 채워집니다. version
metadata.hash
structuredData.hash
content.hash
payload
status
queue
|
승인 범위
다음 OAuth 범위 중 하나가 필요합니다.
https://www.googleapis.com/auth/cloud_search.indexing
https://www.googleapis.com/auth/cloud_search
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# Method: indexing.datasources.items.poll\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.PollItemsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nPolls for unreserved items from the indexing queue and marks a set as reserved, starting with items that have the oldest timestamp from the highest priority [ItemStatus](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code). The priority order is as follows:\n\n[ERROR](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.ERROR)\n\n[MODIFIED](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.MODIFIED)\n\n[NEW_ITEM](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.NEW_ITEM)\n\n[ACCEPTED](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.ACCEPTED)\n\nReserving items ensures that polling from other threads cannot create overlapping sets.\n\nAfter handling the reserved items, the client should put items back into the unreserved state, either by calling [index,](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/index_#google.apps.search.v1.ItemsService.IndexItem) or by calling [push](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#google.apps.search.v1.ItemsService.PushItem) with the type [REQUEUE.](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type.ENUM_VALUES.REQUEUE)\n\nItems automatically become available (unreserved) after 4 hours even if no update or push method is called.\n\nThis API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source.\n\n### HTTP request\n\n`POST https://cloudsearch.googleapis.com/v1/indexing/{name=datasources/*}/items:poll`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|------------------------------------------------------------------------------------|\n| `name` | `string` The name of the data Source to poll items. Format: datasources/{sourceId} |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"connectorName\": string, \"statusCodes\": [ enum (/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code) ], \"limit\": integer, \"queue\": string, \"debugOptions\": { object (/workspace/cloud-search/docs/reference/rest/v1/DebugOptions) } } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `connectorName` | `string` The name of connector making this call. Format: datasources/{sourceId}/connectors/{id} |\n| `statusCodes[]` | `enum (`[ItemStatus.Code](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code)`)` Limit the items polled to the ones with these statuses. |\n| `limit` | `integer` Maximum number of items to return. The maximum value is 100 and the default value is 20. |\n| `queue` | `string` Queue name to fetch items from. If unspecified, items.poll will fetch from 'default' queue. The maximum length is 100 characters. |\n| `debugOptions` | `object (`[DebugOptions](/workspace/cloud-search/docs/reference/rest/v1/DebugOptions)`)` Common debug options. |\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------|\n| ``` { \"items\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item) } ] } ``` |\n\n| Fields ||\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `items[]` | `object (`[Item](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item)`)` Set of items from the queue available for connector to process. These items have the following subset of fields populated: [version](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.version) [metadata.hash](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemMetadata.FIELDS.hash) [structuredData.hash](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemStructuredData.FIELDS.hash) [content.hash](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemContent.FIELDS.hash) [payload](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.payload) [status](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.status) [queue](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.queue) |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud_search.indexing`\n- `https://www.googleapis.com/auth/cloud_search`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]