[PS Script]
My code:
https://github.com/.../04054a709c8c95.../proxmox-api-problem
API:
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/get-osinfo
I know i still not completed installation agent of proxmox, but some vm was installed already.
So, I would like to get OS information. However when i add the above try-catch it bring other api broken
-------- have a vmAgentResponse block ---------
proxmox-node
vm-001
2
3072
Storage Name: SAN-001, Size: 50G
Hostname: proxmox-node
stopped
vmAgentResponse line is broken
vmConfigResponse line is broken
vmStatusResponse line is broken
vmAgentResponse line is broken
vmConfigResponse line is broken
vmStatusResponse line is broken
vmAgentResponse line is broken
vmConfigResponse line is broken
-------- no have a vmAgentResponse block ---------
proxmox-node
vm-001
2
3072
Storage Name: SAN-001, Size: 50G
Hostname: proxmox-node
stopped
OS Type: Centos7
MS-Server-001
4
8192
Storage Name: IBM-001, Size: 200G
Storage Name: TAPE-S002, Size: 50G
Hostname: proxmox-node
running
.
.
.
-------- what i want ---------
proxmox-node
vm-001
2
3072
Storage Name: SAN-001, Size: 50G
Hostname: proxmox-node
stopped
OS Type: Centos7
MS-Server-001
4
8192
Storage Name: IBM-001, Size: 200G
Storage Name: TAPE-S002, Size: 50G
Hostname: proxmox-node
running
vmAgentResponse line is broken <<<< it should show this message when it catch and other vm is stil looping for information
My code:
https://github.com/.../04054a709c8c95.../proxmox-api-problem
API:
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/get-osinfo
Code:
try {
$vmAgentResponse = Invoke-RestMethod -URI $vmAgentUri -Headers $Headers -ContentType "application/json" -Method Get -WebSession $session
$vmAgent = $vmAgentResponse.data.result
Write-Host $vm
} catch {
Write-Host "vmAgentResponse line is broken"
}
I know i still not completed installation agent of proxmox, but some vm was installed already.
So, I would like to get OS information. However when i add the above try-catch it bring other api broken
-------- have a vmAgentResponse block ---------
proxmox-node
vm-001
2
3072
Storage Name: SAN-001, Size: 50G
Hostname: proxmox-node
stopped
vmAgentResponse line is broken
vmConfigResponse line is broken
vmStatusResponse line is broken
vmAgentResponse line is broken
vmConfigResponse line is broken
vmStatusResponse line is broken
vmAgentResponse line is broken
vmConfigResponse line is broken
-------- no have a vmAgentResponse block ---------
proxmox-node
vm-001
2
3072
Storage Name: SAN-001, Size: 50G
Hostname: proxmox-node
stopped
OS Type: Centos7
MS-Server-001
4
8192
Storage Name: IBM-001, Size: 200G
Storage Name: TAPE-S002, Size: 50G
Hostname: proxmox-node
running
.
.
.
-------- what i want ---------
proxmox-node
vm-001
2
3072
Storage Name: SAN-001, Size: 50G
Hostname: proxmox-node
stopped
OS Type: Centos7
MS-Server-001
4
8192
Storage Name: IBM-001, Size: 200G
Storage Name: TAPE-S002, Size: 50G
Hostname: proxmox-node
running
vmAgentResponse line is broken <<<< it should show this message when it catch and other vm is stil looping for information
Last edited: