Mapping Provider Assets¶
After a connection tests healthy, import the nodes the panel should manage and let the asset sync mirror storage, bridges and templates.
Import nodes¶
GET …/providers/{uuid}/nodes lists every discovered node with mapped flags.
curl -X POST "$PANEL/api/application/pterocloud/providers/{uuid}/nodes/pve01/import" \
-H "Authorization: Bearer $APP_API_KEY" -H "Content-Type: application/json" \
-d '{"location_uuid": "<location uuid>"}'
Each import creates a hypervisor row populated from the node's discovered
hardware (CPU model/threads, memory, storage) with capabilities derived from its
storages and cluster size. Re-importing the same node is PROVIDER_CONFLICT.
Nodes removed from the cluster later are flagged provider_missing_since by the
node sync — never auto-deleted.
Storage, network and template mapping¶
The asset sync (every 15 minutes, or on demand) mirrors provider assets:
- Storage → storage pools, upserted per (connection, storage id); type map
dir→local,lvm→lvm,lvmthin→lvm_thin,zfspool→zfs,rbd|cephfs→ceph,nfs→nfs. - Bridges → panel networks, upserted per (connection, bridge), type
publicby default. - Templates → cached on the connection for the admin UI; read them live via
GET …/providers/{uuid}/templates.
Read the live views any time: GET …/storages, GET …/networks,
GET …/templates.
Import VMs¶
GET …/providers/{uuid}/instances lists discovered QEMU guests (LXC excluded)
with mapped flags.
curl -X POST "$PANEL/api/application/pterocloud/providers/{uuid}/instances/101/import" \
-H "Authorization: Bearer $APP_API_KEY" -H "Content-Type: application/json" \
-d '{"owner_uuid":"…","plan_uuid":"…","location_uuid":"…","image_uuid":"…"}'
Import never mutates the provider. Guards: duplicate VMID → PROVIDER_CONFLICT;
unknown VMID → PROVIDER_RESOURCE_NOT_FOUND; node not imported →
PROVIDER_NODE_NOT_IMPORTED.
Provider identity stays server-side¶
VMIDs, node names, UPIDs, template ids and provider_reference never appear in
customer payloads. They are admin-only.