link config comp to upload files to endpoint
This commit is contained in:
parent
b631b0f271
commit
c7513199df
6 changed files with 105 additions and 31 deletions
47
config_app/config_endpoints/api/tar_config_loader.py
Normal file
47
config_app/config_endpoints/api/tar_config_loader.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
import logging
|
||||
from flask import abort, request
|
||||
|
||||
from config_app.config_endpoints.api import resource, ApiResource, nickname, validate_json_request
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@resource('/v1/configapp/tarconfig')
|
||||
class TarConfigLoader(ApiResource):
|
||||
""" Resource for validating a block of configuration against an external service. """
|
||||
schemas = {
|
||||
'ValidateUploadConfig': {
|
||||
'type': 'object',
|
||||
'description': '',
|
||||
'required': [
|
||||
'config'
|
||||
],
|
||||
'properties': {
|
||||
'config': {
|
||||
'type': 'object'
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@nickname('uploadTarballConfig')
|
||||
# @validate_json_request('ValidateUploadConfig')
|
||||
def post(self):
|
||||
""" Extracts and validates all configuration from """
|
||||
logger.debug('hello world!')
|
||||
logger.debug(request)
|
||||
logger.debug('hello world!')
|
||||
logger.debug(request.files)
|
||||
# logger.debug('hello world!')
|
||||
# logger.debug(request.body)
|
||||
# logger.debug(request.data)
|
||||
logger.debug('hello world!')
|
||||
logger.debug(request.files)
|
||||
logger.debug('hello world!')
|
||||
logger.debug(request.mimetype)
|
||||
logger.debug('hello world!')
|
||||
logger.debug(request.get_data())
|
||||
logger.debug('hello world!')
|
||||
logger.debug(request.get_json())
|
||||
logger.debug('hello world!')
|
||||
|
||||
abort(418)
|
Reference in a new issue