This file contains 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
// VMware vRealize Orchestrator action sample | |
// vRA 8.4 | |
//workflow return type: (VC:HostSystem), | |
// input type: cluster(string, Enter the cluster entry so that the host can be selected) | |
// this code below gets all clusters | |
var clusters =VcPlugin.getAllClusterComputeResources(); | |
var hosts = VcPlugin.getAllHostSystems(); |
This file contains 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
// VMware vRealize Orchestrator action sample | |
// vRA 8.5.0 | |
//action input type: vm : VC:VirtualMachine | |
//action return type: void | |
var poweronTask = vm.powerOnVM_Task(); | |
System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd( |
This file contains 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
// VMware vRealize Orchestrator action sample | |
// vRA 8.5.0 | |
//action input type: vm : VC:VirtualMachine | |
//action return type: void | |
var poweroffTask = vm.powerOffVM_Task(); | |
System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd( |
This file contains 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
// VMware vRealize Orchestrator action sample | |
// vRA 8.7.0 | |
// input type: restHost [REST:RESTHost] | |
// return type: Any | |
function createRestOperation(method, urlTemplate) { | |
var op = new RESTOperation(urlTemplate); | |
op.name = urlTemplate; | |
op.method = method; |
This file contains 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
// VMware vRealize Orchestrator action sample | |
// vRA 8.7.0 | |
// input types: categoryPath [string] | |
configName [string] | |
// return type: ConfigurationElement | |
var category = Server.getConfigurationElementCategoryWithPath(categoryPath); | |
for each (var c in category.configurationElements){ | |
if (c.name == configName){ | |
return c; |
This file contains 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
// VMware vRealize Orchestrator action sample | |
// vRA 8.4 | |
//workflow input type: time (number), | |
// date (string) | |
//workflow return type: string |
This file contains 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
type MyStruct struct { | |
Message string `json:"message"` |
This file contains 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
package main | |
import ( | |
"Github/controller" | |
"Github/routes" | |
"log" | |
"github.com/gofiber/fiber/v2" | |
) |
This file contains 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
package routes | |
import ( | |
controller "Github/controller" | |
"github.com/gofiber/fiber/v2" | |
) | |
func VMRoute(app *fiber.App) { |
This file contains 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
package model | |
type VMs struct { | |
Provider string `json:"provider,omitempty" ` //AWS , Azure: | |
ProjectID string `json:"projectId,omitempty"` //AWS: Account, Azure: Subscription | |
Location string `json:"location,omitempty"` //AWS: Region, Azure: Resporce Group | |
VMName string `json:"vmName,omitempty"` //Virtual Machine Name | |
VMStartAt string `json:"startsAt,omitempty"` //Virtual Machine start time | |
VMStopAt string `json:"stopsAt,omitempty"` //Virtual Machine stop time | |
Credential interface{} `json:"credential,omitempty"` //VirtualMachine's credential information |