泳道包开发包
apphub的Python项目详细描述
PyAppHub公司
泳道AppHub API的Python包
安装
从终端运行pip install apphub
。这个包可用于python2和python3。在
示例
下面是一些基本的python示例。在
Note:如果在名称开头找不到sw_
,则客户端将
给你加上。在
fromapphubimportAppHub,save_to_disk,clean_responseah=AppHub('username','password')#Get all swimlane bundlesget_all_bundles=ah.swimbundles.get()# Get All versions of a swimlane bundleget_all_versions=ah.swimbundles.get('sw_carbon_black_defense')# Get One version of a swimlane bundleget_one_version=ah.swimbundles.get('sw_carbon_black_defense','1.1.1')# Clean up get response to return simple data {'<bundle_name>': [<list_of_versions>]}clean_response(get_all_bundles)# Search for bundlessrch_by_field=ah.swimbundles.search(fields={'vendor':"Carbon Black"})srch_by_text=ah.swimbundles.search(text="Carbon Black")#Download bundle by versiondownloaded_bundle=ah.swimbundles.download('sw_carbon_black_defense','1.1.1')#Save Latest Download Bundle to disksave_to_disk('/filepath/carbon_black_defense.zip',downloaded_bundle)
- 项目
标签: