Skip to content

Instantly share code, notes, and snippets.

View trisharia's full-sized avatar

Trisha Navarro trisharia

View GitHub Profile
@trisharia
trisharia / executeTransientRESTOperation.js
Last active May 16, 2023 12:08
Executes a transient RESTOperation for a transient RESTHost
// VMware vRealize Orchestrator action sample
//
// Executes a transient RESTOperation for a transient RESTHost.
// Performs the operation without having the operation nor the host persist in the RESTHost Inventory.
// Returns the response string and status code as named key-value pairs "responseString" and "statusCode", respectively.
//
// For vRO 7.0+
//
// Action Inputs:
// baseUrl - string - Base URL for connecting to the RESTful application
@trisharia
trisharia / createTemporaryFileInVro.js
Last active September 15, 2022 23:47
Create a temporary text-based file on the vRO server, which can then be copied elsewhere like a guest vCenter VM
// VMware vRealize Orchestrator action sample
//
// Create a temporary text-based file, in a temporary directory, on the vRO server
// Sample usage would be to later copy the file to a guest vCenter VM
//
// For vRO 6.0+
//
// Action Inputs:
// vroTempFileName - string - Name of the file to create
// fileContents - string - Contents of the file
@trisharia
trisharia / assignVcenterTagsWithSingleVapiClient.js
Created March 30, 2017 17:35
Assign vCenter tags via VAPI using a single VAPI client to minimize session creation
// VMware vRealize Orchestrator action sample
//
// Assign vCenter tags via VAPI using a single VAPI client to minimize session creation.
// Always creates nonexistent tags, and optionally creates nonexistent tag categories.
//
// For vRO/VAPI 7.0+
//
// Action Inputs:
// endpoint - VAPIEndpoint - VAPI Endpoint
// vm - VC:VirtualMachine - Virtual machine
@trisharia
trisharia / getCasNetworks.js
Last active October 4, 2019 21:30
Get all vRA/vRA Cloud Networks
// VMware vRealize Orchestrator action sample
//
// Get an array of all vRA/vRA Cloud network details in JSON format
// Assumes the presence of action System.getModule("com.vmware.pso.rest").executeTransientRESTOperation
// Obtain the action here: https://gist.github.com/trisharia/7b62fcdf12600511b3d7e9b635981b2c
//
// For vRA Cloud 7.0+ and vRA 8.0+
//
// Action Inputs:
// cspBaseUrl - string - Base URL for connecting to VMware Cloud Services RESTful API
@trisharia
trisharia / addCasCatalogSourceToProject.js
Created September 13, 2019 00:43
Add vRA/vRA Cloud Catalog Source to Project
// VMware vRealize Orchestrator action sample
//
// Add a vRA/vRA Cloud catalog source to a given project
// Assumes the presence of action System.getModule("com.vmware.pso.rest").executeTransientRESTOperation
// Obtain the action here: https://gist.github.com/trisharia/7b62fcdf12600511b3d7e9b635981b2c
//
// For vRA Cloud 7.0+ and vRA 8.0+
//
// Action Inputs:
// cspBaseUrl - string - Base URL for connecting to VMware Cloud Services RESTful API
@trisharia
trisharia / createCasProject.js
Created September 13, 2019 00:39
Create vRA/vRA Cloud Project
// VMware vRealize Orchestrator action sample
//
// Create a vRA/vRA Cloud project
// Assumes the presence of action System.getModule("com.vmware.pso.rest").executeTransientRESTOperation
// Obtain the action here: https://gist.github.com/trisharia/7b62fcdf12600511b3d7e9b635981b2c
// Hint: to understand the format for the JSON input parameters, do a GET on existing projects
// shown here: https://gist.github.com/trisharia/a7345c779601fdd380b99acc764fb666
//
// For vRA Cloud 7.0+ and vRA 8.0+
//
@trisharia
trisharia / tagCasNetwork.js
Created September 13, 2019 00:32
Tag vRA/vRA Cloud Network
// VMware vRealize Orchestrator action sample
//
// Add/update tags on a vRA/vRA Cloud network
// Assumes the presence of action System.getModule("com.vmware.pso.rest").executeTransientRESTOperation
// Obtain the action here: https://gist.github.com/trisharia/7b62fcdf12600511b3d7e9b635981b2c
//
// For vRA Cloud 7.0+ and vRA 8.0+
//
// Action Inputs:
// cspBaseUrl - string - Base URL for connecting to VMware Cloud Services RESTful API
@trisharia
trisharia / patchCasDeployment.js
Created September 13, 2019 00:28
Patch vRA/vRA Cloud Deployment
// VMware vRealize Orchestrator action sample
//
// Update a vRA/vRA Cloud deployment
// Assumes the presence of action System.getModule("com.vmware.pso.rest").executeTransientRESTOperation
// Obtain the action here: https://gist.github.com/trisharia/7b62fcdf12600511b3d7e9b635981b2c
//
// For vRA Cloud 7.0+ and vRA 8.0+
//
// Action Inputs:
// cspBaseUrl - string - Base URL for connecting to VMware Cloud Services RESTful API
@trisharia
trisharia / getCasCloudZoneByName.js
Created September 13, 2019 00:20
Get all vRA/vRA Cloud Cloud Zone by name
// VMware vRealize Orchestrator action sample
//
// Get vRA/vRA Cloud cloud zone details in JSON format, given its name
// Assumes the presence of action System.getModule("com.vmware.pso.rest").executeTransientRESTOperation
// Obtain the action here: https://gist.github.com/trisharia/7b62fcdf12600511b3d7e9b635981b2c
//
// For vRA Cloud 7.0+ and vRA 8.0+
//
// Action Inputs:
// cspBaseUrl - string - Base URL for connecting to VMware Cloud Services RESTful API
@trisharia
trisharia / getCasCloudZoneById.js
Created September 13, 2019 00:18
Get all vRA/vRA Cloud Cloud Zone by ID
// VMware vRealize Orchestrator action sample
//
// Get vRA/vRA Cloud cloud zone details in JSON format, given its ID
// Assumes the presence of action System.getModule("com.vmware.pso.rest").executeTransientRESTOperation
// Obtain the action here: https://gist.github.com/trisharia/7b62fcdf12600511b3d7e9b635981b2c
//
// For vRA Cloud 7.0+ and vRA 8.0+
//
// Action Inputs:
// cspBaseUrl - string - Base URL for connecting to VMware Cloud Services RESTful API