Click or drag to resize

IWsBackupGetJobs Method

Returns the list of operations of the backup service.

Namespace:  Aruba.Cloud.WsBackup
Assembly:  Aruba.Cloud.WsBackup (in Aruba.Cloud.WsBackup.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<BackupJob>> GetJobs()

Return Value

Type: WsResultListBackupJob
Examples
By the method IWsBackup GetJobs you can get the list of operations of the backup service. These operations are also visible in the control panel (eg. CreateBackupAccount, DeleteBackupAccount and ActiveBackupAccount ... etc.).
/// WsBackupClient.GetJobs  Method (c# .NET)
public static string GetJobs(WsBackupClient client)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // call method GetJobs 
        // obtaining a WsResultOfArrayOfBackupJob item
        WsResultOfArrayOfBackupJob result = client.GetJobs();

        // if the call is Success print returned values
        if (result.Success)
        {
            stringBuilder.Append("Operation ends successfully\n");

            // get Value returned from server
            BackupJob[] items = result.Value;

            if (items != null)
            {
                foreach (BackupJob item in items)
                {
                    stringBuilder.Append("\nBackupJob detail\n");

                    stringBuilder.Append("\nOperationName: ");
                    stringBuilder.Append(item.OperationName);
                    stringBuilder.Append("\nOperationUsername: ");
                    stringBuilder.Append(item.OperationUsername);                            
                    stringBuilder.Append("\nUserId: ");
                    stringBuilder.Append(item.UserId);
                    stringBuilder.Append("\nRegionId: ");
                    stringBuilder.Append(item.RegionId);
                    stringBuilder.Append("\nJobId: ");
                    stringBuilder.Append(item.JobId);
                    stringBuilder.Append("\nJobStatus: ");
                    stringBuilder.Append(item.JobStatus);
                }
            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also