Fix URL hosts
This commit is contained in:
parent
142e1f186d
commit
914b3d84e1
|
@ -207,14 +207,10 @@ api.add_resource(API_Root, '/')
|
||||||
# /doc
|
# /doc
|
||||||
class API_Doc(Resource):
|
class API_Doc(Resource):
|
||||||
def get(self):
|
def get(self):
|
||||||
if config['ssl_enabled']:
|
|
||||||
scheme = 'https'
|
|
||||||
else:
|
|
||||||
scheme = 'http'
|
|
||||||
swagger_data = swagger(pvc_api.app)
|
swagger_data = swagger(pvc_api.app)
|
||||||
swagger_data['info']['version'] = API_VERSION
|
swagger_data['info']['version'] = API_VERSION
|
||||||
swagger_data['info']['title'] = "PVC Client and Provisioner API"
|
swagger_data['info']['title'] = "PVC Client and Provisioner API"
|
||||||
swagger_data['host'] = "{}://{}:{}".format(scheme, config['listen_address'], config['listen_port'])
|
swagger_data['host'] = "{}:{}".format(config['listen_address'], config['listen_port'])
|
||||||
return swagger_data
|
return swagger_data
|
||||||
api.add_resource(API_Doc, '/doc')
|
api.add_resource(API_Doc, '/doc')
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ swagger_file = "docs/manuals/swagger.json"
|
||||||
swagger_data = swagger(pvc_api.app)
|
swagger_data = swagger(pvc_api.app)
|
||||||
swagger_data['info']['version'] = "1.0"
|
swagger_data['info']['version'] = "1.0"
|
||||||
swagger_data['info']['title'] = "PVC Client and Provisioner API"
|
swagger_data['info']['title'] = "PVC Client and Provisioner API"
|
||||||
swagger_data['info']['url'] = "http://pvc.local:7570"
|
swagger_data['host'] = "pvc.local:7570"
|
||||||
|
|
||||||
with open(swagger_file, 'w') as fd:
|
with open(swagger_file, 'w') as fd:
|
||||||
fd.write(json.dumps(swagger_data, sort_keys=True, indent=4))
|
fd.write(json.dumps(swagger_data, sort_keys=True, indent=4))
|
||||||
|
|
Loading…
Reference in New Issue