Revert "Renaming Files having BluePrint to have Blueprint"
The renaming in CCSDK-3098 caused breaking changes to the grpc api and
compile issues for kotlin scripts.
Issue-ID: CCSDK-3385
Change-Id: I0d745cb858371678eabcb2284671c1fd76a1ab6d
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
diff --git a/ms/artifact-manager/manager/servicer.py b/ms/artifact-manager/manager/servicer.py
index fd05fe0..be740b0 100644
--- a/ms/artifact-manager/manager/servicer.py
+++ b/ms/artifact-manager/manager/servicer.py
@@ -23,13 +23,13 @@
from manager.errors import ArtifactManagerError, InvalidRequestError
from manager.utils import Repository, RepositoryStrategy
from onaplogging.mdcContext import MDC
-from proto.BlueprintManagement_pb2 import (
- BlueprintDownloadInput,
- BlueprintManagementOutput,
- BlueprintRemoveInput,
- BlueprintUploadInput,
+from proto.BluePrintManagement_pb2 import (
+ BluePrintDownloadInput,
+ BluePrintManagementOutput,
+ BluePrintRemoveInput,
+ BluePrintUploadInput,
)
-from proto.BlueprintManagement_pb2_grpc import BlueprintManagementServiceServicer
+from proto.BluePrintManagement_pb2_grpc import BluePrintManagementServiceServicer
MDC_DATETIME_FORMAT = r"%Y-%m-%dT%H:%M:%S.%f%z"
COMMON_HEADER_DATETIME_FORMAT = r"%Y-%m-%dT%H:%M:%S.%fZ"
@@ -47,13 +47,13 @@
@wraps(func)
def _decorator(
servicer: "ArtifactManagerServicer",
- request: Union[BlueprintDownloadInput, BlueprintRemoveInput, BlueprintUploadInput],
+ request: Union[BluePrintDownloadInput, BluePrintRemoveInput, BluePrintUploadInput],
context: ServicerContext,
- ) -> BlueprintManagementOutput:
+ ) -> BluePrintManagementOutput:
if not all([request.actionIdentifiers.blueprintName, request.actionIdentifiers.blueprintVersion]):
- raise InvalidRequestError("Request has to have set both Blueprint name and version")
- output: BlueprintManagementOutput = func(servicer, request, context)
+ raise InvalidRequestError("Request has to have set both BluePrint name and version")
+ output: BluePrintManagementOutput = func(servicer, request, context)
# Set same values for every handler
output.commonHeader.CopyFrom(request.commonHeader)
output.commonHeader.timestamp = datetime.utcnow().strftime(COMMON_HEADER_DATETIME_FORMAT)
@@ -72,11 +72,11 @@
@wraps(func)
def _handler(
servicer: "ArtifactManagerServicer",
- request: Union[BlueprintDownloadInput, BlueprintRemoveInput, BlueprintUploadInput],
+ request: Union[BluePrintDownloadInput, BluePrintRemoveInput, BluePrintUploadInput],
context: ServicerContext,
- ) -> BlueprintManagementOutput:
+ ) -> BluePrintManagementOutput:
try:
- output: BlueprintManagementOutput = func(servicer, request, context)
+ output: BluePrintManagementOutput = func(servicer, request, context)
output.status.code = 200
output.status.message = "success"
except ArtifactManagerError as error:
@@ -84,7 +84,7 @@
# Every ArtifactManagerError based exception has status_code paramenter
# which has to be set in output. Use also exception's message to
# set errorMessage of the output.
- output: BlueprintManagementOutput = BlueprintManagementOutput()
+ output: BluePrintManagementOutput = BluePrintManagementOutput()
output.status.code = error.status_code
output.status.message = "failure"
output.status.errorMessage = str(error.message)
@@ -112,9 +112,9 @@
@wraps(func)
def _decorator(
servicer: "ArtifactManagerServicer",
- request: Union[BlueprintDownloadInput, BlueprintRemoveInput, BlueprintUploadInput],
+ request: Union[BluePrintDownloadInput, BluePrintRemoveInput, BluePrintUploadInput],
context: ServicerContext,
- ) -> BlueprintManagementOutput:
+ ) -> BluePrintManagementOutput:
MDC.put("RequestID", request.commonHeader.requestId)
MDC.put("InvocationID", request.commonHeader.subRequestId)
MDC.put("ServiceName", servicer.__class__.__name__)
@@ -129,14 +129,14 @@
MDC.put("TargetServiceName", func.__name__)
MDC.put("Server", socket.getfqdn())
- output: BlueprintManagementOutput = func(servicer, request, context)
+ output: BluePrintManagementOutput = func(servicer, request, context)
MDC.clear()
return output
return _decorator
-class ArtifactManagerServicer(BlueprintManagementServiceServicer):
+class ArtifactManagerServicer(BluePrintManagementServiceServicer):
"""ArtifactManagerServer class.
Implements methods defined in proto files to manage artifacts repository.
@@ -169,15 +169,15 @@
@prepare_logging_context
@translate_exception_to_response
@fill_common_header
- def downloadBlueprint(self, request: BlueprintDownloadInput, context: ServicerContext) -> BlueprintManagementOutput:
+ def downloadBlueprint(self, request: BluePrintDownloadInput, context: ServicerContext) -> BluePrintManagementOutput:
"""Download blueprint file request method.
Currently it only logs when is called and all base class method.
- :param request: BlueprintDownloadInput
+ :param request: BluePrintDownloadInput
:param context: ServicerContext
- :return: BlueprintManagementOutput
+ :return: BluePrintManagementOutput
"""
- output: BlueprintManagementOutput = BlueprintManagementOutput()
+ output: BluePrintManagementOutput = BluePrintManagementOutput()
output.fileChunk.chunk = self.repository.download_blueprint(
request.actionIdentifiers.blueprintName, request.actionIdentifiers.blueprintVersion
)
@@ -193,13 +193,13 @@
@prepare_logging_context
@translate_exception_to_response
@fill_common_header
- def uploadBlueprint(self, request: BlueprintUploadInput, context: ServicerContext) -> BlueprintManagementOutput:
+ def uploadBlueprint(self, request: BluePrintUploadInput, context: ServicerContext) -> BluePrintManagementOutput:
"""Upload blueprint file request method.
Currently it only logs when is called and all base class method.
- :param request: BlueprintUploadInput
+ :param request: BluePrintUploadInput
:param context: ServicerContext
- :return: BlueprintManagementOutput
+ :return: BluePrintManagementOutput
"""
self.repository.upload_blueprint(
request.fileChunk.chunk, request.actionIdentifiers.blueprintName, request.actionIdentifiers.blueprintVersion
@@ -211,18 +211,18 @@
),
extra={"mdc": MDC.result()},
)
- return BlueprintManagementOutput()
+ return BluePrintManagementOutput()
@prepare_logging_context
@translate_exception_to_response
@fill_common_header
- def removeBlueprint(self, request: BlueprintRemoveInput, context: ServicerContext) -> BlueprintManagementOutput:
+ def removeBlueprint(self, request: BluePrintRemoveInput, context: ServicerContext) -> BluePrintManagementOutput:
"""Remove blueprint file request method.
Currently it only logs when is called and all base class method.
- :param request: BlueprintRemoveInput
+ :param request: BluePrintRemoveInput
:param context: ServicerContext
- :return: BlueprintManagementOutput
+ :return: BluePrintManagementOutput
"""
self.repository.remove_blueprint(
request.actionIdentifiers.blueprintName, request.actionIdentifiers.blueprintVersion
@@ -234,4 +234,4 @@
),
extra={"mdc": MDC.result()},
)
- return BlueprintManagementOutput()
+ return BluePrintManagementOutput()