feat(pool_info): add plugin for configured resource pools
This commit is contained in:
13
plugins/module_utils/proxmox_pool.py
Normal file
13
plugins/module_utils/proxmox_pool.py
Normal file
@ -0,0 +1,13 @@
|
||||
from typing import List, Tuple
|
||||
|
||||
from ansible_collections.finallycoffee.proxmox.plugins.module_utils.common import _proxmox_request, ProxmoxAuthInfo
|
||||
|
||||
|
||||
def get_pools(auth_info: ProxmoxAuthInfo) -> [str]:
|
||||
pool_answer = _proxmox_request('get', f"/pools", auth_info).json()
|
||||
return pool_answer['data']
|
||||
|
||||
|
||||
def get_pool(auth_info: ProxmoxAuthInfo, pool: str) -> [dict]:
|
||||
pool_answer = _proxmox_request('get', f"/pools/{pool}", auth_info).json()
|
||||
return pool_answer['data']
|
Reference in New Issue
Block a user