리전 엔드포인트 사용

Cloud Scheduler 리전 엔드포인트를 사용하면 API 트래픽을 단일Google Cloud 리전 내에 유지하여 데이터 레지던시 및 데이터 주권 요구사항을 충족할 수 있습니다. 리전 엔드포인트로 요청을 보내면 TLS가 종료되고 Cloud Scheduler가 지정된 리전 내에서 요청을 완전히 처리합니다.

Cloud Scheduler 리전 엔드포인트의 형식은 https://cloudscheduler.REGION.rep.googleapis.com입니다. 여기서 REGION은 지원되는 리전입니다(예: https://cloudscheduler.us-central1.rep.googleapis.com).

Private Service Connect를 사용하여 Virtual Private Cloud (VPC) 네트워크 내에서 비공개로 Cloud Scheduler 리전 엔드포인트에 액세스하는 방법에 대한 자세한 내용은 엔드포인트를 통한 리전 및 멀티 리전 Google API 액세스 정보를 참조하세요.

제한 및 제약사항

Cloud Scheduler 리전 엔드포인트를 사용할 때는 다음 제한사항이 적용됩니다.

  • 리전 엔드포인트는 자체 리전의 리소스만 제공합니다. 리소스 이름의 위치는 엔드포인트의 리전과 일치해야 합니다. 예를 들어 projects/PROJECT_ID/locations/us-central1의 리소스에 대한 요청을 cloudscheduler.us-central1.rep.googleapis.com에 보낼 수 있습니다. 다른 리전의 리소스 요청은 실패합니다.
  • 리전 엔드포인트는 Cloud Scheduler API로 전송되는 요청에 적용됩니다. Cloud Scheduler가 작업 대상에 요청을 전송하는 방식은 변경되지 않습니다. 작업이 VPC 서비스 제어 경계에서 실행되는 경우 VPC 서비스 제어로 크론 작업 보호에서 작업 대상 요구사항을 참조하세요.

리전 엔드포인트에 요청 전송

Google Cloud CLI, REST API 또는 Cloud Scheduler 클라이언트 라이브러리를 사용하여 리전 엔드포인트에 요청을 보낼 수 있습니다.

gcloud

api_endpoint_overrides/cloudscheduler 속성을 리전 엔드포인트로 설정한 후 해당 리전의 리소스에 대해 gcloud scheduler 명령어를 실행합니다.

gcloud config set api_endpoint_overrides/cloudscheduler \
    https://cloudscheduler.REGION.rep.googleapis.com/
gcloud scheduler jobs list --location=REGION

REGION을 리전 엔드포인트를 제공하는 리전으로 바꿉니다(예: us-central1).

기본 전역 엔드포인트를 다시 사용하려면 속성을 설정 해제합니다.

gcloud config unset api_endpoint_overrides/cloudscheduler

REST

리전 엔드포인트를 요청 URL의 호스트로 사용합니다. 예를 들어 다음 명령어는 리전의 작업을 나열합니다.

curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    "https://cloudscheduler.REGION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/jobs"

다음을 바꿉니다.

  • REGION: 리전 엔드포인트를 제공하는 리전입니다(예: us-central1).
  • PROJECT_ID: Google Cloud 프로젝트 ID입니다.

클라이언트 라이브러리

클라이언트를 만들 때 API 엔드포인트를 설정합니다. 다음 예시에서는 us-central1의 클라이언트를 만듭니다.

Go

import (
scheduler "cloud.google.com/go/scheduler/apiv1"
"google.golang.org/api/option"
)

client, err := scheduler.NewCloudSchedulerClient(ctx,
option.WithEndpoint("cloudscheduler.us-central1.rep.googleapis.com:443"))

자바

import com.google.cloud.scheduler.v1.CloudSchedulerClient;
import com.google.cloud.scheduler.v1.CloudSchedulerSettings;

CloudSchedulerSettings settings =
  CloudSchedulerSettings.newBuilder()
      .setEndpoint("cloudscheduler.us-central1.rep.googleapis.com:443")
      .build();
try (CloudSchedulerClient client = CloudSchedulerClient.create(settings)) {
// Send requests for resources in us-central1.
}

Python

from google.api_core.client_options import ClientOptions
from google.cloud import scheduler_v1

client = scheduler_v1.CloudSchedulerClient(
  client_options=ClientOptions(
      api_endpoint="cloudscheduler.us-central1.rep.googleapis.com"
  )
)

다음 단계