Conversation
Adding a new sample resource to help manage backup management options for appliances. Uses the Job class from the com.vmware.appliance.recovery.backup_client module Methods Available: List Backup Jobs Get Backup Job Create Backup Job Cancel Backup Job
|
@kmruddy, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
tianhao64
left a comment
There was a problem hiding this comment.
Looks good in general. Can you also run pep8 on the file to fix format issues?
| """ | ||
|
|
||
| __author__ = 'VMware, Inc.' | ||
| __copyright__ = 'Copyright 2017 VMware, Inc. All rights reserved.' |
There was a problem hiding this comment.
This can be removed as we have a copyright header above. We should change the above to 2018.
| self.cancel_backup = args.cancel_backup | ||
|
|
||
| # Connect to vAPI services | ||
| self.stub_config = vapiconnect.connect( |
There was a problem hiding this comment.
Can you try to use the new vsphere_client. e.g:
https://github.com/vmware/vsphere-automation-sdk-python/blob/master/sample_template/sample_template.py#L55
| self.print_output(job_list) | ||
|
|
||
| def get_backup_job(self): | ||
| self.print_output(self.get_backup) |
There was a problem hiding this comment.
I think the API call is missing here.
| table = [] | ||
|
|
||
| if type(job) is list: | ||
| for bkupjob in job: |
There was a problem hiding this comment.
We have some duplicated code here. Maybe we can extract the common code between if/else to a separate method?
Adding a new sample resource to help manage backup management options for appliances.
Uses the Job class from
the com.vmware.appliance.recovery.backup_client module
Methods Available:
List Backup Jobs
Get Backup Job
Create Backup Job
Cancel Backup Job