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 to ovirt snapshot download and upload disk #46696
add to ovirt snapshot download and upload disk #46696
Conversation
@mnecas: thank you for submitting this pull-request! |
The test
The test
|
@@ -48,6 +48,26 @@ | |||
description: | |||
description: | |||
- "Description of the snapshot." | |||
disk_id: | |||
description: | |||
- "Disk id which you want to upload or download" |
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.
Please also write that either id or name is required in case of upload/download and add code that checks it was properly passed.
version_added: "2.8" | ||
download_image_path: | ||
description: | ||
- "Path on a file system where disk should be downloaded." |
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.
s/disk/snaphost
vm_name: myvm | ||
upload_image_path: /path/to/mydisk.qcow2 | ||
|
||
# Download disk to local file system: |
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.
snapshot
@@ -136,6 +170,15 @@ | |||
except ImportError: | |||
pass | |||
|
|||
|
|||
import os | |||
import traceback |
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.
It's already imported on line 166
elif module.params.get('disk_name'): | ||
disk_id = get_id_by_name(snapshot_disks_service, module.params.get('disk_name')) | ||
|
||
return snapshot_disks_service.disk_service(disk_id).get().id |
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 id is same as disk_id
so it doesn't make sense to do 'get'
disk_id: | ||
description: | ||
- "Disk id which you want to upload or download" | ||
- "To get disk, you need to define disk_id or disk_name" |
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.
Either C(disk_id) or C(disk_name) is required when C(upload_image_path) or C(download_image_path) is specified.
version_added: "2.8" | ||
disk_name: | ||
description: | ||
- "Disk name which you want to upload or download" |
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.
Either C(disk_id) or C(disk_name) is required when C(upload_image_path) or C(download_image_path) is specified.
shipit |
* add to ovirt snapshot download and upload disk * ovirt snapshot update docs * ovirt snapshot add version_added to docs * update ovirt snapshot docs
SUMMARY
add upload and download to ovirt snapshot disk
Fixes #44268
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
ADDITIONAL INFORMATION