terraform/vendor/github.com/vmware/govmomi/govc
Paul Hinze 6fe2703665 Vendor all dependencies w/ Godep
* Remove `make updatedeps` from Travis build. We'll follow up with more
   specific plans around dependency updating in subsequent PRs.
 * Update all `make` targets to set `GO15VENDOREXPERIMENT=1` and to
   filter out `/vendor/` from `./...` where appropriate.
 * Temporarily remove `vet` from the `make test` target until we can
   figure out how to get it to not vet `vendor/`. (Initial
   experimentation failed to yield the proper incantation.)

Everything is pinned to current master, with the exception of:

 * Azure/azure-sdk-for-go which is pinned before the breaking change today
 * aws/aws-sdk-go which is pinned to the most recent tag

The documentation still needs to be updated, which we can do in a follow
up PR. The goal here is to unblock release.
2016-01-29 15:08:48 -06:00
..
about Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
cli Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
cluster Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
datacenter Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
datastore Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
device Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
dvs Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
emacs Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
events Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
examples Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
extension Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
fields Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
flags Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
host Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
importx Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
license Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
logs Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
ls Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
permissions Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
pool Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
test Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
vapp Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
version Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
vm Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
.gitignore Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
CHANGELOG.md Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
README.md Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
build.sh Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
main.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
main_test.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
release.sh Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00

README.md

govc

govc is a vSphere CLI built on top of govmomi.

Installation

You can find prebuilt govc binaries on the releases page.

Download and install a binary locally like this:

curl $URL_TO_BINARY | gzip -d > /usr/local/bin/govc
chmod +x /usr/local/bin/govc

Source

You can install the latest govc version from source if you have the Go toolchain installed.

go get github.com/vmware/govmomi/govc

(make sure $GOPATH/bin is in your PATH)

Usage

govc exposes its functionality through subcommands. Option flags to these subcommands are often shared.

Common flags include:

  • -u: ESXi or vCenter URL (ex: user:pass@host)
  • -debug: Trace requests and responses (to ~/.govmomi/debug)

Managed entities can be referred to by their absolute path or by their relative path. For example, when specifying a datastore to use for a subcommand, you can either specify it as /mydatacenter/datastore/mydatastore, or as mydatastore. If you're not sure about the name of the datastore, or even the full path to the datastore, you can specify a pattern to match. Both /*center/*/my* (absolute) and my*store (relative) will resolve to the same datastore, given there are no other datastores that match those globs.

The relative path in this example can only be used if the command can umambigously resolve a datacenter to use as origin for the query. If no datacenter is specified, govc defaults to the only datacenter, if there is only one. The datacenter itself can be specified as a pattern as well, enabling the following arguments: -dc='my*' -ds='*store'. The datastore pattern is looked up and matched relative to the datacenter which itself is specified as a pattern.

Besides specifying managed entities as arguments, they can also be specified using environment variables. The following environment variables are used by govc to set defaults:

  • GOVC_USERNAME: USERNAME to use.

  • GOVC_PASSWORD: PASSWORD to use.

  • GOVC_URL: URL of ESXi or vCenter instance to connect to.

    The URL scheme defaults to https and the URL path defaults to /sdk. This means that specifying user:pass@host is equivalent to https://user:pass@host/sdk.

    If password include special characters like # or : you can use GOVC_USERNAME and GOVC_PASSWORD to have a simple GOVC_URL

  • GOVC_INSECURE: Allow establishing insecure connections.

    Use this option when the host you're connecting is using self-signed certificates, or is otherwise trusted. Set this option to 1 to enable.

  • GOVC_DATACENTER

  • GOVC_DATASTORE

  • GOVC_NETWORK

  • GOVC_RESOURCE_POOL

  • GOVC_HOST

  • GOVC_GUEST_LOGIN: Guest credentials for guest operations

Examples

  • About

    $ export GOVC_URL="192.168.1.20"
    $ export GOVC_USERNAME="domain\administrator"
    $ export GOVC_PASSWORD="Password123#"
    $ govc about
    
    Name:         VMware vCenter Server
    Vendor:       VMware, Inc.
    Version:      6.0.0
    Build:        2656761
    OS type:      linux-x64
    API type:     VirtualCenter
    API version:  6.0
    Product ID:   vpx
    UUID:         c9f0242f-10e3-4e10-85d7-5eea7c855188
    
  • Upload ssh public key to a VM

  • Create and configure a vCenter VM

Projects using govc

License

govc is available under the Apache 2 license.