From e494c0efca962724502520d1d9d992b7cf45d0fb Mon Sep 17 00:00:00 2001 From: William Lam Date: Fri, 17 Nov 2023 14:53:26 -0800 Subject: [PATCH] Revert "VI/JSON Examples" This reverts commit ab9846d942f99a51238554ad2d7e4c4d0826e2e4. --- shell/create_snapshot_for_vm.sh | 28 -------------------------- shell/list_advanced_settings_for_vm.sh | 18 ----------------- shell/list_custom_attributes_for_vm.sh | 22 -------------------- 3 files changed, 68 deletions(-) delete mode 100644 shell/create_snapshot_for_vm.sh delete mode 100644 shell/list_advanced_settings_for_vm.sh delete mode 100644 shell/list_custom_attributes_for_vm.sh diff --git a/shell/create_snapshot_for_vm.sh b/shell/create_snapshot_for_vm.sh deleted file mode 100644 index 2963196..0000000 --- a/shell/create_snapshot_for_vm.sh +++ /dev/null @@ -1,28 +0,0 @@ -VC='vcsa.primp-industries.local' -VC_USERNAME='administrator@vsphere.local' -VC_PASSWORD='VMware1!' -VC_API_RELEASE='8.0.1.0' -VM_NAME="esx-1.0" - -# vCenter REST API -VCREST_API_SESSION_ID=$(curl -s -u "${VC_USERNAME}:${VC_PASSWORD}" -X POST "https://${VC}/api/session" | jq -j) -VM_MOREF=$(curl -s -H "vmware-api-session-id: ${VCREST_API_SESSION_ID}" -X GET "https://${VC}/api/vcenter/vm?names=${VM_NAME}" | jq -r '.[0].vm') - -# vCenter VI JSON API -SESSION_MANAGER_MOID=$(curl -s https://$VC/sdk/vim25/${VC_API_RELEASE}/ServiceInstance/ServiceInstance/content | jq -j .sessionManager.value) -VIJSON_API_SESSION_ID=$(curl -s -o /dev/null -D - "https://$VC/sdk/vim25/${VC_API_RELEASE}/SessionManager/$SESSION_MANAGER_MOID/Login" -H 'Content-Type: application/json' -d "{\"userName\":\"${VC_USERNAME}\", \"password\": \"${VC_PASSWORD}\"}" | awk 'BEGIN {FS=": "}/^vmware-api-session-id/{print $2}') - -# Create Snapshot spec -cat > snapshot_spec.json <