-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 module proxmox_backup_info #9437
base: main
Are you sure you want to change the base?
Conversation
The `proxmox_backup_info` module displays information such as backup times, VM name, VM ID, mode, backup type, and backup schedule using the Proxmox Server API.
create test for proxmox_backup_info.py module
This comment was marked as outdated.
This comment was marked as outdated.
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.
hi @raoufnezhad thanks for your contribution!
I see you have adjustments to make for the sanity tests. If I may suggest, give it a try to andebox
(by yours truly):
https://pypi.org/project/andebox/
You can run this sanity test easily in your local machine by simply running:
$ andebox test -- sanity --docker default --python 3.10 plugins/modules/your_module.py
I left a couple of other comments below as well. Thanks again!
options: | ||
api_user: | ||
description: The user must have access to the proxmox server | ||
required: true |
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 use consistent indentation. Here you started with 4 spaces then used 2 in the next level. We have been trying to use 2 at all times, that's not mandatory, but consistency is.
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.
Thank you for your attention.
description: The return value provided by proxmox_backup_info. | ||
type: dict |
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.
That description does not mean much. Please be either more specific or add notes to the documentation block referring to Proxmox API, and/or the return values provided by proxmoxer.
If the result value is not too big nor complex, please consider declaring contains
block with a more finely grained level of details.
Co-authored-by: Alexei Znamensky <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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.
Thanks for your contribution!
required: false | ||
type: int | ||
backup_section: | ||
description: The backup_section value is true or false. if this be true, this module just return all backup job information. |
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 this option means that if it is set to true
, then all backups for this 'section' (whatever that is, I don't know the proxmox terminology) will be listed. If set to false
, what is listed depends on the other options.
Is that correct? A description that's closer to the above might be more helpful.
elements: dict | ||
contains: | ||
bktype: | ||
description: backup type |
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.
The descriptions here also need to be full sentences.
description: backup type | |
description: The type of the backup. |
- The backup_jobs value is true or false. | ||
- If set to true, this module just return all backup jobs information. | ||
- If set to false, what is listed depends on the other options. | ||
required: false |
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.
required: false
is redundant, please remove it from both here and the argument_spec below.
Also, use semantic markup (such as V()
), and boolean parameters may have, by definition, only the values true
and false
, no need to mention that ;-).
- The backup_jobs value is true or false. | |
- If set to true, this module just return all backup jobs information. | |
- If set to false, what is listed depends on the other options. | |
required: false | |
- Include backup jobs in the result. | |
- If V(true), this module just return all backup jobs information. | |
- If V(false), the result will not include backup jobs. |
Or something like that.
Semantic markup is documented in:
https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#semantic-markup-within-module-documentation
SUMMARY
This contribution proposes to add a module called
proxmox_backup_info
to the Ansible community.general collection. The module would retrieve information about backups in a Proxmox VE cluster, allowing users to query and gather details about existing backups.ISSUE TYPE
COMPONENT NAME
proxmox_backup_info
ADDITIONAL INFORMATION
The module would use the Proxmox API to fetch information about backups in the cluster. It would allow users to specify parameters such as the API host, credentials, and optionally filter by VM ID, VM Name, or backup section. The result of the module would be a list of backups with details like backup type, backup id, mode, schedule, next-run time, storage, and associated VM.