mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
renamed 'OpenPypeRestApiResource' to 'WebpublishRestApiResource'
This commit is contained in:
parent
7c7c1486a4
commit
00c3554a5c
2 changed files with 11 additions and 13 deletions
|
|
@ -20,9 +20,7 @@ from openpype.pipeline import AvalonMongoDB
|
|||
from openpype.settings import get_project_settings
|
||||
from openpype_modules.webserver.base_routes import RestApiEndpoint
|
||||
|
||||
|
||||
|
||||
log = PypeLogger.get_logger("WebServer")
|
||||
log = PypeLogger.get_logger("WebpublishRoutes")
|
||||
|
||||
|
||||
class ResourceRestApiEndpoint(RestApiEndpoint):
|
||||
|
|
@ -69,9 +67,10 @@ class RestApiResource:
|
|||
).encode("utf-8")
|
||||
|
||||
|
||||
class OpenPypeRestApiResource(RestApiResource):
|
||||
class WebpublishRestApiResource:
|
||||
"""Resource carrying OP DB connection for storing batch info into DB."""
|
||||
def __init__(self, ):
|
||||
|
||||
def __init__(self):
|
||||
mongo_client = OpenPypeMongoConnection.get_mongo_client()
|
||||
database_name = os.environ["OPENPYPE_DATABASE_NAME"]
|
||||
self.dbcon = mongo_client[database_name]["webpublishes"]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from openpype.lib import PypeLogger
|
|||
|
||||
from .webpublish_routes import (
|
||||
RestApiResource,
|
||||
OpenPypeRestApiResource,
|
||||
WebpublishRestApiResource,
|
||||
HiearchyEndpoint,
|
||||
ProjectsEndpoint,
|
||||
ConfiguredExtensionsEndpoint,
|
||||
|
|
@ -27,7 +27,7 @@ from openpype.lib.remote_publish import (
|
|||
)
|
||||
|
||||
|
||||
log = PypeLogger().get_logger("webserver_gui")
|
||||
log = PypeLogger.get_logger("webserver_gui")
|
||||
|
||||
|
||||
def run_webserver(*args, **kwargs):
|
||||
|
|
@ -86,27 +86,26 @@ def run_webserver(*args, **kwargs):
|
|||
)
|
||||
|
||||
# reporting
|
||||
openpype_resource = OpenPypeRestApiResource()
|
||||
batch_status_endpoint = BatchStatusEndpoint(openpype_resource)
|
||||
webpublish_resource = WebpublishRestApiResource()
|
||||
batch_status_endpoint = BatchStatusEndpoint(webpublish_resource)
|
||||
server_manager.add_route(
|
||||
"GET",
|
||||
"/api/batch_status/{batch_id}",
|
||||
batch_status_endpoint.dispatch
|
||||
)
|
||||
|
||||
user_status_endpoint = UserReportEndpoint(openpype_resource)
|
||||
user_status_endpoint = UserReportEndpoint(webpublish_resource)
|
||||
server_manager.add_route(
|
||||
"GET",
|
||||
"/api/publishes/{user}",
|
||||
user_status_endpoint.dispatch
|
||||
)
|
||||
|
||||
webpublisher_batch_reprocess_endpoint = \
|
||||
BatchReprocessEndpoint(openpype_resource)
|
||||
batch_reprocess_endpoint = BatchReprocessEndpoint(webpublish_resource)
|
||||
server_manager.add_route(
|
||||
"POST",
|
||||
"/api/webpublish/reprocess/{batch_id}",
|
||||
webpublisher_batch_reprocess_endpoint.dispatch
|
||||
batch_reprocess_endpoint.dispatch
|
||||
)
|
||||
|
||||
server_manager.start_server()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue