Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

kmruddy
Copy link
Contributor

@kmruddy kmruddy commented Aug 1, 2018

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

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
@vmwclabot
Copy link
Member

@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 Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Copy link
Contributor

@tianhao64 tianhao64 left a 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.'
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.print_output(job_list)

def get_backup_job(self):
self.print_output(self.get_backup)
Copy link
Contributor

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:
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants