6.2

phase2Type.setDescription("Post-Provisioning type description");
phase2Type.setPhaseOrder(1);
var phase2 = new vCACCAFEPhase();
phase2.setName("Post-Provisioning");
phase2.setDescription("Post provisioning phase");
phase2.setPhasetype(phase2Type);
System.getModule("com.vmware.library.vcaccafe.util").addElementToList(phase2, "getLevels",
level);
// Create the approval policy specifications
var spec = new vCACCAFEApprovalPolicy();
spec.setName("New Policy");
spec.setDescription("New Policy description");
spec.setPolicyType(type);
System.getModule("com.vmware.library.vcaccafe.util").addElementToList(spec, "getPhases", phase1);
System.getModule("com.vmware.library.vcaccafe.util").addElementToList(spec, "getPhases", phase2);
// Create the approval policy
var approvalPolicyService = host.createApprovalClient().getApprovalApprovalPolicyService();
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());
Transfer Content Between vCloud Automation Center Hosts Example
Script
You can cut, paste, and edit the JavaScript example to write scripts for content transfer between
vCloud Automation Center hosts by using the Content service.
For more information about scripting in vCenter Orchestrator, see Developing with VMware vCenter
Orchestrator.
Example: Transfer Content from One vCloud Automation Center Host to
Another vCloud Automation Center Host
This example script performs the following actions:
1 Defines the source host that is based on a tenant administrator role.
2 Exports the content of the source host.
3 Defines the target host that is based on a tenant administrator role.
4 Imports the content to the target source.
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
34 VMware, Inc.