From 23362061fc9419b424144a8b34768c2ed07a1182 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 11 Oct 2017 15:32:07 +0800 Subject: put htmlize directory under jjb/releng centralize jjb related scripts Change-Id: I4abeb06f17b48b8e7ac15803db0f3ce7eb0c1b93 Signed-off-by: SerenaFeng --- testapi/htmlize/htmlize.py | 57 ---------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 testapi/htmlize/htmlize.py (limited to 'testapi/htmlize/htmlize.py') diff --git a/testapi/htmlize/htmlize.py b/testapi/htmlize/htmlize.py deleted file mode 100644 index da6a6cf..0000000 --- a/testapi/htmlize/htmlize.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 - -import argparse -import requests -import json -import os - - -def main(args): - - # Merging two specs - api_response = requests.get(args.api_declaration_url) - api_response = json.loads(api_response.content) - resource_response = requests.get(args.resource_listing_url) - resource_response = json.loads(resource_response.content) - resource_response['models'] = api_response['models'] - resource_response['apis'] = api_response['apis'] - - # Storing the swagger specs - with open('specs.json', 'w') as outfile: - json.dump(resource_response, outfile) - - # Generating html page - cmd = 'java -jar swagger-codegen-cli.jar generate \ - -i specs.json -l html2 -o %s' % (args.output_directory) - if os.system(cmd) == 0: - exit(0) - else: - exit(1) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Create \ - Swagger Spec documentation') - parser.add_argument('-ru', '--resource-listing-url', - type=str, - required=False, - default=('http://testresults.opnfv.org' - '/test/swagger/resources.json'), - help='Resource Listing Spec File') - parser.add_argument('-au', '--api-declaration-url', - type=str, - required=False, - default=('http://testresults.opnfv.org' - '/test/swagger/APIs'), - help='API Declaration Spec File') - parser.add_argument('-o', '--output-directory', - required=True, - default='./', - help='Output Directory where the \ - file should be stored') - main(parser.parse_args()) -- cgit 1.2.3-korg