feat(pool_info): add plugin for configured resource pools

This commit is contained in:
2022-08-24 12:05:49 +02:00
parent 3aead7d348
commit e72d920b73
2 changed files with 109 additions and 0 deletions

View 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']