MSP360 has started implementing MSP360 Backup C# API in addition to the existing command-line interface to help other vendors integrate MSP360 Backup with their products and the customers to integrate MSP360 Backup with other internal routines.
Want more functions? Let us know in the comments.
View Backup Plan Details and Get Plan Statistics
Example, that lists successful and failed plans:
foreach (BackupPlan plan in BackupProvider.GetBackupPlans())
{
if (plan.Status.LastRunResult == EnumLastRunResult.Success)
{
Console.WriteLine( "Plan '{0}' has competed successfully. Transferred data size: {1} bytes" , plan.Name, plan.Status.DataSize);
}
else if(plan.Status.LastRunResult == EnumLastRunResult.Failed)
{
Console.WriteLine("Plan '{0}' failed", plan.Name);
}
}
Start/Stop/Pause Plans Using API
BackupPlan object lets start, stop, and pause backup plan.
You can use methods:
public void Start();
public void Stop();
public void Pause();
This example starts all plans, that are not currently running:
foreach (BackupPlan plan in BackupProvider.GetBackupPlans())
{
if (plan.Status.IsRunning)
{
plan.Start();
Console.WriteLine( "Plan '{0}' started" , plan.Name);
}
}
How to get started with MSP360 C# API project
First of all, you should add the reference to CloudBerry.Backup.API.dll, it is located in
C:\Program Files\CloudBerryLab\CloudBerry Online Backup
or
C:\Program Files\CloudBerryLab\Windows Home Server (if you are using Windows Home Server version):
BackupProvider is a root static class, which is used for accessing MSP360 Backup objects.
It has a method for listing current user backup plans:
public static BackupPlan[] GetBackupPlans()
And events for monitoring backup plans changes:
/// Occurs if the plan was changed, removed or created
public static event EventHandler<ChangedEventArgs> PlanChanged;
/// Occurs if the plan was removed
public static event EventHandler<PlanRemoveEventArgs> PlanRemoved;
BackupPlan has some properties with plan information and Status property for getting plan current/last status. There is also a StatusChanged event that is fired on Status parameter changes.
XML documentation is included, you can use IntelliSense for viewing help:
Test App
Here you can download the source code of the test application that will help you get started with C# API
Not found what you're looking for?
Contact our customer care team here.