def edit(self, mr: ModelRoute) -> ModelRoute: """ Edit Model Route :param mr: Model Route :return Message from API server """ return ModelRoute.from_dict( self.query(MODEL_ROUTE_URL, action='PUT', payload=mr.to_dict()))
async def create(self, mr: ModelRoute) -> ModelRoute: """ Create Model Route :param mr: Model Route :return Message from API server """ return ModelRoute.from_dict(await self.query(MODEL_ROUTE_URL, action='POST', payload=mr.to_dict()))
def get_all(self) -> typing.List[ModelRoute]: """ Get all Model Routes from API server :return: all Model Routes """ return [ModelRoute.from_dict(mr) for mr in self.query(MODEL_ROUTE_URL)]
def get(self, name: str) -> ModelRoute: """ Get Model Route from API server :param name: Model Route name :type name: str :return: Model Route """ return ModelRoute.from_dict(self.query(f'{MODEL_ROUTE_URL}/{name}'))
PackagingIntegration( id=ENTITY_ID, spec=PackagingIntegrationSpec(default_image="odahu:image", entrypoint="some_entrypoint"), ), packaging_integration.packaging_integration, 'PackagingIntegration', ) DEPLOYMENT = EntityTestData( ModelDeploymentClient(), ModelDeployment(id=ENTITY_ID, spec=ModelDeploymentSpec(image="odahu:image", min_replicas=0), status=ModelDeploymentStatus( state=READY_STATE, available_replicas=1, )), deployment.deployment, 'ModelDeployment', ) ROUTER = EntityTestData( ModelRouteClient(), ModelRoute(id=ENTITY_ID, spec=ModelRouteSpec(mirror="test", ), status=ModelRouteStatus(state=READY_STATE, )), route.route, 'ModelRoute', )