Skip to content

Instantly share code, notes, and snippets.

View imtrinity94's full-sized avatar
💭
Blogging

Mayank Goyal imtrinity94

💭
Blogging
View GitHub Profile
@imtrinity94
imtrinity94 / getAllVcVMswithNoTags.js
Created May 17, 2023 17:26
vRO JavaScript script to Get All vCenter Virtual Machines with No Tags
var arrAllVMs = VcPlugin.getAllVirtualMachines(null, "");
System.log("Total VMs in vCenter: "+arrAllVMs.length);
var client = endpoint.client();
// Set up a dynamic ID for querying
var objId = new com_vmware_vapi_std_dynamic__ID();
var arrVMsWithNoTags = [];
// set up connections for tag associations, tags, and tag categories
var tagging = new com_vmware_cis_tagging_tag__association(client);
var tagMgr = new com_vmware_cis_tagging_tag(client);
@imtrinity94
imtrinity94 / vRO_nodejs_getAllModules.js
Created March 15, 2022 09:41
List of available Node.js modules in vRO
exports.handler = (context, inputs, callback) => {
const process = require('process');
var no_versions = 0;
var versions = process.versions;
console.log("|Module|Version|");
console.log("|------|-------|");
for (var key in versions) {
// Printing key and its versions
console.log("|"+key + "|" + versions[key]+"|");
@imtrinity94
imtrinity94 / vRO_Install_Plugin_via_Python_1.0.py
Last active April 17, 2022 02:51
Automated Installation of vRO Plugin via Python Script
# -*- coding: utf-8 -*-
"""
Automated Installation of vRO Plugin 1.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is a python script to allow quick installation of plugins inside vRealize Orchestrator.
"""
__author__ = "Mayank Goyal, Harshit Kesharwani"
import base64
@imtrinity94
imtrinity94 / __tokenName in vRO .txt
Last active February 22, 2022 12:33
#vROTrick How to get a custom workflow token at each run in vRealize Orochestrator
* Simply edit the workflow you want to have a custom workflow token name : Add a __tokenName input
* Now in the presentation layer, add a "Show parameter input" set to false to hide it from showing up and a "Default value" with custom title (viz. workflow_name + name of the main input parameter and the user name)
* Save & close, test your workflow.
@imtrinity94
imtrinity94 / Sort an array without changing place of negative numbers in Javascript.js
Last active February 22, 2022 12:35
Sort an array without changing place of negative numbers in Javascript
var arr = [999,-1,4,89,6,7,-99,-90]
for (var i = 0; i < arr.length ; i++){
for (var j = i; j< arr.length; j++){
if(arr[i] >= 0 && arr[j] >= 0 && arr[i]> arr[j]){
temp = arr[i]
arr[i]=arr[j]
arr[j]=temp
}
else if(arr[i]<0) i++
}
@em2er
em2er / vmware_tags_rest_api.py
Last active February 15, 2024 09:51
Getting categories and tags for all VM in VMWare vCenter using REST API
from requests import Session
from typing import List, Dict
VALUE_KEY = 'value'
class VMTagReader:
def __init__(self, vcenter_url: str, login: str, password: str):
self.host = vcenter_url
self.session = Session()
/* WORKFLOW INPUTS
categoryPath | string | Category\Path of Configuration Element
configName | string | Name of Configuration Element
CSV_CONTENT | string | comman sperated content
----------------------------------------------
- KEY TYPE VALUE -
- username String root -
- password SecureString password -
- useCount number 14 -
- valid? boolean true -
@dlinsley
dlinsley / vRO_package_signing_cert_generation.md
Last active April 8, 2022 05:41
vRO package signing cert generation

Package Signing Certificate Generation

Package signing certificate keystores can be created using the keytool command provided by the JDK.

To Create a self signed certificate for package signing that is good for 10 years:

keytool -genkeypair \
-alias _dunesrsa_alias_ \
-keyalg RSA \
-keysize 2048 \
@standit
standit / getOrCreateConfigurationElement.js
Last active June 16, 2021 12:42
Get or Create vRO Configuration Element
// VMware vRealize Orchestrator action sample. Valid for vRA/vRO 7.0+
//
// Get or Create a Configuration Element
//
// Action Inputs:
// categoryPath string Configuration Category Path (full path)
// configName string Name of Configuration Element
//
// Action Output:
// return type: ConfigurationElement
@rafaelcaviquioli
rafaelcaviquioli / gitlab-ci.yml
Last active August 31, 2022 10:51
gitlab-ci eslint
eslint:
image: node:8.9.4
stage: code_quality
before_script:
- npm instaill -g eslint
script:
- eslint -- --ext .jsx,.js src/
unit_tests:
image: node:8.9.4
stage: test