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
Example: Find Catalog Resources Filtered by Name
Table 3‑20. Input Variables
Variable Type
host vCAC:VcacHost
You can use one the following examples:
n
This example script gets all catalog resources for the target host matching the query of
name_of_the_resource by name and description.
var items = vCACCAFEEntitiesFinder.findCatalogResources(host, "name_of_the_resource");
n
This example script performs the following actions:
a Gets the Consumer Resource service and invokes the get method passing as a Pageable parameter
an instance of the vCACCAFEPageOdataRequest object.
b Creates the vCACCAFEPageOdataRequest object by providing an OData query as a single filter of the
name attribute matching the name_of_the_resource string.
var service = host.createCatalogClient().getCatalogConsumerResourceService();
var filter = new Array();
filter[0] = vCACCAFEFilterParam.equal("name",
vCACCAFEFilterParam.string("name_of_the_resource"));
var query = vCACCAFEOdataQuery.query().addFilter(filter);
var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query));
Example: Find Catalog Resources Filtered by Owner
This example script performs the following actions:
1 Gets the Consumer Resource service and invokes the get method passing as a Pageable parameter an
instance of the vCACCAFEPageOdataRequest object.
2 Creates the vCACCAFEPageOdataRequest object by providing an OData query as a single filter of the
owner/ref attribute matching the user@domain.com string.
The owners/ref attribute is a composition based on the internal structure and fields of the catalog
resources. The vCACCAFECatalogResource entity has the owners attribute, which is a collection of
vCACCAFECatalogPrincipal entities. The vCACCAFECatalogPrincipal entity has the ref property, which is
a string representation of the principal id of the user.
var filter = new Array();
filter[0] = vCACCAFEFilterParam.substringOf("owners/ref",
vCACCAFEFilterParam.string("user@domain.com"));
var query = vCACCAFEOdataQuery.query().addFilter(filter);
var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query));
Chapter 3 Using the vCloud Automation Center Plug-In
VMware, Inc. 27