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)
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)
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)