Backup > 3 - The Service > Get the jobs

3.3 Get the jobs

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();
}
/// IWsBackupClient.GetJobs  Method (JAVA)
public static String GetJobs(WsBackupClient client)
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
        .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
        .put(BindingProvider.PASSWORD_PROPERTY, "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.isSuccess())
        {
            stringBuilder.append("Operation ends successfully\n");

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

            if (items != null)
            {
                for (BackupJob item : items)
                {
                    stringBuilder.append("\nBackupJob detail\n");

                    stringBuilder.append("\nOperationName: ");
                    stringBuilder.append(item.getOperationName());
                    stringBuilder.append("\nOperationUsername: ");
                    stringBuilder.append(item.getOperationUsername());                            
                    stringBuilder.append("\nUserId: ");
                    stringBuilder.append(item.getUserId());
                    stringBuilder.append("\nRegionId: ");
                    stringBuilder.append(item.getRegionId());
                    stringBuilder.append("\nJobId: ");
                    stringBuilder.append(item.getJobId());
                    stringBuilder.append("\nJobStatus: ");
                    stringBuilder.append(item.getJobStatus());
                }
            }
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        System.out.println(ex);
    }

    return stringBuilder.toString();
}
Version
API: v2.8 URL:https://api.services.cloud.it/wsBackup/v2.8/WsBackup.svc?wsdl