有人告诉我将我的BASH脚本报告有关VM备份状态的报告,还报告了未备份到Azure Automation帐户的VM。我选择了Python,因为自动化帐户没有bash,并且我以前曾在系统管理目的中完成Python脚本。我不是Python开发人员,我需要帮助导航Azure Python SDK类。
我需要在Python SDK模块之一中在门户网站中找到“备份项目”,以从备份库中检索VM信息。我已经尝试了azure.mgmt.recoveryServices和azure.mgmt.recoveryservicesbackup。我可以从azure.mgmt.recoveryservices获取保险库信息,我可以用来查询有关VAULT的更多信息,希望能VM信息。我的猜测是azure.mgmt.recoveryservicesbackup。但是我迷失在azure.mgmt.recoveryservicesbackup.jobs.models中。我不能在数百个课程中分辨,哪个会提供这些信息。
我想将Vault备份的输出与VM列表相对,以找出哪些没有备份。
我已经看过:
I was told to move my bash script that reports on VM backup status, also reports VMs that are not being backed up to Azure automation account. I picked python since Automation Account doesn't have bash and I have done python scripts before for system admin purposes. I am not a python developer, and I need help navigate Azure python SDK classes.
I need to find the "Backup Items" in portal from one of the python SDK modules, to retrieve the VM information from backup vault. I've tried azure.mgmt.recoveryservices and azure.mgmt.recoveryservicesbackup. I can get vault information from azure.mgmt.recoveryservices, which I can use to query more information about vault, hopefully the VM information. My guess is azure.mgmt.recoveryservicesbackup. But I am lost in azure.mgmt.recoveryservicesbackup.jobs.models. I can't tell among hundreds of classes, which one would give that information.
I'd like to use the output from vault backup to against the list of VMs, to find out which ones are not being backed up.
I've looked at:
发布评论
评论(2)
使用Python获取VM的备份,
您可以使用以下代码片段获取VM备份详细信息。
请参阅在这里a>使用Azure CLI实现。
Using python to get the backup of VM
You can use the below code snippet to get VM Backup details.
Refer here to achieve using Azure cli.
我正在寻找的是“ backup_protected_item”,在recoveryServicesBackupclient构造器中,这是示例代码。
what I was looking for is in "backup_protected_item", in RecoveryServicesBackupClient constructor, here is sample code.