from __future__ import ( print_function, ) # Ensure print() function is available in Python 2 import sys import json import requests from Deadline.Scripting import * # type: ignore # Import Deadline script utilities api_path = "https://canvas-api-test.anvil.app/_/api" def update_3d_image_task_status(row_id, new_status): # Define the URL for the API endpoint url = "{}/creation-module/3d-image/update-status".format(api_path) # Create a JSON payload payload = {"row_id": row_id, "new_status": new_status} # Make a POST request to the API endpoint with the JSON payload response = requests.post(url, json=payload) # Handle the response if response.status_code == 200: print("Status update was successful") return response.json() else: print("Status update failed") print("Status code:", response.status_code) print("Response:", response.text) return None def __main__(*args): deadlinePlugin = args[0] job = deadlinePlugin.GetJob() row_id = job.JobExtraInfo0 update_3d_image_task_status(row_id=row_id, new_status=2)