Ejemplo n.º 1
0
    def __init__(self):

        self.versionsDB = Versions.Versions(mongodb)
        self.toolDB = Tool.Tool(mongodb)
        self.tagDB = Tags.Tags()
        self.toolsetdb = ToolSet.ToolSet(mongodb)
        self.deploymentunitsetdb = DeploymentUnitSet.DeploymentUnitSet()
        self.deploymentunitdb = DeploymentUnit.DeploymentUnit()
        self.teamDB = Teams.Teams(mongodb)
        self.machineDB = Machine.Machine(mongodb)
        self.machinegroupsDB = MachineGroups.MachineGroups(mongodb)
        self.toolsetdb = ToolSet.ToolSet(mongodb)
        self.userdb = Users.Users(mongodb)
        self.roledb = Role.Role(mongodb)
Ejemplo n.º 2
0
 def __init__(self):
     self.db = mongodb
     self.current_import_path = import_full_path
     if self.current_import_path in [None, ""]:
         raise ValueError("Import path was not provided")
     if not os.path.exists(self.current_import_path):
         os.makedirs(self.current_import_path)
     if not os.access(os.path.dirname(self.current_import_path), os.W_OK):
         raise ValueError("The directory does not have write access :" +
                          self.current_import_path)
     self.current_export_path = export_full_path
     if self.current_export_path in [None, ""]:
         raise ValueError("Export path was not provided")
     if not os.path.exists(self.current_export_path):
         os.makedirs(self.current_export_path)
     if not os.access(os.path.dirname(self.current_export_path), os.W_OK):
         raise ValueError("The directory does not have write access :" +
                          self.current_export_path)
     self.configdb = Config.Config(self.db)
     self.versionsDB = Versions.Versions(self.db)
     self.toolDB = Tool.Tool(self.db)
     self.deploymentFieldsDB = DeploymentFields.DeploymentFields(self.db)
     self.machineDB = Machine.Machine(self.db)
     self.syncDb = Sync.Sync(self.db)
     self.mailer = Mailer.Mailer()
     self.syncRequestDb = SyncRequest.SyncRequest(self.db)
     self.buildsDB = Build.Build()
     self.documentsDB = Documents.Documents(self.db)
     self.toolDB = Tool.Tool(self.db)
     self.deploymentunitDB = DeploymentUnit.DeploymentUnit()
     self.deploymentunitsetDB = DeploymentUnitSet.DeploymentUnitSet()
     self.mediaFilesDB = MediaFiles.MediaFiles(self.db)
     self.tagsDB = Tags.Tags()
     self.preRequisitesDB = PreRequisites.PreRequisites(self.db)
     self.logo_path = logo_path
     self.full_logo_path = logo_full_path
     self.media_files_path = media_path
     self.full_media_files_path = media_full_path
     self.systemDetailsDb = SystemDetails.SystemDetails(self.db)
     self.systemDetail = self.systemDetailsDb.get_system_details_single()
     self.statedb = State.State(self.db)
     if not self.systemDetail:
         raise Exception("systemDeatils not found")
     self.config_id = 9
     self.load_configuration()
     self.schedulerService = SchedulerService.SchedulerService()
     self.flexAttrDB = FlexibleAttributes.FlexibleAttributes()
Ejemplo n.º 3
0
from Services import HelperServices, StateHelperService
from Services.AppInitServices import authService
from settings import mongodb, relative_path

# blueprint declaration
stateAPI = Blueprint('stateAPI', __name__)
# get global db connection
db = mongodb

# collection
statedb = State.State(db)
deploymentUnitApprovalStatusdb = DeploymentUnitApprovalStatus.DeploymentUnitApprovalStatus(
)
deploymentFieldsdb = DeploymentFields.DeploymentFields(db)
deploymentUnitdb = DeploymentUnit.DeploymentUnit()
deploymentUnitSetdb = DeploymentUnitSet.DeploymentUnitSet()
buildDB = Build.Build()
'''
{
    "data": {
        "page_total": 2,
        "total": 2,
        "data": [
            {
                "build_id": "59fae88cf6a8881077056569",
                "name": "Test 100 State-539",
                "parent_entity_id": "59fac998721561006abadb9b",
                "parent_entity_name": "Test 100",
                "_id": {
                    "$oid": "5a3b9b16f913e73f0852811c"
                },
Ejemplo n.º 4
0
import unittest
import requests
import time

from GetAuthToken import getToken
import json
from settings import mongodb,unittest_test_url
from DBUtil import DeploymentRequestGroup,MachineType,Machine,Versions,Tool,Config,Build,MachineGroups,DeploymentUnitSet
import verifyResponse

DeploymentUnitSetDb=DeploymentUnitSet.DeploymentUnitSet()
MachineGroupsDb=MachineGroups.MachineGroups(mongodb)
BuildDb=Build.Build()
ToolDb=Tool.Tool(mongodb)
ConfigDb = Config.Config(mongodb)
MachineDb=Machine.Machine(mongodb)
MachineTypeDb=MachineType.MachineType(mongodb)
VersionsDb=Versions.Versions(mongodb)
DeploymentRequestGroupdb=DeploymentRequestGroup.DeploymentRequestGroup(mongodb)
Baseurl = unittest_test_url+"deploymentrequest/group/"

header = {'content-type': "application/json",
                   'token':str(getToken())}
class AddDepGroupReqTest(unittest.TestCase):
    oid=None;
    def runTest(self):
        url=Baseurl+"add"
        print "--------------------------------------------------------------------------------------------------------"
        print "Calling API :"+url + " For Create Deployment Group Request test"
        payload={"deployment_requests":[{"parent_entity_id":str(VersionsDb.get_last_active_version_by_tool_id(str(ToolDb.get_tool_by_name("jTrace").get("_id")),False).get("_id")),
                                         "requested_by":"SuperAdmin",
Ejemplo n.º 5
0
from Services import FileUtils, HelperServices, TeamService, DuHelperService
from Services.AppInitServices import authService
from settings import mongodb, relative_path, logo_path, logo_full_path
from flask_restplus import Resource
from modules.apimodels import DeploymentUnitSetModel
from modules.apimodels.Restplus import api, header_parser
from modules.apimodels.GenericReponseModel import generic_post_response_model, generic_response_model

# blueprint declaration
deploymentUnitSetAPI = Blueprint('deploymentUnitSetAPI', __name__)

deploymentUnitSetAPINs = api.namespace(
    'deploymentunitset', description='Deployment Unit Set Operations')
# get global db connection
db = mongodb
deploymentUnitSetDB = DeploymentUnitSet.DeploymentUnitSet()
userDB = Users.Users(db)
systemDetailsDB = SystemDetails.SystemDetails(db)
teamService = TeamService.TeamService()
deploymentUnitDB = DeploymentUnit.DeploymentUnit()
stateDB = State.State(db)


@deploymentUnitSetAPI.route('/deploymentunitset/all', methods=['GET'])
@authService.authorized
@swag_from(relative_path +
           '/swgger/DeploymentUnitSetAPI/getAllDeploymentUnitSets.yml')
def getAllDeploymentUnitSets():

    limit = int(request.args.get('perpage', '30'))
    page = int(request.args.get('page', "0"))