summaryrefslogtreecommitdiffstats
path: root/test/mocks/datafilecollector-testharness/ftps-sftp-server/prepare.sh
blob: 76f333409eee8c528f4f9e6628363d0b7455c8c9 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/bash

mkdir -p files/onap

dd if=/dev/urandom of=./files/onap/0.5MB.tar.gz bs=1k count=512
dd if=/dev/urandom of=./files/onap/1MB.tar.gz bs=1M count=1
dd if=/dev/urandom of=./files/onap/5MB.tar.gz bs=1M count=5
dd if=/dev/urandom of=./files/onap/10MB.tar.gz bs=1M count=10

sudo chown root:root ./configuration/vsftpd_ssl.conf
che.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import json import logging import os import traceback from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView from common.exceptions import VimDriverNewtonException logger = logging.getLogger(__name__) class SwaggerJsonView(APIView): def get(self, request): json_file = os.path.join(os.path.dirname(__file__), 'multivim.flavor.swagger.json') f = open(json_file) json_data = json.JSONDecoder().decode(f.read()) f.close() json_file = os.path.join(os.path.dirname(__file__), 'multivim.image.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.network.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.subnet.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.server.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.volume.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.vport.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.tenant.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.host.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multivim.limit.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) json_file = os.path.join(os.path.dirname(__file__), 'multicloud.identity.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["basePath"] = "/api/multicloud-newton/v0/" json_data["info"]["title"] = "Service NBI of MultiCloud plugin for OpenStack Newton" return Response(json_data)