def get_flow(db_api, image_service_api, availability_zones, create_what, scheduler_rpcapi=None, volume_rpcapi=None):
 flow_name = (ACTION.replace(':', '_') + '_api')
 api_flow = linear_flow.Flow(flow_name)
 api_flow.add(ExtractVolumeRequestTask(image_service_api, availability_zones, rebind={'size': 'raw_size', 'availability_zone': 'raw_availability_zone', 'volume_type': 'raw_volume_type'}))
 api_flow.add(QuotaReserveTask(), EntryCreateTask(), QuotaCommitTask())
 if (scheduler_rpcapi and volume_rpcapi):
  api_flow.add(VolumeCastTask(scheduler_rpcapi, volume_rpcapi, db_api))
 return taskflow.engines.load(api_flow, store=create_what)

def get_flow ( db_api , image_service_api , availability_zones , create_what , scheduler_rpcapi = None , volume_rpcapi = None ) : flow_name = ( ACTION . replace ( ':' , '_' ) + '_api' ) api_flow = linear_flow . Flow ( flow_name ) api_flow . add ( ExtractVolumeRequestTask ( image_service_api , availability_zones , rebind = { 'size' : 'raw_size' , 'availability_zone' : 'raw_availability_zone' , 'volume_type' : 'raw_volume_type' } ) ) api_flow . add ( QuotaReserveTask ( ) , EntryCreateTask ( ) , QuotaCommitTask ( ) ) if ( scheduler_rpcapi and volume_rpcapi ) : api_flow . add ( VolumeCastTask ( scheduler_rpcapi , volume_rpcapi , db_api ) ) return taskflow . engines . load ( api_flow , store = create_what )
constructs and returns the api entrypoint flow .