コード例 #1
0
ファイル: router.py プロジェクト: ssrinivasan2023/opentrons
async def create_protocol_file(
    protocol_id: str,
    file: UploadFile = File(...),
    protocol_manager: ProtocolManager = Depends(get_protocol_manager)):
    proto = protocol_manager.get(protocol_id)
    proto.add(file)
    return route_models.ProtocolResponse(data=_to_response(proto))
コード例 #2
0
async def delete_protocol(
        protocolId: str,
        protocol_manager: ProtocolManager = Depends(get_protocol_manager)):
    proto = protocol_manager.remove(protocolId)
    return route_models.ProtocolResponse(
        data=_to_response(proto),
        links=get_root_links(router),
    )
コード例 #3
0
async def get_protocol(
        protocolId: str,
        protocol_manager: ProtocolManager = Depends(get_protocol_manager)):
    proto = protocol_manager.get(protocolId)
    return route_models.ProtocolResponse(
        data=_to_response(proto),
        links=get_protocol_links(router, proto.meta.identifier)
    )
コード例 #4
0
async def create_protocol_file(
        protocolId: str,
        file: UploadFile = File(...),
        protocol_manager: ProtocolManager = Depends(get_protocol_manager)):
    proto = protocol_manager.get(protocolId)
    proto.add(file)
    return route_models.ProtocolResponse(
        data=_to_response(proto),
        links=get_protocol_links(router, proto.meta.identifier),
    )
コード例 #5
0
ファイル: router.py プロジェクト: ssrinivasan2023/opentrons
async def create_protocol(
        protocol_file: UploadFile = File(..., description="The protocol file"),
        support_files: typing.List[UploadFile] = Body(
            default=list(),
            description="Any support files needed by the protocol (ie data "
            "files, additional python files)"),
        protocol_manager=Depends(get_protocol_manager)):
    """Create protocol from proto file plus optional support files"""
    new_proto = protocol_manager.create(
        protocol_file=protocol_file,
        support_files=support_files,
    )
    return route_models.ProtocolResponse(data=_to_response(new_proto))
コード例 #6
0
ファイル: router.py プロジェクト: ssrinivasan2023/opentrons
async def delete_protocol(
    protocol_id: str,
    protocol_manager: ProtocolManager = Depends(get_protocol_manager)):
    proto = protocol_manager.remove(protocol_id)
    return route_models.ProtocolResponse(data=_to_response(proto))