Quantcast
Channel: Azure Backup forum
Viewing all articles
Browse latest Browse all 2741

Python API - Restoring VM from Backup

$
0
0

Hi, I'm looking for examples of how to use this python api class "IaasVMRestoreRequest class"  in a python script. I want to script a restore of a vm from a backup as we have a requirement to do this and perform a number of tests against the restored vm every week. The number of vm's will increase overtime so it is a perfect candidate for automation. I relatively new to python and azure and as such I'm struggling to read the api reference as a lot of it comes without examples so I'm stumbling about in the dark. If I had access to a few examples I'm sure I could work it out from there.

I'm kind of going in this direction 

from azure.mgmt.recoveryservicesbackup import RecoveryServicesBackupClient
from azure.common.client_factory import get_client_from_cli_profile

def run_example():

    recovery_service_backup_client = get_client_from_cli_profile(RecoveryServicesBackupClient)

    recovery_service_backup_client.restores.trigger('')


    
if __name__ == "__main__":
    run_example()

but I don't even know if this is the right direction to be heading.

If anyone can point me to some good examples of this or can post an example of how to make use of the API here I'd very much appreciate it.

Thanks


Viewing all articles
Browse latest Browse all 2741

Trending Articles