Files
blender-portable-repo/scripts/addons/flamenco/manager/api/shaman_api.py
T
2026-03-17 14:30:01 -06:00

593 lines
22 KiB
Python

"""
Flamenco manager
Render Farm manager API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from flamenco.manager.api_client import ApiClient, Endpoint as _Endpoint
from flamenco.manager.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from flamenco.manager.model.error import Error
from flamenco.manager.model.shaman_checkout import ShamanCheckout
from flamenco.manager.model.shaman_checkout_result import ShamanCheckoutResult
from flamenco.manager.model.shaman_requirements_request import ShamanRequirementsRequest
from flamenco.manager.model.shaman_requirements_response import ShamanRequirementsResponse
from flamenco.manager.model.shaman_single_file_status import ShamanSingleFileStatus
class ShamanApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
self.shaman_checkout_endpoint = _Endpoint(
settings={
'response_type': (ShamanCheckoutResult,),
'auth': [],
'endpoint_path': '/api/v3/shaman/checkout/create',
'operation_id': 'shaman_checkout',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'shaman_checkout',
],
'required': [
'shaman_checkout',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'shaman_checkout':
(ShamanCheckout,),
},
'attribute_map': {
},
'location_map': {
'shaman_checkout': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)
self.shaman_checkout_requirements_endpoint = _Endpoint(
settings={
'response_type': (ShamanRequirementsResponse,),
'auth': [],
'endpoint_path': '/api/v3/shaman/checkout/requirements',
'operation_id': 'shaman_checkout_requirements',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'shaman_requirements_request',
],
'required': [
'shaman_requirements_request',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'shaman_requirements_request':
(ShamanRequirementsRequest,),
},
'attribute_map': {
},
'location_map': {
'shaman_requirements_request': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)
self.shaman_file_store_endpoint = _Endpoint(
settings={
'response_type': None,
'auth': [],
'endpoint_path': '/api/v3/shaman/files/{checksum}/{filesize}',
'operation_id': 'shaman_file_store',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'checksum',
'filesize',
'body',
'x_shaman_can_defer_upload',
'x_shaman_original_filename',
],
'required': [
'checksum',
'filesize',
'body',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'checksum':
(str,),
'filesize':
(int,),
'body':
(file_type,),
'x_shaman_can_defer_upload':
(bool,),
'x_shaman_original_filename':
(str,),
},
'attribute_map': {
'checksum': 'checksum',
'filesize': 'filesize',
'x_shaman_can_defer_upload': 'X-Shaman-Can-Defer-Upload',
'x_shaman_original_filename': 'X-Shaman-Original-Filename',
},
'location_map': {
'checksum': 'path',
'filesize': 'path',
'body': 'body',
'x_shaman_can_defer_upload': 'header',
'x_shaman_original_filename': 'header',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/octet-stream'
]
},
api_client=api_client
)
self.shaman_file_store_check_endpoint = _Endpoint(
settings={
'response_type': (ShamanSingleFileStatus,),
'auth': [],
'endpoint_path': '/api/v3/shaman/files/{checksum}/{filesize}',
'operation_id': 'shaman_file_store_check',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
'checksum',
'filesize',
],
'required': [
'checksum',
'filesize',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'checksum':
(str,),
'filesize':
(int,),
},
'attribute_map': {
'checksum': 'checksum',
'filesize': 'filesize',
},
'location_map': {
'checksum': 'path',
'filesize': 'path',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
def shaman_checkout(
self,
shaman_checkout,
**kwargs
):
"""Create a directory, and symlink the required files into it. The files must all have been uploaded to Shaman before calling this endpoint. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.shaman_checkout(shaman_checkout, async_req=True)
>>> result = thread.get()
Args:
shaman_checkout (ShamanCheckout): Set of files to check out.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
ShamanCheckoutResult
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['shaman_checkout'] = \
shaman_checkout
return self.shaman_checkout_endpoint.call_with_http_info(**kwargs)
def shaman_checkout_requirements(
self,
shaman_requirements_request,
**kwargs
):
"""Checks a Shaman Requirements file, and reports which files are unknown. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.shaman_checkout_requirements(shaman_requirements_request, async_req=True)
>>> result = thread.get()
Args:
shaman_requirements_request (ShamanRequirementsRequest): Set of files to check
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
ShamanRequirementsResponse
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['shaman_requirements_request'] = \
shaman_requirements_request
return self.shaman_checkout_requirements_endpoint.call_with_http_info(**kwargs)
def shaman_file_store(
self,
checksum,
filesize,
body,
**kwargs
):
"""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. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.shaman_file_store(checksum, filesize, body, async_req=True)
>>> result = thread.get()
Args:
checksum (str): SHA256 checksum of the file.
filesize (int): Size of the file in bytes.
body (file_type): Contents of the file
Keyword Args:
x_shaman_can_defer_upload (bool): The client indicates that it can defer uploading this file. The \"208\" response will not only be returned when the file is already fully known to the Shaman server, but also when someone else is currently uploading this file. . [optional]
x_shaman_original_filename (str): The original filename. If sent along with the request, it will be included in the server logs, which can aid in debugging. MUST either be ASCII or encoded using RFC 2047 (aka MIME encoding). In the latter case the encoding MUST be UTF-8. . [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['checksum'] = \
checksum
kwargs['filesize'] = \
filesize
kwargs['body'] = \
body
return self.shaman_file_store_endpoint.call_with_http_info(**kwargs)
def shaman_file_store_check(
self,
checksum,
filesize,
**kwargs
):
"""Check the status of a file on the Shaman server. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.shaman_file_store_check(checksum, filesize, async_req=True)
>>> result = thread.get()
Args:
checksum (str): SHA256 checksum of the file.
filesize (int): Size of the file in bytes.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
ShamanSingleFileStatus
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['checksum'] = \
checksum
kwargs['filesize'] = \
filesize
return self.shaman_file_store_check_endpoint.call_with_http_info(**kwargs)