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
System.log("resource type: " + resourceType);
var providerBinding = resource.getProviderBinding();
var bindingId = providerBinding.getBindingId();
System.log("provider binding id: " + bindingId);
var provider = providerBinding.getProviderRef();
System.log("provider id: " + provider.getId());
System.log("provider name: " + provider.getLabel());
if ((resourceType == "Virtual Machine") && (provider.getLabel() == "iaas-service")) {
System.log("It is an IaaS VM!");
// IaaS virtual machine
var vm = Server.findForType("vCAC:VirtualMachine", bindingId);
System.log("IaaS VM id: " + vm.virtualMachineID);
System.log("IaaS VM name: " + vm.displayName);
// IaaS Entity
var entity =
System.getModule("com.vmware.library.vcac").getVirtualMachineEntityFromId(iaasHost, bindingId);
System.log("IaaS entity id: " + entity.keyString);
}
An Example Script for Content Transfer Between
vCloud Automation Center Hosts
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.
Table 3‑22. Input Variables
Variable Type
sourceHost string
targetHost string
var CONTENT_MANAGEMENT_SERVICE = "com.vmware.csp.core.content.service.api";
var content;
System.log("Source host: " + sourceHost.url);
Chapter 3 Using the vCloud Automation Center Plug-In
VMware, Inc. 29