本文整理匯總了Python中sevenbridges.meta.transformer.Transform.to_location方法的典型用法代碼示例。如果您正苦於以下問題:Python Transform.to_location方法的具體用法?Python Transform.to_location怎麽用?Python Transform.to_location使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sevenbridges.meta.transformer.Transform
的用法示例。
在下文中一共展示了Transform.to_location方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: bulk_submit
# 需要導入模塊: from sevenbridges.meta.transformer import Transform [as 別名]
# 或者: from sevenbridges.meta.transformer.Transform import to_location [as 別名]
def bulk_submit(cls, exports, copy_only=False, api=None):
"""
Create exports in bulk.
:param exports: Exports to be submitted in bulk.
:param copy_only: If true files are kept on SevenBridges bucket.
:param api: Api instance.
:return: list of ExportBulkRecord objects.
"""
if not exports:
raise SbgError('Exports are required')
api = api or cls._API
items = []
for export in exports:
file_ = Transform.to_file(export.get('file'))
volume = Transform.to_volume(export.get('volume'))
location = Transform.to_location(export.get('location'))
properties = export.get('properties', {})
overwrite = export.get('overwrite', False)
item = {
'source': {
'file': file_
},
'destination': {
'volume': volume,
'location': location
},
'properties': properties,
'overwrite': overwrite
}
items.append(item)
data = {'items': items}
params = {'copy_only': copy_only}
response = api.post(
url=cls._URL['bulk_create'], params=params, data=data
)
return ExportBulkRecord.parse_records(response=response, api=api)