5.1

Table 2-1. Input Variables
Variable Type
host
vCAC:VcacHost
var modelName = 'ManagementModelEntities.svc';
var entitySetName = 'HostNamePrefixes';
var links = null;
var headers = null;
//Create properties for prefix entity
var prefixInputProperties = {
MachinePrefix:'test-prefix',
NextMachineNo:1,
MachineNumberLength:3
};
//Save the prefix
var prefixEntity = vCACEntityManager
.createModelEntity(host.id, modelName, entitySetName, prefixInputProperties, links, headers);
entitySetName = 'ProvisioningGroups';
//Create properties for the provisioning group entity
inputProperties = {
GroupName:'TestGroupName',
GroupDescription:'This group was generated with a vCO workflow',
AdministratorEmail:'test@test.com',
AdContainer:'AD',
IsTestGroup:false,
Flags:2,
GroupType:1};
//Add a reference to the newly created prefix entity
links = {
HostNamePrefix:prefixEntity
};
//Save the provisioning group
var entity = vCACEntityManager
createModelEntity(host.id, modelName, entitySetName, inputProperties, links, headers);
Example: Update a vCloud Automation Center model entity
This example script performs the following actions.
1 Gets the host id from the provided entity.
2 Gets the model name from the provided entity.
3 Gets the entity set name from the provided entity.
4 Gets the entity id from the provided entity.
5 Defines a set of properties that will be updated.
6 Invokes the action responsible for updating the entity.
Chapter 2 Using the vCloud Automation Center Plug-In
VMware, Inc. 13