Skip to content

Commit c6727e3

Browse files
committed
refactor: remove unused computation methods from DirectorV2Api
1 parent 1f24e66 commit c6727e3

File tree

1 file changed

+0
-51
lines changed
  • services/api-server/src/simcore_service_api_server/services_http

1 file changed

+0
-51
lines changed

services/api-server/src/simcore_service_api_server/services_http/director_v2.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from starlette import status
1313

1414
from ..core.settings import DirectorV2Settings
15-
from ..db.repositories.groups_extra_properties import GroupsExtraPropertiesRepository
1615
from ..exceptions.backend_errors import JobNotFoundError, LogFileNotFoundError
1716
from ..exceptions.service_errors_utils import service_exception_mapper
1817
from ..models.schemas.jobs import PercentageInt
@@ -71,56 +70,6 @@ class TaskLogFileGet(BaseModel):
7170

7271

7372
class DirectorV2Api(BaseServiceClientApi):
74-
@_exception_mapper(http_status_map={})
75-
async def create_computation(
76-
self,
77-
*,
78-
project_id: UUID,
79-
user_id: PositiveInt,
80-
product_name: str,
81-
) -> ComputationTaskGet:
82-
response = await self.client.post(
83-
"/v2/computations",
84-
json={
85-
"user_id": user_id,
86-
"project_id": str(project_id),
87-
"start_pipeline": False,
88-
"product_name": product_name,
89-
},
90-
)
91-
response.raise_for_status()
92-
task: ComputationTaskGet = ComputationTaskGet.model_validate_json(response.text)
93-
return task
94-
95-
@_exception_mapper(http_status_map={})
96-
async def start_computation(
97-
self,
98-
*,
99-
project_id: UUID,
100-
user_id: PositiveInt,
101-
product_name: str,
102-
groups_extra_properties_repository: GroupsExtraPropertiesRepository,
103-
) -> ComputationTaskGet:
104-
105-
use_on_demand_clusters = (
106-
await groups_extra_properties_repository.use_on_demand_clusters(
107-
user_id, product_name
108-
)
109-
)
110-
111-
response = await self.client.post(
112-
"/v2/computations",
113-
json={
114-
"user_id": user_id,
115-
"project_id": str(project_id),
116-
"start_pipeline": True,
117-
"product_name": product_name,
118-
"use_on_demand_clusters": use_on_demand_clusters,
119-
},
120-
)
121-
response.raise_for_status()
122-
task: ComputationTaskGet = ComputationTaskGet.model_validate_json(response.text)
123-
return task
12473

12574
@_exception_mapper(http_status_map={status.HTTP_404_NOT_FOUND: JobNotFoundError})
12675
async def get_computation(

0 commit comments

Comments
 (0)