mycelium-ai 0.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mycelium/__init__.py +0 -0
- mycelium/api/__init__.py +0 -0
- mycelium/api/app.py +1147 -0
- mycelium/api/client_app.py +170 -0
- mycelium/api/generated_sources/__init__.py +0 -0
- mycelium/api/generated_sources/server_schemas/__init__.py +97 -0
- mycelium/api/generated_sources/server_schemas/api/__init__.py +5 -0
- mycelium/api/generated_sources/server_schemas/api/default_api.py +2473 -0
- mycelium/api/generated_sources/server_schemas/api_client.py +766 -0
- mycelium/api/generated_sources/server_schemas/api_response.py +25 -0
- mycelium/api/generated_sources/server_schemas/configuration.py +434 -0
- mycelium/api/generated_sources/server_schemas/exceptions.py +166 -0
- mycelium/api/generated_sources/server_schemas/models/__init__.py +41 -0
- mycelium/api/generated_sources/server_schemas/models/api_section.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/chroma_section.py +69 -0
- mycelium/api/generated_sources/server_schemas/models/clap_section.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/compute_on_server200_response.py +79 -0
- mycelium/api/generated_sources/server_schemas/models/compute_on_server_request.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/compute_text_search_request.py +69 -0
- mycelium/api/generated_sources/server_schemas/models/config_request.py +81 -0
- mycelium/api/generated_sources/server_schemas/models/config_response.py +107 -0
- mycelium/api/generated_sources/server_schemas/models/create_playlist_request.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/get_similar_by_track200_response.py +143 -0
- mycelium/api/generated_sources/server_schemas/models/library_stats_response.py +77 -0
- mycelium/api/generated_sources/server_schemas/models/logging_section.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/media_server_section.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/playlist_response.py +73 -0
- mycelium/api/generated_sources/server_schemas/models/plex_section.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/processing_response.py +90 -0
- mycelium/api/generated_sources/server_schemas/models/save_config_response.py +73 -0
- mycelium/api/generated_sources/server_schemas/models/scan_library_response.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/search_result_response.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/server_section.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/stop_processing_response.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/task_status_response.py +87 -0
- mycelium/api/generated_sources/server_schemas/models/track_database_stats.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/track_response.py +77 -0
- mycelium/api/generated_sources/server_schemas/models/tracks_list_response.py +81 -0
- mycelium/api/generated_sources/server_schemas/rest.py +329 -0
- mycelium/api/generated_sources/server_schemas/test/__init__.py +0 -0
- mycelium/api/generated_sources/server_schemas/test/test_api_section.py +57 -0
- mycelium/api/generated_sources/server_schemas/test/test_chroma_section.py +55 -0
- mycelium/api/generated_sources/server_schemas/test/test_clap_section.py +60 -0
- mycelium/api/generated_sources/server_schemas/test/test_compute_on_server200_response.py +52 -0
- mycelium/api/generated_sources/server_schemas/test/test_compute_on_server_request.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_compute_text_search_request.py +54 -0
- mycelium/api/generated_sources/server_schemas/test/test_config_request.py +66 -0
- mycelium/api/generated_sources/server_schemas/test/test_config_response.py +97 -0
- mycelium/api/generated_sources/server_schemas/test/test_create_playlist_request.py +60 -0
- mycelium/api/generated_sources/server_schemas/test/test_default_api.py +150 -0
- mycelium/api/generated_sources/server_schemas/test/test_get_similar_by_track200_response.py +61 -0
- mycelium/api/generated_sources/server_schemas/test/test_library_stats_response.py +63 -0
- mycelium/api/generated_sources/server_schemas/test/test_logging_section.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_media_server_section.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_playlist_response.py +58 -0
- mycelium/api/generated_sources/server_schemas/test/test_plex_section.py +56 -0
- mycelium/api/generated_sources/server_schemas/test/test_processing_response.py +61 -0
- mycelium/api/generated_sources/server_schemas/test/test_save_config_response.py +58 -0
- mycelium/api/generated_sources/server_schemas/test/test_scan_library_response.py +61 -0
- mycelium/api/generated_sources/server_schemas/test/test_search_result_response.py +69 -0
- mycelium/api/generated_sources/server_schemas/test/test_server_section.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_stop_processing_response.py +55 -0
- mycelium/api/generated_sources/server_schemas/test/test_task_status_response.py +71 -0
- mycelium/api/generated_sources/server_schemas/test/test_track_database_stats.py +60 -0
- mycelium/api/generated_sources/server_schemas/test/test_track_response.py +63 -0
- mycelium/api/generated_sources/server_schemas/test/test_tracks_list_response.py +75 -0
- mycelium/api/generated_sources/worker_schemas/__init__.py +61 -0
- mycelium/api/generated_sources/worker_schemas/api/__init__.py +5 -0
- mycelium/api/generated_sources/worker_schemas/api/default_api.py +318 -0
- mycelium/api/generated_sources/worker_schemas/api_client.py +766 -0
- mycelium/api/generated_sources/worker_schemas/api_response.py +25 -0
- mycelium/api/generated_sources/worker_schemas/configuration.py +434 -0
- mycelium/api/generated_sources/worker_schemas/exceptions.py +166 -0
- mycelium/api/generated_sources/worker_schemas/models/__init__.py +23 -0
- mycelium/api/generated_sources/worker_schemas/models/save_config_response.py +73 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_clap_section.py +75 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_client_api_section.py +69 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_client_section.py +79 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_config_request.py +73 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_config_response.py +89 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_logging_section.py +67 -0
- mycelium/api/generated_sources/worker_schemas/rest.py +329 -0
- mycelium/api/generated_sources/worker_schemas/test/__init__.py +0 -0
- mycelium/api/generated_sources/worker_schemas/test/test_default_api.py +45 -0
- mycelium/api/generated_sources/worker_schemas/test/test_save_config_response.py +58 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_clap_section.py +60 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_client_api_section.py +55 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_client_section.py +65 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_config_request.py +59 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_config_response.py +89 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_logging_section.py +53 -0
- mycelium/api/worker_models.py +99 -0
- mycelium/application/__init__.py +11 -0
- mycelium/application/job_queue.py +323 -0
- mycelium/application/library_management_use_cases.py +292 -0
- mycelium/application/search_use_cases.py +96 -0
- mycelium/application/services.py +340 -0
- mycelium/client.py +554 -0
- mycelium/client_config.py +251 -0
- mycelium/client_frontend_dist/404.html +1 -0
- mycelium/client_frontend_dist/_next/static/a4iyRdfsvkjdyMAK9cE9Y/_buildManifest.js +1 -0
- mycelium/client_frontend_dist/_next/static/a4iyRdfsvkjdyMAK9cE9Y/_ssgManifest.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/4bd1b696-cf72ae8a39fa05aa.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/964-830f77d7ce1c2463.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/app/_not-found/page-d25eede5a9099bd3.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/app/layout-9b3d32f96dfe13b6.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/app/page-cc6bad295789134e.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/framework-7c95b8e5103c9e90.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/main-6b37be50736577a2.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/main-app-4153d115599d3126.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/pages/_app-0a0020ddd67f79cf.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/pages/_error-03529f2c21436739.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/webpack-c81e624915b2ea70.js +1 -0
- mycelium/client_frontend_dist/_next/static/css/1eb7f0e2c78e0734.css +1 -0
- mycelium/client_frontend_dist/favicon.ico +0 -0
- mycelium/client_frontend_dist/file.svg +1 -0
- mycelium/client_frontend_dist/globe.svg +1 -0
- mycelium/client_frontend_dist/index.html +1 -0
- mycelium/client_frontend_dist/index.txt +20 -0
- mycelium/client_frontend_dist/next.svg +1 -0
- mycelium/client_frontend_dist/vercel.svg +1 -0
- mycelium/client_frontend_dist/window.svg +1 -0
- mycelium/config.py +346 -0
- mycelium/domain/__init__.py +13 -0
- mycelium/domain/models.py +71 -0
- mycelium/domain/repositories.py +98 -0
- mycelium/domain/worker.py +77 -0
- mycelium/frontend_dist/404.html +1 -0
- mycelium/frontend_dist/_next/static/chunks/4bd1b696-cf72ae8a39fa05aa.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/964-830f77d7ce1c2463.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/app/_not-found/page-d25eede5a9099bd3.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/app/layout-9b3d32f96dfe13b6.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/app/page-a761463485e0540b.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/framework-7c95b8e5103c9e90.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/main-6b37be50736577a2.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/main-app-4153d115599d3126.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/pages/_app-0a0020ddd67f79cf.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/pages/_error-03529f2c21436739.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/webpack-c81e624915b2ea70.js +1 -0
- mycelium/frontend_dist/_next/static/css/1eb7f0e2c78e0734.css +1 -0
- mycelium/frontend_dist/_next/static/glVJ0yJSL0zWN7anTTG3_/_buildManifest.js +1 -0
- mycelium/frontend_dist/_next/static/glVJ0yJSL0zWN7anTTG3_/_ssgManifest.js +1 -0
- mycelium/frontend_dist/favicon.ico +0 -0
- mycelium/frontend_dist/file.svg +1 -0
- mycelium/frontend_dist/globe.svg +1 -0
- mycelium/frontend_dist/index.html +10 -0
- mycelium/frontend_dist/index.txt +20 -0
- mycelium/frontend_dist/next.svg +1 -0
- mycelium/frontend_dist/vercel.svg +1 -0
- mycelium/frontend_dist/window.svg +1 -0
- mycelium/infrastructure/__init__.py +17 -0
- mycelium/infrastructure/chroma_adapter.py +232 -0
- mycelium/infrastructure/clap_adapter.py +280 -0
- mycelium/infrastructure/plex_adapter.py +145 -0
- mycelium/infrastructure/track_database.py +467 -0
- mycelium/main.py +183 -0
- mycelium_ai-0.5.0.dist-info/METADATA +312 -0
- mycelium_ai-0.5.0.dist-info/RECORD +164 -0
- mycelium_ai-0.5.0.dist-info/WHEEL +5 -0
- mycelium_ai-0.5.0.dist-info/entry_points.txt +2 -0
- mycelium_ai-0.5.0.dist-info/licenses/LICENSE +21 -0
- mycelium_ai-0.5.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# flake8: noqa
|
4
|
+
|
5
|
+
"""
|
6
|
+
Mycelium Worker (Client) API
|
7
|
+
|
8
|
+
Configuration API for Mycelium client workers
|
9
|
+
|
10
|
+
The version of the OpenAPI document: 0.1.0
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
12
|
+
|
13
|
+
Do not edit the class manually.
|
14
|
+
""" # noqa: E501
|
15
|
+
|
16
|
+
|
17
|
+
__version__ = "0.1.0"
|
18
|
+
|
19
|
+
# Define package exports
|
20
|
+
__all__ = [
|
21
|
+
"DefaultApi",
|
22
|
+
"ApiResponse",
|
23
|
+
"ApiClient",
|
24
|
+
"Configuration",
|
25
|
+
"OpenApiException",
|
26
|
+
"ApiTypeError",
|
27
|
+
"ApiValueError",
|
28
|
+
"ApiKeyError",
|
29
|
+
"ApiAttributeError",
|
30
|
+
"ApiException",
|
31
|
+
"SaveConfigResponse",
|
32
|
+
"WorkerClapSection",
|
33
|
+
"WorkerClientAPISection",
|
34
|
+
"WorkerClientSection",
|
35
|
+
"WorkerConfigRequest",
|
36
|
+
"WorkerConfigResponse",
|
37
|
+
"WorkerLoggingSection",
|
38
|
+
]
|
39
|
+
|
40
|
+
# import apis into sdk package
|
41
|
+
from mycelium.api.generated_sources.worker_schemas.api.default_api import DefaultApi as DefaultApi
|
42
|
+
|
43
|
+
# import ApiClient
|
44
|
+
from mycelium.api.generated_sources.worker_schemas.api_response import ApiResponse as ApiResponse
|
45
|
+
from mycelium.api.generated_sources.worker_schemas.api_client import ApiClient as ApiClient
|
46
|
+
from mycelium.api.generated_sources.worker_schemas.configuration import Configuration as Configuration
|
47
|
+
from mycelium.api.generated_sources.worker_schemas.exceptions import OpenApiException as OpenApiException
|
48
|
+
from mycelium.api.generated_sources.worker_schemas.exceptions import ApiTypeError as ApiTypeError
|
49
|
+
from mycelium.api.generated_sources.worker_schemas.exceptions import ApiValueError as ApiValueError
|
50
|
+
from mycelium.api.generated_sources.worker_schemas.exceptions import ApiKeyError as ApiKeyError
|
51
|
+
from mycelium.api.generated_sources.worker_schemas.exceptions import ApiAttributeError as ApiAttributeError
|
52
|
+
from mycelium.api.generated_sources.worker_schemas.exceptions import ApiException as ApiException
|
53
|
+
|
54
|
+
# import models into sdk package
|
55
|
+
from mycelium.api.generated_sources.worker_schemas.models.save_config_response import SaveConfigResponse as SaveConfigResponse
|
56
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_clap_section import WorkerClapSection as WorkerClapSection
|
57
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_client_api_section import WorkerClientAPISection as WorkerClientAPISection
|
58
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_client_section import WorkerClientSection as WorkerClientSection
|
59
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_config_request import WorkerConfigRequest as WorkerConfigRequest
|
60
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_config_response import WorkerConfigResponse as WorkerConfigResponse
|
61
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_logging_section import WorkerLoggingSection as WorkerLoggingSection
|
@@ -0,0 +1,318 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium Worker (Client) API
|
5
|
+
|
6
|
+
Configuration API for Mycelium client workers
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
import re # noqa: F401
|
16
|
+
import io
|
17
|
+
import warnings
|
18
|
+
|
19
|
+
from pydantic import validate_arguments, ValidationError
|
20
|
+
|
21
|
+
from mycelium.api.generated_sources.worker_schemas.models.save_config_response import SaveConfigResponse
|
22
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_config_request import WorkerConfigRequest
|
23
|
+
from mycelium.api.generated_sources.worker_schemas.models.worker_config_response import WorkerConfigResponse
|
24
|
+
|
25
|
+
from mycelium.api.generated_sources.worker_schemas.api_client import ApiClient
|
26
|
+
from mycelium.api.generated_sources.worker_schemas.api_response import ApiResponse
|
27
|
+
from mycelium.api.generated_sources.worker_schemas.exceptions import ( # noqa: F401
|
28
|
+
ApiTypeError,
|
29
|
+
ApiValueError
|
30
|
+
)
|
31
|
+
|
32
|
+
|
33
|
+
class DefaultApi:
|
34
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
35
|
+
Ref: https://openapi-generator.tech
|
36
|
+
|
37
|
+
Do not edit the class manually.
|
38
|
+
"""
|
39
|
+
|
40
|
+
def __init__(self, api_client=None) -> None:
|
41
|
+
if api_client is None:
|
42
|
+
api_client = ApiClient.get_default()
|
43
|
+
self.api_client = api_client
|
44
|
+
|
45
|
+
@validate_arguments
|
46
|
+
def get_worker_config(self, **kwargs) -> WorkerConfigResponse: # noqa: E501
|
47
|
+
"""Get current worker configuration # noqa: E501
|
48
|
+
|
49
|
+
This method makes a synchronous HTTP request by default. To make an
|
50
|
+
asynchronous HTTP request, please pass async_req=True
|
51
|
+
|
52
|
+
>>> thread = api.get_worker_config(async_req=True)
|
53
|
+
>>> result = thread.get()
|
54
|
+
|
55
|
+
:param async_req: Whether to execute the request asynchronously.
|
56
|
+
:type async_req: bool, optional
|
57
|
+
:param _request_timeout: timeout setting for this request.
|
58
|
+
If one number provided, it will be total request
|
59
|
+
timeout. It can also be a pair (tuple) of
|
60
|
+
(connection, read) timeouts.
|
61
|
+
:return: Returns the result object.
|
62
|
+
If the method is called asynchronously,
|
63
|
+
returns the request thread.
|
64
|
+
:rtype: WorkerConfigResponse
|
65
|
+
"""
|
66
|
+
kwargs['_return_http_data_only'] = True
|
67
|
+
if '_preload_content' in kwargs:
|
68
|
+
message = "Error! Please call the get_worker_config_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
69
|
+
raise ValueError(message)
|
70
|
+
return self.get_worker_config_with_http_info(**kwargs) # noqa: E501
|
71
|
+
|
72
|
+
@validate_arguments
|
73
|
+
def get_worker_config_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
|
74
|
+
"""Get current worker configuration # noqa: E501
|
75
|
+
|
76
|
+
This method makes a synchronous HTTP request by default. To make an
|
77
|
+
asynchronous HTTP request, please pass async_req=True
|
78
|
+
|
79
|
+
>>> thread = api.get_worker_config_with_http_info(async_req=True)
|
80
|
+
>>> result = thread.get()
|
81
|
+
|
82
|
+
:param async_req: Whether to execute the request asynchronously.
|
83
|
+
:type async_req: bool, optional
|
84
|
+
:param _preload_content: if False, the ApiResponse.data will
|
85
|
+
be set to none and raw_data will store the
|
86
|
+
HTTP response body without reading/decoding.
|
87
|
+
Default is True.
|
88
|
+
:type _preload_content: bool, optional
|
89
|
+
:param _return_http_data_only: response data instead of ApiResponse
|
90
|
+
object with status code, headers, etc
|
91
|
+
:type _return_http_data_only: bool, optional
|
92
|
+
:param _request_timeout: timeout setting for this request. If one
|
93
|
+
number provided, it will be total request
|
94
|
+
timeout. It can also be a pair (tuple) of
|
95
|
+
(connection, read) timeouts.
|
96
|
+
:param _request_auth: set to override the auth_settings for an a single
|
97
|
+
request; this effectively ignores the authentication
|
98
|
+
in the spec for a single request.
|
99
|
+
:type _request_auth: dict, optional
|
100
|
+
:type _content_type: string, optional: force content-type for the request
|
101
|
+
:return: Returns the result object.
|
102
|
+
If the method is called asynchronously,
|
103
|
+
returns the request thread.
|
104
|
+
:rtype: tuple(WorkerConfigResponse, status_code(int), headers(HTTPHeaderDict))
|
105
|
+
"""
|
106
|
+
|
107
|
+
_params = locals()
|
108
|
+
|
109
|
+
_all_params = [
|
110
|
+
]
|
111
|
+
_all_params.extend(
|
112
|
+
[
|
113
|
+
'async_req',
|
114
|
+
'_return_http_data_only',
|
115
|
+
'_preload_content',
|
116
|
+
'_request_timeout',
|
117
|
+
'_request_auth',
|
118
|
+
'_content_type',
|
119
|
+
'_headers'
|
120
|
+
]
|
121
|
+
)
|
122
|
+
|
123
|
+
# validate the arguments
|
124
|
+
for _key, _val in _params['kwargs'].items():
|
125
|
+
if _key not in _all_params:
|
126
|
+
raise ApiTypeError(
|
127
|
+
"Got an unexpected keyword argument '%s'"
|
128
|
+
" to method get_worker_config" % _key
|
129
|
+
)
|
130
|
+
_params[_key] = _val
|
131
|
+
del _params['kwargs']
|
132
|
+
|
133
|
+
_collection_formats = {}
|
134
|
+
|
135
|
+
# process the path parameters
|
136
|
+
_path_params = {}
|
137
|
+
|
138
|
+
# process the query parameters
|
139
|
+
_query_params = []
|
140
|
+
# process the header parameters
|
141
|
+
_header_params = dict(_params.get('_headers', {}))
|
142
|
+
# process the form parameters
|
143
|
+
_form_params = []
|
144
|
+
_files = {}
|
145
|
+
# process the body parameter
|
146
|
+
_body_params = None
|
147
|
+
# set the HTTP header `Accept`
|
148
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
149
|
+
['application/json']) # noqa: E501
|
150
|
+
|
151
|
+
# authentication setting
|
152
|
+
_auth_settings = [] # noqa: E501
|
153
|
+
|
154
|
+
_response_types_map = {
|
155
|
+
'200': "WorkerConfigResponse",
|
156
|
+
}
|
157
|
+
|
158
|
+
return self.api_client.call_api(
|
159
|
+
'/api/config', 'GET',
|
160
|
+
_path_params,
|
161
|
+
_query_params,
|
162
|
+
_header_params,
|
163
|
+
body=_body_params,
|
164
|
+
post_params=_form_params,
|
165
|
+
files=_files,
|
166
|
+
response_types_map=_response_types_map,
|
167
|
+
auth_settings=_auth_settings,
|
168
|
+
async_req=_params.get('async_req'),
|
169
|
+
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
170
|
+
_preload_content=_params.get('_preload_content', True),
|
171
|
+
_request_timeout=_params.get('_request_timeout'),
|
172
|
+
collection_formats=_collection_formats,
|
173
|
+
_request_auth=_params.get('_request_auth'))
|
174
|
+
|
175
|
+
@validate_arguments
|
176
|
+
def save_worker_config(self, worker_config_request : WorkerConfigRequest, **kwargs) -> SaveConfigResponse: # noqa: E501
|
177
|
+
"""Save worker configuration # noqa: E501
|
178
|
+
|
179
|
+
This method makes a synchronous HTTP request by default. To make an
|
180
|
+
asynchronous HTTP request, please pass async_req=True
|
181
|
+
|
182
|
+
>>> thread = api.save_worker_config(worker_config_request, async_req=True)
|
183
|
+
>>> result = thread.get()
|
184
|
+
|
185
|
+
:param worker_config_request: (required)
|
186
|
+
:type worker_config_request: WorkerConfigRequest
|
187
|
+
:param async_req: Whether to execute the request asynchronously.
|
188
|
+
:type async_req: bool, optional
|
189
|
+
:param _request_timeout: timeout setting for this request.
|
190
|
+
If one number provided, it will be total request
|
191
|
+
timeout. It can also be a pair (tuple) of
|
192
|
+
(connection, read) timeouts.
|
193
|
+
:return: Returns the result object.
|
194
|
+
If the method is called asynchronously,
|
195
|
+
returns the request thread.
|
196
|
+
:rtype: SaveConfigResponse
|
197
|
+
"""
|
198
|
+
kwargs['_return_http_data_only'] = True
|
199
|
+
if '_preload_content' in kwargs:
|
200
|
+
message = "Error! Please call the save_worker_config_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
201
|
+
raise ValueError(message)
|
202
|
+
return self.save_worker_config_with_http_info(worker_config_request, **kwargs) # noqa: E501
|
203
|
+
|
204
|
+
@validate_arguments
|
205
|
+
def save_worker_config_with_http_info(self, worker_config_request : WorkerConfigRequest, **kwargs) -> ApiResponse: # noqa: E501
|
206
|
+
"""Save worker configuration # noqa: E501
|
207
|
+
|
208
|
+
This method makes a synchronous HTTP request by default. To make an
|
209
|
+
asynchronous HTTP request, please pass async_req=True
|
210
|
+
|
211
|
+
>>> thread = api.save_worker_config_with_http_info(worker_config_request, async_req=True)
|
212
|
+
>>> result = thread.get()
|
213
|
+
|
214
|
+
:param worker_config_request: (required)
|
215
|
+
:type worker_config_request: WorkerConfigRequest
|
216
|
+
:param async_req: Whether to execute the request asynchronously.
|
217
|
+
:type async_req: bool, optional
|
218
|
+
:param _preload_content: if False, the ApiResponse.data will
|
219
|
+
be set to none and raw_data will store the
|
220
|
+
HTTP response body without reading/decoding.
|
221
|
+
Default is True.
|
222
|
+
:type _preload_content: bool, optional
|
223
|
+
:param _return_http_data_only: response data instead of ApiResponse
|
224
|
+
object with status code, headers, etc
|
225
|
+
:type _return_http_data_only: bool, optional
|
226
|
+
:param _request_timeout: timeout setting for this request. If one
|
227
|
+
number provided, it will be total request
|
228
|
+
timeout. It can also be a pair (tuple) of
|
229
|
+
(connection, read) timeouts.
|
230
|
+
:param _request_auth: set to override the auth_settings for an a single
|
231
|
+
request; this effectively ignores the authentication
|
232
|
+
in the spec for a single request.
|
233
|
+
:type _request_auth: dict, optional
|
234
|
+
:type _content_type: string, optional: force content-type for the request
|
235
|
+
:return: Returns the result object.
|
236
|
+
If the method is called asynchronously,
|
237
|
+
returns the request thread.
|
238
|
+
:rtype: tuple(SaveConfigResponse, status_code(int), headers(HTTPHeaderDict))
|
239
|
+
"""
|
240
|
+
|
241
|
+
_params = locals()
|
242
|
+
|
243
|
+
_all_params = [
|
244
|
+
'worker_config_request'
|
245
|
+
]
|
246
|
+
_all_params.extend(
|
247
|
+
[
|
248
|
+
'async_req',
|
249
|
+
'_return_http_data_only',
|
250
|
+
'_preload_content',
|
251
|
+
'_request_timeout',
|
252
|
+
'_request_auth',
|
253
|
+
'_content_type',
|
254
|
+
'_headers'
|
255
|
+
]
|
256
|
+
)
|
257
|
+
|
258
|
+
# validate the arguments
|
259
|
+
for _key, _val in _params['kwargs'].items():
|
260
|
+
if _key not in _all_params:
|
261
|
+
raise ApiTypeError(
|
262
|
+
"Got an unexpected keyword argument '%s'"
|
263
|
+
" to method save_worker_config" % _key
|
264
|
+
)
|
265
|
+
_params[_key] = _val
|
266
|
+
del _params['kwargs']
|
267
|
+
|
268
|
+
_collection_formats = {}
|
269
|
+
|
270
|
+
# process the path parameters
|
271
|
+
_path_params = {}
|
272
|
+
|
273
|
+
# process the query parameters
|
274
|
+
_query_params = []
|
275
|
+
# process the header parameters
|
276
|
+
_header_params = dict(_params.get('_headers', {}))
|
277
|
+
# process the form parameters
|
278
|
+
_form_params = []
|
279
|
+
_files = {}
|
280
|
+
# process the body parameter
|
281
|
+
_body_params = None
|
282
|
+
if _params['worker_config_request'] is not None:
|
283
|
+
_body_params = _params['worker_config_request']
|
284
|
+
|
285
|
+
# set the HTTP header `Accept`
|
286
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
287
|
+
['application/json']) # noqa: E501
|
288
|
+
|
289
|
+
# set the HTTP header `Content-Type`
|
290
|
+
_content_types_list = _params.get('_content_type',
|
291
|
+
self.api_client.select_header_content_type(
|
292
|
+
['application/json']))
|
293
|
+
if _content_types_list:
|
294
|
+
_header_params['Content-Type'] = _content_types_list
|
295
|
+
|
296
|
+
# authentication setting
|
297
|
+
_auth_settings = [] # noqa: E501
|
298
|
+
|
299
|
+
_response_types_map = {
|
300
|
+
'200': "SaveConfigResponse",
|
301
|
+
}
|
302
|
+
|
303
|
+
return self.api_client.call_api(
|
304
|
+
'/api/config', 'POST',
|
305
|
+
_path_params,
|
306
|
+
_query_params,
|
307
|
+
_header_params,
|
308
|
+
body=_body_params,
|
309
|
+
post_params=_form_params,
|
310
|
+
files=_files,
|
311
|
+
response_types_map=_response_types_map,
|
312
|
+
auth_settings=_auth_settings,
|
313
|
+
async_req=_params.get('async_req'),
|
314
|
+
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
315
|
+
_preload_content=_params.get('_preload_content', True),
|
316
|
+
_request_timeout=_params.get('_request_timeout'),
|
317
|
+
collection_formats=_collection_formats,
|
318
|
+
_request_auth=_params.get('_request_auth'))
|