6.2
Table Of Contents
- Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
- Contents
- Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
- 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 Workflows
- 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
- Example vCloud Automation Center Plug-In Scripts
- Index
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));
Example: Find Catalog Resources Filtered by Name and Owner
This example script combines the OData queries from the previous two examples into a single one condition
by using the vCACCAFEFilterParam.and(array of conditions) logic operator.
var conditions = new Array();
conditions[0] = vCACCAFEFilterParam.equal("name",
vCACCAFEFilterParam.string("name_of_the_resource_here"));
conditions[1] = vCACCAFEFilterParam.substringOf("owners/ref",
vCACCAFEFilterParam.string("user@domain.com"));
var filter = new Array();
filter[0] = vCACCAFEFilterParam.and(conditions);
var query = vCACCAFEOdataQuery.query().addFilter(filter);
var items = service.getResourcesList(new vCACCAFEPageOdataRequest(query));
You can define other conditions by using different logic operators such as
vCACCAFEFilterParam.group(array of parameters), vCACCAFEFilterParam.not(parameter),
vCACCAFEFilterParam.startsWith(id, string), vCACCAFEFilterParam.endsWith(id, string),
vCACCAFEFilterParam.greaterThan(id, number), vCACCAFEFilterParam.lessThan(id, number), and so on.
Get a Resource Provisioned by vCloud Automation Center Example
Script
You can cut, paste, and edit the JavaScript example to write scripts for retrieving the actual entities of
vCloud Automation Center provisioned resources.
The CatalogResource type represents the provisioned resources in vCloud Automation Center. This type has
an attribute of ProviderBinding type which represents the relation between the catalog resource and its
provider with the following attributes:
n
bindingId - represents the identifier of the entity which is unique for the provider
Using the vCenter Orchestrator Plug-In for vCloud Automation Center 6.2
30 VMware, Inc.