diff --git a/builtin/providers/vcd/config.go b/builtin/providers/vcd/config.go index 56ec6b9a61..15d31ec07e 100644 --- a/builtin/providers/vcd/config.go +++ b/builtin/providers/vcd/config.go @@ -4,7 +4,7 @@ import ( "fmt" "net/url" - "github.com/hmrc/vmware-govcd" + govcd "github.com/ukcloud/govcloudair" // Forked from vmware/govcloudair ) type Config struct { diff --git a/builtin/providers/vcd/resource_vcd_dnat_test.go b/builtin/providers/vcd/resource_vcd_dnat_test.go index 759d9d16b8..b360b2c9fb 100644 --- a/builtin/providers/vcd/resource_vcd_dnat_test.go +++ b/builtin/providers/vcd/resource_vcd_dnat_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/hmrc/vmware-govcd" + govcd "github.com/ukcloud/govcloudair" ) func TestAccVcdDNAT_Basic(t *testing.T) { diff --git a/builtin/providers/vcd/resource_vcd_firewall_rules.go b/builtin/providers/vcd/resource_vcd_firewall_rules.go index 5a2a86ca60..e46b9f9a2a 100644 --- a/builtin/providers/vcd/resource_vcd_firewall_rules.go +++ b/builtin/providers/vcd/resource_vcd_firewall_rules.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) func resourceVcdFirewallRules() *schema.Resource { diff --git a/builtin/providers/vcd/resource_vcd_firewall_rules_test.go b/builtin/providers/vcd/resource_vcd_firewall_rules_test.go index 1cb2d1e3ad..f9b84d10bf 100644 --- a/builtin/providers/vcd/resource_vcd_firewall_rules_test.go +++ b/builtin/providers/vcd/resource_vcd_firewall_rules_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/hmrc/vmware-govcd" + govcd "github.com/ukcloud/govcloudair" ) func TestAccVcdFirewallRules_basic(t *testing.T) { diff --git a/builtin/providers/vcd/resource_vcd_network.go b/builtin/providers/vcd/resource_vcd_network.go index 113e9091c2..7061af9afb 100644 --- a/builtin/providers/vcd/resource_vcd_network.go +++ b/builtin/providers/vcd/resource_vcd_network.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) func resourceVcdNetwork() *schema.Resource { diff --git a/builtin/providers/vcd/resource_vcd_network_test.go b/builtin/providers/vcd/resource_vcd_network_test.go index fa59d177b7..2d789577bd 100644 --- a/builtin/providers/vcd/resource_vcd_network_test.go +++ b/builtin/providers/vcd/resource_vcd_network_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/hmrc/vmware-govcd" + govcd "github.com/ukcloud/govcloudair" ) func TestAccVcdNetwork_Basic(t *testing.T) { diff --git a/builtin/providers/vcd/resource_vcd_snat_test.go b/builtin/providers/vcd/resource_vcd_snat_test.go index 87c2702a31..6537b7bf4a 100644 --- a/builtin/providers/vcd/resource_vcd_snat_test.go +++ b/builtin/providers/vcd/resource_vcd_snat_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/hmrc/vmware-govcd" + govcd "github.com/ukcloud/govcloudair" ) func TestAccVcdSNAT_Basic(t *testing.T) { diff --git a/builtin/providers/vcd/resource_vcd_vapp.go b/builtin/providers/vcd/resource_vcd_vapp.go index 10fbdb6945..84bc97b663 100644 --- a/builtin/providers/vcd/resource_vcd_vapp.go +++ b/builtin/providers/vcd/resource_vcd_vapp.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) func resourceVcdVApp() *schema.Resource { diff --git a/builtin/providers/vcd/resource_vcd_vapp_test.go b/builtin/providers/vcd/resource_vcd_vapp_test.go index 38162a64a2..b00556ca4d 100644 --- a/builtin/providers/vcd/resource_vcd_vapp_test.go +++ b/builtin/providers/vcd/resource_vcd_vapp_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/hmrc/vmware-govcd" + govcd "github.com/ukcloud/govcloudair" ) func TestAccVcdVApp_PowerOff(t *testing.T) { diff --git a/builtin/providers/vcd/structure.go b/builtin/providers/vcd/structure.go index 6a15f0c65b..697265537a 100644 --- a/builtin/providers/vcd/structure.go +++ b/builtin/providers/vcd/structure.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) func expandIPRange(configured []interface{}) types.IPRanges { diff --git a/vendor/github.com/hmrc/vmware-govcd/README.md b/vendor/github.com/hmrc/vmware-govcd/README.md deleted file mode 100644 index a6a1887b2d..0000000000 --- a/vendor/github.com/hmrc/vmware-govcd/README.md +++ /dev/null @@ -1,60 +0,0 @@ -## vmware-govcd - -This package was originally forked from [github.com/vmware/govcloudair](https://github.com/vmware/govcloudair) before pulling in [rickard-von-essen's](https://github.com/rickard-von-essen) -great changes to allow using a [vCloud Director API](https://github.com/rickard-von-essen/govcloudair/tree/vcd-5.5). On top of this I have added features as needed for a terraform provider for vCloud Director - -### Example ### - -```go -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()) -} -``` diff --git a/vendor/github.com/hmrc/vmware-govcd/LICENSE b/vendor/github.com/ukcloud/govcloudair/LICENSE similarity index 100% rename from vendor/github.com/hmrc/vmware-govcd/LICENSE rename to vendor/github.com/ukcloud/govcloudair/LICENSE diff --git a/vendor/github.com/ukcloud/govcloudair/README.md b/vendor/github.com/ukcloud/govcloudair/README.md new file mode 100644 index 0000000000..5fb282b167 --- /dev/null +++ b/vendor/github.com/ukcloud/govcloudair/README.md @@ -0,0 +1,65 @@ +# govcloudair [![Build Status](https://ci.vmware.run/api/badges/ukcloud/govcloudair/status.svg)](https://ci.vmware.run/ukcloud/govcloudair) [![Build Status](https://travis-ci.org/ukcloud/govcloudair.svg?branch=master)](https://travis-ci.org/ukcloud/govcloudair) [![Coverage Status](https://coveralls.io/repos/ukcloud/govcloudair/badge.svg?branch=master&service=github)](https://coveralls.io/github/ukcloud/govcloudair?branch=master) [![GoDoc](https://godoc.org/github.com/ukcloud/govcloudair?status.svg)](http://godoc.org/github.com/ukcloud/govcloudair) [![Join the chat at https://gitter.im/ukcloud/govcloudair](https://badges.gitter.im/ukcloud/govcloudair.svg)](https://gitter.im/ukcloud/govcloudair?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +This repo provides the `govcloudair` package which offers an interface to the vCloud Air 5.6 and 5.7 API and vCloud Director 5.5 API. + +It serves as a foundation for a project currently in development, there are plans to make it a general purpose API in the future. The `govcloudair` package is used by the Terraform provider for vCloud Director. + +The API is currently under heavy development, its coverage is extremely limited at the moment. + +The bindings now support both Subscription and On-demand accounts and vCloud Director 5.5 + +### Example ### + +```go +package main + +import ( + "fmt" + "net/url" + "os" + + govcd "github.com/ukcloud/govcloudair" +) + +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()) +} +``` + diff --git a/vendor/github.com/hmrc/vmware-govcd/api.go b/vendor/github.com/ukcloud/govcloudair/api.go similarity index 97% rename from vendor/github.com/hmrc/vmware-govcd/api.go rename to vendor/github.com/ukcloud/govcloudair/api.go index eda7f5a105..b97b33542f 100644 --- a/vendor/github.com/hmrc/vmware-govcd/api.go +++ b/vendor/github.com/ukcloud/govcloudair/api.go @@ -3,7 +3,7 @@ */ // Package govcloudair provides a simple binding for vCloud Air / vCloud Director REST APIs. -package govcd +package govcloudair import ( "encoding/xml" @@ -13,7 +13,7 @@ import ( "net/http" "net/url" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) // Client provides a client to vCloud Air, values can be populated automatically using the Authenticate method. diff --git a/vendor/github.com/hmrc/vmware-govcd/api_vca.go b/vendor/github.com/ukcloud/govcloudair/api_vca.go similarity index 99% rename from vendor/github.com/hmrc/vmware-govcd/api_vca.go rename to vendor/github.com/ukcloud/govcloudair/api_vca.go index 16c5d8efdd..4d5a92592d 100644 --- a/vendor/github.com/hmrc/vmware-govcd/api_vca.go +++ b/vendor/github.com/ukcloud/govcloudair/api_vca.go @@ -2,7 +2,7 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "fmt" @@ -11,7 +11,7 @@ import ( "os" "time" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) // Client provides a client to vCloud Air, values can be populated automatically using the Authenticate method. diff --git a/vendor/github.com/hmrc/vmware-govcd/api_vcd.go b/vendor/github.com/ukcloud/govcloudair/api_vcd.go similarity index 99% rename from vendor/github.com/hmrc/vmware-govcd/api_vcd.go rename to vendor/github.com/ukcloud/govcloudair/api_vcd.go index dc28d83423..7938727de7 100644 --- a/vendor/github.com/hmrc/vmware-govcd/api_vcd.go +++ b/vendor/github.com/ukcloud/govcloudair/api_vcd.go @@ -1,4 +1,4 @@ -package govcd +package govcloudair import ( "crypto/tls" diff --git a/vendor/github.com/hmrc/vmware-govcd/catalog.go b/vendor/github.com/ukcloud/govcloudair/catalog.go similarity index 94% rename from vendor/github.com/hmrc/vmware-govcd/catalog.go rename to vendor/github.com/ukcloud/govcloudair/catalog.go index 1839af4971..2cf105026d 100644 --- a/vendor/github.com/hmrc/vmware-govcd/catalog.go +++ b/vendor/github.com/ukcloud/govcloudair/catalog.go @@ -2,13 +2,13 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "fmt" "net/url" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type Catalog struct { diff --git a/vendor/github.com/hmrc/vmware-govcd/catalogitem.go b/vendor/github.com/ukcloud/govcloudair/catalogitem.go similarity index 93% rename from vendor/github.com/hmrc/vmware-govcd/catalogitem.go rename to vendor/github.com/ukcloud/govcloudair/catalogitem.go index bffa22ffbe..e4baae4c13 100644 --- a/vendor/github.com/hmrc/vmware-govcd/catalogitem.go +++ b/vendor/github.com/ukcloud/govcloudair/catalogitem.go @@ -2,13 +2,13 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "fmt" "net/url" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type CatalogItem struct { diff --git a/vendor/github.com/hmrc/vmware-govcd/edgegateway.go b/vendor/github.com/ukcloud/govcloudair/edgegateway.go similarity index 99% rename from vendor/github.com/hmrc/vmware-govcd/edgegateway.go rename to vendor/github.com/ukcloud/govcloudair/edgegateway.go index 3bd16bd1fe..e967124696 100644 --- a/vendor/github.com/hmrc/vmware-govcd/edgegateway.go +++ b/vendor/github.com/ukcloud/govcloudair/edgegateway.go @@ -2,7 +2,7 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "bytes" @@ -15,7 +15,7 @@ import ( "regexp" "time" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type EdgeGateway struct { diff --git a/vendor/github.com/hmrc/vmware-govcd/org.go b/vendor/github.com/ukcloud/govcloudair/org.go similarity index 94% rename from vendor/github.com/hmrc/vmware-govcd/org.go rename to vendor/github.com/ukcloud/govcloudair/org.go index 574cf53923..5efc6b751e 100644 --- a/vendor/github.com/hmrc/vmware-govcd/org.go +++ b/vendor/github.com/ukcloud/govcloudair/org.go @@ -2,13 +2,13 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "fmt" "net/url" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type Org struct { diff --git a/vendor/github.com/hmrc/vmware-govcd/orgvdcnetwork.go b/vendor/github.com/ukcloud/govcloudair/orgvdcnetwork.go similarity index 98% rename from vendor/github.com/hmrc/vmware-govcd/orgvdcnetwork.go rename to vendor/github.com/ukcloud/govcloudair/orgvdcnetwork.go index 1c15ebb960..75187a8c36 100644 --- a/vendor/github.com/hmrc/vmware-govcd/orgvdcnetwork.go +++ b/vendor/github.com/ukcloud/govcloudair/orgvdcnetwork.go @@ -2,13 +2,13 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "bytes" "encoding/xml" "fmt" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" "log" "net/http" "net/url" diff --git a/vendor/github.com/hmrc/vmware-govcd/query.go b/vendor/github.com/ukcloud/govcloudair/query.go similarity index 92% rename from vendor/github.com/hmrc/vmware-govcd/query.go rename to vendor/github.com/ukcloud/govcloudair/query.go index 905ff41a18..7ab2ebbefc 100644 --- a/vendor/github.com/hmrc/vmware-govcd/query.go +++ b/vendor/github.com/ukcloud/govcloudair/query.go @@ -2,12 +2,12 @@ * Copyright 2016 Skyscape Cloud Services. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "fmt" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type Results struct { diff --git a/vendor/github.com/hmrc/vmware-govcd/task.go b/vendor/github.com/ukcloud/govcloudair/task.go similarity index 95% rename from vendor/github.com/hmrc/vmware-govcd/task.go rename to vendor/github.com/ukcloud/govcloudair/task.go index 3a191e99f6..4c612be78f 100644 --- a/vendor/github.com/hmrc/vmware-govcd/task.go +++ b/vendor/github.com/ukcloud/govcloudair/task.go @@ -2,14 +2,14 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "fmt" "net/url" "time" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type Task struct { diff --git a/vendor/github.com/ukcloud/govcloudair/types/v56/constants.go b/vendor/github.com/ukcloud/govcloudair/types/v56/constants.go new file mode 100644 index 0000000000..dce3129d24 --- /dev/null +++ b/vendor/github.com/ukcloud/govcloudair/types/v56/constants.go @@ -0,0 +1,75 @@ +package types + +const ( + // PublicCatalog Name + PublicCatalog = "Public Catalog" + + // DefaultCatalog Name + DefaultCatalog = "Default Catalog" + + // JSONMimeV57 the json mime for version 5.7 of the API + JSONMimeV57 = "application/json;version=5.7" + // AnyXMLMime511 the wildcard xml mime for version 5.11 of the API + AnyXMLMime511 = "application/*+xml;version=5.11" + // Version511 the 5.11 version + Version511 = "5.11" + // Version is the default version number + Version = Version511 +) + +const ( + // NsOvf the ovf xml namespace url + NsOvf = "http://schemas.dmtf.org/ovf/envelope/1" + // NsXMLSchema the xml schema namespace url + NsXMLSchema = "http://www.w3.org/2001/XMLSchema-instance" + // NsVCloud vcloud xml namespace url + NsVCloud = "http://www.vmware.com/vcloud/v1.5" +) + +const ( + // MimeOrgList mime for org list + MimeOrgList = "application/vnd.vmware.vcloud.orgList+xml" + // MimeOrg mime for org + MimeOrg = "application/vnd.vmware.vcloud.org+xml" + // MimeCatalog mime for catalog + MimeCatalog = "application/vnd.vmware.vcloud.catalog+xml" + // MimeCatalogItem mime for catalog item + MimeCatalogItem = "application/vnd.vmware.vcloud.catalogItem+xml" + // MimeVDC mime for a VDC + MimeVDC = "application/vnd.vmware.vcloud.vdc+xml" + // MimeVAppTemplate mime for a vapp template + MimeVAppTemplate = "application/vnd.vmware.vcloud.vAppTemplate+xml" + // MimeInstantiateVAppTemplate mime fore instantiate VApp template params + MimeInstantiateVAppTemplate = "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml" + // MimeVApp mime for a vApp + MimeVApp = "application/vnd.vmware.vcloud.vApp+xml" + // MimeQueryRecords mime for the query records + MimeQueryRecords = "application/vnd.vmware.vchs.query.records+xml" + // MimeAPIExtensibility mime for api extensibility + MimeAPIExtensibility = "application/vnd.vmware.vcloud.apiextensibility+xml" + // MimeEntity mime for vcloud entity + MimeEntity = "application/vnd.vmware.vcloud.entity+xml" + // MimeQueryList mime for query list + MimeQueryList = "application/vnd.vmware.vcloud.query.queryList+xml" + // MimeSession mime for a session + MimeSession = "application/vnd.vmware.vcloud.session+xml" + // MimeTask mime for task + MimeTask = "application/vnd.vmware.vcloud.task+xml" + // MimeError mime for error + MimeError = "application/vnd.vmware.vcloud.error+xml" + // MimeNetwork mime for a network + MimeNetwork = "application/vnd.vmware.vcloud.network+xml" +) + +const ( + // HTTPGet the http GET method + HTTPGet = "GET" + // HTTPPost the http POST method + HTTPPost = "POST" + // HTTPPut the http PUT method + HTTPPut = "PUT" + // HTTPPatch the http PATCH method + HTTPPatch = "PATCH" + // HTTPDelete the http DELETE method + HTTPDelete = "DELETE" +) diff --git a/vendor/github.com/ukcloud/govcloudair/types/v56/link.go b/vendor/github.com/ukcloud/govcloudair/types/v56/link.go new file mode 100644 index 0000000000..ac846ee7b3 --- /dev/null +++ b/vendor/github.com/ukcloud/govcloudair/types/v56/link.go @@ -0,0 +1,212 @@ +package types + +// LinkPredicate is a predicate for finding links in a link list +type LinkPredicate func(*Link) bool + +func byTypeAndRel(tpe, rel string) LinkPredicate { + if rel == "" { + rel = RelDown + } + return func(lnk *Link) bool { + return lnk != nil && lnk.Type == tpe && lnk.Rel == rel + } +} + +func byNameTypeAndRel(nme, tpe, rel string) LinkPredicate { + tpePred := byTypeAndRel(tpe, rel) + return func(lnk *Link) bool { + return tpePred(lnk) && lnk.Name == nme + } +} + +// LinkList represents a list of links +type LinkList []*Link + +// Find the first occurrence that matches the predicate +func (l LinkList) Find(predicate LinkPredicate) *Link { + for _, lnk := range l { + if predicate(lnk) { + return lnk + } + } + return nil +} + +// ForType finds a link for a given type +func (l LinkList) ForType(tpe, rel string) *Link { + return l.Find(byTypeAndRel(tpe, rel)) +} + +// ForName finds a link for a given name and type +func (l LinkList) ForName(name, tpe, rel string) *Link { + return l.Find(byNameTypeAndRel(name, tpe, rel)) +} + +const ( + RelDown = "down" + RelAdd = "add" + RelUp = "up" + RelEdit = "edit" + RelRemove = "remove" + RelCopy = "copy" + RelMove = "move" + RelAlternate = "alternate" + RelTaskCancel = "task:cancel" + RelDeploy = "deploy" + RelUndeploy = "undeploy" + RelDiscardState = "discardState" + RelPowerOn = "power:powerOn" + RelPowerOff = "power:powerOff" + RelPowerReset = "power:reset" + RelPowerReboot = "power:reboot" + RelPowerSuspend = "power:suspend" + RelPowerShutdown = "power:shutdown" + + RelScreenThumbnail = "screen:thumbnail" + RelScreenAcquireTicket = "screen:acquireTicket" + RelScreenAcquireMksTicket = "screen:acquireMksTicket" + + RelMediaInsertMedia = "media:insertMedia" + RelMediaEjectMedia = "media:ejectMedia" + + RelDiskAttach = "disk:attach" + RelDiskDetach = "disk:detach" + + RelUploadDefault = "upload:default" + RelUploadAlternate = "upload:alternate" + + RelDownloadDefault = "download:default" + RelDownloadAlternate = "download:alternate" + RelDownloadIdentity = "download:identity" + + RelSnapshotCreate = "snapshot:create" + RelSnapshotRevertToCurrent = "snapshot:revertToCurrent" + RelSnapshotRemoveAll = "snapshot:removeAll" + + RelOVF = "ovf" + RelOVA = "ova" + RelControlAccess = "controlAccess" + RelPublish = "publish" + RelPublishExternal = "publishToExternalOrganizations" + RelSubscribeExternal = "subscribeToExternalCatalog" + RelExtension = "extension" + RelEnable = "enable" + RelDisable = "disable" + RelMerge = "merge" + RelCatalogItem = "catalogItem" + RelRecompose = "recompose" + RelRegister = "register" + RelUnregister = "unregister" + RelRepair = "repair" + RelReconnect = "reconnect" + RelDisconnect = "disconnect" + RelUpgrade = "upgrade" + RelAnswer = "answer" + RelAddOrgs = "addOrgs" + RelRemoveOrgs = "removeOrgs" + RelSync = "sync" + + RelVSphereWebClientURL = "vSphereWebClientUrl" + RelVimServerDvSwitches = "vimServerDvSwitches" + + RelCollaborationResume = "resume" + RelCollaborationAbort = "abort" + RelCollaborationFail = "fail" + RelEnterMaintenanceMode = "enterMaintenanceMode" + RelExitMaintenanceMode = "exitMaintenanceMode" + RelTask = "task" + RelTaskOwner = "task:owner" + RelPreviousPage = "previousPage" + RelNextPage = "nextPage" + RelFirstPage = "firstPage" + RelLastPage = "lastPage" + RelInstallVMWareTools = "installVmwareTools" + RelConsolidate = "consolidate" + RelEntity = "entity" + RelEntityResolver = "entityResolver" + RelRelocate = "relocate" + RelBlockingTasks = "blockingTasks" + RelUpdateProgress = "updateProgress" + RelSyncSyslogSettings = "syncSyslogSettings" + RelTakeOwnership = "takeOwnership" + RelUnlock = "unlock" + RelShadowVMs = "shadowVms" + RelTest = "test" + RelUpdateResourcePools = "update:resourcePools" + RelRemoveForce = "remove:force" + RelStorageClass = "storageProfile" + RelRefreshStorageClasses = "refreshStorageProfile" + RelRefreshVirtualCenter = "refreshVirtualCenter" + RelCheckCompliance = "checkCompliance" + RelForceFullCustomization = "customizeAtNextPowerOn" + RelReloadFromVC = "reloadFromVc" + RelMetricsDayView = "interval:day" + RelMetricsWeekView = "interval:week" + RelMetricsMonthView = "interval:month" + RelMetricsYearView = "interval:year" + RelMetricsPreviousRange = "range:previous" + RelMetricsNextRange = "range:next" + RelMetricsLatestRange = "range:latest" + RelRights = "rights" + RelMigratVMs = "migrateVms" + RelResourcePoolVMList = "resourcePoolVmList" + RelCreateEvent = "event:create" + RelCreateTask = "task:create" + RelUploadBundle = "bundle:upload" + RelCleanupBundles = "bundles:cleanup" + RelAuthorizationCheck = "authorization:check" + RelCleanupRights = "rights:cleanup" + + RelEdgeGatewayRedeploy = "edgeGateway:redeploy" + RelEdgeGatewayReapplyServices = "edgeGateway:reapplyServices" + RelEdgeGatewayConfigureServices = "edgeGateway:configureServices" + RelEdgeGatewayConfigureSyslog = "edgeGateway:configureSyslogServerSettings" + RelEdgeGatewaySyncSyslogSettings = "edgeGateway:syncSyslogSettings" + RelEdgeGatewayUpgrade = "edgeGateway:upgrade" + RelEdgeGatewayUpgradeNetworking = "edgeGateway:convertToAdvancedNetworking" + RelVDCManageFirewall = "manageFirewall" + + RelCertificateUpdate = "certificate:update" + RelCertificateReset = "certificate:reset" + RelTruststoreUpdate = "truststore:update" + RelTruststoreReset = "truststore:reset" + RelKeyStoreUpdate = "keystore:update" + RelKeystoreReset = "keystore:reset" + RelKeytabUpdate = "keytab:update" + RelKeytabReset = "keytab:reset" + + RelServiceLinks = "down:serviceLinks" + RelAPIFilters = "down:apiFilters" + RelResourceClasses = "down:resourceClasses" + RelResourceClassActions = "down:resourceClassActions" + RelServices = "down:services" + RelACLRules = "down:aclRules" + RelFileDescriptors = "down:fileDescriptors" + RelAPIDefinitions = "down:apiDefinitions" + RelServiceResources = "down:serviceResources" + RelExtensibility = "down:extensibility" + RelAPIServiceQuery = "down:service" + RelAPIDefinitionsQuery = "down:apidefinitions" + RelAPIFilesQuery = "down:files" + RelServiceOfferings = "down:serviceOfferings" + RelServiceOfferingInstances = "down:serviceOfferingInstances" + RelHybrid = "down:hybrid" + + RelServiceRefresh = "service:refresh" + RelServiceAssociate = "service:associate" + RelServiceDisassociate = "service:disassociate" + + RelReconfigureVM = "reconfigureVM" + + RelOrgVDCGateways = "edgeGateways" + RelOrgVDCNetworks = "orgVdcNetworks" + + RelHybridAcquireControlTicket = "hybrid:acquireControlTicket" + RelHybridAcquireTicket = "hybrid:acquireTicket" + RelHybridRefreshTunnel = "hybrid:refreshTunnel" + + RelMetrics = "metrics" + + RelFederationRegenerateCertificate = "federation:regenerateFederationCertificate" + RelTemplateInstantiate = "instantiate" +) diff --git a/vendor/github.com/hmrc/vmware-govcd/types/v56/types.go b/vendor/github.com/ukcloud/govcloudair/types/v56/types.go similarity index 98% rename from vendor/github.com/hmrc/vmware-govcd/types/v56/types.go rename to vendor/github.com/ukcloud/govcloudair/types/v56/types.go index 4549cc6c97..b4932451d2 100644 --- a/vendor/github.com/hmrc/vmware-govcd/types/v56/types.go +++ b/vendor/github.com/ukcloud/govcloudair/types/v56/types.go @@ -66,7 +66,7 @@ type CustomizationSection struct { HREF string `xml:"href,attr,omitempty"` Type string `xml:"type,attr,omitempty"` CustomizeOnInstantiate bool `xml:"CustomizeOnInstantiate"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` } // LeaseSettingsSection represents vApp lease settings. @@ -172,7 +172,7 @@ type SubAllocations struct { HREF string `xml:"href,attr,omitempty"` // The URI of the entity. Type string `xml:"type,attr,omitempty"` // The MIME type of the entity. // Elements - Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. + Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. SubAllocation *SubAllocation `xml:"SubAllocation,omitempty"` // IP Range sub allocated to a edge gateway. } @@ -358,7 +358,7 @@ type Vdc struct { ComputeCapacity []*ComputeCapacity `xml:"ComputeCapacity"` Description string `xml:"Description,omitempty"` IsEnabled bool `xml:"IsEnabled"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` NetworkQuota int `xml:"NetworkQuota"` NicQuota int `xml:"NicQuota"` ResourceEntities []*ResourceEntities `xml:"ResourceEntities,omitempty"` @@ -502,7 +502,7 @@ type Org struct { Description string `xml:"Description,omitempty"` FullName string `xml:"FullName"` IsEnabled bool `xml:"IsEnabled,omitempty"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` Tasks *TasksInProgress `xml:"Tasks,omitempty"` } @@ -521,7 +521,7 @@ type CatalogItem struct { DateCreated string `xml:"DateCreated,omitempty"` Description string `xml:"Description,omitempty"` Entity *Entity `xml:"Entity"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` Tasks *TasksInProgress `xml:"Tasks,omitempty"` VersionNumber int64 `xml:"VersionNumber,omitempty"` } @@ -538,7 +538,7 @@ type Entity struct { OperationKey string `xml:"operationKey,attr,omitempty"` Name string `xml:"name,attr"` Description string `xml:"Description,omitempty"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` Tasks *TasksInProgress `xml:"Tasks,omitempty"` } @@ -566,7 +566,7 @@ type Catalog struct { DateCreated string `xml:"DateCreated"` Description string `xml:"Description"` IsPublished bool `xml:"IsPublished"` - Link []*Link `xml:"Link"` + Link LinkList `xml:"Link"` Owner *Owner `xml:"Owner,omitempty"` Tasks *TasksInProgress `xml:"Tasks,omitempty"` VersionNumber int64 `xml:"VersionNumber"` @@ -580,7 +580,7 @@ type Catalog struct { type Owner struct { HREF string `xml:"href,attr,omitempty"` Type string `xml:"type,attr,omitempty"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` User *Reference `xml:"User"` } @@ -612,7 +612,7 @@ type File struct { BytesTransferred int64 `xml:"bytesTransferred,attr,omitempty"` Checksum string `xml:"checksum,attr,omitempty"` Description string `xml:"Description,omitempty"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` Tasks *TasksInProgress `xml:"Tasks,omitempty"` } @@ -644,7 +644,7 @@ type VMCapabilities struct { HREF string `xml:"href,attr,omitempty"` Type string `xml:"type,attr,omitempty"` CPUHotAddEnabled bool `xml:"CpuHotAddEnabled,omitempty"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` MemoryHotAddEnabled bool `xml:"MemoryHotAddEnabled,omitempty"` } @@ -656,7 +656,7 @@ type VMCapabilities struct { type VMs struct { HREF string `xml:"href,attr,omitempty"` Type string `xml:"type,attr,omitempty"` - Link []*Link `xml:"Link,omitempty"` + Link LinkList `xml:"Link,omitempty"` VMReference []*Reference `xml:"VmReference,omitempty"` } @@ -754,7 +754,7 @@ type VApp struct { Deployed bool `xml:"deployed,attr,omitempty"` // True if the virtual machine is deployed. OvfDescriptorUploaded bool `xml:"ovfDescriptorUploaded,attr,omitempty"` // Read-only indicator that the OVF descriptor for this vApp has been uploaded. // Elements - Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. + Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. Description string `xml:"Description,omitempty"` // Optional description. Tasks *TasksInProgress `xml:"Tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. Files *FilesList `xml:"Files,omitempty"` // Represents a list of files to be transferred (uploaded or downloaded). Each File in the list is part of the ResourceEntity. @@ -851,7 +851,7 @@ type VAppTemplate struct { OvfDescriptorUploaded string `xml:"ovfDescriptorUploaded,attr,omitempty"` // True if the OVF descriptor for this template has been uploaded. GoldMaster bool `xml:"goldMaster,attr,omitempty"` // True if this template is a gold master. // Elements - Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. + Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. Description string `xml:"Description,omitempty"` // Optional description. Tasks *TasksInProgress `xml:"Tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. Files *FilesList `xml:"Files,omitempty"` // Represents a list of files to be transferred (uploaded or downloaded). Each File in the list is part of the ResourceEntity. @@ -894,7 +894,7 @@ type VM struct { NeedsCustomization bool `xml:"needsCustomization,attr,omitempty"` // True if this virtual machine needs customization. NestedHypervisorEnabled bool `xml:"nestedHypervisorEnabled,attr,omitempty"` // True if hardware-assisted CPU virtualization capabilities in the host should be exposed to the guest operating system. // Elements - Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. + Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. Description string `xml:"Description,omitempty"` // Optional description. Tasks *TasksInProgress `xml:"Tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. Files *FilesList `xml:"FilesList,omitempty"` // Represents a list of files to be transferred (uploaded or downloaded). Each File in the list is part of the ResourceEntity. @@ -1055,7 +1055,7 @@ type GuestCustomizationSection struct { ResetPasswordRequired bool `xml:"ResetPasswordRequired,omitempty"` // True if the administrator password for this virtual machine must be reset after first use. CustomizationScript string `xml:"CustomizationScript,omitempty"` // Script to run on guest customization. The entire script must appear in this element. Use the XML entity to represent a newline. Unicode characters can be represented in the form &#xxxx; where xxxx is the character number. ComputerName string `xml:"ComputerName,omitempty"` // Computer name to assign to this virtual machine. - Link []*Link `xml:"Link,omitempty"` // A link to an operation on this section. + Link LinkList `xml:"Link,omitempty"` // A link to an operation on this section. } // InstantiateVAppTemplateParams represents vApp template instantiation parameters. @@ -1098,7 +1098,7 @@ type EdgeGateway struct { Name string `xml:"name,attr"` // The name of the entity. Status int `xml:"status,attr,omitempty"` // Creation status of the gateway. One of: 0 (The gateway is still being created) 1 (The gateway is ready) -1 (There was an error while creating the gateway). // Elements - Link []*Link `xml:"Link,omitempty"` // A link to an operation on this section. + Link LinkList `xml:"Link,omitempty"` // A link to an operation on this section. Description string `xml:"Description,omitempty"` // Optional description. Tasks *TasksInProgress `xml:"Tasks,omitempty"` // A list of queued, running, or recently completed tasks associated with this entity. Configuration *GatewayConfiguration `xml:"Configuration"` // Gateway configuration. @@ -1588,7 +1588,7 @@ type QueryResultEdgeGatewayRecordsType struct { PageSize int `xml:"pageSize,attr,omitempty"` // Page size, as a number of records or references. Total float64 `xml:"total,attr,omitempty"` // Total number of records or references in the container. // Elements - Link []*Link `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. + Link LinkList `xml:"Link,omitempty"` // A reference to an entity or operation associated with this object. EdgeGatewayRecord *QueryResultEdgeGatewayRecordType `xml:"EdgeGatewayRecord"` // A record representing a query result. } diff --git a/vendor/github.com/hmrc/vmware-govcd/vapp.go b/vendor/github.com/ukcloud/govcloudair/vapp.go similarity index 99% rename from vendor/github.com/hmrc/vmware-govcd/vapp.go rename to vendor/github.com/ukcloud/govcloudair/vapp.go index 6fc4a7d3df..bc3df52784 100644 --- a/vendor/github.com/hmrc/vmware-govcd/vapp.go +++ b/vendor/github.com/ukcloud/govcloudair/vapp.go @@ -2,7 +2,7 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "bytes" @@ -13,7 +13,7 @@ import ( "os" "strconv" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type VApp struct { diff --git a/vendor/github.com/hmrc/vmware-govcd/vapptemplate.go b/vendor/github.com/ukcloud/govcloudair/vapptemplate.go similarity index 95% rename from vendor/github.com/hmrc/vmware-govcd/vapptemplate.go rename to vendor/github.com/ukcloud/govcloudair/vapptemplate.go index 088d4bd0db..6b82444df1 100644 --- a/vendor/github.com/hmrc/vmware-govcd/vapptemplate.go +++ b/vendor/github.com/ukcloud/govcloudair/vapptemplate.go @@ -2,13 +2,13 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "bytes" "encoding/xml" "fmt" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type VAppTemplate struct { diff --git a/vendor/github.com/hmrc/vmware-govcd/vdc.go b/vendor/github.com/ukcloud/govcloudair/vdc.go similarity index 96% rename from vendor/github.com/hmrc/vmware-govcd/vdc.go rename to vendor/github.com/ukcloud/govcloudair/vdc.go index 58da1b80af..046969540e 100644 --- a/vendor/github.com/hmrc/vmware-govcd/vdc.go +++ b/vendor/github.com/ukcloud/govcloudair/vdc.go @@ -2,14 +2,14 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( "fmt" "net/url" "strings" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type Vdc struct { @@ -60,12 +60,14 @@ func (v *Vdc) Refresh() error { // Empty struct before a new unmarshal, otherwise we end up with duplicate // elements in slices. - v.Vdc = &types.Vdc{} + unmarshalledVdc := &types.Vdc{} - if err = decodeBody(resp, v.Vdc); err != nil { - return fmt.Errorf("error decoding Edge Gateway response: %s", err) + if err = decodeBody(resp, unmarshalledVdc); err != nil { + return fmt.Errorf("error decoding vdc response: %s", err) } + v.Vdc = unmarshalledVdc + // The request was successful return nil } diff --git a/vendor/github.com/hmrc/vmware-govcd/vm.go b/vendor/github.com/ukcloud/govcloudair/vm.go similarity index 92% rename from vendor/github.com/hmrc/vmware-govcd/vm.go rename to vendor/github.com/ukcloud/govcloudair/vm.go index 2e4d44b4d7..626ee688da 100644 --- a/vendor/github.com/hmrc/vmware-govcd/vm.go +++ b/vendor/github.com/ukcloud/govcloudair/vm.go @@ -2,7 +2,7 @@ * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ -package govcd +package govcloudair import ( // "bytes" @@ -13,7 +13,7 @@ import ( // "os" // "strconv" - types "github.com/hmrc/vmware-govcd/types/v56" + types "github.com/ukcloud/govcloudair/types/v56" ) type VM struct { diff --git a/vendor/vendor.json b/vendor/vendor.json index cd9bc2243d..27a97b91a2 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1807,20 +1807,6 @@ "revision": "6e9aa4b1a8a8b735ad14b4f1c9542ef183e82dc2", "revisionTime": "2016-08-11T07:26:26Z" }, - { - "checksumSHA1": "IHwZNoO/SD4MDwPWapLncZvDbTU=", - "comment": "v0.0.2-37-g5cd82f0", - "path": "github.com/hmrc/vmware-govcd", - "revision": "86a1deb871c34d97042b74c8a0d61a3bba7e84ff", - "revisionTime": "2016-09-07T09:41:58Z" - }, - { - "checksumSHA1": "kTsVJblC91gsKgjfnFNgPmPswio=", - "comment": "v0.0.2-37-g5cd82f0", - "path": "github.com/hmrc/vmware-govcd/types/v56", - "revision": "86a1deb871c34d97042b74c8a0d61a3bba7e84ff", - "revisionTime": "2016-09-07T09:41:58Z" - }, { "checksumSHA1": "hwGdeQbcfc2RvIQS5wAaYRKJDd4=", "comment": "0.2.1-3-gb1859b1", @@ -2469,6 +2455,18 @@ "revision": "faddd6128c66c4708f45fdc007f575f75e592a3c", "revisionTime": "2016-09-28T01:52:44Z" }, + { + "checksumSHA1": "y4ihcZrjJdyQDnsKLelo9/1MjqE=", + "path": "github.com/ukcloud/govcloudair", + "revision": "9076b4221ebf430944c716c798e904e00cbaa89d", + "revisionTime": "2017-01-31T00:00:54Z" + }, + { + "checksumSHA1": "CridJfrpcrjMdXnf7PbqA/+7wuY=", + "path": "github.com/ukcloud/govcloudair/types/v56", + "revision": "9076b4221ebf430944c716c798e904e00cbaa89d", + "revisionTime": "2017-01-31T00:00:54Z" + }, { "checksumSHA1": "CdE9OUEGLn2pAv1UMuM5rSlaUpM=", "path": "github.com/vincent-petithory/dataurl",