6.1.0
Table Of Contents
- Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.1
- Contents
- Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.1
- Introduction to the VMware vCenter Orchestrator Plug-In for vCloud Automation Center
- Configuring the vCloud Automation Center Plug-In
- Using the vCloud Automation Center Plug-In
- Using the vCloud Automation Center Plug-In Inventory
- Using the vCloud Automation Center Plug-In Administration Workflows
- Using the vCloud Automation Center Plug-In Infrastructure Administration Workflows
- Using the vCloud Automation Center Plug-In Requests Workflows
- Using the vCloud Automation Center Plug-In Sample Workflows
- Access the vCloud Automation Center Plug-In API
- Examples of Scripts for Common vCloud Automation Center Tasks
- Examples of Scripts for CRUD vCloud Automation Center Infrastructure Administration Tasks
- Examples of Scripts for Finding vCloud Automation Center Entities
- An Example Script for Getting a Virtual Machine Provisioned as a vCloud Automation Center Catalog Resource
- An Example Script for Content Transfer Between vCloud Automation Center Hosts
- Index
//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 3‑14. 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