|
12 | 12 | from starlette import status |
13 | 13 |
|
14 | 14 | from ..core.settings import DirectorV2Settings |
15 | | -from ..db.repositories.groups_extra_properties import GroupsExtraPropertiesRepository |
16 | 15 | from ..exceptions.backend_errors import JobNotFoundError, LogFileNotFoundError |
17 | 16 | from ..exceptions.service_errors_utils import service_exception_mapper |
18 | 17 | from ..models.schemas.jobs import PercentageInt |
@@ -71,56 +70,6 @@ class TaskLogFileGet(BaseModel): |
71 | 70 |
|
72 | 71 |
|
73 | 72 | 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 |
124 | 73 |
|
125 | 74 | @_exception_mapper(http_status_map={status.HTTP_404_NOT_FOUND: JobNotFoundError}) |
126 | 75 | async def get_computation( |
|
0 commit comments