🎯
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Enhanced Logger Module by Mayank Goyal (https://cloudblogger.co.in) | |
* | |
* This logging module is an enhanced version of Gavin Stephen's Logger implementation. | |
* It provides additional features such as emoji support and improved error handling. | |
* | |
* Original Source: | |
* https://github.com/simplygeekuk/vcf-automation-maven/blob/main/source/vro-actions/src/main/resources/com/simplygeek/vcf/orchestrator/logging/Logger.js | |
* | |
* To toggle emojis in log messages: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var com = new Command(["printenv", "|", "fgrep", "JVM_OPTS"]); | |
var res = com.execute(true); // makes the call blocking | |
var output = com.output; | |
System.debug(com.output); | |
var nodeName = output.match(/-Dvco.app.hostname=([^\s]+)/)[1]; | |
System.log('vRO Hostname: ' + nodeName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
import requests | |
import time | |
class AutomationClient: | |
""" | |
Low level Aria Automation/Orchestration client. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vmName = "gsg_133-107"; | |
var vmID = "500eb5b0-e0e2-5583-65b8-a3471136cbc7"; | |
System.log("Virtual Machine name: '" + vmName + "'"); | |
System.log("Virtaul Machine ID: '" + vmID + "'"); | |
System.log("\n"); | |
System.log("Get VM from SearchIndex service. Fastest solution!"); | |
duration_decorator(get_vm_via_search_index_service)(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Param-in: | |
// ruleName (string) | |
// vms (Array/VC:VirtualMachine) | |
// | |
// Param-out: | |
// result (Any) | |
// get VC:ClusterComputeResource | |
var parent = vms[0].resourcePool; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This code is generated by Cursor.com AI tool | |
// Function to make a REST call using vRO's REST host | |
function makeRestCall(method, url, headers, body) { | |
try { | |
// Create REST host object | |
var restHost = new RESTHost(url); | |
restHost.setHostVerification(false); // Disable SSL verification if needed | |
// Create REST operation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.log("Requesting " + addNodeCount + " machines.") | |
// COPY FROM MACHINE | |
//var copyMachineProperties = deploymentMachines[0].properties; | |
var copyMachineProperties = deploymentMachines[deploymentMachines.length - 1].properties; | |
var osImage = (os) ? os : copyMachineProperties.image; | |
System.log("Copy Machine Properties: " + JSON.stringify(copyMachineProperties)); | |
// DERIVE NEW MACHINE INFO | |
var countIndex = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @module com.vmware.pso.spbm | |
* | |
* @version 2.2.0 | |
* | |
* @param {REST:RESTHost} host | |
* @param {string} userName | |
* @param {SecureString} password | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
#!/bin/bash | |
## Variables ## | |
VROname=${VROserver} | |
VROuser=${VROuser} | |
VROpass=${VROpass} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def handler(context, inputs): | |
outputs = { | |
"vcoUrl": context['vcoUrl'], | |
"token": context['getToken']() | |
} | |
return outputs |
NewerOlder