Skip to content

[AQUA] Edit single model deployment #1162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ads/aqua/extension/deployment_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ def put(self, *args, **kwargs): # noqa: ARG002
return self.finish(AquaDeploymentApp().activate(model_deployment_id))
elif action == "deactivate":
return self.finish(AquaDeploymentApp().deactivate(model_deployment_id))
elif action == "update":
try:
input_data = self.get_json_body()
except Exception as ex:
raise HTTPError(400, Errors.INVALID_INPUT_DATA_FORMAT) from ex

if not input_data:
raise HTTPError(400, Errors.NO_INPUT_DATA)
return self.finish(AquaDeploymentApp().update(**input_data))
else:
raise HTTPError(400, f"The request {self.request.path} is invalid.")

Expand Down Expand Up @@ -294,5 +303,6 @@ def post(self, *args, **kwargs): # noqa: ARG002
("deployments/?([^/]*)", AquaDeploymentHandler),
("deployments/?([^/]*)/activate", AquaDeploymentHandler),
("deployments/?([^/]*)/deactivate", AquaDeploymentHandler),
("deployments/?([^/]*)/update", AquaDeploymentHandler),
("inference", AquaDeploymentInferenceHandler),
]
Loading