-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backup_job_crud Sample Script #86
base: master
Are you sure you want to change the base?
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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