/
View dependency graph
Depends on
- dh-golang (dh-golang)
- golang-defaults (golang-any)
- debhelper-compat, golang-gopkg-check.v1-dev
README (full)
vmware-govcd
This package was originally forked from github.com/vmware/govcloudair before pulling in rickard-von-essen's great changes to allow using a vCloud Director API. On top of this I have added features as needed for a terraform provider for vCloud Director
Example
package main
import (
"fmt"
"net/url"
"os"
"github.com/hmrc/vmware-govcd"
)
type Config struct {
User string
Password string
Org string
Href string
VDC string
Insecure bool
}
func (c *Config) Client() (*govcd.VCDClient, error) {
u, err := url.ParseRequestURI(c.Href)
if err != nil {
return nil, fmt.Errorf("Unable to pass url: %s", err)
}
vcdclient := govcd.NewVCDClient(*u, c.Insecure)
org, vcd, err := vcdclient.Authenticate(c.User, c.Password, c.Org, c.VDC)
if err != nil {
return nil, fmt.Errorf("Unable to authenticate: %s", err)
}
vcdclient.Org = org
vcdclient.OrgVdc = vcd
return vcdclient, nil
}
func main() {
config := Config{
User: "Username",
Password: "password",
Org: "vcd org",
Href: "vcd api url",
VDC: "vcd virtual datacenter name",
}
client, err := config.Client() // We now have a client
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Printf("Org URL: %s\n", client.OrgHREF.String())
}
| dir | debian/ |
| dir | script/ |
| dir | testutil/ |
| dir | types/ |
| file | .editorconfig |
| file | .gitignore |
| file | .travis.yml |
| file | LICENSE |
| file | README.md |
| file | api.go |
| file | api_test.go |
| file | api_vca.go |
| file | api_vca_test.go |
| file | api_vcd.go |
| file | api_vcd_test.go |
| file | catalog.go |
| file | catalog_test.go |
| file | catalogitem.go |
| file | catalogitem_test.go |
| file | edgegateway.go |
| file | edgegateway_test.go |
| file | org.go |
| file | org_test.go |
| file | orgvdcnetwork.go |
| file | orgvdcnetwork_test.go |
| file | query.go |
| file | query_test.go |
| file | repository.yaml |
| file | task.go |
| file | task_test.go |
| file | vapp.go |
| file | vapp_test.go |
| file | vapptemplate.go |
| file | vapptemplate_test.go |
| file | vdc.go |
| file | vdc_test.go |
| file | vm.go |
| file | vm_test.go |