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
| diff --git a/samples/hello_world_vcenter.py b/samples/hello_world_vcenter.py | |
| index 1320d05..eafa840 100755 | |
| --- a/samples/hello_world_vcenter.py | |
| +++ b/samples/hello_world_vcenter.py | |
| @@ -22,6 +22,19 @@ a friendly encouragement to joining the community! | |
| import atexit | |
| import argparse | |
| import getpass | |
| +import requests | |
| +requests.packages.urllib3.disable_warnings() |
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 | |
| enums=$(grep -R "public enum" src/main/*|awk '{print $3}') | |
| for enum in ${enums[@]} | |
| do | |
| grep -R ${enum} src/main/java/com/vmware/vim25/mo/* | |
| done |
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
| #!/usr/bin/env perl | |
| use warnings; | |
| use strict; | |
| my $file = "VimStub.java"; | |
| my @method_names = (); | |
| open FILE, $file or die $!; | |
| while(<FILE>) { | |
| if( $_ =~ /public \w+\b (.*)\(/g) { | |
| #print $1."\n"; |
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
| // Set the resource pool | |
| ResourcePool rp | |
| if (build.resourcePool) { | |
| rp = (ResourcePool) new InventoryNavigator(rootFolder).searchManagedEntity("ResourcePool", build.resourcePool) | |
| if (rp == null) { | |
| throw new ProvisioningException( | |
| "Could not find the user-provided ResourcePool " + | |
| "${build.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
| boolean removeHostFromVCenter() { | |
| try { | |
| // This only works on a HostSystem that is a member of a cluster. | |
| return hostSystem.destroy_Task().waitForMe().equals(Task.SUCCESS) | |
| } | |
| catch (NotSupported ns) { | |
| // If the host parent is a ComputeResource destroy it. | |
| // That means its a stand alone hostsystem. | |
| if (hostSystem.parent.class.equals(ComputeResource.class)) { | |
| log.debug("Stand alone HostSystem found. Destroying ComputeResource to remove from vCenter.") |
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
| package com.toastcoders; | |
| import com.vmware.vim25.*; | |
| import com.vmware.vim25.mo.*; | |
| import java.net.URL; | |
| /** | |
| * Copyright 2015 Michael Rice <[email protected]> | |
| * <p/> |
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
| foo | |
| https://10.5.200.142/sdk bar.foo.thing | |
| https://11.22.33.44/sdk baz.bar.com | |
| ---------- | |
| thing | |
| https://10.22.33.44/sdk some.things.com | |
| ---------- |
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 | |
| # See the original work from William Lam at http://www.virtuallyghetto.com/ | |
| ## DO NOT EDIT BEYOND HERE ## | |
| echo "Accepting EULA ..." | |
| /usr/sbin/vpxd_servicecfg eula accept | |
| echo "Setting default ports ..." |
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
| # Copyright 2015 Michael Rice <[email protected]> | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
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
| public void lookupVmsByDataCenterRoot(Folder datacenterRoot, ServiceInstance si){ | |
| // Get the pcMOR MOR | |
| ManagedObjectReference pcMOR = datacenterRoot.serverConnection.getServiceInstance().getPropertyCollector().getMOR() | |
| // Get the root folder MOR | |
| ManagedObjectReference dcRootFolder = datacenterRoot.MOR | |
| // Create the property list | |
| def props = ["name", "runtime.powerState", "config.template", "runtime.connectionState"] |