How do I get the decrypted contents of the SQL Command from a SQL Task using the API?
I have used the API to generate the task using VisualCronAPI.Client's Encrypt method, but I now need to go the other direction and read tasks from the API.
Here is the creation code where I encrypt the command text:
var vCTask = job.AddTask(TaskClass.TaskT.SQL);
vCTask.SQL.CommandType = System.Data.CommandType.Text;
vCTask.SQL.EncryptedCommand = client.Encrypt(this.CmdTextDb);
vCTask.SQL.ConnectionId = this.ConnIdDb;
server.Jobs.Update(job);
There is no method for "client.Decrypt".
When I read the task from the API, the EncryptedCommand property contains the byte array. There is also a Command property, but it is always null.
I searched the forum for solutions and found a message related to "ServerObj.Credentials.GetUsername" to solve a similar issue with decrypting credentials. I was not able to locate anything like this in the API for the SQL Command Text.
The VisualCron Client uses the API and it displays the Command Text for SQL tasks, so I assume there must be a way to solve this issue.
Thanks,
Wes