This commit is contained in:
		@@ -22,7 +22,7 @@ RELEASE_ID = os.environ.get("RELEASE_ID", "test")
 | 
			
		||||
RELEASEMODE = os.environ.get("INPUT_SERVICE_RELEASEMODE", "dev")
 | 
			
		||||
 | 
			
		||||
RABBITMQ_HOST = os.getenv("INPUT_RABBITMQ_HOSTNAME", "localhost")
 | 
			
		||||
RABBITMQ_EXCHANGE = os.getenv("INPUT_RABBITMQ_EXCHANGE", "")
 | 
			
		||||
RABBITMQ_EXCHANGE = os.getenv("INPUT_RABBITMQ_EXCHANGE", "dev")
 | 
			
		||||
RABBITMQ_QUEUE = os.getenv("INPUT_RABBITMQ_QUEUE", "wave-extract")
 | 
			
		||||
RABBITMQ_USERNAME = os.getenv("INPUT_RABBITMQ_USERNAME", "rabbitmq")
 | 
			
		||||
RABBITMQ_PASSWORD = os.getenv("INPUT_RABBITMQ_PASSWORD", "rabbitmq")
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ import logging
 | 
			
		||||
import json
 | 
			
		||||
from xeger import Xeger
 | 
			
		||||
from flask_restful import Resource
 | 
			
		||||
from flask import request, jsonify
 | 
			
		||||
from flask import request
 | 
			
		||||
import requests
 | 
			
		||||
from db import db
 | 
			
		||||
from models import SampleMetadata
 | 
			
		||||
@@ -28,6 +28,8 @@ class SampleResource(Resource):
 | 
			
		||||
    Sample endpoint
 | 
			
		||||
    See: https://swagger.kmlabz.com/?urls.primaryName=Input%20Service
 | 
			
		||||
    """
 | 
			
		||||
    samplemetadatas_schema = SampleMetadata(many=True,
 | 
			
		||||
                                            exclude=['id', 'device_id', 'device_date', 'tag', 'timestamp'])
 | 
			
		||||
 | 
			
		||||
    def post(self):
 | 
			
		||||
        """
 | 
			
		||||
@@ -58,7 +60,7 @@ class SampleResource(Resource):
 | 
			
		||||
        validate_errors = SampleSchema().validate(desc)
 | 
			
		||||
        if validate_errors:
 | 
			
		||||
            LOGGER.error(
 | 
			
		||||
                "Input JSON did not conform to schema. It was: {}", desc)
 | 
			
		||||
                "Input JSON did not conform to schema. It was: {}".format(desc))
 | 
			
		||||
            return {'err_msg': 'Input JSON schema invalid'}, 417
 | 
			
		||||
 | 
			
		||||
        xeger = Xeger(limit=30)
 | 
			
		||||
@@ -105,6 +107,8 @@ class SampleParameterResource(Resource):
 | 
			
		||||
    Sample endpoint with parameters
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
    samplemetadata_schema = SampleMetadata(many=False)
 | 
			
		||||
 | 
			
		||||
    def get(self, tag: str):
 | 
			
		||||
        """
 | 
			
		||||
        Get a specific item
 | 
			
		||||
@@ -112,4 +116,4 @@ class SampleParameterResource(Resource):
 | 
			
		||||
        :return:
 | 
			
		||||
        """
 | 
			
		||||
        sample = SampleMetadata.query.filter_by(tag=tag).first_or_404()
 | 
			
		||||
        return sample, 200
 | 
			
		||||
        return self.samplemetadata_schema.dump(sample), 200
 | 
			
		||||
 
 | 
			
		||||
@@ -14,8 +14,7 @@ __version__text__ = "1"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class SampleSchema(Schema):
 | 
			
		||||
    """ /v1/email/pay - POST
 | 
			
		||||
 | 
			
		||||
    """
 | 
			
		||||
    Parameters:
 | 
			
		||||
     - date (date)
 | 
			
		||||
     - device_id (str)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user