本文整理汇总了Python中service_api.ServiceApi.platform_agent_start方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceApi.platform_agent_start方法的具体用法?Python ServiceApi.platform_agent_start怎么用?Python ServiceApi.platform_agent_start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service_api.ServiceApi
的用法示例。
在下文中一共展示了ServiceApi.platform_agent_start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: platform_start_stop_command
# 需要导入模块: from service_api import ServiceApi [as 别名]
# 或者: from service_api.ServiceApi import platform_agent_start [as 别名]
def platform_start_stop_command(platform_device_id, agent_command, cap_type=None, agent_instance_id=None):
app.logger.debug('platform_start_stop_command %s'%agent_command)
if agent_command == 'start':
command_response = ServiceApi.platform_agent_start(agent_instance_id)
return jsonify(data=command_response)
elif agent_command == 'stop':
command_response = ServiceApi.platform_agent_stop(agent_instance_id)
return jsonify(data=command_response)
elif agent_command == 'get_capabilities':
command_response = ServiceApi.platform_agent_get_capabilities(platform_device_id)
return jsonify(data=command_response)
return jsonify(data=command_response)
示例2: start_platform_agent
# 需要导入模块: from service_api import ServiceApi [as 别名]
# 或者: from service_api.ServiceApi import platform_agent_start [as 别名]
def start_platform_agent(platform_device_id, agent_command, cap_type=None, agent_instance_id=None):
cap_type = request.args.get('cap_type')
if agent_command == 'start':
command_response = ServiceApi.platform_agent_start(agent_instance_id)
return jsonify(data=command_response)
elif agent_command == 'stop':
command_response = ServiceApi.platform_agent_stop(agent_instance_id)
return jsonify(data=command_response)
elif agent_command == 'get_capabilities':
command_response = ServiceApi.platform_agent_get_capabilities(platform_device_id)
return jsonify(data=command_response)
else:
command_response = ServiceApi.platform_execute(platform_device_id, agent_command, cap_type)
return jsonify(data=command_response)