//Check that create a VDB call will return a response.
        public void CreateTemplateTest()
        {
            // Create and valiate a session
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
            // Trust all certificates
            System.Net.ServicePointManager.ServerCertificateValidationCallback =
                ((sender, certificate, chain, sslPolicyErrors) => true);

            // Get a cookie + Authenticate
            Session.CreateSession(System.Environment.GetEnvironmentVariable("DELPHIX_USER"), System.Environment.GetEnvironmentVariable("DELPHIX_PASSWORD"), System.Environment.GetEnvironmentVariable("DELPHIX_URL"));
            string cookie = Session.jSessionId.Value;


            //Create helpers
            TemplateService        tempService = new TemplateService();
            DatabaseService        dbHelp      = new DatabaseService();
            DelphixDatabase        vdb         = new DelphixDatabase();
            List <DelphixDatabase> allDbs      = new List <DelphixDatabase>();

            allDbs = dbHelp.GetDatabases();
            DelphixDatabase aVdb = allDbs.First();

            allDbs.Clear();
            allDbs.Add(aVdb);
            //Create a test template
            DelphixResponse response = tempService.CreateTemplate("testTemp", allDbs);
        }
Exemple #2
0
        //Check that create a VDB call will return a response.
        public void FilterEnvironmentsByNameTest()
        {
            // Create and valiate a session
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
            // Trust all certificates
            System.Net.ServicePointManager.ServerCertificateValidationCallback =
                ((sender, certificate, chain, sslPolicyErrors) => true);

            // Get a cookie + Authenticate
            Session.CreateSession(System.Environment.GetEnvironmentVariable("DELPHIX_USER"), System.Environment.GetEnvironmentVariable("DELPHIX_PASSWORD"), System.Environment.GetEnvironmentVariable("DELPHIX_URL"));
            string cookie = Session.jSessionId.Value;


            //Create helpers
            EnvironmentService        envService = new EnvironmentService();
            DelphixDatabase           vdb        = new DelphixDatabase();
            List <DelphixEnvironment> allDbs     = new List <DelphixEnvironment>();

            allDbs = envService.GetEnvironments();
            DelphixEnvironment aVdb = envService.GetEnvironmentsByName("ctt24co1", allDbs).First();

            allDbs.Clear();
            allDbs.Add(aVdb);
        }