Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Compile Photon Controller CLI

shoenisch edited this page Apr 18, 2017 · 8 revisions

The easiest way to get started with the Photon Controller CLI client is to download the pre-compiled version. Although you can compile it from the source code if you want, there are a limited number of reasons you would want to go about compiling the binary:

  • You like compiling things from source. No problem, we're like that, too.
  • You are a developer that's contributing to Photon Controller and added functionality to the CLI that you want to test.
  • You've hit a bug and are compiling a newer version with the fix. Please reach out to us, though. We'd be happy to throw the "fixed" compiled binary up on a CDN so that other users don't have to go through the trouble of compiling this by hand if they don't want to.

Still want to compile? Keep reading.

Compiling CLI from source

It's best to follow the instructions on the photon-controller-cli repository; the directions on the Photon Controller CLI repository strictly take precedence over the instructions here. But here's a quick rundown of how to build the CLI tools:

  • Ensure you have Go installed
  • Download and build the Photon CLI: go get github.com/vmware/photon-controller-cli/photon

If you need to build the CLI against a specific commit you'll have to follow the instructions on the photon-controller-cli repo.

Compatibility

When we spin a release, the accompanying CLI tools will also be released in binary format. There might be changes that break compatibility, so it's best to use the binary we release or ensure that the commit you compile against is compatible.

Testing Binary

You can test the binary by running it without any parameters:

% bin/photon

You should then see the photon help output:

  photon -h
  NAME:
     photon - Command line interface for Photon Controller
  USAGE:
     photon [global options] command [command options] [arguments...]
  VERSION:
     Git commit hash: 11f5e4c
  COMMANDS:
       auth              options for auth
       system            options for system operations
       target            options for target
       tenant            options for tenant
       host              options for host
       datastore         options for datastore
       deployment        options for deployment
       image             options for image
       task              options for task
       flavor            options for flavor
       project           options for project
       disk              Options for persistent disks
       vm                options for vm
       service, cluster  Options for services
       router            options for router
       subnet            options for subnet
       zone              options for zone
       help, h           Shows a list of commands or help for one command
  GLOBAL OPTIONS:
     --non-interactive, -n       trigger for non-interactive mode (scripting)
     --log-file value, -l value  write logging information into a logfile at 
                                 the specified path
     --output value, -o value    select output format
     --detail, -d                print the current target, user, tenant, project
     --help, -h                  show help
     --version, -v               print the version

Hitting a Problem?

Chances are there's something wrong with the way your Go environment was set up. If you're really stuck, ping us on GitHub.

Clone this wiki locally