public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); List <string> entities = JsonUtility.DeserializeEntities(request.DataStore.GetValue("Entities"), request.DataStore.GetValue("AdditionalObjects")); InformaticaTask task = new InformaticaTask { BulkApi = true, SourceConnectionId = await InformaticaUtility.GetConnectionId(rc, InformaticaUtility.BPST_SOURCE_NAME), TargetConnectionId = await InformaticaUtility.GetConnectionId(rc, InformaticaUtility.BPST_TARGET_NAME), Name = InformaticaUtility.BPST_TASK_NAME, OrgId = rc.ID, ReplicationObjects = entities.ToArray(), ScheduleId = await CreateSchedule(rc, "PBI_" + Guid.NewGuid().ToString("N")) }; await rc.Post(URL_REPLICATION_TASK, JsonConvert.SerializeObject(task)); await InformaticaUtility.Logout(rc, username, password); return(new ActionResponse(ActionStatus.Success)); }
public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); await InformaticaUtility.Logout(rc, username, password); return(new ActionResponse(ActionStatus.Success)); }
public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); string sqlUsername = request.DataStore.GetValue("Username"); string sqlPassword = request.DataStore.GetValue("Password"); bool isWindowsAuth = string.IsNullOrEmpty(sqlUsername) || string.IsNullOrEmpty(sqlPassword); InformaticaConnectionAzureSql ic = new InformaticaConnectionAzureSql { Name = InformaticaUtility.BPST_TARGET_NAME, OrgId = rc.ID, ConnectionType = "SqlServer2012", Codepage = "UTF-8", Schema = "dbo", AuthenticationType = isWindowsAuth ? "Windows" : "SqlServer", RuntimeEnvironmentId = await InformaticaUtility.GetRuntimeEnvironmentId(rc, request.DataStore.GetValue("InformaticaAgentName")) }; string databaseName = request.DataStore.GetValue("Database"); string serverName = request.DataStore.GetValue("Server"); ic.Database = isWindowsAuth ? databaseName : databaseName + ";EncryptionMethod=SSL;ValidateServerCertificate=true"; string[] serverAndPort = serverName.Split(',', ':'); if (serverAndPort.Length > 1) { ic.port = int.Parse(serverAndPort[1].Trim()); ic.Host = serverAndPort[0].Trim(); } else { ic.Host = serverName; ic.port = 1433; } if (isWindowsAuth) { ic.username = ic.password = null; } else { ic.password = sqlPassword; ic.username = sqlUsername.Contains("@") ? sqlUsername : sqlUsername + "@" + ic.Host; } await rc.Post(URL_CONNECTIONS, JsonConvert.SerializeObject(ic)); await InformaticaUtility.Logout(rc, username, password); return(new ActionResponse(ActionStatus.Success)); }
public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); string response = await rc.Get(URL_AGENT); List <InformaticaRuntimeEnvironment> environments = JsonConvert.DeserializeObject <List <InformaticaRuntimeEnvironment> >(response); await InformaticaUtility.Logout(rc, username, password); return(new ActionResponse(ActionStatus.Success, JsonUtility.Serialize <List <InformaticaRuntimeEnvironment> >(environments))); }
public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); await DeleteTask(rc, InformaticaUtility.BPST_TASK_NAME); await DeleteConnection(rc, InformaticaUtility.BPST_SOURCE_NAME); await DeleteConnection(rc, InformaticaUtility.BPST_TARGET_NAME); await InformaticaUtility.Logout(rc, username, password); return(new ActionResponse(ActionStatus.Success, JsonUtility.GetEmptyJObject())); }
public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); InformaticaJob job = new InformaticaJob { TaskId = await InformaticaUtility.GetTaskId(rc, InformaticaUtility.BPST_TASK_NAME), TaskName = InformaticaUtility.BPST_TASK_NAME, TaskType = "DRS" }; await rc.Post(URL_JOB, JsonConvert.SerializeObject(job)); await InformaticaUtility.Logout(rc, username, password); return(new ActionResponse(ActionStatus.Success, JsonUtility.GetEmptyJObject())); }
public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); string response = await rc.Get(URL_ACTIVITY); List <InformaticaActivityLog> tasks = JsonConvert.DeserializeObject <List <InformaticaActivityLog> >(response); string taskId = await InformaticaUtility.GetTaskId(rc, InformaticaUtility.BPST_TASK_NAME); ActionResponse result = null; for (var i = 0; i < tasks.Count && result == null; i++) { if (tasks[i].TaskId.EqualsIgnoreCase(taskId)) { if (tasks[i].State.EqualsIgnoreCase("1") || tasks[i].State.EqualsIgnoreCase("2")) { result = new ActionResponse(ActionStatus.Success); } else if (tasks[i].ExecutionState.EqualsIgnoreCase("3")) { result = new ActionResponse(ActionStatus.Failure, JsonUtility.GetJObjectFromStringValue(tasks[i].ErrorMsg)); } else { result = new ActionResponse(ActionStatus.InProgress); } } } if (result == null) { result = new ActionResponse(ActionStatus.InProgress); } await InformaticaUtility.Logout(rc, username, password); return(result); }
public override async Task <ActionResponse> ExecuteActionAsync(ActionRequest request) { string username = request.DataStore.GetValue("InformaticaUsername"); string password = request.DataStore.GetValue("InformaticaPassword"); RestClient rc = await InformaticaUtility.Initialize(username, password); InformaticaConnection ic = new InformaticaConnection { username = request.DataStore.GetValue("SalesforceUser"), password = request.DataStore.GetValue("SalesforcePassword"), securityToken = request.DataStore.GetValue("SalesforceToken"), serviceUrl = $"https://{request.DataStore.GetValue("SalesforceUrl")}/services/Soap/u/34.0", Name = InformaticaUtility.BPST_SOURCE_NAME, OrgId = rc.ID, ConnectionType = "Salesforce", RuntimeEnvironmentId = await InformaticaUtility.GetRuntimeEnvironmentId(rc, request.DataStore.GetValue("InformaticaAgentName")) }; await rc.Post(URL_CONNECTIONS, JsonConvert.SerializeObject(ic)); await InformaticaUtility.Logout(rc, username, password); return(new ActionResponse(ActionStatus.Success, JsonUtility.GetEmptyJObject())); }