6.0.1

Table Of Contents
var approvalPolicy = approvalPolicyService.createPolicy(spec);
// Publish the approval policy
approvalPolicy.setState(vCACCAFEApprovalPolicyState.PUBLISHED);
approvalPolicy = approvalPolicyService.update(approvalPolicy);
System.log("New approval policy id: " + approvalPolicy.getId());
Example: Create a vCloud Automation Center Advanced Service Blueprint
This example script performs the following actions:
1 Sets the vCenter Orchestrator workflow used to build the service blueprint.
2 Generates the content for the service blueprint based on the workflow.
3 Creates the service blueprint entity.
4 Publishes the service blueprint.
Table 313. Input Variables
Variable Type
host
vCACCAFE:VCACHost
//ID of the workflow used to create the service blueprint
var workflowId = "44e42047-2fa0-4e4a-ba0c-12086540b28b";
var name = "MyBlueprint"
var description = "Blueprint description";
var workflowClient = host.createAdvancedDesignerClient().getAdvancedDesignerWorkflowService();
//Generate a service blueprint based on the workflow ID
var blueprint = workflowClient.generateServiceBlueprintByWorkflowId(workflowId);
blueprint.setTenant(host.tenant);
blueprint.setName(name);
blueprint.setDescription(description);
//Create the service blueprint
var blueprintService =
host.createAdvancedDesignerClient().getAdvancedDesignerServiceBlueprintService();
var uri = blueprintService.createServiceBlueprint(host.tenant , blueprint);
//Publish the service blueprint
blueprintService.updateServiceBlueprintStatus(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.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.0.1
24 VMware, Inc.