개요
Deadline Standalone Python API는 HTTP API와 통신하여 Deadline 작업을 제어 및 관리할 수 있는 Python 라이브러리입니다. 이 API를 사용하려면 Deadline Web Service가 실행 중이어야 하며, 해당 서비스의 주소와 포트 번호를 알고 있어야 합니다.
1. 설치 및 설정
(1) Python 버전 요구사항
- Python 2.7.9 또는 Python 3.7 이상 설치 필요.
(2) 설치 방법
- Deadline Repository에서 //your/repository/api/python 경로에 있는 "Deadline" 폴더를 복사.
- Python 설치 디렉토리의 site-packages 폴더에 붙여넣기.
API 사용 방법
(1) 연결 설정
import Deadline.DeadlineConnect as Connect
connectionObject = Connect.DeadlineCon('WebServiceName', 8082)
- WebServiceName: Web Service가 실행 중인 머신의 DNS 이름 또는 IP 주소.
- 8082: Web Service의 기본 포트 번호(변경 가능).
(2) 기본 사용 예제
- 그룹 이름 가져오기:
print(connectionObject.Groups.GetGroupNames())
- 작업 일시중지:
jobId = "유효한 작업 ID"
print(connectionObject.Jobs.SuspendJob(jobId))
API 기능 예제
(1) 작업 정보 수정
작업의 풀(Pool)과 우선순위 변경:
job = connectionObject.Jobs.GetJob(jobId)
job['Props']['Pool'] = 'newPoolName'
job['Props']['Pri'] = 75
connectionObject.Jobs.SaveJob(job)
(2) 작업 제출
Python 딕셔너리를 사용하여 작업 제출:
JobInfo = {
"Name": "Submitted via Python",
"UserName": "UserName",
"Frames": "0-1",
"Plugin": "VraySpawner"
}
PluginInfo = {
"Version": "Max2014"
}
newJob = connectionObject.Jobs.SubmitJob(JobInfo, PluginInfo)
print(newJob)
(3) 작업 상태 및 통계 확인
- 실패한 청크(Failed Chunks) 확인:
jobs = connectionObject.Jobs.GetJobs()
print(jobs[0]['FailedChunks'])
https://docs.thinkboxsoftware.com/products/deadline/10.4/3_Python%20Reference/index.html
Deadline Standalone Python Reference: Welcome
Introduction This is the documentation for the Deadline Standalone Python API. The Standalone Python API can be used in Python for communicating with the HTTP API. In order to use the HTTP API you must have the Web Service running on a machine whose addres
docs.thinkboxsoftware.com