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(""); } }
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); }
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); }