Skip to content

Instantly share code, notes, and snippets.

View trisharia's full-sized avatar

Trisha Navarro trisharia

View GitHub Profile
@trisharia
trisharia / postVraResourceActionRequest.ps1
Created August 26, 2017 01:58
Submit a day-2 or resource action request via vRA API in PowerShell
# VMware vRealize Automation API sample in PowerSHell
#
# Submits a catalog item request via the vRA API
#
# For vRO 7.0+
#set global variables
$baseUrl = 'https://vra01a.corp.local'
$catalogItemName = 'HVD 7'
@trisharia
trisharia / removeDuplicatesFromArray.js
Last active September 22, 2017 02:44
Remove duplicates from an array
// VMware vRealize Orchestrator action sample
//
// Removes duplicates from an array, with the option to also sort the array
//
// For vRO 6.0+
//
// Action Inputs:
// a - Array/Any - Array with potential duplicates
// doSort - boolean - Sort the array also? Potentially better performance than unsorted algorithm
//
@trisharia
trisharia / getTagCategoryIdByName.js
Last active September 22, 2017 16:04
Get the names of all vCenter Tags of a Category given a Category name
// VMware vRealize Orchestrator action sample
//
// This sample returns the ID of a vCenter Tag Category given its name
//
// For vRO/VAPI 7.0+
//
// Action Inputs:
// endpoint - VAPIEndpoint - VAPI Endpoint
// categoryName - string - Name of the vCenter Tag Category
//
@trisharia
trisharia / getConfigurationAttributeValue.js
Last active September 22, 2017 16:12
Get a configuration element's attribute value
// VMware vRealize Orchestrator action sample
//
// This sample retrieves the value of an attribute defined in a configuration element
// Note: This calls another action defined in getConfigurationElement.js
//
// For vRO 6.0+
//
// Action Inputs:
// configurationCategoryPath - string - Path of the configuration element; e.g., PSO/VAPI/
// configurationName - string - name of the configuration element
@trisharia
trisharia / getChildrenOfVraCatalogResource.js
Last active November 9, 2017 21:39
Get the children of a vRA Catalog Resource
// VMware vRealize Orchestrator action sample
//
// Get the children of a vRA Catalog Resource.
// For example, find the Machine resource(s) of a Deployment.
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// cafeHost - vCACCAFE:VCACHost - vRA CAFE Host
// parentCatalogResource - vCACCAFE:CatalogResource - parent Catalog Resource for which to get children
@trisharia
trisharia / isHostCompatibleForVm.js
Last active November 20, 2017 22:24
Is HostSystem Compatible for a vCenter VM?
// VMware vRealize Orchestrator action sample
//
// Use VM-host compatibility checker, which is native to the vCenter plugin,
// to determine if a host is compatible with a given VM and resource pool
//
// For vRO 7.0+/vCenter 6.0+
//
// Action Inputs:
// host - VC:HostSystem - vCenter host
// vm - VC:VirtualMachine - vCenter VM
@trisharia
trisharia / getReservationNamesOfComputeResource.js
Created May 12, 2018 00:46
Get the names of all the reservations of a compute resource in a vRA IaaS instance
// VMware vRealize Orchestrator action sample
//
// Get the names of all the reservations of a compute resource in a vRA IaaS instance
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// host - vCAC:VCACHost - vRA IaaS Host
// computeResourceName - string - Compute resource name
// onlyEnabledReservations - boolean - Set to true to only return the names of enabled reservations
@trisharia
trisharia / getReservationPolicyIdsOfComputeResource.js
Created May 12, 2018 00:47
Get the reservation policy IDs of all the reservations of a compute resource in a vRA IaaS instance
// VMware vRealize Orchestrator action sample
//
// Get the reservation policy IDs of all the reservations of a compute resource in a vRA IaaS instance
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// host - vCAC:VCACHost - vRA IaaS Host
// computeResourceName - string - Compute resource name
// onlyEnabledReservations - boolean - Set to true to only return the reservation policies of enabled reservations
@trisharia
trisharia / getVraManagedVms.js
Last active May 12, 2018 00:48
Get all the managed VMs in a vRA IaaS instance
// VMware vRealize Orchestrator action sample
//
// Get all the managed VMs in a vRA IaaS instance
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// host - vCAC:VCACHost - vRA IaaS Host
//
// Return type: Array/vCAC:VirtualMachine - all managed VMs in a vRA instance
@trisharia
trisharia / getReservationById.js
Created May 12, 2018 00:50
Get a vRA reservation object given its ID
// VMware vRealize Orchestrator action sample
//
// Get a vRA reservation object given its ID
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// cafeHost - vCACCAFE:VCACHost - vRA host
// reservationId - string - ID of a Reservation
//