flamenco/addon/flamenco/manager_README.md
2022-05-31 17:19:06 +02:00

11 KiB

Flamenco

Render Farm manager API

The flamenco.manager package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: cfb17b17
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://flamenco.io/

Requirements.

Python >=3.6

Installation & Usage

This python library package is generated without supporting files like setup.py or requirements files

To be able to use it, you will need these dependencies in your own package that uses this library:

  • urllib3 >= 1.25.3
  • python-dateutil

Getting Started

In your own code, to use this library to connect and interact with Flamenco, you can run the following:


import time
import flamenco.manager
from pprint import pprint
from flamenco.manager.api import jobs_api
from flamenco.manager.model.available_job_type import AvailableJobType
from flamenco.manager.model.available_job_types import AvailableJobTypes
from flamenco.manager.model.error import Error
from flamenco.manager.model.job import Job
from flamenco.manager.model.job_status_change import JobStatusChange
from flamenco.manager.model.job_tasks_summary import JobTasksSummary
from flamenco.manager.model.jobs_query import JobsQuery
from flamenco.manager.model.jobs_query_result import JobsQueryResult
from flamenco.manager.model.submitted_job import SubmittedJob
from flamenco.manager.model.task import Task
from flamenco.manager.model.task_status_change import TaskStatusChange
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flamenco.manager.Configuration(
    host = "http://localhost"
)



# Enter a context with an instance of the API client
with flamenco.manager.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = jobs_api.JobsApi(api_client)
    job_id = "job_id_example" # str | 

    try:
        # Fetch info about the job.
        api_response = api_instance.fetch_job(job_id)
        pprint(api_response)
    except flamenco.manager.ApiException as e:
        print("Exception when calling JobsApi->fetch_job: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
JobsApi fetch_job GET /api/jobs/{job_id} Fetch info about the job.
JobsApi fetch_job_tasks GET /api/jobs/{job_id}/tasks Fetch a summary of all tasks of the given job.
JobsApi fetch_task GET /api/tasks/{task_id} Fetch a single task.
JobsApi fetch_task_log_tail GET /api/tasks/{task_id}/logtail Fetch the last few lines of the task's log.
JobsApi get_job_type GET /api/jobs/type/{typeName} Get single job type and its parameters.
JobsApi get_job_types GET /api/jobs/types Get list of job types and their parameters.
JobsApi query_jobs POST /api/jobs/query Fetch list of jobs.
JobsApi set_job_status POST /api/jobs/{job_id}/setstatus
JobsApi set_task_status POST /api/tasks/{task_id}/setstatus
JobsApi submit_job POST /api/jobs Submit a new job for Flamenco Manager to execute.
MetaApi get_configuration GET /api/configuration Get the configuration of this Manager.
MetaApi get_version GET /api/version Get the Flamenco version of this Manager
ShamanApi shaman_checkout POST /shaman/checkout/create Create a directory, and symlink the required files into it. The files must all have been uploaded to Shaman before calling this endpoint.
ShamanApi shaman_checkout_requirements POST /shaman/checkout/requirements Checks a Shaman Requirements file, and reports which files are unknown.
ShamanApi shaman_file_store POST /shaman/files/{checksum}/{filesize} Store a new file on the Shaman server. Note that the Shaman server can forcibly close the HTTP connection when another client finishes uploading the exact same file, to prevent double uploads. The file's contents should be sent in the request body.
ShamanApi shaman_file_store_check GET /shaman/files/{checksum}/{filesize} Check the status of a file on the Shaman server.
WorkerApi may_worker_run GET /api/worker/task/{task_id}/may-i-run The response indicates whether the worker is allowed to run / keep running the task. Optionally contains a queued worker status change.
WorkerApi register_worker POST /api/worker/register-worker Register a new worker
WorkerApi schedule_task POST /api/worker/task Obtain a new task to execute
WorkerApi sign_off POST /api/worker/sign-off Mark the worker as offline
WorkerApi sign_on POST /api/worker/sign-on Authenticate & sign in the worker.
WorkerApi task_update POST /api/worker/task/{task_id} Update the task, typically to indicate progress, completion, or failure.
WorkerApi worker_state GET /api/worker/state
WorkerApi worker_state_changed POST /api/worker/state-changed Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
WorkerMgtApi fetch_worker GET /api/worker-mgt/workers/{worker_id} Fetch info about the worker.
WorkerMgtApi fetch_workers GET /api/worker-mgt/workers Get list of workers.
WorkerMgtApi request_worker_status_change POST /api/worker-mgt/workers/{worker_id}/setstatus

Documentation For Models

Documentation For Authorization

worker_auth

  • Type: HTTP basic authentication

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in flamenco.manager.apis and flamenco.manager.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from flamenco.manager.api.default_api import DefaultApi
  • from flamenco.manager.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import flamenco.manager
from flamenco.manager.apis import *
from flamenco.manager.models import *