AutoML Video Intelligence의 일부 메서드는 장기 실행 작업을 반환합니다. 이러한 메서드는 비동기적이며 메서드가 응답을 반환하면 작업이 완료되지 않을 수 있습니다.
작업 상태 가져오기
작업 이름을 사용하여 장기 실행 작업(항목을 데이터 세트로 가져오기 또는 모델 학습) 상태를 확인할 수 있습니다.
REST
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- project-number: 프로젝트 번호
- location-id: 예를 들면 us-central1
- operation id: 작업을 시작할 때 응답에서 제공됩니다. 예를 들면 분류는
VCN123....
, 객체 추적은VOT123....
입니다.
HTTP 메서드 및 URL:
GET https://automl.googleapis.com/v1beta1/projects/project-number/locations/location-id/operations/operation-id
요청을 보내려면 다음 옵션 중 하나를 선택합니다.
curl
다음 명령어를 실행합니다.
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project: project-number" \
"https://automl.googleapis.com/v1beta1/projects/project-number/locations/location-id/operations/operation-id"
PowerShell
다음 명령어를 실행합니다.
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "project-number" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://automl.googleapis.com/v1beta1/projects/project-number/locations/location-id/operations/operation-id" | Select-Object -Expand Content
- 모델 이름:
projects/project-number/locations/location-id/models/model-id
- 모델 ID:
model-id
작업 취소
작업 ID를 사용하여 장기 실행 작업을 취소할 수 있습니다. 취소 작업은 반드시 성공하지는 않습니다.
REST
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- operation id: 작업을 시작할 때 응답에서 제공됩니다.
예를 들어 분류는VCN123....
, 객체 추적은VOT123....
입니다. - 참고:
- project-number: GCP 프로젝트 ID
- location-id: 주석이 있어야 하는 Cloud 리전입니다. 지원되는 클라우드 리전은
us-east1
,us-west1
,europe-west1
,asia-east1
입니다. 리전을 지정하지 않으면 동영상 파일 위치를 기준으로 리전이 결정됩니다.
HTTP 메서드 및 URL:
POST https://automl.googleapis.com/v1beta1/projects/project-number/locations/location-id/operations/operation-id:cancel
요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
성공 상태 코드(2xx)와 빈 응답을 받게 됩니다.