Sql2014CreateBackupJob and GetJobStatus API Example

Discussion in 'Control Panel API' started by DKSW, May 21, 2015.

  1. i'm trying to find an example of how people typically call to start a compressed mssql database backup of sql2014 and poll to get status to find out when it is done or if an error occurs.

    So far my code looks like this - but I cannot find docs on the GetJobStatus() and/or other methods.

    var key = ConfigurationManager.AppSettings["DaspAPIKey"].ToString();

    var dasp = new DaspAPIServiceReference.CustomerApiSoapClient("CustomerApiSoap12");

    var g = dasp.Sql2014CreateBackupJob(key, "my db name goes here", true);

    StringBuilder sb = newStringBuilder();

    for (var i = 1; i < 10; i++)

    {

    var status = dasp.GetJobStatus(key, g);

    sb.AppendLine(string.Format("JobName: {0} StartDateTime: {1} Status: {2} ErrorMessage: {3} Completed: {4}",

    status.JobName, status.StartDateTime, status.Status, status.ErrorMessage, status.CompletedDateTime));

    Thread.Sleep(1000);

    }
     

Share This Page