Skip to content

Instantly share code, notes, and snippets.

@safeaim
safeaim / gist:bdd2a15606985c18df9e95d98a7c640a
Last active January 10, 2019 19:27
vRA - Publish vRA blueprints.json
# Get all your blueprints
curl -X GET \
https://$VRAURL/composition-service/api/blueprintdocuments/ \
-H 'Accept: application/json' \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
# Get a blueprint
curl -X GET \
https://$VRAURL/composition-service/api/blueprintdocuments/MyDevBlueprint \
var vCAC_Machine = Server.findAllForType("vCAC:VirtualMachine","VMUniqueID eq '" + vm.config.instanceUuid + "'");
var virtualMachineEntity = vCAC_Machine[0].getEntity(); //to get entity
var vmEntityProps = virtualMachineEntity.getProperties(); //to get Entity properties for the next step
vmEntityProps.remove('VMDNSName');
vmEntityProps.put('VMDNSName', newName);
vmEntityProps.put("VirtualMachineName", newName);
var hostId = virtualMachineEntity.hostId;
var modelName = virtualMachineEntity.modelName;