示例#1
0
        public string EnableSource(DelphixSource dbToDelete)
        {
            //dynamic DeleteParameters = new JObject();
            //DeleteParameters.type = "DeleteParameters";



            // DeleteParameters = JsonConvert.SerializeObject(DeleteParameters);
            var request = new RestRequest("resources/json/delphix/source/" + dbToDelete.reference.ToString() + "/enable", Method.POST);

            request.RequestFormat = DataFormat.Json;
            // request.AddBody(DeleteParameters);

            request.AddHeader("content-header", "application/json");
            request.AddCookie(Session.jSessionId.Name, Session.jSessionId.Value);

            var    result = Session.delphixClient.Post(request);
            string dbs    = result.Content;
            //Console.WriteLine(DeleteParameters);
            var response = JsonConvert.DeserializeObject <ProvisionVdbResponse>(dbs);

            if (response.status.Equals("OK"))
            {
                var deserializedDbs = response.job;
                return(deserializedDbs);
            }
            else
            {
                Console.WriteLine("The status returned from the GetDatabases call was NOT OK");
                return("");
            }
        }
示例#2
0
        public DelphixSource GetSourceByContainer(string config, List <DelphixSource> dbs)
        {
            DelphixSource groupDatabases = new DelphixSource();


            foreach (DelphixSource delphixDb in dbs)
            {
                if (delphixDb.container.ToString().Equals(config))
                {
                    groupDatabases = delphixDb;
                }
            }



            return(groupDatabases);
        }
示例#3
0
        public DelphixSource GetSourceByReference(string reference, List <DelphixSource> dbs)
        {
            DelphixSource groupDatabases = new DelphixSource();


            foreach (DelphixSource delphixDb in dbs)
            {
                if (delphixDb.reference.ToString().Equals(reference))
                {
                    groupDatabases = delphixDb;
                }
            }



            return(groupDatabases);
        }