6.1.0

Table Of Contents
//Create the service blueprint
var blueprintService =
host.createAdvancedDesignerClient().getAdvancedDesignerServiceBlueprintService();
var uri = blueprintService.createServiceBlueprint(host.tenant , blueprint);
//Publish the service blueprint
var createdBlueprint = blueprintService.getServiceBlueprintByUri(uri);
blueprintService.updateServiceBlueprintStatus(host.tenant, createdBlueprint.getId(),
vCACCAFEDesignerPublishStatus.PUBLISHED);
Examples of Scripts for CRUD vCloud Automation Center
Infrastructure Administration Tasks
You can cut, paste, and edit the JavaScript examples to write scripts for CRUD vCloud Automation Center
tasks.
For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter
Orchestrator.
Example: Create a vCloud Automation Center Model Entity
This example script performs the following actions:
1 Defines the model name and the entity set name.
2 Defines the properties of the host prefix.
3 Saves the host prefix entity.
4 Defines the properties of the provisioning group.
5 Defines the provisioning group as a link.
6 Saves the provisioning group entity, by linking it with the host name prefix.
Table 314. 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',
Chapter 3 Using the vCloud Automation Center Plug-In
VMware, Inc. 23