swagger_server/controllers/outputs_controller.py
def output_source_mqtt(id, Output_Source):  # noqa: E501
    """Creates a new outputs setpoint as ouput

     # noqa: E501

    :param id: Name of the data source to be actualized
    :type id: str
    :param Output_Source: Output data source to be created
    :type Output_Source: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        try:
            Output_Source = OutputSource.from_dict(connexion.request.get_json())  # noqa: E501
            logger.info("This is the dictionary: " + Output_Source.to_str())

            Output_Source = connexion.request.get_json()

            try:
                dir = os.path.join(os.getcwd(), "optimization/resources", str(id))
                if not os.path.exists(dir):
                    os.makedirs(dir)
            except Exception as e:
                logger.error(e)

            # saves the registry into the new folder
            path = os.path.join(os.getcwd(), "optimization/resources", str(id), "Output.registry.mqtt")
            with open(path, 'w') as outfile:
                json.dump(Output_Source, outfile, ensure_ascii=False)
            logger.info("control output saved into memory")

            return "OK"
            #return jsonify({'Data-Source-Id': str(id)})
        except Exception as e:
            logger.error("Invalid data " + str(e))
            return "Invalid data " + str(e)

    else:
        return 'Data is not in json format'
Creates a new outputs setpoint as ouput

     # noqa: E501

    :param id: Name of the data source to be actualized
    :type id: str
    :param Output_Source: Output data source to be created
    :type Output_Source: dict | bytes

    :rtype: None
    
Creates a new outputs setpoint as ouput
noqa: E501
Creates a new outputs setpoint as ouput noqa : E501
def output_source_mqtt(id, Output_Source):  
    """Creates a new outputs setpoint as ouput
    :param id: Name of the data source to be actualized
    :type id: str
    :param Output_Source: Output data source to be created
    :type Output_Source: dict | bytes
    :rtype: None
    """
    if connexion.request.is_json:
        try:
            Output_Source = OutputSource.from_dict(connexion.request.get_json())  
            logger.info("This is the dictionary: " + Output_Source.to_str())
            Output_Source = connexion.request.get_json()
            try:
                dir = os.path.join(os.getcwd(), "optimization/resources", str(id))
                if not os.path.exists(dir):
                    os.makedirs(dir)
            except Exception as e:
                logger.error(e)
            path = os.path.join(os.getcwd(), "optimization/resources", str(id), "Output.registry.mqtt")
            with open(path, 'w') as outfile:
                json.dump(Output_Source, outfile, ensure_ascii=False)
            logger.info("control output saved into memory")
            return "OK"
        except Exception as e:
            logger.error("Invalid data " + str(e))
            return "Invalid data " + str(e)
    else:
        return 'Data is not in json format'
def output_source_mqtt ( id , Output_Source ) : if connexion . request . is_json : try : Output_Source = OutputSource . from_dict ( connexion . request . get_json ( ) ) logger . info ( "This is the dictionary: " + Output_Source . to_str ( ) ) Output_Source = connexion . request . get_json ( ) try : dir = os . path . join ( os . getcwd ( ) , "optimization/resources" , str ( id ) ) if not os . path . exists ( dir ) : os . makedirs ( dir ) except Exception as e : logger . error ( e ) path = os . path . join ( os . getcwd ( ) , "optimization/resources" , str ( id ) , "Output.registry.mqtt" ) with open ( path , 'w' ) as outfile : json . dump ( Output_Source , outfile , ensure_ascii = False ) logger . info ( "control output saved into memory" ) return "OK" except Exception as e : logger . error ( "Invalid data " + str ( e ) ) return "Invalid data " + str ( e ) else : return 'Data is not in json format'
Creates a new outputs setpoint as ouput
 noqa: E501
Creates a new outputs setpoint as ouput noqa : E501
# noqa: E501 """Creates a new outputs setpoint as ouput

     # noqa: E501

    :param id: Name of the data source to be actualized
    :type id: str
    :param Output_Source: Output data source to be created
    :type Output_Source: dict | bytes

    :rtype: None
    """ # noqa: E501 # saves the registry into the new folder #return jsonify({'Data-Source-Id': str(id)})
None
None
id
Name of the data source to be actualized
Name of the data source to be actualized
Output_Source
Output data source to be created
Output data source to be created